update
This commit is contained in:
parent
8320546641
commit
bc9f7c83f4
10
.github/CONTRIBUTING.md
vendored
10
.github/CONTRIBUTING.md
vendored
@ -4,13 +4,14 @@ How to contribute to Dolibarr
|
|||||||
Bug reports and feature requests
|
Bug reports and feature requests
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum).
|
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum.php). Forums exist in different languages.
|
||||||
|
|
||||||
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
|
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
|
||||||
|
Default language here is english. So please prepare your contributions in english.
|
||||||
|
|
||||||
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
|
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
|
||||||
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
|
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
|
||||||
4. Tell us the version you are using!
|
4. Tell us the version you are using! (look at /htdocs/admin/system/dolibarr.php? and check if you are using the latest version)
|
||||||
3. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible).
|
3. Write a report with as much detail as possible (Use [screenshots](https://help.github.com/articles/issue-attachments) or even screencasts and provide logging and debugging informations whenever possible).
|
||||||
|
|
||||||
|
|
||||||
@ -26,7 +27,8 @@ Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
|
|||||||
4. Commit and push your changes.
|
4. Commit and push your changes.
|
||||||
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
|
5. [Make a pull request](https://help.github.com/articles/creating-a-pull-request).
|
||||||
|
|
||||||
### <a name="branches"></a>Branches
|
<span id="branches" name="branches"></span>
|
||||||
|
### Branches
|
||||||
|
|
||||||
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
|
Unless you're fixing a bug, all pull requests should be made against the *develop* branch.
|
||||||
|
|
||||||
@ -141,7 +143,7 @@ Translations done on transifex are available in the next major release.
|
|||||||
|
|
||||||
Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source
|
Note: Sometimes, the source text (english) is modified. In such a case, the translation is reset. Transifex assume that if the original source
|
||||||
has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
|
has changed, the translation is surely no more correct so must be done again. But old translation is not lost and you can use the tab "History"
|
||||||
to retreive all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to.
|
to retrieve all old translation of a source text, and restore the translation in one click with no need to retranslate it if there is no need to.
|
||||||
|
|
||||||
|
|
||||||
### Resources
|
### Resources
|
||||||
|
|||||||
4
.github/workflows/exakat.yml
vendored
4
.github/workflows/exakat.yml
vendored
@ -13,5 +13,5 @@ jobs:
|
|||||||
- name: Exakat
|
- name: Exakat
|
||||||
uses: docker://exakat/exakat-ga
|
uses: docker://exakat/exakat-ga
|
||||||
with:
|
with:
|
||||||
ignore_rules: 'Performances/PrePostIncrement,Functions/WrongNumberOfArguments,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/UselessParenthesis'
|
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||||
ignore_dirs: '/htdocs/includes,/htdocs/build,/htdocs/dev,/htdocs/doc,/htdocs/scripts,/htdocs/test'
|
ignore_dirs: '/htdocs/includes,/build,/dev,/doc,/scripts,/test'
|
||||||
2
.github/workflows/stale-issues-safe.yml
vendored
2
.github/workflows/stale-issues-safe.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).'
|
stale-message: 'This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).'
|
||||||
stale-label: 'Issue Stale (automatic label)'
|
stale-label: 'Issue Stale (automatic label)'
|
||||||
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,Hacktoberfest,good first issue,Bug Security (CVE),Analysis of PR in progres'
|
exempt-labels: 'Priority High / Blocking,Priority Top Strategic,Priority Medium,hacktoberfest,hacktoberfest-accepted,good first issue,Bug Security (CVE),Analysis of PR in progress'
|
||||||
days-before-stale: 365
|
days-before-stale: 365
|
||||||
days-before-close: 10
|
days-before-close: 10
|
||||||
operations-per-run: 100
|
operations-per-run: 100
|
||||||
|
|||||||
13
.gitignore
vendored
13
.gitignore
vendored
@ -41,3 +41,16 @@ htdocs/includes/sebastian/
|
|||||||
htdocs/includes/squizlabs/
|
htdocs/includes/squizlabs/
|
||||||
htdocs/includes/webmozart/
|
htdocs/includes/webmozart/
|
||||||
htdocs/.well-known/apple-developer-merchantid-domain-association
|
htdocs/.well-known/apple-developer-merchantid-domain-association
|
||||||
|
|
||||||
|
# Node Modules
|
||||||
|
build/yarn-error.log
|
||||||
|
build/node_modules/
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
#yarn
|
||||||
|
yarn.lock
|
||||||
|
|
||||||
|
#package-lock
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
|
doc/install.lock
|
||||||
|
|||||||
@ -17,8 +17,10 @@ filter:
|
|||||||
- build/*
|
- build/*
|
||||||
- dev/*
|
- dev/*
|
||||||
- doc/*
|
- doc/*
|
||||||
- test/*
|
- documents/*
|
||||||
- htdocs/includes/*
|
- htdocs/includes/*
|
||||||
|
- node_modules/*
|
||||||
|
- test/*
|
||||||
paths:
|
paths:
|
||||||
- htdocs/*
|
- htdocs/*
|
||||||
- scripts/*
|
- scripts/*
|
||||||
|
|||||||
96
.travis.yml
96
.travis.yml
@ -6,7 +6,6 @@
|
|||||||
os: linux
|
os: linux
|
||||||
dist: xenial
|
dist: xenial
|
||||||
#dist: bionic
|
#dist: bionic
|
||||||
sudo: required
|
|
||||||
|
|
||||||
language: php
|
language: php
|
||||||
|
|
||||||
@ -32,53 +31,25 @@ addons:
|
|||||||
# We need pgloader for import mysql database into pgsql
|
# We need pgloader for import mysql database into pgsql
|
||||||
- pgloader
|
- pgloader
|
||||||
|
|
||||||
php:
|
|
||||||
- '5.6'
|
|
||||||
- '7.0'
|
|
||||||
- '7.1'
|
|
||||||
- '7.2'
|
|
||||||
- '7.3'
|
|
||||||
- '7.4'
|
|
||||||
- nightly
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# Set to true for very verbose output
|
# Set to true for very verbose output
|
||||||
- DEBUG=false
|
- DEBUG=false
|
||||||
jobs:
|
|
||||||
# MariaDB overrides MySQL installation so it's not possible to test both yet
|
|
||||||
#- DB=mariadb
|
|
||||||
- DB=mysql
|
|
||||||
- DB=postgresql
|
|
||||||
# See https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
|
|
||||||
#- WS=apache
|
|
||||||
# See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test
|
|
||||||
#- WS=nginx
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- php: nightly
|
- php: nightly
|
||||||
# We exclude some combinations not usefull to save Travis CPU
|
include:
|
||||||
exclude:
|
- if: type = push
|
||||||
- php: '7.0'
|
php: '5.6'
|
||||||
|
env: DB=postgresql
|
||||||
|
- if: type = pull_request OR type = push
|
||||||
|
php: '7.4'
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.1'
|
- if: type = push AND branch = develop
|
||||||
|
php: nightly
|
||||||
env: DB=mysql
|
env: DB=mysql
|
||||||
- php: '7.2'
|
|
||||||
env: DB=mysql
|
|
||||||
- php: '7.3'
|
|
||||||
env: DB=mysql
|
|
||||||
- php: '7.0'
|
|
||||||
env: DB=postgresql
|
|
||||||
- php: '7.1'
|
|
||||||
env: DB=postgresql
|
|
||||||
- php: '7.2'
|
|
||||||
env: DB=postgresql
|
|
||||||
- php: '7.3'
|
|
||||||
env: DB=postgresql
|
|
||||||
- php: nightly
|
|
||||||
env: DB=postgresql
|
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
@ -111,33 +82,48 @@ install:
|
|||||||
echo "Updating Composer"
|
echo "Updating Composer"
|
||||||
rm $TRAVIS_BUILD_DIR/composer.json
|
rm $TRAVIS_BUILD_DIR/composer.json
|
||||||
rm $TRAVIS_BUILD_DIR/composer.lock
|
rm $TRAVIS_BUILD_DIR/composer.lock
|
||||||
|
composer -V
|
||||||
composer self-update
|
composer self-update
|
||||||
# To have composer making parallel downloads
|
|
||||||
composer global require hirak/prestissimo
|
|
||||||
composer -n init
|
composer -n init
|
||||||
composer -n config vendor-dir htdocs/includes
|
composer -n config vendor-dir htdocs/includes
|
||||||
|
composer -n config -g vendor-dir htdocs/includes
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION"
|
echo "Installing Composer dependencies - PHP Unit, Parallel Lint, PHP CodeSniffer - for $TRAVIS_PHP_VERSION"
|
||||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] \
|
if [ "$TRAVIS_PHP_VERSION" = '5.6' ]; then
|
||||||
[ "$TRAVIS_PHP_VERSION" = '7.2' ] || [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
|
||||||
composer -n require phpunit/phpunit ^5 \
|
composer -n require phpunit/phpunit ^5 \
|
||||||
php-parallel-lint/php-parallel-lint ^0 \
|
php-parallel-lint/php-parallel-lint ^1 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
fi
|
||||||
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = '7.1' ] || [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
||||||
composer -n require --ignore-platform-reqs phpunit/phpunit ^5 \
|
composer -n require phpunit/phpunit ^6 \
|
||||||
php-parallel-lint/php-parallel-lint ^1 \
|
php-parallel-lint/php-parallel-lint ^1 \
|
||||||
php-parallel-lint/php-console-highlighter ^0 \
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
squizlabs/php_codesniffer ^3
|
squizlabs/php_codesniffer ^3
|
||||||
fi
|
fi
|
||||||
|
if [ "$TRAVIS_PHP_VERSION" = '7.3' ] || [ "$TRAVIS_PHP_VERSION" = '7.4' ]; then
|
||||||
|
composer -n require phpunit/phpunit ^7 \
|
||||||
|
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||||
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
|
squizlabs/php_codesniffer ^3
|
||||||
|
fi
|
||||||
|
# phpunit 9 is required for php 8
|
||||||
|
if [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||||
|
composer -n require --ignore-platform-reqs phpunit/phpunit ^7 \
|
||||||
|
php-parallel-lint/php-parallel-lint ^1.2 \
|
||||||
|
php-parallel-lint/php-console-highlighter ^0 \
|
||||||
|
squizlabs/php_codesniffer ^3
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Adding path of binaries tools installed by composer to the PATH"
|
echo "Adding path of binaries tools installed by composer to the PATH"
|
||||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||||
|
echo $PATH
|
||||||
|
ls $TRAVIS_BUILD_DIR/vendor
|
||||||
|
ls $TRAVIS_BUILD_DIR/htdocs/includes/bin
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|
||||||
@ -164,15 +150,20 @@ before_script:
|
|||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Versions information"
|
echo "Versions information"
|
||||||
|
echo
|
||||||
# Check PHP
|
# Check PHP
|
||||||
echo "PHP version"
|
echo "PHP version"
|
||||||
php -i | head -
|
php -i | head -
|
||||||
# Check PHP CodeSniffer installation
|
# Check Parallel-lint version
|
||||||
|
echo "Parallel-lint version"
|
||||||
|
which parallel-lint
|
||||||
|
parallel-lint -V
|
||||||
|
# Check PHP CodeSniffer version
|
||||||
echo "PHPCS version"
|
echo "PHPCS version"
|
||||||
which phpcs
|
which phpcs
|
||||||
phpcs --version | head -
|
phpcs --version | head -
|
||||||
phpcs -i | head -
|
phpcs -i | head -
|
||||||
# Check PHPUnit installation
|
# Check PHPUnit version
|
||||||
echo "PHPUnit version"
|
echo "PHPUnit version"
|
||||||
which phpunit
|
which phpunit
|
||||||
phpunit --version | head -
|
phpunit --version | head -
|
||||||
@ -278,7 +269,7 @@ script:
|
|||||||
set -e
|
set -e
|
||||||
#parallel-lint --exclude htdocs/includes --blame .
|
#parallel-lint --exclude htdocs/includes --blame .
|
||||||
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
parallel-lint --exclude dev/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||||
@ -286,12 +277,13 @@ script:
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
- |
|
- |
|
||||||
echo "Checking coding style (excluding Pull Requests builds)"
|
echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)"
|
||||||
# Ensure we catch errors
|
# Ensure we catch errors
|
||||||
set -e
|
set -e
|
||||||
# Exclusions are defined in the ruleset.xml file
|
# Exclusions are defined in the ruleset.xml file
|
||||||
#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" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then
|
||||||
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
|
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
|
set +e
|
||||||
echo
|
echo
|
||||||
|
|
||||||
@ -408,7 +400,7 @@ script:
|
|||||||
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
php step5.php 12.0.0 13.0.0 > $TRAVIS_BUILD_DIR/upgrade12001300-3.log
|
||||||
|
|
||||||
# Enable modules not enabled into original dump
|
# Enable modules not enabled into original dump
|
||||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKETSUP,MAIN_MODULE_ACCOUNTING > $TRAVIS_BUILD_DIR/enablemodule.log
|
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP,MAIN_MODULE_RECRUITMENT > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||||
echo $?
|
echo $?
|
||||||
cd -
|
cd -
|
||||||
set +e
|
set +e
|
||||||
@ -427,7 +419,7 @@ script:
|
|||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
- |
|
- |
|
||||||
echo "After script - Output lines of dolibarr.log"
|
echo "After script - Output last lines of dolibarr.log"
|
||||||
ls $TRAVIS_BUILD_DIR/documents
|
ls $TRAVIS_BUILD_DIR/documents
|
||||||
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
#cat $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
sudo tail -n 50 $TRAVIS_BUILD_DIR/documents/dolibarr.log
|
||||||
|
|||||||
@ -164,6 +164,12 @@ source_file = htdocs/langs/en_US/hrm.lang
|
|||||||
source_lang = en_US
|
source_lang = en_US
|
||||||
type = MOZILLAPROPERTIES
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
|
[dolibarr.intracommreport]
|
||||||
|
file_filter = htdocs/langs/<lang>/intracommreport.lang
|
||||||
|
source_file = htdocs/langs/en_US/intracommreport.lang
|
||||||
|
source_lang = en_US
|
||||||
|
type = MOZILLAPROPERTIES
|
||||||
|
|
||||||
[dolibarr.install]
|
[dolibarr.install]
|
||||||
file_filter = htdocs/langs/<lang>/install.lang
|
file_filter = htdocs/langs/<lang>/install.lang
|
||||||
source_file = htdocs/langs/en_US/install.lang
|
source_file = htdocs/langs/en_US/install.lang
|
||||||
|
|||||||
@ -21,8 +21,8 @@ Mobiledetect 2.8.34 MIT License Yes
|
|||||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
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
|
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||||
ParseDown 1.6 MIT License Yes Markdown parser
|
ParseDown 1.6 MIT License Yes Markdown parser
|
||||||
|
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
|
||||||
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
|
PHPDebugBar 1.15.1 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
|
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
|
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
|
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||||
@ -38,7 +38,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
|
|||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||||
ChartJS 2.9.3 MIT License Yes JS library for graph
|
ChartJS 2.9.4 MIT License Yes JS library for graph
|
||||||
jQuery 3.5.1 MIT License Yes JS library
|
jQuery 3.5.1 MIT License Yes JS library
|
||||||
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
||||||
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
||||||
|
|||||||
358
ChangeLog
358
ChangeLog
@ -4,27 +4,348 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
|
||||||
|
|
||||||
For users:
|
For users:
|
||||||
|
----------
|
||||||
NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
|
NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
|
||||||
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
|
NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
|
||||||
|
NEW: Module Recruitment to manage Job position and applications.
|
||||||
|
NEW: Several security issues after a private bug bounty campaign.
|
||||||
|
NEW: Accountancy - add chart of sub accounts
|
||||||
|
NEW: Accountancy - add options to disable binding on sales, purchases & expense reports independently of the modules
|
||||||
|
NEW: Accountancy balance - add a menu entry to show subtotal by group
|
||||||
|
NEW: Accountancy - change menu disposition
|
||||||
|
NEW: Accountancy - on transfers, select the periodicity by default
|
||||||
|
NEW: Accountancy - Add export for Gestinum (v3 & v5)
|
||||||
|
NEW: new currency rate editor
|
||||||
|
NEW: add a widget to show the customers with outstanding limits reached
|
||||||
|
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
|
||||||
|
NEW: add a counter of number of words for pages in website module
|
||||||
|
NEW: add alert before changing thirdparty in TakePOS
|
||||||
|
NEW: add a page to list Stock at a given date in the past
|
||||||
|
NEW: add a start date to begin binding in accountancy
|
||||||
|
NEW: add a statistics page to list popularity of products on invoices
|
||||||
|
NEW: add calendar selection for agenda view
|
||||||
|
NEW: Support documents generation for ticket edition (PDF or ODT)
|
||||||
|
NEW: add column payment term into list of supplier invoices
|
||||||
|
NEW: add column quantity in product margin page
|
||||||
|
NEW: add column vat rate in page to define accounting account on product/service
|
||||||
|
NEW: add costprice in fields of products list
|
||||||
|
NEW: add an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
|
||||||
|
NEW: add employee link in expense report binding page
|
||||||
|
NEW: add EORI No. as ProfID5
|
||||||
|
NEW: add export for various payments
|
||||||
|
NEW: add Extrafields labels and values in mail on create ticket
|
||||||
|
NEW: add Extrafields support on ECM module
|
||||||
|
NEW: add filter rules "is answer" and "is not answer" in email collector
|
||||||
|
NEW: add focus when editing on product/stock/product.php Close #14548
|
||||||
|
NEW: add free text on each terminal of cash desk
|
||||||
|
NEW: add global search for customer payments and vendor payments
|
||||||
|
NEW: add global search for miscellaneous payments
|
||||||
|
NEW: add helper function for table headers with numbers
|
||||||
|
NEW: add link to edit property from the search result of website pages
|
||||||
|
NEW: add link to reset qty on supplier dispatch page
|
||||||
|
NEW: add MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const to remove header stored by email collector
|
||||||
|
NEW: add Manufacturing Orders attached files into the automatic ECM view
|
||||||
|
NEW: add margin info in invoice list
|
||||||
|
NEW: add mass action to set category on a list of website pages
|
||||||
|
NEW: add mass deletion for events
|
||||||
|
NEW: add mass deletion for draft invoices
|
||||||
|
NEW: add more filters on monthly statement list
|
||||||
|
NEW: add option TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT
|
||||||
|
NEW: add option to define a default warehouse at user level
|
||||||
|
NEW: add option to include products without alert in replenish
|
||||||
|
NEW: add order by lastname and firstname by default in get sales representatives
|
||||||
|
NEW: add param to not show links when output tags
|
||||||
|
NEW: add PDF document templates for warehouses (list of stock)
|
||||||
|
NEW: add a prospect status for the contact with managment of custom icon
|
||||||
|
NEW: add public note on products ; this also partially fix the #14342
|
||||||
|
NEW: add quick dropdown menu in top right menu (experimental with MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN)
|
||||||
|
NEW: add region in export companies and contacts
|
||||||
|
NEW: add rights on margin info on invoice list
|
||||||
|
NEW: add search param for close date on order list
|
||||||
|
NEW: add show preview for mail attachement on form mail
|
||||||
|
NEW: add State/Province origin for products
|
||||||
|
NEW: add the workflow interaction close intervention on closing ticket
|
||||||
|
NEW: add third order printer to TakePOS
|
||||||
|
NEW: add tracking number in list and search_all items
|
||||||
|
NEW: add vcard for adherent and user
|
||||||
|
NEW: add week number for month view in agenda
|
||||||
|
NEW: Algeria data (VAT and forme_juridique)
|
||||||
|
NEW: allow click on all header numbers on commerce area
|
||||||
|
NEW: allow to reopen interventions (green button)
|
||||||
|
NEW: allow zero quantity on supplier/vendor order line
|
||||||
|
NEW: appearance tab in TakePOS with more visual parameters
|
||||||
|
NEW: better currency rate editor
|
||||||
|
NEW: can build vendor invoice from vendor orders
|
||||||
|
NEW: can change a product in lines of a recurring invoice or contract
|
||||||
|
NEW: can change size of logo on PDF documents
|
||||||
|
NEW: can change VAT rate of all lines of a draft object in one step
|
||||||
|
NEW: can define date range of validity of a login during creation
|
||||||
|
NEW: can disable, from edit page, the whole web site
|
||||||
|
NEW: can edit and set sales representatives directly on thirdparty card
|
||||||
|
NEW: can edit the list of sending email profiles
|
||||||
|
NEW: can enable/disable users in bulk actions
|
||||||
|
NEW: can filter on accounting system ref in export of chart of account
|
||||||
|
NEW: can filter on container type, language and tags in the list of web pages
|
||||||
|
NEW: can hide eatby, sellby dates with option PRODUCT_DISABLE_SELLBY and PRODUCT_DISABLE_EATBY
|
||||||
|
NEW: can import proposals, sales orders, supplier invoices
|
||||||
|
NEW: can set a dedicated SMTP config for sending email from public ticket interface
|
||||||
|
NEW: can set tags/categories to website pages
|
||||||
|
NEW: can set type of price without tax per default for new sale price creation
|
||||||
|
NEW: can use desired stock of a given warehouse for replenishment
|
||||||
|
NEW: change thirdparty with barcode scan in TakePOS
|
||||||
|
NEW: common behavior for monthly leave list view
|
||||||
|
NEW: convert all subscription in datetime
|
||||||
|
NEW: can create a thirdparty customer from TakePOS
|
||||||
|
NEW: date shipment from order accepts hours
|
||||||
|
NEW: price level compatibility for variant
|
||||||
|
NEW: delayed payment in TakePOS
|
||||||
|
NEW: display date range if exist in TakePOS
|
||||||
|
NEW: display resiliate status in TakePOS for member
|
||||||
|
NEW: display stat for BOM on "object referent"/linked Object product tab
|
||||||
|
NEW: Email configuration - allow auto signed certificate when smtp ssl activated
|
||||||
|
NEW: enable free emails input with select2
|
||||||
|
NEW: Events in agenda for contact
|
||||||
|
NEW: filter on progress column in task list
|
||||||
|
NEW: filter product list by country and/or state/province
|
||||||
|
NEW: format tickets sent by mail in public interface
|
||||||
|
NEW: form to add customer/supplier into categories
|
||||||
|
NEW: Framework is ready for CSRF token protection on explicit GET URLs
|
||||||
|
NEW: helper functions for export with phpspreadsheet
|
||||||
|
NEW: hide closed contract lines
|
||||||
|
NEW: hide label in PDF for variants
|
||||||
|
NEW: if specific help page is available, we change color of icon
|
||||||
|
NEW: include the tag editor of page as a popup into website editor
|
||||||
|
NEW: introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
|
||||||
|
NEW: introducing new modal boxes in TakePOS
|
||||||
|
NEW: keep TakePOS terminal when login/logout
|
||||||
|
NEW: link on balance to the ledger
|
||||||
|
NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector
|
||||||
|
NEW: manage errors on update extra fields in ticket card
|
||||||
|
NEW: mass-actions for the event list view
|
||||||
|
NEW: Module Intracomm report
|
||||||
|
NEW: more filter for "View change logs"
|
||||||
|
NEW: multicurrency total in TakePOS
|
||||||
|
NEW: multiselect type and date to date filter
|
||||||
|
NEW: Nature of product is now a dictionay
|
||||||
|
NEW: new line template: hidden conf to fill service dates from the last service line
|
||||||
|
NEW: PDF model storm for delivery
|
||||||
|
NEW: possibilty to group payments by mode and show their subtotal
|
||||||
|
NEW: Print payment method and change in TakePOS
|
||||||
|
NEW: Priority and transparency from external calendar events
|
||||||
|
NEW: Products Import/Export 'default warehouse' and 'use batch number' fields
|
||||||
|
NEW: Purchase price table: added filterable table columns
|
||||||
|
NEW: rate editor for multicurrency
|
||||||
|
NEW: ref_ext field for Commande lines, order lines, Attributes and Combinations, Invoice lines, payments, order lines
|
||||||
|
NEW: remove new lines in mail on add ticket message
|
||||||
|
NEW: restrict thirdparty to customer in TakePOS
|
||||||
|
NEW: Rule "email to" accept wildcard *
|
||||||
|
NEW: Save filter of the project homepage
|
||||||
|
NEW: select-able columns on customer and supplier invoice paymnet list
|
||||||
|
NEW: select-able columns on miscellaneous payments + more data columns
|
||||||
|
NEW: select-able columns on social taxes list
|
||||||
|
NEW: send context and remove new lines on create ticket
|
||||||
|
NEW: show available stock in TakePOS
|
||||||
|
NEW: show category filter on lists only when user have rights to read categories
|
||||||
|
NEW: show header number and make it clickable in warehouse area, payment area, shipment area
|
||||||
|
NEW: show image of user in the combo select of users
|
||||||
|
NEW: show label on batch card
|
||||||
|
NEW: show links for select and multi-select in category extra field
|
||||||
|
NEW: show module and permission ids on user/group rights (only admin)
|
||||||
|
NEW: show place from events on import calender
|
||||||
|
NEW: show references in contract form on interventions
|
||||||
|
NEW: show tags and status in search list of website pages
|
||||||
|
NEW: show user on external calender events (when found)
|
||||||
|
NEW: subject title with company name instead of application title in ticket message
|
||||||
|
NEW: Support for Samba4 AD
|
||||||
|
NEW: TakePOS connector compatibility with RECEIPT PRINTERS module
|
||||||
|
NEW: TakePOS Gift Receipt
|
||||||
|
NEW: TakePOS Multicurrency compatibility
|
||||||
|
NEW: the global header of a website can also have dynamic content
|
||||||
|
NEW: Third-Party Import new fields: mother company,outstanding debt limit,bank account,incoterms
|
||||||
|
NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding amount late
|
||||||
|
NEW: ticket classification on create from email collector
|
||||||
|
NEW: Ticket message notifications when edited from public interface
|
||||||
|
NEW: translate classification labels in ticket
|
||||||
|
NEW: VAT rate for Angola #15606
|
||||||
|
NEW: VAT and juridical status for Algeria
|
||||||
|
NEW: VAT report - Invert constant to show by default zero VAT in reports
|
||||||
|
NEW: website page fields selection
|
||||||
|
NEW: Weighing Scale compatibility with TakePOS connector
|
||||||
|
NEW: when creating a user from a member linked to a thirdparty, you can choose to create it as external or internal user
|
||||||
|
NEW: add clone button on miscellaneous payment
|
||||||
|
NEW: #15065 Add option to put the product label in bold in the PDF templates if configured
|
||||||
|
NEW: Add option "If the feature to manage kits of module Stock is used, show details of subproducts of a kit on PDF."
|
||||||
|
|
||||||
|
|
||||||
|
For developers:
|
||||||
|
---------------
|
||||||
|
NEW: add __MEMBER_TYPE__ substitution key
|
||||||
|
NEW: add __TYPE__ substitution key
|
||||||
|
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
||||||
|
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
||||||
|
NEW: Add some fields to link website page to an other object
|
||||||
|
NEW: fill ECM src object fields in dol_add_file_process
|
||||||
|
NEW: conf to allow to show the full tree in warehouse popup
|
||||||
|
NEW: can use THEME_DARKMODEENABLED=2 for a preview of theme in dark mode
|
||||||
|
NEW: can force the antivirus from conf file or autoprepend ini setup
|
||||||
|
NEW: can add event to log into blockedlog module with a constant
|
||||||
|
NEW: add property cssview when declaring fields of an object
|
||||||
|
NEW: Can use dynamic code into the 'enabled' property of DAO fields
|
||||||
|
NEW: allow to edit "demand reason" field though API
|
||||||
|
NEW: fetch contact by email with REST API
|
||||||
|
NEW: field ref_ext in llx_commandedet
|
||||||
|
NEW: fields ref_ext for Attributes and Combinations
|
||||||
|
NEW: get state by REST API
|
||||||
|
NEW: get state dictionnary by REST API
|
||||||
|
NEW: improve Product API for variant products
|
||||||
|
NEW: OAuth SCOPE for Admin SDK
|
||||||
|
NEW: retrieve discount from invoice from API
|
||||||
|
NEW: standardizes API thirdparties by email like other object
|
||||||
|
NEW: Thirdparty REST API: endpoint to set price level
|
||||||
|
NEW: use new category API for project list view
|
||||||
|
NEW: Triggers Attributes and Attributes values
|
||||||
|
NEW: added incoterms data into the substitution array
|
||||||
|
NEW: add send context for ticket
|
||||||
|
NEW: add a message in error_log after detection of SQL or script injection
|
||||||
|
NEW: add validation of MX domain for emails
|
||||||
|
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
|
||||||
|
NEW: Graphics can be horizontal bars
|
||||||
|
|
||||||
|
APIs
|
||||||
|
NEW: API get contacts list of a given order
|
||||||
|
NEW: API endpoint getContacts and Clean results
|
||||||
|
NEW: API can update a payment
|
||||||
|
NEW: API get member by thirdparty
|
||||||
|
NEW: API get thirdparty by barcode
|
||||||
|
NEW: API get users by email / login
|
||||||
|
|
||||||
|
HOOKs
|
||||||
|
NEW: Hook on propal card
|
||||||
|
NEW: add hooks on newpayment page to allow external payment modules
|
||||||
|
NEW: add hooks on stats pages
|
||||||
|
NEW: add formConfirm hook on product page
|
||||||
|
NEW: add two hooks printFieldListFrom and printFieldSearchParam
|
||||||
|
NEW: add hook "loginCheckSecurityAccess"
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
|
|
||||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
* Properties ->contactid has been renamed into ->contact_id
|
* The object "livraison" has been renamed into "delivery" (directory, class, keys, methods with livraison in name ...).
|
||||||
* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english)
|
* All properties ->contactid have been renamed into ->contact_id
|
||||||
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in
|
* All properties ->titre have been renamed into ->title
|
||||||
your email templates.
|
* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id
|
||||||
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom
|
|
||||||
days of holiday.
|
|
||||||
* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency.
|
* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency.
|
||||||
|
* The deprecated subsitution key __SIGNATURE__ has been removed. Use __USER_SIGNATURE__ if you used the old syntax in your email templates.
|
||||||
|
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday.
|
||||||
* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm),
|
* If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm),
|
||||||
you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait.
|
you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait.
|
||||||
* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML.
|
* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML.
|
||||||
* If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors.
|
* If you have links in your code with '&action=add', '&action=update', '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors.
|
||||||
|
* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount.
|
||||||
|
* The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed.
|
||||||
|
* Depreciate all methods with name ->valide(). Use instead methods ->validate().
|
||||||
|
* Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
|
||||||
|
* Context for hook showSocinfoOnPrint has been moved from "showsocinfoonprint" to "main"
|
||||||
|
* Library htdocs/includes/phpoffice/phpexcel as been removed (replaced with htdocs/includes/phpoffice/PhpSpreadsheet)
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 12.0.4 compared to 12.0.3 *****
|
||||||
|
FIX: make formConfirm an addreplace-type hook
|
||||||
|
FIX: regex to remove 'action' parameter: taking feedback from PR#15213 into account
|
||||||
|
FIX: remove 'action' parameter from redirect URL when reordering lines on a document
|
||||||
|
FIX: error when displaying lines on order after adding a line if both MAIN_MULTILANGS and MAIN_DISABLE_PDF_AUTOUPDATE are activated
|
||||||
|
FIX: on survey creation, entity is always set to 1 ⇒ set it to $conf->entity
|
||||||
|
FIX: set entity to $conf->entity (instead of 1 by default) when creating a survey; otherwise the survey cannot be listed from the entity it was created on unless it is the main entity
|
||||||
|
FIX: the stringent XSS protection provided by 'alphanohtml' causes problems with some clients who used basic tags (bold, italic, underline) in product labels. Using 'restricthtml' instead could be a good compromise.
|
||||||
|
FIX: third party of object is not always fetched when initiating the e-mail presend action (e.g. from an order)
|
||||||
|
FIX: when the cronjob 'params' field is empty, the cron method is called with one empty string param instead of no params at all
|
||||||
|
FIX: XSS protection too stringent -> replace 'alphanohtml' with 'restricthtml'
|
||||||
|
FIX: #13067 including opening balance in calculation of displayed balance
|
||||||
|
FIX: #14326
|
||||||
|
FIX: #14649
|
||||||
|
FIX: #14901
|
||||||
|
FIX: #14927 Change ContratLigne property type to product_type
|
||||||
|
FIX: #14979
|
||||||
|
FIX: #15074
|
||||||
|
FIX: #15111 Fix special characters output in PDF
|
||||||
|
FIX: #15161 MO translation conflict
|
||||||
|
FIX: #15163
|
||||||
|
FIX: #15199
|
||||||
|
FIX: #15208
|
||||||
|
FIX: #15303
|
||||||
|
FIX: #15365 export of extrafields for user and resources
|
||||||
|
FIX: #15374 : "New" doesn't clear total amounts
|
||||||
|
FIX: #15501
|
||||||
|
FIX: #15572
|
||||||
|
FIX: #15590
|
||||||
|
FIX: #15618
|
||||||
|
FIX: supplier proposals as linked objects of events are not correctly fetched
|
||||||
|
FIX: when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
|
||||||
|
FIX: Accountancy - Some ajustments on length of the account (general & auxiliary)
|
||||||
|
FIX: admin conf selected
|
||||||
|
FIX: also check if there is a method $object->fetch_thirdparty() before calling it
|
||||||
|
FIX: autofocus on first setup
|
||||||
|
FIX: Bad rigths to send contract
|
||||||
|
FIX: Better error message with IMAP when connection fails
|
||||||
|
FIX: Can create user but not update user with activedirectory
|
||||||
|
FIX: Can receipt of a product that required lot after disabling stock and
|
||||||
|
FIX: Can't create shipment for virtual product. Add
|
||||||
|
FIX: cant empty action comm desc
|
||||||
|
FIX: CA report by product/service : subcategory filter
|
||||||
|
FIX: Clean orphan records in llx_ecm_files into repair script.
|
||||||
|
FIX: default accountancy values and posted values
|
||||||
|
FIX: Deletion of expensereport + other generated object not complete.
|
||||||
|
FIX: disabled users must not be available in sales representative list on societe edit mode
|
||||||
|
FIX: Dol print error : conf usage thirdparty propagate extrafields to
|
||||||
|
FIX: Don't display inactive users in birthday box and company card
|
||||||
|
FIX: empty value is needed on filter list
|
||||||
|
FIX: enable HTML in product labels depending on conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML
|
||||||
|
FIX: error 500 on cash closure
|
||||||
|
FIX: excess comma
|
||||||
|
FIX: Export FEC - Remove line at zero
|
||||||
|
FIX: extrafield required error after submit
|
||||||
|
FIX: filter on project list
|
||||||
|
FIX: force payment mode to withdraw
|
||||||
|
FIX: formating of prices with foreign languages
|
||||||
|
FIX: handling $heightforinfotot when he's superior to a page height
|
||||||
|
FIX: if no PDF default model in admin for expense report, do not create a PDF
|
||||||
|
FIX: invoice payment terms edition: error management
|
||||||
|
FIX: list of fields in list of recurring invoices was empty
|
||||||
|
FIX: load default linked options for linked sellist extra fields
|
||||||
|
FIX: Loan - Return on list when you cancel create form or delete a loan
|
||||||
|
FIX: Missing lang trans
|
||||||
|
FIX: no empty value in required extrafield
|
||||||
|
FIX: Param joinfiles not sanitized
|
||||||
|
FIX: Payment by BankTransfer
|
||||||
|
FIX: pdf_getlinetotalwithtax must show total incl tax
|
||||||
|
FIX: Problem on supplier payment card
|
||||||
|
FIX: product auto volume calculation
|
||||||
|
FIX: product customer prices: missing triggers in CRUD class
|
||||||
|
FIX: Request on purchase orders in timeout even on very small databases
|
||||||
|
FIX: set paid on total discount of a product in cash desk
|
||||||
|
FIX: several warning with the barcode use in ODT templates
|
||||||
|
FIX: SHIP MODE install v12 bug insert
|
||||||
|
FIX: stripe for connect mode
|
||||||
|
FIX: subcat filter
|
||||||
|
FIX: supplier invoice: automatically calculate payment term when modifying payment condition
|
||||||
|
FIX: SUPPLIER PROPOSAL v12 bug add
|
||||||
|
FIX: table making extrafield input too small on advance target mailing
|
||||||
|
FIX: table making extrafield too small advtagertmailing
|
||||||
|
FIX: Unable to edit extrafields in expense report
|
||||||
|
FIX: update margins rates on object line edit
|
||||||
|
FIX: uses price2numjs
|
||||||
|
FIX: various payments: bad data handling for subledger account + useless db commit/rollback
|
||||||
|
FIX: virtual products: displayed value is by unit
|
||||||
|
FIX: virtual products: supplier discount was not applied in component list
|
||||||
|
FIX: warning for purchase order delivery late.
|
||||||
|
FIX: Warning on late purchase order delivery
|
||||||
|
FIX: WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty
|
||||||
|
FIX: wrong tab
|
||||||
|
FIX: Yogosha report 4425 (backport)
|
||||||
|
FIX: Yogosha report 4434 (backport)
|
||||||
|
|
||||||
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
||||||
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
|
FIX: 10.0 - when the mime file name is different from the filesystem name, the attachment name should be the mime filename
|
||||||
FIX: 11.0 - expenses lines overlapping the total amounts frame
|
FIX: 11.0 - expenses lines overlapping the total amounts frame
|
||||||
@ -51,7 +372,7 @@ FIX: Look and feel v12: First tab must be name of object
|
|||||||
FIX: missing entity check
|
FIX: missing entity check
|
||||||
FIX: missing param for hook
|
FIX: missing param for hook
|
||||||
FIX: Missing transaction on PO actions
|
FIX: Missing transaction on PO actions
|
||||||
FIX: MySql Strict mode
|
FIX: MySQL Strict mode
|
||||||
FIX: param entity in html form file
|
FIX: param entity in html form file
|
||||||
FIX: Problems on FEC format
|
FIX: Problems on FEC format
|
||||||
FIX: round stock value on product list
|
FIX: round stock value on product list
|
||||||
@ -70,6 +391,7 @@ FIX: Visualization rights correction on last modified contacts box
|
|||||||
FIX: Wrong redirection
|
FIX: Wrong redirection
|
||||||
FIX: Yogosha report 4425 (backport)
|
FIX: Yogosha report 4425 (backport)
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
***** ChangeLog for 12.0.2 compared to 12.0.1 *****
|
||||||
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
FIX: computation of the bottom margin of <body> returns NaN because body is not loaded yet
|
||||||
FIX: DebugBar hides content at page bottom
|
FIX: DebugBar hides content at page bottom
|
||||||
@ -158,8 +480,8 @@ FIX: SQL Problem in customer invoice list
|
|||||||
FIX: SQL Problem in social contribution list
|
FIX: SQL Problem in social contribution list
|
||||||
FIX: SQL Problem in supplier invoice list
|
FIX: SQL Problem in supplier invoice list
|
||||||
FIX: SQL syntax error when editing extrafields
|
FIX: SQL syntax error when editing extrafields
|
||||||
FIX: Sql type
|
FIX: SQL type
|
||||||
FIX: takepos 12 hook
|
FIX: TakePOS 12 hook
|
||||||
FIX: Update form erased extrafields that were hidden
|
FIX: Update form erased extrafields that were hidden
|
||||||
FIX: Update of extrafields date
|
FIX: Update of extrafields date
|
||||||
FIX: Update of extrafiels on draft object
|
FIX: Update of extrafiels on draft object
|
||||||
@ -173,7 +495,7 @@ For users:
|
|||||||
|
|
||||||
NEW: Module MO (Manufacturing Order) is available as stable module.
|
NEW: Module MO (Manufacturing Order) is available as stable module.
|
||||||
NEW: Receipt printer module moved from 'development' to 'experimental'
|
NEW: Receipt printer module moved from 'development' to 'experimental'
|
||||||
NEW: Add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists.
|
NEW: add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists
|
||||||
NEW: add numbering module for TakePOS module
|
NEW: add numbering module for TakePOS module
|
||||||
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
|
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
|
||||||
NEW: Accountancy add column thirdparty on binding page
|
NEW: Accountancy add column thirdparty on binding page
|
||||||
@ -184,19 +506,19 @@ NEW: Accountancy - Add possibility to manage a short alternative label for accou
|
|||||||
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
|
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
|
||||||
NEW: Add accountancy code of thirdparty in contact and supplier export
|
NEW: Add accountancy code of thirdparty in contact and supplier export
|
||||||
NEW: support webp image format
|
NEW: support webp image format
|
||||||
NEW: Add checkbox "overwrite if exists" into ECM/DMS module
|
NEW: add checkbox "overwrite if exists" into ECM/DMS module
|
||||||
NEW: add a link to notes in members list
|
NEW: add a link to notes in members list
|
||||||
NEW: add a parameter to group same products in TakePOS
|
NEW: add a parameter to group same products in TakePOS
|
||||||
NEW: add a parameter to sort product by label in TakePOS
|
NEW: add a parameter to sort product by label in TakePOS
|
||||||
NEW: Add a profil to import contact categories
|
NEW: add a profil to import contact categories
|
||||||
NEW: Add company extrafields into order export
|
NEW: add company extrafields into order export
|
||||||
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
|
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
|
||||||
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
|
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
|
||||||
NEW: add csv separator setup in module admin
|
NEW: add csv separator setup in module admin
|
||||||
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
||||||
NEW: add default warehouse for dispatch
|
NEW: add default warehouse for dispatch
|
||||||
NEW: Add due date in feature "Export accounting documents"
|
NEW: add due date in feature "Export accounting documents"
|
||||||
NEW: Add duration information for fichinter
|
NEW: add duration information for fichinter
|
||||||
NEW: Start support of Dark theme into ELDY theme
|
NEW: Start support of Dark theme into ELDY theme
|
||||||
NEW: Add field author public alias for blog post on website module
|
NEW: Add field author public alias for blog post on website module
|
||||||
NEW: Add "finished" field on product list
|
NEW: Add "finished" field on product list
|
||||||
@ -3383,7 +3705,7 @@ Following changes may create regression for some external modules, but were nece
|
|||||||
entities and to review completely the rights of the groups and the users.
|
entities and to review completely the rights of the groups and the users.
|
||||||
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
||||||
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
||||||
retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
retrieve the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
||||||
* The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output
|
* The hook formObjectOptions was not implemented correctly in previous version. Sometimes, you had to return output
|
||||||
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
||||||
hook specifications so you must return output into "resprint".
|
hook specifications so you must return output into "resprint".
|
||||||
@ -6129,7 +6451,7 @@ For users:
|
|||||||
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
|
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
|
||||||
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
|
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
|
||||||
- Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
|
- Fix: [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
|
||||||
- Fix: Expedition creation, can retreive product from other expedition
|
- Fix: Expedition creation, can retrieve product from other expedition
|
||||||
|
|
||||||
For translators:
|
For translators:
|
||||||
- Update language files.
|
- Update language files.
|
||||||
|
|||||||
6
INSTALL
6
INSTALL
@ -1,6 +0,0 @@
|
|||||||
INSTALL
|
|
||||||
-------
|
|
||||||
|
|
||||||
English: See README.md file.
|
|
||||||
|
|
||||||
French: Voir fichier README-FR.md.
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
|
Dolibarr ERP & CRM est un logiciel moderne pour gérer votre activité (société, association, auto-entrepreneurs, artisans).
|
||||||
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
|
Il est simple d'utilisation et modulaire, vous permettant de n'activez que les fonctions dont vous avez besoin (contacts, fournisseurs, factures, commandes, stocks, agenda, ...).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## LICENCE
|
## LICENCE
|
||||||
|
|
||||||
|
|||||||
38
README.md
38
README.md
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
[](https://php.net/)
|
||||||
|
[](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|
||||||
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
Dolibarr ERP & CRM is a modern software package that helps manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||||
|
|
||||||
@ -11,9 +13,9 @@ You can freely use, study, modify or distribute it according to its licence.
|
|||||||
|
|
||||||
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
||||||
|
|
||||||
Dolibarr has a large community ready to help you, free forums and [oficially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## LICENSE
|
## LICENSE
|
||||||
|
|
||||||
@ -43,7 +45,7 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
|||||||
|
|
||||||
#### Generic install steps:
|
#### Generic install steps:
|
||||||
|
|
||||||
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Versions).
|
- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
|
||||||
|
|
||||||
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later):
|
- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommanded if you know git as it makes it easier if you want to upgrade later):
|
||||||
|
|
||||||
@ -69,6 +71,7 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
|
|||||||
|
|
||||||
- Follow the installer instructions
|
- Follow the installer instructions
|
||||||
|
|
||||||
|
|
||||||
### Saas/Cloud setup
|
### Saas/Cloud setup
|
||||||
|
|
||||||
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
|
If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free.
|
||||||
@ -84,10 +87,12 @@ Dolibarr supports upgrading usually wihtout the need for any (commercial) suppor
|
|||||||
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
|
- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
|
||||||
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
|
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
|
||||||
|
|
||||||
|
|
||||||
## WHAT'S NEW
|
## WHAT'S NEW
|
||||||
|
|
||||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||||
|
|
||||||
|
|
||||||
## FEATURES
|
## FEATURES
|
||||||
|
|
||||||
### Main application/modules (all optional)
|
### Main application/modules (all optional)
|
||||||
@ -137,15 +142,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
### Other general features
|
### Other general features
|
||||||
|
|
||||||
- Localization in most major languages
|
- Localization in most major languages
|
||||||
|
- Multi-Language Support
|
||||||
- Multi-Users and groups with finely grained rights
|
- Multi-Users and groups with finely grained rights
|
||||||
- Multi-currency
|
- Multi-Currency
|
||||||
- Multi-company by adding of an external module
|
- Multi-Company (by adding of an external module)
|
||||||
|
|
||||||
- Very user friendly and easy to use
|
- Very user friendly and easy to use
|
||||||
- customizable Dashboard
|
- customizable Dashboard
|
||||||
- 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)
|
- 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)
|
||||||
|
|
||||||
- APIs
|
- APIs (REST, SOAP)
|
||||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||||
|
|
||||||
- Support a lot of country specific features:
|
- Support a lot of country specific features:
|
||||||
- Spanish Tax RE and ISPF
|
- Spanish Tax RE and ISPF
|
||||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||||
@ -158,15 +166,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
- Flexible PDF & ODT generation for invoices, proposals, orders...
|
||||||
- …
|
- …
|
||||||
|
|
||||||
|
|
||||||
### System Environment / Requirements
|
### System Environment / Requirements
|
||||||
|
|
||||||
- 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))
|
- Works with PHP 5.6+ 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.
|
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
|
||||||
|
|
||||||
|
|
||||||
### Extending
|
### Extending
|
||||||
|
|
||||||
Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com).
|
Dolibarr can be extended with a lot of other external application or modules from third party developers available at the [DoliStore](https://www.dolistore.com).
|
||||||
|
|
||||||
|
|
||||||
## WHAT DOLIBARR CAN'T DO YET
|
## WHAT DOLIBARR CAN'T DO YET
|
||||||
|
|
||||||
These are features that Dolibarr does **not** yet fully support:
|
These are features that Dolibarr does **not** yet fully support:
|
||||||
@ -176,22 +187,29 @@ These are features that Dolibarr does **not** yet fully support:
|
|||||||
- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
|
- No native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
|
||||||
- Dolibarr can't do coffee (yet)
|
- Dolibarr can't do coffee (yet)
|
||||||
|
|
||||||
|
|
||||||
## DOCUMENTATION
|
## DOCUMENTATION
|
||||||
|
|
||||||
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
Administrator, user, developer and translator's documentations are available along with other community resources in the [Wiki](https://wiki.dolibarr.org).
|
||||||
|
|
||||||
|
|
||||||
## CONTRIBUTING
|
## CONTRIBUTING
|
||||||
|
|
||||||
This project exists thanks to all the people who contribute. [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
|
This project exists thanks to all the people who contribute.
|
||||||
|
Please read the instructions how to contribute (report a bug/error, a feature request, send code ...) [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
|
||||||
|
|
||||||
|
A view on Contributors:
|
||||||
|
|
||||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
||||||
|
|
||||||
|
|
||||||
## CREDITS
|
## CREDITS
|
||||||
|
|
||||||
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.
|
Dolibarr is the work of many contributors over the years and uses some fine PHP libraries.
|
||||||
|
|
||||||
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
|
See [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT) file.
|
||||||
|
|
||||||
|
|
||||||
## NEWS AND SOCIAL NETWORKS
|
## NEWS AND SOCIAL NETWORKS
|
||||||
|
|
||||||
Follow Dolibarr project on:
|
Follow Dolibarr project on:
|
||||||
@ -202,6 +220,8 @@ Follow Dolibarr project on:
|
|||||||
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
- [YouTube](https://www.youtube.com/user/DolibarrERPCRM)
|
||||||
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
- [GitHub](https://github.com/Dolibarr/dolibarr)
|
||||||
|
|
||||||
|
|
||||||
### Sponsors
|
### Sponsors
|
||||||
|
|
||||||
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
Support this project by becoming a sponsor. Your logo will show up here. 🙏 [[Become a sponsor/backer](https://opencollective.com/dolibarr#backer)]
|
||||||
|
|
||||||
|
|||||||
39
SECURITY.md
39
SECURITY.md
@ -6,14 +6,13 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
|||||||
|
|
||||||
| Version | Supported |
|
| Version | Supported |
|
||||||
| --------- | ------------------ |
|
| --------- | ------------------ |
|
||||||
| <= 9.0.* | :x: |
|
| <= 12.* | :x: |
|
||||||
| >= 10.0.* | :white_check_mark: |
|
| >= 13.* | :white_check_mark: |
|
||||||
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
To report a vulnerability, please send an email to security@dolibarr.org
|
To report a vulnerability, please use GitHub security advisory (alternatively 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.
|
|
||||||
|
|
||||||
|
|
||||||
## Hunting vulnerabilities on Dolibarr
|
## Hunting vulnerabilities on Dolibarr
|
||||||
@ -24,11 +23,11 @@ If you believe you've found a security bug in our service, we are happy to work
|
|||||||
|
|
||||||
Any type of denial of service attacks is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
|
Any type of denial of service attacks is strictly forbidden, as well as any interference with network equipment and Dolibarr infrastructure.
|
||||||
|
|
||||||
We recommand to install Dolibarr ERP CRM on you own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
|
We recommand to install Dolibarr ERP CRM on your own server (as most Open Source software, download and use is free: https://www.dolibarr.org/download) to get access on every side of application.
|
||||||
|
|
||||||
### User Agent
|
### User Agent
|
||||||
|
|
||||||
If you try to find bug on Dolibarr, we recommend to append to your user-agent header the following value: '-BugHunting-dolibarr'.
|
If you try to find bug on Dolibarr, we recommend to append to your user-agent header the following value: '-securitytest-for-dolibarr'.
|
||||||
|
|
||||||
### Account access
|
### Account access
|
||||||
|
|
||||||
@ -37,44 +36,32 @@ You can install the web application yourself on your own platform/server so you
|
|||||||
|
|
||||||
## Eligibility and Responsible Disclosure
|
## Eligibility and Responsible Disclosure
|
||||||
|
|
||||||
We are happy to thank everyone who submits valid reports which help us improve the security of Dolibarr however, only those that meet the following eligibility requirements may receive a monetary reward:
|
We are happy to thank everyone who submits valid reports which help us improve the security of Dolibarr however, only those that meet the following eligibility requirements will be "validated reports" (if not, we may close the report without any answer):
|
||||||
|
|
||||||
You must be the first reporter of a vulnerability.
|
You must be the first reporter of the vulnerability (duplicate reports are closed).
|
||||||
|
|
||||||
The vulnerability must be a qualifying vulnerability (see below)
|
|
||||||
|
|
||||||
Any vulnerability found must be reported no later than 24 hours after discovery
|
|
||||||
|
|
||||||
You must send a clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
|
You must send a clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary.
|
||||||
|
|
||||||
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommand to install softwate on your own platform.
|
You must avoid tests that could cause degradation or interruption of our service (refrain from using automated tools, and limit yourself about requests per second), that's why we recommand to install softwate on your own platform.
|
||||||
|
|
||||||
You must not leak, manipulate, or destroy any user data.
|
You must not leak, manipulate, or destroy any user data of third parties to find your vulnerability.
|
||||||
|
|
||||||
You must not be a former or current employee of Dolibarr or one of its contractor.
|
|
||||||
|
|
||||||
Reports about vulnerabilities are examined by our security analysts.
|
|
||||||
|
|
||||||
Our analysis is always based on worst case exploitation of the vulnerability, as is the reward we pay.
|
|
||||||
|
|
||||||
No vulnerability disclosure, including partial is allowed for the moment.
|
|
||||||
|
|
||||||
|
|
||||||
## Scope for qualified vulnerabilities
|
## Scope for qualified vulnerabilities
|
||||||
|
|
||||||
ONLY vulnerabilities discovered, when the following setup on test platform is used, are accepted:
|
ONLY vulnerabilities discovered, when the following setup on test platform is used, are "valid":
|
||||||
|
|
||||||
* $dolibarr_main_prod must be set to 1 into conf.php
|
* $dolibarr_main_prod must be set to 1 into conf.php
|
||||||
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
|
* $dolibarr_nocsrfcheck must be kept to the value 0 into conf.php (this is the default value)
|
||||||
* $dolibarr_main_force_https must be set to something else than 0.
|
* $dolibarr_main_force_https must be set to something else than 0.
|
||||||
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be enabled soon by default)
|
* The constant MAIN_SECURITY_CSRF_WITH_TOKEN must be set to 1 into backoffice menu Home - Setup - Other (this protection should be set to 1 soon by default)
|
||||||
* The module DebugBar must NOT be enabled (by default, this module is not enabled. This is a developer tool)
|
* The module DebugBar must NOT be enabled (by default, this module is not enabled. This is a developer tool)
|
||||||
* The module ModuleBuilder must NOT be enabled (by default, this module is not enabled. This is a developer tool)
|
* The module ModuleBuilder must NOT be enabled (by default, this module is not enabled. This is a developer tool)
|
||||||
* ONLY security reports on modules provided by default and with the "stable" status are allowed (troubles into "experimental", "developement" or external modules are not accepted).
|
* ONLY security reports on modules provided by default and with the "stable" status are valid (troubles into "experimental", "developement" or external modules are not valid vulnerabilities).
|
||||||
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
* The root of web server must link to htdocs and the documents directory must be outside of the web server root (this is the default when using the default installer but may differs with external installer).
|
||||||
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
|
* The web server setup must be done so only the documents directory is in write mode. The root directory called htdocs must be readonly.
|
||||||
* CSRF attacks are accepted for all when using a POST URL, but are accepted only for creating or updating data resctricted to the admin user when using GET URL.
|
* CSRF attacks are accepted for all when using a POST URL, but when using GET URL, they are validated only for creating or updating data resctricted to the admin user.
|
||||||
* Ability for a high level user to edit web site pages in the CMS by including javascript is an expected feature.
|
* Ability for a high level user to edit web site pages into the CMS by including HTML or Javascript is an expected feature. Vulnerabilities into the website module are validated only if HTML or Javascript injection can be done by a non allowed user.
|
||||||
|
|
||||||
Scope is the web application (back office) and the APIs.
|
Scope is the web application (back office) and the APIs.
|
||||||
|
|
||||||
|
|||||||
26
build/README
26
build/README
@ -1,48 +1,62 @@
|
|||||||
README (English)
|
README (English)
|
||||||
|
|
||||||
|
Path: /dolibarr/build/README
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
Building packages
|
Building packages
|
||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
All sub-directories of "build" directory contains files (setup or binary tools) 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:
|
|
||||||
|
|
||||||
|
There are several tools:
|
||||||
|
|
||||||
|
|
||||||
- To build full Dolibarr packages, launch the script
|
- To build full Dolibarr packages, launch the script
|
||||||
> Launch command perl makepack-dolibarr.pl
|
> Launch command perl makepack-dolibarr.pl
|
||||||
|
|
||||||
Note: Prerequisites to build tgz, debian, rpm package
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
Prerequisites to build tgz, debian, rpm package:
|
||||||
|
|
||||||
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
||||||
|
|
||||||
Note: Prerequisites to build autoexe DoliWamp package:
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Prerequisites to build autoexe DoliWamp package:
|
||||||
> apt-get install wine q4wine
|
> apt-get install wine q4wine
|
||||||
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
||||||
> Install InnoSetup
|
> Install InnoSetup
|
||||||
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
|
For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
|
||||||
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
||||||
For example by running wampserver3.2.0_x64.exe (http://www.wampserver.com). See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com).
|
||||||
|
See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
||||||
> Add path to ISCC into PATH windows var:
|
> Add path to ISCC into PATH windows var:
|
||||||
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
||||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
||||||
open file build/exe/doliwamp.iss and click on button "Compile".
|
open file build/exe/doliwamp.iss and click on button "Compile".
|
||||||
The .exe file will be build into directory build.
|
The .exe file will be build into directory build.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build a theme package, launch the script
|
- To build a theme package, launch the script
|
||||||
> perl makepack-dolibarrtheme.pl
|
> perl makepack-dolibarrtheme.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build a package for a module, launch the script
|
- To build a package for a module, launch the script
|
||||||
> perl makepack-dolibarrmodule.pl
|
> perl makepack-dolibarrmodule.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build developper documentation, launch the script
|
- To build developper documentation, launch the script
|
||||||
> perl dolibarr-doxygen-build.pl
|
> perl dolibarr-doxygen-build.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
||||||
|
|||||||
@ -306,7 +306,7 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
|
|||||||
- htdocs/includes/jquery/plugins/datatables
|
- htdocs/includes/jquery/plugins/datatables
|
||||||
- htdocs/includes/jszip
|
- htdocs/includes/jszip
|
||||||
- htdocs/includes/mike42
|
- htdocs/includes/mike42
|
||||||
- htdocs/includes/phpexcel or htdocs/includes/phpoffice
|
- htdocs/includes/phpoffice
|
||||||
- htdocs/includes/restler/framework/Luracast/Restler/explorer
|
- htdocs/includes/restler/framework/Luracast/Restler/explorer
|
||||||
- htdocs/includes/swiftmailer
|
- htdocs/includes/swiftmailer
|
||||||
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
|
- htdocs/includes/tcpdf or htdocs/includes/tecnickcom
|
||||||
|
|||||||
@ -232,7 +232,7 @@ $dolibarr_main_prod='0';
|
|||||||
# Examples:
|
# Examples:
|
||||||
# $dolibarr_mailing_limit_sendbycli='0';
|
# $dolibarr_mailing_limit_sendbycli='0';
|
||||||
|
|
||||||
# dolibarr_distrib
|
# dolibarr_main_distrib
|
||||||
# A key to identify the distribution used for first installation
|
# A key to identify the distribution used for first installation
|
||||||
$dolibarr_distrib = 'deb';
|
$dolibarr_main_distrib = 'debian';
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
Upstream-Name: Dolibarr
|
Upstream-Name: Dolibarr
|
||||||
Upstream-Contact: Laurent Destailleur <eldy@users.sourceforge.net>
|
Upstream-Contact: Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
Source: https://www.dolibarr.org/files/stable/standard/
|
Source: https://www.dolibarr.org/files/stable/standard/
|
||||||
@ -38,6 +38,7 @@ Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|||||||
2011, Herve Prot <herve.prot@symeos.com>
|
2011, Herve Prot <herve.prot@symeos.com>
|
||||||
2011, Remy Younes <ryounes@gmail.com>
|
2011, Remy Younes <ryounes@gmail.com>
|
||||||
2012-2013, Christophe Battarel <christophe.battarel@altairis.fr>
|
2012-2013, Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
|
|
||||||
License: GPL-3+
|
License: GPL-3+
|
||||||
This program is free software; you can redistribute it
|
This program is free software; you can redistribute it
|
||||||
and/or modify it under the terms of the GNU General Public
|
and/or modify it under the terms of the GNU General Public
|
||||||
@ -56,7 +57,9 @@ License: GPL-3+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 3 can be found in the file
|
License version 3 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-3'.
|
'/usr/share/common-licenses/GPL-3'.
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/adodbtime/*
|
Files: htdocs/includes/adodbtime/*
|
||||||
Copyright: 2003-2005, John Lim
|
Copyright: 2003-2005, John Lim
|
||||||
@ -80,6 +83,9 @@ Comment:
|
|||||||
Those files are not shipped in the binary package since we use
|
Those files are not shipped in the binary package since we use
|
||||||
the library as packaged in "libphp-adodb".
|
the library as packaged in "libphp-adodb".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/ckeditor/*
|
Files: htdocs/includes/ckeditor/*
|
||||||
Copyright: 2003-2012 CKSource - Frederico Knabben
|
Copyright: 2003-2012 CKSource - Frederico Knabben
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
@ -109,6 +115,9 @@ Comment:
|
|||||||
Those files are not shipped in the binary package since we use the
|
Those files are not shipped in the binary package since we use the
|
||||||
library as packaged in "ckeditor".
|
library as packaged in "ckeditor".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/fonts/*
|
Files: htdocs/includes/fonts/*
|
||||||
Copyright: 2003, Bitstream Inc
|
Copyright: 2003, Bitstream Inc
|
||||||
unknown, Gavin Graham
|
unknown, Gavin Graham
|
||||||
@ -159,6 +168,9 @@ Comments:
|
|||||||
Those files are not shipped in the binary package as we
|
Those files are not shipped in the binary package as we
|
||||||
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
|
configure Dolibarr to use Dejavu fonts from "fonts-dejavu-core".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: doc/images/*
|
Files: doc/images/*
|
||||||
Copyright: Laurent Destailleur
|
Copyright: Laurent Destailleur
|
||||||
License: CC-BY-SA-3.0
|
License: CC-BY-SA-3.0
|
||||||
@ -174,33 +186,15 @@ License: CC-BY-SA-3.0
|
|||||||
distribute the resulting work only under the same, similar or a compatible
|
distribute the resulting work only under the same, similar or a compatible
|
||||||
license.
|
license.
|
||||||
.
|
.
|
||||||
For more information, see http://creativecommons.org/licenses/by-sa/3.0/
|
For more information, see https://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
Files: htdocs/includes/fpdfi/*
|
|
||||||
Copyright: 2004-2011 Setasign - Jan Slabon
|
|
||||||
License: GPL-2+
|
|
||||||
This program is free software; you can redistribute it
|
|
||||||
and/or modify it under the terms of the GNU General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later
|
|
||||||
version.
|
|
||||||
.
|
|
||||||
This program is distributed in the hope that it will be
|
|
||||||
useful, but WITHOUT ANY WARRANTY; without even the implied
|
|
||||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. See the GNU General Public License for more
|
|
||||||
details.
|
|
||||||
.
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
.
|
|
||||||
On Debian systems, the full text of the GNU General Public
|
|
||||||
License version 2 can be found in the file
|
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
|
||||||
|
|
||||||
Files: htdocs/includes/geoip/*
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
|
Files: htdocs/includes/geoip2/*
|
||||||
Copyright: 2007 MaxMind LLC
|
Copyright: 2007 MaxMind LLC
|
||||||
License: LGPL-2.1+
|
License: CC-By-SA
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
@ -216,10 +210,14 @@ License: LGPL-2.1+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU Lesser General Public
|
On Debian systems, the full text of the GNU Lesser General Public
|
||||||
License version 2.1 can be found in the file
|
License version 2.1 can be found in the file
|
||||||
`/usr/share/common-licenses/LGPL-2.1'.
|
'/usr/share/common-licenses/LGPL-2.1'.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/jquery/*
|
Files: htdocs/includes/jquery/*
|
||||||
Copyright: JQuery team
|
Copyright: JQuery team
|
||||||
|
https://www.jquery.com
|
||||||
License: GPL-2+ or MIT
|
License: GPL-2+ or MIT
|
||||||
=== GPL-2+ LICENSE NOTICE ===
|
=== GPL-2+ LICENSE NOTICE ===
|
||||||
.
|
.
|
||||||
@ -240,7 +238,7 @@ License: GPL-2+ or MIT
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 2 can be found in the file
|
License version 2 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
'/usr/share/common-licenses/GPL-2'.
|
||||||
.
|
.
|
||||||
=== MIT LICENSE ===
|
=== MIT LICENSE ===
|
||||||
.
|
.
|
||||||
@ -267,6 +265,8 @@ Comment:
|
|||||||
"libjs-jquery-ui". Most of the plugins are shipped though.
|
"libjs-jquery-ui". Most of the plugins are shipped though.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/jquery/plugins/flot/*
|
Files: htdocs/includes/jquery/plugins/flot/*
|
||||||
Copyright: Flot team
|
Copyright: Flot team
|
||||||
License: Public-Domain
|
License: Public-Domain
|
||||||
@ -275,6 +275,9 @@ Comment:
|
|||||||
Those files are not shipped in the binary package because we configure
|
Those files are not shipped in the binary package because we configure
|
||||||
Dolibarr to use the files provided by "libjs-flot".
|
Dolibarr to use the files provided by "libjs-flot".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/jsgantt/*
|
Files: htdocs/includes/jsgantt/*
|
||||||
Copyright: JSGantt team
|
Copyright: JSGantt team
|
||||||
License: GPL-2+
|
License: GPL-2+
|
||||||
@ -295,7 +298,10 @@ License: GPL-2+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 2 can be found in the file
|
License version 2 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
'/usr/share/common-licenses/GPL-2'.
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/nusoap/*
|
Files: htdocs/includes/nusoap/*
|
||||||
Copyright: 2002-2010 NuSphere Corporation
|
Copyright: 2002-2010 NuSphere Corporation
|
||||||
@ -315,11 +321,14 @@ License: LGPL-2.1+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU Lesser General Public
|
On Debian systems, the full text of the GNU Lesser General Public
|
||||||
License version 2.1 can be found in the file
|
License version 2.1 can be found in the file
|
||||||
`/usr/share/common-licenses/LGPL-2.1'.
|
'/usr/share/common-licenses/LGPL-2.1'.
|
||||||
Comment:
|
Comment:
|
||||||
Those files are not shipped in the binary package since we
|
Those files are not shipped in the binary package since we
|
||||||
configure Dolibarr to use the library provided in "libnusoap-php".
|
configure Dolibarr to use the library provided in "libnusoap-php".
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------------------------
|
||||||
|
|
||||||
Files: htdocs/includes/odtphp/*
|
Files: htdocs/includes/odtphp/*
|
||||||
Copyright: 2008, Julien Pauli
|
Copyright: 2008, Julien Pauli
|
||||||
2008, Cyril PIERRE de GEYER
|
2008, Cyril PIERRE de GEYER
|
||||||
@ -342,29 +351,12 @@ License: GPL-2+
|
|||||||
.
|
.
|
||||||
On Debian systems, the full text of the GNU General Public
|
On Debian systems, the full text of the GNU General Public
|
||||||
License version 2 can be found in the file
|
License version 2 can be found in the file
|
||||||
`/usr/share/common-licenses/GPL-2'.
|
'/usr/share/common-licenses/GPL-2'.
|
||||||
|
|
||||||
Files: htdocs/includes/phpexcel/*
|
|
||||||
Copyright: 2006-2011 PHPExcel (http://www.codeplex.com/PHPExcel)
|
|
||||||
License: LGPL-2.1+
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
.
|
|
||||||
This library is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
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 <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
|
|
||||||
`/usr/share/common-licenses/LGPL-2.1'.
|
|
||||||
|
|
||||||
Files: htdocs/includes/tcpdf/*
|
------------------------------------------------------------
|
||||||
|
|
||||||
|
Files: htdocs/includes/tecnickcom/*
|
||||||
Copyright: 2002-2013 Nicola Asuni - Tecnick.com LTD
|
Copyright: 2002-2013 Nicola Asuni - Tecnick.com LTD
|
||||||
License: LGPL-3.0+
|
License: LGPL-3.0+
|
||||||
TCPDF is free software: you can redistribute it and/or modify it
|
TCPDF is free software: you can redistribute it and/or modify it
|
||||||
|
|||||||
@ -150,7 +150,6 @@ case "$1" in
|
|||||||
##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
##grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
#grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
#grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||||
##grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
|
||||||
##grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
##grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
#grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
#grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -24,6 +24,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='debian';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one.
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one.
|
||||||
// If during install, we enable/disable declaration to use non embedded libraries, we must also check they are
|
// If during install, we enable/disable declaration to use non embedded libraries, we must also check they are
|
||||||
@ -34,7 +35,6 @@ $force_install_lockinstall='444';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
//$force_dolibarr_lib_PHPEXCEL_PATH=''; // Use '' or 'disabled'
|
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; // Use '/javascript/ckeditor' or 'disabled'
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||||
|
|||||||
@ -103,8 +103,6 @@ override_dh_install:
|
|||||||
|
|
||||||
# clean from useless files
|
# clean from useless files
|
||||||
rm -fr htdocs/includes/jquery/plugins/multiselect
|
rm -fr htdocs/includes/jquery/plugins/multiselect
|
||||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PDF
|
|
||||||
rm -fr htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip
|
|
||||||
rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33
|
rm -fr htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-2.33
|
||||||
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
|
rm -fr htdocs/includes/tcpdf/fonts/freefont-20100919
|
||||||
rm -fr htdocs/includes/tcpdf/fonts/utils
|
rm -fr htdocs/includes/tcpdf/fonts/utils
|
||||||
@ -113,7 +111,6 @@ override_dh_install:
|
|||||||
|
|
||||||
# Licence files are already included into copyright file.
|
# Licence files are already included into copyright file.
|
||||||
rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt
|
rm -f htdocs/includes/jquery/plugins/flot/LICENSE.txt
|
||||||
rm -f htdocs/includes/phpexcel/license.txt
|
|
||||||
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
rm -f htdocs/includes/tcpdf/LICENSE.TXT
|
||||||
|
|
||||||
# Drop unwanted executable permissions
|
# Drop unwanted executable permissions
|
||||||
|
|||||||
@ -20,6 +20,9 @@ RUN apt-get update -y \
|
|||||||
unzip \
|
unzip \
|
||||||
curl \
|
curl \
|
||||||
apt-utils \
|
apt-utils \
|
||||||
|
msmtp \
|
||||||
|
msmtp-mta \
|
||||||
|
mailutils \
|
||||||
&& apt-get autoremove -y \
|
&& apt-get autoremove -y \
|
||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
|
||||||
@ -44,7 +47,17 @@ RUN echo 'xdebug.remote_port=9000' >> ${PHP_INI_DIR}/php.ini
|
|||||||
RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
|
RUN echo 'xdebug.remote_connect_back=1' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
|
RUN echo 'xdebug.profiler_enable=0' >> ${PHP_INI_DIR}/php.ini
|
||||||
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
RUN echo 'xdebug.remote_log="/tmp/xdebug.log"' >> ${PHP_INI_DIR}/php.ini
|
||||||
#RUN echo '172.17.0.1 docker.host' >> /etc/hosts
|
#RUN echo 'localhost docker.host' >> /etc/hosts
|
||||||
|
|
||||||
|
# set up sendmail config, to use maildev
|
||||||
|
RUN echo "account default" > /etc/msmtprc
|
||||||
|
RUN echo "auth off" >> /etc/msmtprc
|
||||||
|
RUN echo "port 25" >> /etc/msmtprc
|
||||||
|
RUN echo "host mail" >> /etc/msmtprc
|
||||||
|
RUN echo "from local@localdomain.com" >> /etc/msmtprc
|
||||||
|
RUN echo "domain localhost.localdomain" >> /etc/msmtprc
|
||||||
|
RUN echo "sendmail_path=/usr/bin/msmtp -t" >> /usr/local/etc/php/conf.d/php-sendmail.ini
|
||||||
|
RUN echo "localhost localhost.localdomain" >> /etc/hosts
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ And then, you can run :
|
|||||||
|
|
||||||
docker-compose up
|
docker-compose up
|
||||||
|
|
||||||
This will run 3 container Docker : Dolibarr, MariaDB and PhpMyAdmin.
|
This will run 4 containers Docker : Dolibarr, MariaDB, PhpMyAdmin and MailDev.
|
||||||
|
|
||||||
The URL to go to the Dolibarr is :
|
The URL to go to the Dolibarr is :
|
||||||
|
|
||||||
@ -26,6 +26,9 @@ The URL to go to PhpMyAdmin is (login/password is root/root) :
|
|||||||
|
|
||||||
http://0.0.0.0:8080
|
http://0.0.0.0:8080
|
||||||
|
|
||||||
Setup the database connection during the installation process, please use mariad
|
In Dolibarr configuration Email let PHP mail function, To see all mail send by Dolibarr go to maildev
|
||||||
b (name of the database container) as database host.
|
|
||||||
|
http://0.0.0.0:8081
|
||||||
|
|
||||||
|
Setup the database connection during the installation process, please use mariadb (name of the database container) as database host.
|
||||||
Setup documents folder, during the installation process, to /var/documents
|
Setup documents folder, during the installation process, to /var/documents
|
||||||
|
|||||||
@ -12,8 +12,11 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: root
|
MYSQL_ROOT_PASSWORD: root
|
||||||
MYSQL_DATABASE: dolibarr
|
MYSQL_DATABASE: dolibarr
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
networks:
|
networks:
|
||||||
- internal-pod
|
- internal-pod
|
||||||
|
- external-pod
|
||||||
|
|
||||||
phpmyadmin:
|
phpmyadmin:
|
||||||
image: phpmyadmin/phpmyadmin
|
image: phpmyadmin/phpmyadmin
|
||||||
@ -49,3 +52,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8081:80"
|
- "8081:80"
|
||||||
- "25:25"
|
- "25:25"
|
||||||
|
networks:
|
||||||
|
- internal-pod
|
||||||
|
- external-pod
|
||||||
|
|||||||
@ -118,7 +118,7 @@ Source: "C:\wamp64\bin\mariadb\mariadb10.4.10\*.*"; DestDir: "{app}\bin\mariadb\
|
|||||||
;Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mariadb\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
;Source: "build\exe\doliwamp\mysql\*.*"; DestDir: "{app}\bin\mariadb\data\mysql"; Flags: onlyifdoesntexist ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db"
|
||||||
|
|
||||||
; Dolibarr
|
; Dolibarr
|
||||||
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,PHPExcel\Shared\PDF\*,PHPExcel\Shared\PCLZip\*,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
|
Source: "htdocs\*.*"; DestDir: "{app}\www\dolibarr\htdocs"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,custom\*,custom2\*,documents\*,includes\ckeditor\_source\*,includes\savant\*,includes\phpmailer\*,jquery\plugins\template\*,nltechno*\*,sabre\sabre\*\tests,tcpdf\fonts\dejavu-fonts-ttf-2.33\*,tcpdf\fonts\freefont-20100919\*,tcpdf\fonts\utils\*,*\conf.php,*\conf.php.mysql,*\conf.php.old,*\conf.php.postgres,*\conf.php.sav,*\install.forced.php"
|
||||||
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
|
Source: "dev\*.*"; DestDir: "{app}\www\dolibarr\dev"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,dbmodel\*,fpdf\*,initdata\*,initdemo\*,iso-normes\*,licence\*,phpcheckstyle\*,phpunit\*,samples\*,test\*,uml\*,vagrant\*,xdebug\*"
|
||||||
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
|
Source: "doc\*.*"; DestDir: "{app}\www\dolibarr\doc"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,wiki\*,plaquette\*,dev\*,images\dolibarr_screenshot2.png,images\dolibarr_screenshot3.png,images\dolibarr_screenshot4.png,images\dolibarr_screenshot5.png,images\dolibarr_screenshot6.png,images\dolibarr_screenshot7.png,images\dolibarr_screenshot8.png,images\dolibarr_screenshot9.png,images\dolibarr_screenshot10.png,images\dolibarr_screenshot11.png,images\dolibarr_screenshot12.png"
|
||||||
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
|
Source: "scripts\*.*"; DestDir: "{app}\www\dolibarr\scripts"; Flags: ignoreversion recursesubdirs; Excludes: ".gitignore,.project,CVS\*,Thumbs.db,product\materiel.net.php,product\import-product.php"
|
||||||
|
|||||||
@ -22,6 +22,7 @@ $force_install_databaserootpass='WAMPMYSQLNEWPASSWORD';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='644';
|
$force_install_lockinstall='644';
|
||||||
|
$force_install_distrib='doliwamp';
|
||||||
|
|
||||||
$force_install_module='';
|
$force_install_module='';
|
||||||
?>
|
?>
|
||||||
@ -125,6 +125,11 @@ $checksumconcat=array();
|
|||||||
|
|
||||||
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
||||||
$fp = fopen($outputfile, 'w');
|
$fp = fopen($outputfile, 'w');
|
||||||
|
if (empty($fp)) {
|
||||||
|
print 'Failed to open file '.$outputfile."\n";
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
||||||
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
||||||
|
|
||||||
|
|||||||
@ -476,6 +476,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build.xml`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
||||||
@ -504,6 +505,9 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/sqlite3`;
|
||||||
|
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/node_modules`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
||||||
@ -578,49 +582,54 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||||
|
|
||||||
# Removed other test files
|
# Removed other test files
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
||||||
|
|
||||||
|
# Removed files installed by the awful composer
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/composer`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/doctrine`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/docs`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/.github`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/docs`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/samples`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PDF`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# \file dolibarr.pl
|
# \file dolibarr.pl
|
||||||
# \brief Dolibarr script install for Virtualmin Pro
|
# \brief Dolibarr script install for Virtualmin Pro
|
||||||
# \author (c)2009-2019 Regis Houssin <regis.houssin@inodbox.com>
|
# \author (c)2009-2020 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ return "Regis Houssin";
|
|||||||
# script_dolibarr_versions()
|
# script_dolibarr_versions()
|
||||||
sub script_dolibarr_versions
|
sub script_dolibarr_versions
|
||||||
{
|
{
|
||||||
return ( "10.0.0", "9.0.3", "8.0.5", "7.0.5", "6.0.8" );
|
return ( "12.0.3", "11.0.5", "10.0.7", "9.0.4", "8.0.6", "7.0.5" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub script_dolibarr_release
|
sub script_dolibarr_release
|
||||||
@ -77,6 +77,16 @@ if ($ver >= 3.6) {
|
|||||||
push(@rv, "Dolibarr requires PHP version 5.3 or later");
|
push(@rv, "Dolibarr requires PHP version 5.3 or later");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($ver >= 12.0) {
|
||||||
|
# Check for PHP 5.6+
|
||||||
|
local $phpv = &get_php_version($phpver || 5, $d);
|
||||||
|
if (!$phpv) {
|
||||||
|
push(@rv, "Could not work out exact PHP version");
|
||||||
|
}
|
||||||
|
elsif ($phpv < 5.6) {
|
||||||
|
push(@rv, "Dolibarr requires PHP version 5.6 or later");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return @rv;
|
return @rv;
|
||||||
}
|
}
|
||||||
@ -376,7 +386,7 @@ sub script_dolibarr_realversion
|
|||||||
local ($d, $opts, $sinfo) = @_;
|
local ($d, $opts, $sinfo) = @_;
|
||||||
local $lref = &read_file_lines("$opts->{'dir'}/filefunc.inc.php", 1);
|
local $lref = &read_file_lines("$opts->{'dir'}/filefunc.inc.php", 1);
|
||||||
foreach my $l (@$lref) {
|
foreach my $l (@$lref) {
|
||||||
if ($l =~ /'DOL_VERSION','([0-9a-z\.\-]+)'/) {
|
if ($l =~ /'DOL_VERSION',\s?'([0-9a-z\.\-]+)'/) {
|
||||||
return $1;
|
return $1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,6 +400,8 @@ sub script_dolibarr_check_latest
|
|||||||
{
|
{
|
||||||
local ($ver) = @_;
|
local ($ver) = @_;
|
||||||
local @vers = &osdn_package_versions("dolibarr",
|
local @vers = &osdn_package_versions("dolibarr",
|
||||||
|
$ver >= 12.0 ? "dolibarr\\-(12\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
|
$ver >= 11.0 ? "dolibarr\\-(11\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 10.0 ? "dolibarr\\-(10\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 10.0 ? "dolibarr\\-(10\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 9.0 ? "dolibarr\\-(9\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
$ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
|
$ver >= 8.0 ? "dolibarr\\-(8\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||||
@ -410,7 +422,7 @@ return $ver eq $vers[0] ? undef : $vers[0];
|
|||||||
|
|
||||||
sub script_dolibarr_site
|
sub script_dolibarr_site
|
||||||
{
|
{
|
||||||
return 'http://www.dolibarr.org/';
|
return 'https://www.dolibarr.org/';
|
||||||
}
|
}
|
||||||
|
|
||||||
sub script_dolibarr_passmode
|
sub script_dolibarr_passmode
|
||||||
|
|||||||
@ -181,6 +181,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
%_datadir/dolibarr/htdocs/emailcollector
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
@ -196,8 +197,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/imports
|
%_datadir/dolibarr/htdocs/imports
|
||||||
%_datadir/dolibarr/htdocs/includes
|
%_datadir/dolibarr/htdocs/includes
|
||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -273,7 +274,6 @@ then
|
|||||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
|
||||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -261,6 +261,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
%_datadir/dolibarr/htdocs/emailcollector
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
@ -276,8 +277,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/imports
|
%_datadir/dolibarr/htdocs/imports
|
||||||
%_datadir/dolibarr/htdocs/includes
|
%_datadir/dolibarr/htdocs/includes
|
||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -423,7 +424,6 @@ then
|
|||||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
|
||||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -177,6 +177,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/custom
|
%_datadir/dolibarr/htdocs/custom
|
||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
@ -193,8 +194,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/imports
|
%_datadir/dolibarr/htdocs/imports
|
||||||
%_datadir/dolibarr/htdocs/includes
|
%_datadir/dolibarr/htdocs/includes
|
||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -270,7 +271,6 @@ then
|
|||||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
|
||||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -189,6 +189,7 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/datapolicy
|
%_datadir/dolibarr/htdocs/datapolicy
|
||||||
%_datadir/dolibarr/htdocs/dav
|
%_datadir/dolibarr/htdocs/dav
|
||||||
%_datadir/dolibarr/htdocs/debugbar
|
%_datadir/dolibarr/htdocs/debugbar
|
||||||
|
%_datadir/dolibarr/htdocs/delivery
|
||||||
%_datadir/dolibarr/htdocs/don
|
%_datadir/dolibarr/htdocs/don
|
||||||
%_datadir/dolibarr/htdocs/ecm
|
%_datadir/dolibarr/htdocs/ecm
|
||||||
%_datadir/dolibarr/htdocs/emailcollector
|
%_datadir/dolibarr/htdocs/emailcollector
|
||||||
@ -204,8 +205,8 @@ done >>%{name}.lang
|
|||||||
%_datadir/dolibarr/htdocs/imports
|
%_datadir/dolibarr/htdocs/imports
|
||||||
%_datadir/dolibarr/htdocs/includes
|
%_datadir/dolibarr/htdocs/includes
|
||||||
%_datadir/dolibarr/htdocs/install
|
%_datadir/dolibarr/htdocs/install
|
||||||
|
%_datadir/dolibarr/htdocs/intracommreport
|
||||||
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
|
||||||
%_datadir/dolibarr/htdocs/livraison
|
|
||||||
%_datadir/dolibarr/htdocs/loan
|
%_datadir/dolibarr/htdocs/loan
|
||||||
%_datadir/dolibarr/htdocs/mailmanspip
|
%_datadir/dolibarr/htdocs/mailmanspip
|
||||||
%_datadir/dolibarr/htdocs/margin
|
%_datadir/dolibarr/htdocs/margin
|
||||||
@ -281,7 +282,6 @@ then
|
|||||||
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_GEOIP_PATH" $config || echo "<?php \$dolibarr_lib_GEOIP_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
grep -q -c "dolibarr_lib_NUSOAP_PATH" $config || [ ! -d "/usr/share/php/nusoap" ] || echo "<?php \$dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
grep -q -c "dolibarr_lib_ODTPHP_PATHTOPCLZIP" $config || [ ! -d "/usr/share/php/libphp-pclzip" ] || echo "<?php \$dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; ?>" >> $config
|
||||||
#grep -q -c "dolibarr_lib_PHPEXCEL_PATH" $config || echo "<?php \$dolibarr_lib_PHPEXCEL_PATH=''; ?>" >> $config
|
|
||||||
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
#grep -q -c "dolibarr_lib_TCPDF_PATH" $config || echo "<?php \$dolibarr_lib_TCPDF_PATH=''; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
grep -q -c "dolibarr_js_CKEDITOR" $config || [ ! -d "/usr/share/javascript/ckeditor" ] || echo "<?php \$dolibarr_js_CKEDITOR='/javascript/ckeditor'; ?>" >> $config
|
||||||
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
grep -q -c "dolibarr_js_JQUERY" $config || [ ! -d "/usr/share/javascript/jquery" ] || echo "<?php \$dolibarr_js_JQUERY='/javascript/jquery'; ?>" >> $config
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmfedora';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||||
@ -24,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
|
||||||
$force_dolibarr_lib_TCPDF_PATH='';
|
$force_dolibarr_lib_TCPDF_PATH='';
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmgeneric';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
// We don't force any external lib with generic package
|
// We don't force any external lib with generic package
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmmandriva';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||||
@ -24,7 +25,6 @@ $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
|
||||||
$force_dolibarr_lib_TCPDF_PATH='';
|
$force_dolibarr_lib_TCPDF_PATH='';
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
|
|||||||
@ -17,6 +17,7 @@ $force_install_databaserootpass='__SUPERUSERPASSWORD__';
|
|||||||
$force_install_dolibarrlogin='admin';
|
$force_install_dolibarrlogin='admin';
|
||||||
$force_install_nophpinfo='1';
|
$force_install_nophpinfo='1';
|
||||||
$force_install_lockinstall='444';
|
$force_install_lockinstall='444';
|
||||||
|
$force_install_distrib='rpmopensuse';
|
||||||
|
|
||||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||||
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
//$force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb';
|
||||||
@ -24,7 +25,6 @@ $force_install_lockinstall='444';
|
|||||||
//$force_dolibarr_lib_GEOIP_PATH='';
|
//$force_dolibarr_lib_GEOIP_PATH='';
|
||||||
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
//$force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap';
|
||||||
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
//$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip';
|
||||||
$force_dolibarr_lib_PHPEXCEL_PATH='';
|
|
||||||
$force_dolibarr_lib_TCPDF_PATH='';
|
$force_dolibarr_lib_TCPDF_PATH='';
|
||||||
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
//$force_dolibarr_js_CKEDITOR='/javascript/ckeditor';
|
||||||
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
//$force_dolibarr_js_JQUERY='/javascript/jquery';
|
||||||
|
|||||||
592
composer.lock
generated
592
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -48,6 +48,7 @@ By
|
|||||||
* In file nusoap.php, to avoid a warning,
|
* In file nusoap.php, to avoid a warning,
|
||||||
Replace call to serialize_val with no bugged value
|
Replace call to serialize_val with no bugged value
|
||||||
|
|
||||||
|
* In all files, replace constructor names into __construct. Replace also parent::constructor_name with parent::__construct
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -217,14 +218,6 @@ JQUERYFILETREE:
|
|||||||
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
|
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
|
||||||
|
|
||||||
|
|
||||||
PHPEXCEL:
|
|
||||||
---------
|
|
||||||
* Replace in htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared/OLE.php
|
|
||||||
continue;
|
|
||||||
with:
|
|
||||||
continue 2;
|
|
||||||
|
|
||||||
|
|
||||||
RESTLER:
|
RESTLER:
|
||||||
--------
|
--------
|
||||||
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
Change content of file htdocs/includes/restler/framework/Luracast/Restler/explorer/index.html
|
||||||
|
|||||||
21
dev/examples/zapier/.editorconfig
Normal file
21
dev/examples/zapier/.editorconfig
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# EditorConfig is awesome: https://editorconfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
|
||||||
|
[*.js]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = false
|
||||||
1
dev/examples/zapier/.gitignore
vendored
1
dev/examples/zapier/.gitignore
vendored
@ -5,3 +5,4 @@ node_modules
|
|||||||
.environment
|
.environment
|
||||||
.env
|
.env
|
||||||
.zapierapprc
|
.zapierapprc
|
||||||
|
package-lock.json
|
||||||
|
|||||||
68
dev/examples/zapier/README.md
Normal file
68
dev/examples/zapier/README.md
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
# HOW TO BUILD
|
||||||
|
|
||||||
|
|
||||||
|
## ENABLE MODULE ZAPIER ON DOLIBARR
|
||||||
|
|
||||||
|
This should also enable the module API (required for authentication by Zapier service and to execute action in Dolibarr by Zapier).
|
||||||
|
|
||||||
|
Create the Dolibarr login that will be used by Zapier to call APIs. Give the login the permissions on the action you plan to automate.
|
||||||
|
|
||||||
|
|
||||||
|
## CREATE A ZAPIER DEVELOPPER ACCOUNT
|
||||||
|
|
||||||
|
At first, you need to have a Zapier developper acoount, create it here [Zapier Platform](https://developer.zapier.com/)
|
||||||
|
|
||||||
|
|
||||||
|
## INSTALL ZAPIER COMMAND LINE TOOLS WITH LINK TO ZAPIER ONLINE ACCOUNT
|
||||||
|
|
||||||
|
### Install Node.js
|
||||||
|
|
||||||
|
An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier.
|
||||||
|
|
||||||
|
After installation, confirm that Node.js is ready to use:
|
||||||
|
`node --version`
|
||||||
|
|
||||||
|
### Install the Zapier CLI
|
||||||
|
|
||||||
|
Next let's install the Zapier CLI tools. The CLI will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more:
|
||||||
|
|
||||||
|
`cd dev/examples/zapier`
|
||||||
|
|
||||||
|
`npm install -g zapier-platform-cli` to install the CLI globally
|
||||||
|
|
||||||
|
`zapier --version` to return version of the CLI
|
||||||
|
|
||||||
|
### Run Zapier Login
|
||||||
|
|
||||||
|
Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application.
|
||||||
|
|
||||||
|
`zapier login`
|
||||||
|
|
||||||
|
This command will set up a .zapierrc file in your home directory.
|
||||||
|
|
||||||
|
### Install the Project
|
||||||
|
|
||||||
|
In zapier example directory, run:
|
||||||
|
|
||||||
|
`cd dev/examples/zapier`
|
||||||
|
|
||||||
|
`npm install`
|
||||||
|
|
||||||
|
### Deploying your App
|
||||||
|
|
||||||
|
Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers.
|
||||||
|
|
||||||
|
`zapier register` (the first time, choose name for example "Dolibarr")
|
||||||
|
|
||||||
|
`zapier push`
|
||||||
|
|
||||||
|
After a push, the Application, with the name you defined during the register step, is available when creating a Zap.
|
||||||
|
|
||||||
|
You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction)
|
||||||
|
|
||||||
|
|
||||||
|
### Create a Zap
|
||||||
|
|
||||||
|
Create a ZAP that use the application you registered.
|
||||||
|
For authentication, you must enter the login / pass of account used by Zapier to call APIs.
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
/*jshint esversion: 6 */
|
/*jshint esversion: 6 */
|
||||||
const testAuth = (z , bundle) => {
|
const test = (z , bundle) => {
|
||||||
const url = bundle.authData.url+'/api/index.php/login';
|
const url = bundle.authData.url+'/api/index.php/status';
|
||||||
// Normally you want to make a request to an endpoint that is either specifically designed to test auth, or one that
|
// Normally you want to make a request to an endpoint that is either specifically designed to test auth, or one that
|
||||||
// every user will have access to, such as an account or profile endpoint like /me.
|
// every user will have access to, such as an account or profile endpoint like /me.
|
||||||
// In this example, we'll hit httpbin, which validates the Authorization Header against the arguments passed in the URL path
|
// In this example, we'll hit httpbin, which validates the Authorization Header against the arguments passed in the URL path
|
||||||
@ -11,44 +11,69 @@ const testAuth = (z , bundle) => {
|
|||||||
// This method can return any truthy value to indicate the credentials are valid.
|
// This method can return any truthy value to indicate the credentials are valid.
|
||||||
// Raise an error to show
|
// Raise an error to show
|
||||||
return promise.then((response) => {
|
return promise.then((response) => {
|
||||||
if (response.status === 401) {
|
if (response.status === 400) {
|
||||||
throw new Error('The Session Key you supplied is invalid');
|
throw new Error('400 -The Session Key you supplied is invalid');
|
||||||
|
}
|
||||||
|
if (response.status === 403) {
|
||||||
|
throw new Error('403 -The Session Key you supplied is invalid');
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getSessionKey = (z, bundle) => {
|
// To include the session key header on all outbound requests, simply define a function here.
|
||||||
|
// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot
|
||||||
|
const includeSessionKeyHeader = (request, z, bundle) => {
|
||||||
|
if (bundle.authData.sessionKey) {
|
||||||
|
request.headers = request.headers || {};
|
||||||
|
request.headers['DOLAPIKEY'] = bundle.authData.sessionKey;
|
||||||
|
}
|
||||||
|
return request;
|
||||||
|
};
|
||||||
|
|
||||||
|
// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange.
|
||||||
|
const sessionRefreshIf401 = (response, z, bundle) => {
|
||||||
|
if (bundle.authData.sessionKey) {
|
||||||
|
if (response.status === 401) {
|
||||||
|
throw new z.errors.RefreshAuthError('Session apikey needs refreshing.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
};
|
||||||
|
|
||||||
|
const getSessionKey = async (z, bundle) => {
|
||||||
const url = bundle.authData.url + '/api/index.php/login';
|
const url = bundle.authData.url + '/api/index.php/login';
|
||||||
|
|
||||||
const promise = z.request({
|
const response = await z.request({
|
||||||
method: 'POST',
|
|
||||||
url: url,
|
url: url,
|
||||||
|
method: 'POST',
|
||||||
body: {
|
body: {
|
||||||
login: bundle.authData.login,
|
login: bundle.authData.login,
|
||||||
password: bundle.authData.password,
|
password: bundle.authData.password,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return promise.then((response) => {
|
// if (response.status === 401) {
|
||||||
if (response.status === 401) {
|
// throw new Error('The login/password you supplied is invalid');
|
||||||
throw new Error('The login/password you supplied is invalid');
|
// }
|
||||||
}
|
|
||||||
const json = JSON.parse(response.content);
|
const json = JSON.parse(response.content);
|
||||||
return {
|
return {
|
||||||
sessionKey: json.success.token || 'secret'
|
sessionKey: json.success.token || '',
|
||||||
};
|
};
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
config: {
|
||||||
type: 'session',
|
type: 'session',
|
||||||
|
sessionConfig: {
|
||||||
|
perform: getSessionKey
|
||||||
|
},
|
||||||
// Define any auth fields your app requires here. The user will be prompted to enter this info when
|
// Define any auth fields your app requires here. The user will be prompted to enter this info when
|
||||||
// they connect their account.
|
// they connect their account.
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
key: 'url',
|
key: 'url',
|
||||||
label: 'Url of service',
|
label: 'Url of service without trailing-slash',
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string'
|
type: 'string'
|
||||||
},
|
},
|
||||||
@ -67,11 +92,11 @@ module.exports = {
|
|||||||
],
|
],
|
||||||
// The test method allows Zapier to verify that the credentials a user provides are valid. We'll execute this
|
// The test method allows Zapier to verify that the credentials a user provides are valid. We'll execute this
|
||||||
// method whenever a user connects their account for the first time.
|
// method whenever a user connects their account for the first time.
|
||||||
test: testAuth,
|
test,
|
||||||
// The method that will exchange the fields provided by the user for session credentials.
|
// The method that will exchange the fields provided by the user for session credentials.
|
||||||
sessionConfig: {
|
|
||||||
perform: getSessionKey
|
|
||||||
},
|
|
||||||
// assuming "login" is a key returned from the test
|
// assuming "login" is a key returned from the test
|
||||||
connectionLabel: '{{login}}'
|
connectionLabel: '{{login}}'
|
||||||
|
},
|
||||||
|
befores: [includeSessionKeyHeader],
|
||||||
|
afters: [sessionRefreshIf401],
|
||||||
};
|
};
|
||||||
|
|||||||
@ -72,7 +72,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'name_alias', label: 'Name alias'},
|
{key: 'name_alias', label: 'Name alias'},
|
||||||
{key: 'address', label: 'Address'},
|
{key: 'address', label: 'Address'},
|
||||||
@ -81,8 +81,8 @@ module.exports = {
|
|||||||
{key: 'phone', label: 'Phone'},
|
{key: 'phone', label: 'Phone'},
|
||||||
{key: 'fax', label: 'Fax'},
|
{key: 'fax', label: 'Fax'},
|
||||||
{key: 'email', label: 'Email'},
|
{key: 'email', label: 'Email'},
|
||||||
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
{key: 'client', type: "integer", label: 'Customer/Prospect 0/1/2/3'},
|
||||||
{key: 'fournisseur', label: 'Supplier 0/1'},
|
{key: 'fournisseur', type: "integer", label: 'Supplier 0/1'},
|
||||||
{key: 'code_client', label: 'Customer code'},
|
{key: 'code_client', label: 'Customer code'},
|
||||||
{key: 'code_fournisseur', label: 'Supplier code'}
|
{key: 'code_fournisseur', label: 'Supplier code'}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -1,33 +1,39 @@
|
|||||||
/*jshint esversion: 6 */
|
/*jshint esversion: 6 */
|
||||||
const triggerThirdparty = require('./triggers/thirdparty');
|
|
||||||
const triggerOrder = require('./triggers/order');
|
|
||||||
const triggerAction = require('./triggers/action');
|
const triggerAction = require('./triggers/action');
|
||||||
|
const triggerOrder = require('./triggers/order');
|
||||||
|
const triggerThirdparty = require('./triggers/thirdparty');
|
||||||
|
const triggerTicket = require('./triggers/ticket');
|
||||||
|
const triggerUser = require('./triggers/user');
|
||||||
|
|
||||||
const searchThirdparty = require('./searches/thirdparty');
|
const searchThirdparty = require('./searches/thirdparty');
|
||||||
|
|
||||||
const createThirdparty = require('./creates/thirdparty');
|
const createThirdparty = require('./creates/thirdparty');
|
||||||
|
|
||||||
const authentication = require('./authentication');
|
const {
|
||||||
|
config: authentication,
|
||||||
|
befores = [],
|
||||||
|
afters = [],
|
||||||
|
} = require('./authentication');
|
||||||
|
|
||||||
// To include the session key header on all outbound requests, simply define a function here.
|
// To include the session key header on all outbound requests, simply define a function here.
|
||||||
// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot
|
// It runs runs before each request is sent out, allowing you to make tweaks to the request in a centralized spot
|
||||||
const includeSessionKeyHeader = (request, z, bundle) => {
|
// const includeSessionKeyHeader = (request, z, bundle) => {
|
||||||
if (bundle.authData.sessionKey) {
|
// if (bundle.authData.sessionKey) {
|
||||||
request.headers = request.headers || {};
|
// request.headers = request.headers || {};
|
||||||
request.headers['DOLAPIKEY'] = bundle.authData.sessionKey;
|
// request.headers['DOLAPIKEY'] = bundle.authData.sessionKey;
|
||||||
}
|
// }
|
||||||
return request;
|
// return request;
|
||||||
};
|
// };
|
||||||
|
|
||||||
// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange.
|
// If we get a response and it is a 401, we can raise a special error telling Zapier to retry this after another exchange.
|
||||||
const sessionRefreshIf401 = (response, z, bundle) => {
|
// const sessionRefreshIf401 = (response, z, bundle) => {
|
||||||
if (bundle.authData.sessionKey) {
|
// if (bundle.authData.sessionKey) {
|
||||||
if (response.status === 401) {
|
// if (response.status === 401) {
|
||||||
throw new z.errors.RefreshAuthError('Session apikey needs refreshing.');
|
// throw new z.errors.RefreshAuthError('Session apikey needs refreshing.');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return response;
|
// return response;
|
||||||
};
|
// };
|
||||||
|
|
||||||
// We can roll up all our behaviors in an App.
|
// We can roll up all our behaviors in an App.
|
||||||
const App = {
|
const App = {
|
||||||
@ -40,11 +46,11 @@ const App = {
|
|||||||
|
|
||||||
// beforeRequest & afterResponse are optional hooks into the provided HTTP client
|
// beforeRequest & afterResponse are optional hooks into the provided HTTP client
|
||||||
beforeRequest: [
|
beforeRequest: [
|
||||||
includeSessionKeyHeader
|
...befores
|
||||||
],
|
],
|
||||||
|
|
||||||
afterResponse: [
|
afterResponse: [
|
||||||
sessionRefreshIf401
|
...afters
|
||||||
],
|
],
|
||||||
|
|
||||||
// If you want to define optional resources to simplify creation of triggers, searches, creates - do that here!
|
// If you want to define optional resources to simplify creation of triggers, searches, creates - do that here!
|
||||||
@ -53,9 +59,11 @@ const App = {
|
|||||||
|
|
||||||
// If you want your trigger to show up, you better include it here!
|
// If you want your trigger to show up, you better include it here!
|
||||||
triggers: {
|
triggers: {
|
||||||
[triggerThirdparty.key]: triggerThirdparty,
|
[triggerAction.key]: triggerAction,
|
||||||
[triggerOrder.key]: triggerOrder,
|
[triggerOrder.key]: triggerOrder,
|
||||||
[triggerAction.key]: triggerAction
|
[triggerThirdparty.key]: triggerThirdparty,
|
||||||
|
[triggerTicket.key]: triggerTicket,
|
||||||
|
[triggerUser.key]: triggerUser,
|
||||||
},
|
},
|
||||||
|
|
||||||
// If you want your searches to show up, you better include it here!
|
// If you want your searches to show up, you better include it here!
|
||||||
|
|||||||
405
dev/examples/zapier/package-lock.json
generated
405
dev/examples/zapier/package-lock.json
generated
@ -1,405 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "Dolibarr",
|
|
||||||
"version": "1.0.2",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": {
|
|
||||||
"version": "8.10.20",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.20.tgz",
|
|
||||||
"integrity": "sha512-M7x8+5D1k/CuA6jhiwuSCmE8sbUWJF0wYsjcig9WrXvwUI5ArEoUBdOXpV4JcEMrLp02/QbDjw+kI+vQeKyQgg==",
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"asynckit": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
|
||||||
},
|
|
||||||
"balanced-match": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"bluebird": {
|
|
||||||
"version": "3.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
|
|
||||||
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
|
|
||||||
},
|
|
||||||
"brace-expansion": {
|
|
||||||
"version": "1.1.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
||||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"balanced-match": "^1.0.0",
|
|
||||||
"concat-map": "0.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"browser-stdout": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"combined-stream": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
|
|
||||||
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
|
|
||||||
"requires": {
|
|
||||||
"delayed-stream": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"commander": {
|
|
||||||
"version": "2.15.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
|
|
||||||
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"concat-map": {
|
|
||||||
"version": "0.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
|
||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"content-disposition": {
|
|
||||||
"version": "0.5.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
|
|
||||||
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"delayed-stream": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
|
||||||
},
|
|
||||||
"diff": {
|
|
||||||
"version": "3.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
|
|
||||||
"integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"dotenv": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow=="
|
|
||||||
},
|
|
||||||
"encoding": {
|
|
||||||
"version": "0.1.12",
|
|
||||||
"resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
|
|
||||||
"integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
|
|
||||||
"requires": {
|
|
||||||
"iconv-lite": "~0.4.13"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"escape-string-regexp": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
|
||||||
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"form-data": {
|
|
||||||
"version": "2.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
|
|
||||||
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
|
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "1.0.6",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fs.realpath": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"glob": {
|
|
||||||
"version": "7.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
|
|
||||||
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fs.realpath": "^1.0.0",
|
|
||||||
"inflight": "^1.0.4",
|
|
||||||
"inherits": "2",
|
|
||||||
"minimatch": "^3.0.4",
|
|
||||||
"once": "^1.3.0",
|
|
||||||
"path-is-absolute": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"growl": {
|
|
||||||
"version": "1.10.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz",
|
|
||||||
"integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"has-flag": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
|
||||||
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"he": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"iconv-lite": {
|
|
||||||
"version": "0.4.24",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
|
||||||
"requires": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inflight": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
|
||||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"once": "^1.3.0",
|
|
||||||
"wrappy": "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inherits": {
|
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
|
||||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"is-stream": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
|
||||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
|
|
||||||
},
|
|
||||||
"json-tryparse": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/json-tryparse/-/json-tryparse-1.0.5.tgz",
|
|
||||||
"integrity": "sha1-Khy6CLTjEjNo+p+2o01GQwBFeyc="
|
|
||||||
},
|
|
||||||
"jsonschema": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-PO3o4+QR03eHLu+8n98mODy8Ptk="
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.11",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
|
||||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
|
|
||||||
},
|
|
||||||
"mime-db": {
|
|
||||||
"version": "1.38.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
|
|
||||||
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg=="
|
|
||||||
},
|
|
||||||
"mime-types": {
|
|
||||||
"version": "2.1.22",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
|
|
||||||
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
|
|
||||||
"requires": {
|
|
||||||
"mime-db": "~1.38.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"minimatch": {
|
|
||||||
"version": "3.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"brace-expansion": "^1.1.7"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"minimist": {
|
|
||||||
"version": "0.0.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
|
||||||
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"mkdirp": {
|
|
||||||
"version": "0.5.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
|
||||||
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"minimist": "0.0.8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"mocha": {
|
|
||||||
"version": "5.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
|
|
||||||
"integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"browser-stdout": "1.3.1",
|
|
||||||
"commander": "2.15.1",
|
|
||||||
"debug": "3.1.0",
|
|
||||||
"diff": "3.5.0",
|
|
||||||
"escape-string-regexp": "1.0.5",
|
|
||||||
"glob": "7.1.2",
|
|
||||||
"growl": "1.10.5",
|
|
||||||
"he": "1.1.1",
|
|
||||||
"minimatch": "3.0.4",
|
|
||||||
"mkdirp": "0.5.1",
|
|
||||||
"supports-color": "5.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node-fetch": {
|
|
||||||
"version": "1.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.1.tgz",
|
|
||||||
"integrity": "sha512-j8XsFGCLw79vWXkZtMSmmLaOk9z5SQ9bV/tkbZVCqvgwzrjAGq66igobLofHtF63NvMTp2WjytpsNTGKa+XRIQ==",
|
|
||||||
"requires": {
|
|
||||||
"encoding": "^0.1.11",
|
|
||||||
"is-stream": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"oauth-sign": {
|
|
||||||
"version": "0.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
|
||||||
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
|
|
||||||
},
|
|
||||||
"once": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
|
||||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"wrappy": "1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"path-is-absolute": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"safer-buffer": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
|
||||||
},
|
|
||||||
"semver": {
|
|
||||||
"version": "5.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
|
||||||
"integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg=="
|
|
||||||
},
|
|
||||||
"should": {
|
|
||||||
"version": "13.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/should/-/should-13.2.3.tgz",
|
|
||||||
"integrity": "sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-equal": "^2.0.0",
|
|
||||||
"should-format": "^3.0.3",
|
|
||||||
"should-type": "^1.4.0",
|
|
||||||
"should-type-adaptors": "^1.0.1",
|
|
||||||
"should-util": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-equal": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-equal/-/should-equal-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-type": "^1.4.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-format": {
|
|
||||||
"version": "3.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-format/-/should-format-3.0.3.tgz",
|
|
||||||
"integrity": "sha1-m/yPdPo5IFxT04w01xcwPidxJPE=",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-type": "^1.3.0",
|
|
||||||
"should-type-adaptors": "^1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-type": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-type/-/should-type-1.4.0.tgz",
|
|
||||||
"integrity": "sha1-B1bYzoRt/QmEOmlHcZ36DUz/XPM=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"should-type-adaptors": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-type-adaptors/-/should-type-adaptors-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"should-type": "^1.3.0",
|
|
||||||
"should-util": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"should-util": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/should-util/-/should-util-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-yYzaN0qmsZDfi6h8mInCtNtiAGM=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"supports-color": {
|
|
||||||
"version": "5.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
|
|
||||||
"integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"has-flag": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wrappy": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"zapier-platform-core": {
|
|
||||||
"version": "8.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/zapier-platform-core/-/zapier-platform-core-8.0.1.tgz",
|
|
||||||
"integrity": "sha512-vuAe7JkFQ88AeQ//NwwNEh8ZjiZr30GRWtwYo7Wo/nx1cqZwq+CRc9zJU2WRrhJfJOtOOTUF6w+pArBTtMOC5A==",
|
|
||||||
"requires": {
|
|
||||||
"@types/node": "8.10.20",
|
|
||||||
"bluebird": "3.5.0",
|
|
||||||
"content-disposition": "0.5.2",
|
|
||||||
"dotenv": "5.0.1",
|
|
||||||
"form-data": "2.3.2",
|
|
||||||
"lodash": "4.17.11",
|
|
||||||
"node-fetch": "1.7.1",
|
|
||||||
"oauth-sign": "0.9.0",
|
|
||||||
"semver": "5.6.0",
|
|
||||||
"zapier-platform-schema": "8.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"zapier-platform-schema": {
|
|
||||||
"version": "8.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/zapier-platform-schema/-/zapier-platform-schema-8.0.1.tgz",
|
|
||||||
"integrity": "sha512-97KJ0xVLtpU4BiXVaMTPQpiA0T6CQIEzWfzAWwJAWbu5336+6DMFUzDWN4bANBeD3CIsRHHPcZkP8n/17U05ag==",
|
|
||||||
"requires": {
|
|
||||||
"jsonschema": "1.1.1",
|
|
||||||
"lodash": "4.17.10"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
|
||||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "Dolibarr",
|
"name": "dolibarr",
|
||||||
"version": "1.0.0",
|
"version": "1.13.0",
|
||||||
"description": "An app for connecting Dolibarr to the Zapier platform.",
|
"description": "An app for connecting Dolibarr to the Zapier platform.",
|
||||||
"repository": "Dolibarr/dolibarr",
|
"repository": "Dolibarr/dolibarr",
|
||||||
"homepage": "https://www.dolibarr.fr/",
|
"homepage": "https://www.dolibarr.org/",
|
||||||
"author": "Frédéric France <frederic.france@netlogic.fr>",
|
"author": "Frédéric France <frederic.france@netlogic.fr>",
|
||||||
"license": "BSD-3-Clause",
|
"license": "BSD-3-Clause",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"npm": ">=5.6.0"
|
"npm": ">=5.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"zapier-platform-core": "8.0.1"
|
"zapier-platform-core": "10.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
|
|||||||
@ -54,13 +54,20 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{
|
||||||
{key: 'createdAt', label: 'Created At'},
|
key: 'id',
|
||||||
|
type: "integer",
|
||||||
|
label: 'ID'
|
||||||
|
},
|
||||||
|
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'firstname', label: 'Firstname'},
|
{key: 'firstname', label: 'Firstname'},
|
||||||
{key: 'directions', label: 'Directions'},
|
{key: 'directions', label: 'Directions'},
|
||||||
{key: 'authorId', label: 'Author ID'},
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
{key: 'style', label: 'Style'}
|
{
|
||||||
|
key: 'style',
|
||||||
|
label: 'Style'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const subscribeHook = (z, bundle) => {
|
|||||||
const options = {
|
const options = {
|
||||||
url: url,
|
url: url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
// You may return a promise or a normal data structure from any perform method.
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
@ -100,7 +100,7 @@ module.exports = {
|
|||||||
noun: 'Action',
|
noun: 'Action',
|
||||||
display: {
|
display: {
|
||||||
label: 'New Agenda',
|
label: 'New Agenda',
|
||||||
description: 'Trigger when a new agenda with action is done in Dolibarr.'
|
description: 'Triggers when a new agenda with action is done in Dolibarr.'
|
||||||
},
|
},
|
||||||
|
|
||||||
// `operation` is where the business logic goes.
|
// `operation` is where the business logic goes.
|
||||||
@ -111,6 +111,7 @@ module.exports = {
|
|||||||
inputFields: [
|
inputFields: [
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
helpText: 'Which action of agenda this should trigger on.',
|
helpText: 'Which action of agenda this should trigger on.',
|
||||||
choices: {
|
choices: {
|
||||||
@ -145,12 +146,33 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{
|
||||||
{key: 'createdAt', label: 'Created At'},
|
key: 'id',
|
||||||
{key: 'name', label: 'Name'},
|
type: "integer",
|
||||||
{key: 'usertodo__name', label: 'UserToDo Name'},
|
label: 'ID'
|
||||||
{key: 'authorId', label: 'Author ID'},
|
},
|
||||||
{key: 'action', label: 'Action'}
|
{
|
||||||
|
key: 'createdAt',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Created At'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'name',
|
||||||
|
label: 'Name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'usertodo__name',
|
||||||
|
label: 'UserToDo Name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'authorId',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Author ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
label: 'Action'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const subscribeHook = (z, bundle) => {
|
|||||||
const options = {
|
const options = {
|
||||||
url: url,
|
url: url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
// You may return a promise or a normal data structure from any perform method.
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
@ -90,7 +90,7 @@ module.exports = {
|
|||||||
noun: 'Order',
|
noun: 'Order',
|
||||||
display: {
|
display: {
|
||||||
label: 'New Order',
|
label: 'New Order',
|
||||||
description: 'Trigger when a new order with action is done in Dolibarr.'
|
description: 'Triggers when a new order with action is done in Dolibarr.'
|
||||||
},
|
},
|
||||||
|
|
||||||
// `operation` is where the business logic goes.
|
// `operation` is where the business logic goes.
|
||||||
@ -101,6 +101,7 @@ module.exports = {
|
|||||||
inputFields: [
|
inputFields: [
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
helpText: 'Which action of order this should trigger on.',
|
helpText: 'Which action of order this should trigger on.',
|
||||||
choices: {
|
choices: {
|
||||||
@ -136,11 +137,11 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
{key: 'createdAt', label: 'Created At'},
|
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'directions', label: 'Directions'},
|
{key: 'directions', label: 'Directions'},
|
||||||
{key: 'authorId', label: 'Author ID'},
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
{key: 'module', label: 'Module'},
|
{key: 'module', label: 'Module'},
|
||||||
{key: 'action', label: 'Action'}
|
{key: 'action', label: 'Action'}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const subscribeHook = (z, bundle) => {
|
|||||||
const options = {
|
const options = {
|
||||||
url: url,
|
url: url,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(data)
|
body: data,
|
||||||
};
|
};
|
||||||
|
|
||||||
// You may return a promise or a normal data structure from any perform method.
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
@ -112,7 +112,7 @@ module.exports = {
|
|||||||
noun: 'Thirdparty',
|
noun: 'Thirdparty',
|
||||||
display: {
|
display: {
|
||||||
label: 'New Thirdparty',
|
label: 'New Thirdparty',
|
||||||
description: 'Trigger when a new thirdpaty action is done in Dolibarr.'
|
description: 'Triggers when a new thirdpaty action is done in Dolibarr.'
|
||||||
},
|
},
|
||||||
|
|
||||||
// `operation` is where the business logic goes.
|
// `operation` is where the business logic goes.
|
||||||
@ -123,6 +123,7 @@ module.exports = {
|
|||||||
inputFields: [
|
inputFields: [
|
||||||
{
|
{
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
helpText: 'Which action of thirdparty this should trigger on.',
|
helpText: 'Which action of thirdparty this should trigger on.',
|
||||||
choices: {
|
choices: {
|
||||||
@ -159,12 +160,12 @@ module.exports = {
|
|||||||
// outputFields: () => { return []; }
|
// outputFields: () => { return []; }
|
||||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
outputFields: [
|
outputFields: [
|
||||||
{key: 'id', label: 'ID'},
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
{key: 'createdAt', label: 'Created At'},
|
{key: 'createdAt', label: 'Created At'},
|
||||||
{key: 'name', label: 'Name'},
|
{key: 'name', label: 'Name'},
|
||||||
{key: 'name_alias', label: 'Name alias'},
|
{key: 'name_alias', label: 'Name alias'},
|
||||||
{key: 'firstname', label: 'Firstame'},
|
{key: 'firstname', label: 'Firstname'},
|
||||||
{key: 'authorId', label: 'Author ID'},
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
{key: 'action', label: 'Action'},
|
{key: 'action', label: 'Action'},
|
||||||
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
||||||
{key: 'fournisseur', label: 'Supplier 0/1'},
|
{key: 'fournisseur', label: 'Supplier 0/1'},
|
||||||
|
|||||||
237
dev/examples/zapier/triggers/ticket.js
Normal file
237
dev/examples/zapier/triggers/ticket.js
Normal file
@ -0,0 +1,237 @@
|
|||||||
|
const subscribeHook = (z, bundle) => {
|
||||||
|
// `z.console.log()` is similar to `console.log()`.
|
||||||
|
z.console.log('suscribing hook!');
|
||||||
|
|
||||||
|
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||||
|
const data = {
|
||||||
|
url: bundle.targetUrl,
|
||||||
|
event: bundle.event,
|
||||||
|
module: 'ticket',
|
||||||
|
action: bundle.inputData.action
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: url,
|
||||||
|
method: 'POST',
|
||||||
|
body: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsubscribeHook = (z, bundle) => {
|
||||||
|
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||||
|
// request made initially.
|
||||||
|
z.console.log('unsuscribing hook!');
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||||
|
method: 'DELETE',
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const getTicket = (z, bundle) => {
|
||||||
|
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||||
|
// test poll) and also a .querystring property with the URL's query string.
|
||||||
|
const ticket = {
|
||||||
|
id: bundle.cleanedRequest.id,
|
||||||
|
track_id: bundle.cleanedRequest.track_id,
|
||||||
|
subject: bundle.cleanedRequest.subject,
|
||||||
|
message: bundle.cleanedRequest.message,
|
||||||
|
lastname: bundle.cleanedRequest.lastname,
|
||||||
|
firstname: bundle.cleanedRequest.firstname,
|
||||||
|
address: bundle.cleanedRequest.address,
|
||||||
|
zip: bundle.cleanedRequest.zip,
|
||||||
|
town: bundle.cleanedRequest.town,
|
||||||
|
email_from: bundle.cleanedRequest.email_from,
|
||||||
|
login: bundle.cleanedRequest.login,
|
||||||
|
authorId: bundle.cleanedRequest.authorId,
|
||||||
|
createdAt: bundle.cleanedRequest.createdAt,
|
||||||
|
action: bundle.cleanedRequest.action
|
||||||
|
};
|
||||||
|
|
||||||
|
return [ticket];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFallbackRealTicket = (z, bundle) => {
|
||||||
|
// For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
const module = bundle.inputData.module;
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/tickets/0',
|
||||||
|
};
|
||||||
|
|
||||||
|
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// const getModulesChoices = (z/*, bundle*/) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const options = {
|
||||||
|
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
// const getModulesChoices = () => {
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// orders: "Order",
|
||||||
|
// invoices: "Invoice",
|
||||||
|
// thirdparties: "Thirdparty",
|
||||||
|
// users: "User",
|
||||||
|
// tickets: "Ticket",
|
||||||
|
// contacts: "Contacts"
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const getActionsChoices = (z, bundle) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const module = bundle.inputData.module;
|
||||||
|
// const options = {
|
||||||
|
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
|
||||||
|
// We recommend writing your triggers separate like this and rolling them
|
||||||
|
// into the App definition at the end.
|
||||||
|
module.exports = {
|
||||||
|
key: 'ticket',
|
||||||
|
|
||||||
|
// You'll want to provide some helpful display labels and descriptions
|
||||||
|
// for tickets. Zapier will put them into the UX.
|
||||||
|
noun: 'Ticket',
|
||||||
|
display: {
|
||||||
|
label: 'New Ticket',
|
||||||
|
description: 'Triggers when a new ticket action is done in Dolibarr.'
|
||||||
|
},
|
||||||
|
|
||||||
|
// `operation` is where the business logic goes.
|
||||||
|
operation: {
|
||||||
|
|
||||||
|
// `inputFields` can define the fields a ticket could provide,
|
||||||
|
// we'll pass them in as `bundle.inputData` later.
|
||||||
|
inputFields: [
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
type: 'string',
|
||||||
|
required: true,
|
||||||
|
helpText: 'Which action of ticket this should trigger on.',
|
||||||
|
choices: {
|
||||||
|
create: "Create",
|
||||||
|
modify: "Modify",
|
||||||
|
validate: "Validate",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
type: 'hook',
|
||||||
|
|
||||||
|
performSubscribe: subscribeHook,
|
||||||
|
performUnsubscribe: unsubscribeHook,
|
||||||
|
|
||||||
|
perform: getTicket,
|
||||||
|
performList: getFallbackRealTicket,
|
||||||
|
|
||||||
|
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||||
|
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||||
|
// returned records, and have obviously dummy values that we can show to any user.
|
||||||
|
sample: {
|
||||||
|
id: 1,
|
||||||
|
track_id: 'Xaz123er',
|
||||||
|
subject: 'Subject',
|
||||||
|
message: 'Message',
|
||||||
|
createdAt: 1472069465,
|
||||||
|
lastname: 'DOE',
|
||||||
|
firstname: 'John',
|
||||||
|
email: 'john@doe.com',
|
||||||
|
address: 'Park Avenue',
|
||||||
|
zip: '12345',
|
||||||
|
town: 'NEW-YORK',
|
||||||
|
email_from: 'doe.john@example;com',
|
||||||
|
authorId: 1,
|
||||||
|
action: 'create'
|
||||||
|
},
|
||||||
|
|
||||||
|
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||||
|
// field definitions. The result will be used to augment the sample.
|
||||||
|
// outputFields: () => { return []; }
|
||||||
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
|
outputFields: [
|
||||||
|
{
|
||||||
|
key: 'id',
|
||||||
|
type: "integer",
|
||||||
|
label: 'ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'track_id',
|
||||||
|
type: "string",
|
||||||
|
label: 'TrackID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'subject',
|
||||||
|
type: "string",
|
||||||
|
label: 'Subject'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'message',
|
||||||
|
type: "string",
|
||||||
|
label: 'Message'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'createdAt',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Created At'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'lastname',
|
||||||
|
label: 'Lastname'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'firstname',
|
||||||
|
label: 'Firstname'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'email',
|
||||||
|
label: 'Email'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'address',
|
||||||
|
label: 'Address'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'zip',
|
||||||
|
label: 'Zip'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'town',
|
||||||
|
label: 'Town'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'email_from',
|
||||||
|
type: 'string',
|
||||||
|
label: 'Email from'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'authorId',
|
||||||
|
type: "integer",
|
||||||
|
label: 'Author ID'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
type: 'string',
|
||||||
|
label: 'Action'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
177
dev/examples/zapier/triggers/user.js
Normal file
177
dev/examples/zapier/triggers/user.js
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
const subscribeHook = (z, bundle) => {
|
||||||
|
// `z.console.log()` is similar to `console.log()`.
|
||||||
|
z.console.log('suscribing hook!');
|
||||||
|
|
||||||
|
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||||
|
const data = {
|
||||||
|
url: bundle.targetUrl,
|
||||||
|
event: bundle.event,
|
||||||
|
module: 'user',
|
||||||
|
action: bundle.inputData.action
|
||||||
|
};
|
||||||
|
|
||||||
|
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: url,
|
||||||
|
method: 'POST',
|
||||||
|
body: data,
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsubscribeHook = (z, bundle) => {
|
||||||
|
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||||
|
// request made initially.
|
||||||
|
z.console.log('unsuscribing hook!');
|
||||||
|
|
||||||
|
// You can build requests and our client will helpfully inject all the variables
|
||||||
|
// you need to complete. You can also register middleware to control this.
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||||
|
method: 'DELETE',
|
||||||
|
};
|
||||||
|
|
||||||
|
// You may return a promise or a normal data structure from any perform method.
|
||||||
|
return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
};
|
||||||
|
|
||||||
|
const getUser = (z, bundle) => {
|
||||||
|
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||||
|
// test poll) and also a .querystring property with the URL's query string.
|
||||||
|
const user = {
|
||||||
|
id: bundle.cleanedRequest.id,
|
||||||
|
lastname: bundle.cleanedRequest.lastname,
|
||||||
|
firstname: bundle.cleanedRequest.firstname,
|
||||||
|
address: bundle.cleanedRequest.address,
|
||||||
|
zip: bundle.cleanedRequest.zip,
|
||||||
|
town: bundle.cleanedRequest.town,
|
||||||
|
email: bundle.cleanedRequest.email,
|
||||||
|
login: bundle.cleanedRequest.login,
|
||||||
|
authorId: bundle.cleanedRequest.authorId,
|
||||||
|
createdAt: bundle.cleanedRequest.createdAt,
|
||||||
|
action: bundle.cleanedRequest.action
|
||||||
|
};
|
||||||
|
|
||||||
|
return [user];
|
||||||
|
};
|
||||||
|
|
||||||
|
const getFallbackRealUser = (z, bundle) => {
|
||||||
|
// For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
const module = bundle.inputData.module;
|
||||||
|
const options = {
|
||||||
|
url: bundle.authData.url + '/api/index.php/users/0',
|
||||||
|
};
|
||||||
|
|
||||||
|
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// const getModulesChoices = (z/*, bundle*/) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const options = {
|
||||||
|
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
// const getModulesChoices = () => {
|
||||||
|
|
||||||
|
// return {
|
||||||
|
// orders: "Order",
|
||||||
|
// invoices: "Invoice",
|
||||||
|
// thirdparties: "Thirdparty",
|
||||||
|
// users: "User",
|
||||||
|
// contacts: "Contacts"
|
||||||
|
// };
|
||||||
|
// };
|
||||||
|
|
||||||
|
// const getActionsChoices = (z, bundle) => {
|
||||||
|
// // For the test poll, you should get some real data, to aid the setup process.
|
||||||
|
// const module = bundle.inputData.module;
|
||||||
|
// const options = {
|
||||||
|
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||||
|
// };
|
||||||
|
|
||||||
|
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||||
|
// };
|
||||||
|
|
||||||
|
// We recommend writing your triggers separate like this and rolling them
|
||||||
|
// into the App definition at the end.
|
||||||
|
module.exports = {
|
||||||
|
key: 'user',
|
||||||
|
|
||||||
|
// You'll want to provide some helpful display labels and descriptions
|
||||||
|
// for users. Zapier will put them into the UX.
|
||||||
|
noun: 'User',
|
||||||
|
display: {
|
||||||
|
label: 'New User',
|
||||||
|
description: 'Triggers when a new user action is done in Dolibarr.'
|
||||||
|
},
|
||||||
|
|
||||||
|
// `operation` is where the business logic goes.
|
||||||
|
operation: {
|
||||||
|
|
||||||
|
// `inputFields` can define the fields a user could provide,
|
||||||
|
// we'll pass them in as `bundle.inputData` later.
|
||||||
|
inputFields: [
|
||||||
|
{
|
||||||
|
key: 'action',
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
helpText: 'Which action of user this should trigger on.',
|
||||||
|
choices: {
|
||||||
|
create: "Create",
|
||||||
|
modify: "Modify",
|
||||||
|
validate: "Validate",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
type: 'hook',
|
||||||
|
|
||||||
|
performSubscribe: subscribeHook,
|
||||||
|
performUnsubscribe: unsubscribeHook,
|
||||||
|
|
||||||
|
perform: getUser,
|
||||||
|
performList: getFallbackRealUser,
|
||||||
|
|
||||||
|
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||||
|
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||||
|
// returned records, and have obviously dummy values that we can show to any user.
|
||||||
|
sample: {
|
||||||
|
id: 1,
|
||||||
|
createdAt: 1472069465,
|
||||||
|
lastname: 'DOE',
|
||||||
|
firstname: 'John',
|
||||||
|
email: 'john@doe.com',
|
||||||
|
address: 'Park Avenue',
|
||||||
|
zip: '12345',
|
||||||
|
town: 'NEW-YORK',
|
||||||
|
login: 'doe.john',
|
||||||
|
authorId: 1,
|
||||||
|
action: 'create'
|
||||||
|
},
|
||||||
|
|
||||||
|
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||||
|
// field definitions. The result will be used to augment the sample.
|
||||||
|
// outputFields: () => { return []; }
|
||||||
|
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||||
|
outputFields: [
|
||||||
|
{key: 'id', type: "integer", label: 'ID'},
|
||||||
|
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||||
|
{key: 'lastname', label: 'Lastname'},
|
||||||
|
{key: 'firstname', label: 'Firstname'},
|
||||||
|
{key: 'email', label: 'Email'},
|
||||||
|
{key: 'address', label: 'Address'},
|
||||||
|
{key: 'zip', label: 'Zip'},
|
||||||
|
{key: 'town', label: 'Town'},
|
||||||
|
{key: 'login', label: 'Login'},
|
||||||
|
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||||
|
{key: 'action', label: 'Action'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
$script_file = basename(__FILE__);
|
$script_file = basename(__FILE__);
|
||||||
$path=dirname(__FILE__).'/';
|
$path=__DIR__.'/';
|
||||||
|
|
||||||
// Test si mode batch
|
// Test si mode batch
|
||||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||||
@ -120,8 +120,8 @@ $sqls=array(
|
|||||||
"DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'",
|
"DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'",
|
||||||
),
|
),
|
||||||
'delivery'=>array(
|
'delivery'=>array(
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."livraisondet WHERE fk_livraison IN (select rowid FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__')",
|
"DELETE FROM ".MAIN_DB_PREFIX."deliverydet WHERE fk_delivery IN (select rowid FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__')",
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__'",
|
"DELETE FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__'",
|
||||||
),
|
),
|
||||||
'contract'=>array(
|
'contract'=>array(
|
||||||
"DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__'))",
|
"DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__'))",
|
||||||
|
|||||||
@ -189,8 +189,8 @@ export res=$?
|
|||||||
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
export documentdir=`cat $mydir/../../htdocs/conf/conf.php | grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g' `
|
||||||
if [ "x$documentdir" != "x" ]
|
if [ "x$documentdir" != "x" ]
|
||||||
then
|
then
|
||||||
$DIALOG --title "Reset document directory tpp" --clear \
|
$DIALOG --title "Reset document directory" --clear \
|
||||||
--inputbox "Delete and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
|
--inputbox "DELETE and recreate document directory $documentdir/:" 16 55 n 2> $fichtemp
|
||||||
|
|
||||||
valret=$?
|
valret=$?
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
dev/resources/iso-normes/Intracommreport-ManuelDebXml.pdf
Normal file
BIN
dev/resources/iso-normes/Intracommreport-ManuelDebXml.pdf
Normal file
Binary file not shown.
BIN
dev/resources/iso-normes/Intracommreport-ManuelDesXML.pdf
Normal file
BIN
dev/resources/iso-normes/Intracommreport-ManuelDesXML.pdf
Normal file
Binary file not shown.
2
dev/resources/iso-normes/company_ids.txt
Normal file
2
dev/resources/iso-normes/company_ids.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Spain https://incwell.eu/en/company-formation-spain/
|
||||||
|
France https://www.economie.gouv.fr/entreprises/numeros-identification-entreprise
|
||||||
@ -17,6 +17,7 @@
|
|||||||
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
||||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||||
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
||||||
|
<exclude-pattern type="relative">.git</exclude-pattern>
|
||||||
|
|
||||||
<!-- List of all tests -->
|
<!-- List of all tests -->
|
||||||
|
|
||||||
|
|||||||
@ -357,8 +357,8 @@ function pg2mysql(&$input, &$arrayofprimaryalreadyintabledef, $header = true)
|
|||||||
$line = str_replace(" time with time zone", " time", $line);
|
$line = str_replace(" time with time zone", " time", $line);
|
||||||
$line = str_replace(" time without time zone", " time", $line);
|
$line = str_replace(" time without time zone", " time", $line);
|
||||||
|
|
||||||
$line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line);
|
$line = str_replace(" timestamp DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", $line);
|
||||||
$line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP", $line);
|
$line = str_replace(" timestamp without time zone DEFAULT now()", " timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP", $line);
|
||||||
|
|
||||||
if (strstr($line, "auto_increment") || preg_match('/ rowid int/', $line) || preg_match('/ id int/', $line)) {
|
if (strstr($line, "auto_increment") || preg_match('/ rowid int/', $line) || preg_match('/ id int/', $line)) {
|
||||||
$field = getfieldname($line);
|
$field = getfieldname($line);
|
||||||
|
|||||||
@ -2,13 +2,18 @@ README (English)
|
|||||||
--------------------------------
|
--------------------------------
|
||||||
This directory contains tools to generate translation files for a new
|
This directory contains tools to generate translation files for a new
|
||||||
languages or to update translation files for existing languages.
|
languages or to update translation files for existing languages.
|
||||||
|
|
||||||
See Dolibarr Wiki page:
|
See Dolibarr Wiki page:
|
||||||
https://wiki.dolibarr.org/index.php/Translator_documentation
|
https://wiki.dolibarr.org/index.php/Translator_documentation
|
||||||
For more information on how to use them.
|
For more information on how to use them.
|
||||||
|
|
||||||
for Linux OS:
|
Translation of Dolibarr Project at Transifex:
|
||||||
To install transifex client:
|
https://www.transifex.com/dolibarr-association/dolibarr/dashboard/
|
||||||
|
|
||||||
|
|
||||||
|
Installation of Transifex Client:
|
||||||
|
---------------------------------
|
||||||
|
for Linux OS
|
||||||
|
to install or to update transifex client:
|
||||||
sudo pip install --upgrade transifex-client
|
sudo pip install --upgrade transifex-client
|
||||||
|
|
||||||
To update transifex client:
|
|
||||||
sudo pip install --upgrade transifex-client
|
|
||||||
|
|||||||
@ -21,8 +21,8 @@
|
|||||||
* \ingroup dev
|
* \ingroup dev
|
||||||
* \brief This script uses google language ajax api as the translator engine
|
* \brief This script uses google language ajax api as the translator engine
|
||||||
* The main translator function can be found at:
|
* The main translator function can be found at:
|
||||||
* http://code.google.com/intl/fr/apis/language/translate/overview.html
|
* defunct -http://code.google.com/intl/fr/apis/language/translate/overview.html-
|
||||||
* http://translate.google.com/translate_tools
|
* defunct -http://translate.google.com/translate_tools-
|
||||||
* https://code.google.com/apis/console
|
* https://code.google.com/apis/console
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ $dir=DOL_DOCUMENT_ROOT."/langs";
|
|||||||
if (! isset($argv[3])) {
|
if (! isset($argv[3])) {
|
||||||
print "Usage: ".$script_file." lang_code_src lang_code_dest|all APIKEY [langfile.lang]\n";
|
print "Usage: ".$script_file." lang_code_src lang_code_dest|all APIKEY [langfile.lang]\n";
|
||||||
print "Example: ".$script_file." en_US pt_PT 123456\n";
|
print "Example: ".$script_file." en_US pt_PT 123456\n";
|
||||||
print "Rem: lang_code to use can be found on http://www.google.com/language_tools\n";
|
print "Rem: lang_code to use can be found on https://translate.google.com\n";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
comparison of terms
|
|
||||||
|
|
||||||
|
|
||||||
Dolibarr SAP ERP Odoo
|
|
||||||
-------------------------------------------------------------------------
|
|
||||||
Thirdparty Contact partner Partner/Contact (company)
|
|
||||||
Contact/address Contact person Partner/Contact (individual)
|
|
||||||
|
|
||||||
Financial Finance (FI) Accounting
|
|
||||||
Accounting
|
|
||||||
|
|
||||||
|
|
||||||
Income / Expense ?? Profit / Loss
|
|
||||||
Balance ?? Net profit
|
|
||||||
Subledger account Subledger account ??
|
|
||||||
|
|
||||||
CRM Sales & Distribution Sales
|
|
||||||
Proposal ?? Quotation
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Proposal is ok but proposition looks better (proposal is for a detailed proposition).
|
|
||||||
We can say also "business proposition or business proposal".
|
|
||||||
In India they are using "Quotation".
|
|
||||||
|
|
||||||
BIN
doc/images/invoice.png
Normal file
BIN
doc/images/invoice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
@ -1,28 +1,29 @@
|
|||||||
README (deutsch / german / allemand)
|
README (deutsch / german / allemand)
|
||||||
--------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
|
||||||
--------------------------------
|
------------------------------------
|
||||||
Download / Herunterladen
|
Download / Herunterladen
|
||||||
--------------------------------
|
------------------------------------
|
||||||
|
|
||||||
* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
|
* Dolibarr ERP/CRM kann man über die offizielle Dolibarr Website
|
||||||
|
|
||||||
https://www.dolibarr.org/downloads
|
https://www.dolibarr.org/downloads
|
||||||
oder direkt von Sourceforge
|
|
||||||
|
oder direkt bei Sourceforge
|
||||||
|
|
||||||
https://sourceforge.net/projects/dolibarr/files/
|
https://sourceforge.net/projects/dolibarr/files/
|
||||||
|
|
||||||
herunterladen.
|
herunterladen.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* Die meisten externen Module/Themens sind über den DoliStore verfügbar:
|
|
||||||
https://www.dolistore.com/de/
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Installation / Hilfe
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
--------------------------------
|
* Für eine kurze Einleitung schau in die README Datei im Hauptverzeichnis.
|
||||||
Installation
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
|
|
||||||
|
|
||||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||||
@ -31,3 +32,14 @@ Installation
|
|||||||
https://www.dolibarr.de/
|
https://www.dolibarr.de/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------
|
||||||
|
Zusatzmodule
|
||||||
|
------------------------------------
|
||||||
|
|
||||||
|
* Die meisten externen Module/Themen sind über den offiziellen DoliStore verfügbar:
|
||||||
|
|
||||||
|
https://www.dolistore.com/de/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,13 +6,14 @@ README (french)
|
|||||||
Téléchargement
|
Téléchargement
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
* Dolibarr ERP/CRM can be downloaded at sourceforge:
|
* Dolibarr ERP/CRM peut être téléchargé sur sourceforge:
|
||||||
http://sourceforge.net/projects/dolibarr/files
|
https://sourceforge.net/projects/dolibarr/files
|
||||||
or from Dolibarr official web site:
|
|
||||||
|
ou sur le site officiel de Dolibarr:
|
||||||
https://www.dolibarr.org
|
https://www.dolibarr.org
|
||||||
|
|
||||||
* Most external modules are only available on DoliStore:
|
* La plupart des modules externes ne sont disponibles que sur le DoliStore officiel:
|
||||||
https://www.dolistore.org
|
https://www.dolistore.com
|
||||||
|
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@ -24,4 +25,4 @@ README-FR à la racine.
|
|||||||
|
|
||||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||||
ligne sur le wiki de Dolibarr à l'adresse:
|
ligne sur le wiki de Dolibarr à l'adresse:
|
||||||
https://wiki.dolibarr.org
|
https://wiki.dolibarr.org/index.php/Accueil
|
||||||
|
|||||||
@ -294,13 +294,11 @@ if ($resql)
|
|||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans("New"), $langs->trans("Addanaccount"), 'fa fa-plus-circle', './card.php?action=create');
|
$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, 0, 0, 1);
|
||||||
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
|
// Box to select active chart of account
|
||||||
print $langs->trans("Selectchartofaccounts")." : ";
|
print $langs->trans("Selectchartofaccounts")." : ";
|
||||||
@ -343,15 +341,15 @@ if ($resql)
|
|||||||
|
|
||||||
// Line for search fields
|
// Line for search fields
|
||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="'.$search_account.'"></td>';
|
if (!empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_account" value="'.$search_account.'"></td>';
|
||||||
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
if (!empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width150" name="search_label" value="'.$search_label.'"></td>';
|
||||||
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_labelshort" value="'.$search_labelshort.'"></td>';
|
if (!empty($arrayfields['aa.labelshort']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_labelshort" value="'.$search_labelshort.'"></td>';
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
if (!empty($arrayfields['aa.account_parent']['checked'])) {
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
print $formaccounting->select_account($search_accountparent, 'search_accountparent', 2);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
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_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat width100" name="search_pcgtype" value="'.$search_pcgtype.'"></td>';
|
||||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['aa.reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
||||||
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
if (!empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||||
print '<td class="liste_titre maxwidthsearch">';
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
@ -416,18 +414,24 @@ if ($resql)
|
|||||||
// Account parent
|
// Account parent
|
||||||
if (!empty($arrayfields['aa.account_parent']['checked']))
|
if (!empty($arrayfields['aa.account_parent']['checked']))
|
||||||
{
|
{
|
||||||
if (!empty($obj->account_parent))
|
// Note: obj->account_parent is a foreign key to a rowid. It is field in child table and obj->rowid2 is same, but in parent table.
|
||||||
|
// So for orphans, obj->account_parent is set but not obj->rowid2
|
||||||
|
if (!empty($obj->account_parent) && !empty($obj->rowid2))
|
||||||
{
|
{
|
||||||
|
print "<td>";
|
||||||
|
print '<!-- obj->account_parent = '.$obj->account_parent.' obj->rowid2 = '.$obj->rowid2.' -->';
|
||||||
$accountparent->id = $obj->rowid2;
|
$accountparent->id = $obj->rowid2;
|
||||||
$accountparent->label = $obj->label2;
|
$accountparent->label = $obj->label2;
|
||||||
$accountparent->account_number = $obj->account_number2;
|
$accountparent->account_number = $obj->account_number2; // Sotre an account number for output
|
||||||
|
|
||||||
print "<td>";
|
|
||||||
print $accountparent->getNomUrl(1);
|
print $accountparent->getNomUrl(1);
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
} else {
|
} else {
|
||||||
print '<td> </td>';
|
print '<td>';
|
||||||
|
if (!empty($obj->account_parent)) {
|
||||||
|
print '<!-- Bad value for obj->account_parent = '.$obj->account_parent.': is a rowid that does not exists -->';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -481,11 +485,11 @@ if ($resql)
|
|||||||
// Action
|
// Action
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($user->rights->accounting->chartofaccount) {
|
if ($user->rights->accounting->chartofaccount) {
|
||||||
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
|
||||||
print img_edit();
|
print img_edit();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?chartofaccounts='.$object->id).'">';
|
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
|
||||||
print img_delete();
|
print img_delete();
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -187,7 +187,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (isset($_POST["country"]) && ($_POST["country"] == '0') && ($id != 2))
|
if (GETPOSTISSET("country") && (GETPOST("country") == '0') && ($id != 2))
|
||||||
{
|
{
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
||||||
@ -609,7 +609,7 @@ if ($id)
|
|||||||
if (empty($reshook)) fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit');
|
if (empty($reshook)) fieldListAccountModel($fieldlist, $obj, $tabname[$id], 'edit');
|
||||||
|
|
||||||
print '<td colspan="3" class="right"><a name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<td colspan="3" class="right"><a name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
print ' <input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||||
} else {
|
} else {
|
||||||
$tmpaction = 'view';
|
$tmpaction = 'view';
|
||||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||||
|
|||||||
@ -210,7 +210,7 @@ if ($action == 'create') {
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -247,17 +247,17 @@ if ($action == 'create') {
|
|||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -272,7 +272,7 @@ if ($action == 'create') {
|
|||||||
// Edit mode
|
// Edit mode
|
||||||
if ($action == 'update')
|
if ($action == 'update')
|
||||||
{
|
{
|
||||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
||||||
|
|
||||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
@ -309,17 +309,17 @@ if ($action == 'create') {
|
|||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -327,7 +327,7 @@ if ($action == 'create') {
|
|||||||
// View mode
|
// View mode
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr');
|
print dol_get_fiche_head($head, 'card', $langs->trans('AccountAccounting'), -1, 'billr');
|
||||||
|
|
||||||
dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref');
|
dol_banner_tab($object, 'ref', $linkback, 1, 'account_number', 'ref');
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions buttons
|
* Actions buttons
|
||||||
|
|||||||
@ -102,7 +102,7 @@ print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="display">';
|
print '<input type="hidden" name="action" value="display">';
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ if (!empty($cat_id))
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ if ($action == 'display' || $action == 'delete') {
|
|||||||
print '<td class="right">';
|
print '<td class="right">';
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&account_category='.$cat_id.'&cptid='.$cpt->rowid.'">';
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&account_category='.$cat_id.'&cptid='.$cpt->rowid.'">';
|
||||||
print $langs->trans("DeleteFromCat");
|
print $langs->trans("DeleteFromCat");
|
||||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink');
|
print img_picto($langs->trans("DeleteFromCat"), 'unlink', 'class="paddingleft"');
|
||||||
print "</a>";
|
print "</a>";
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -168,7 +168,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($_POST["code"]))
|
if (GETPOSTISSET("code"))
|
||||||
{
|
{
|
||||||
if ($_POST["code"] == '0')
|
if ($_POST["code"] == '0')
|
||||||
{
|
{
|
||||||
@ -705,7 +705,7 @@ if ($id)
|
|||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
||||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -159,7 +159,7 @@ if ($action == 'create')
|
|||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="add">';
|
print '<input type="hidden" name="action" value="add">';
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -187,12 +187,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -202,7 +202,7 @@ if ($action == 'create')
|
|||||||
$head = fiscalyear_prepare_head($object);
|
$head = fiscalyear_prepare_head($object);
|
||||||
|
|
||||||
if ($action == 'edit') {
|
if ($action == 'edit') {
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
|
print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
|
||||||
|
|
||||||
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
@ -241,14 +241,14 @@ if ($action == 'create')
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br><div class="center">';
|
print '<br><div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
|
print '<input type="submit" class="button button-save" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Confirm delete
|
* Confirm delete
|
||||||
@ -257,7 +257,7 @@ if ($action == 'create')
|
|||||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete");
|
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete");
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
|
print dol_get_fiche_head($head, 'card', $langs->trans("Fiscalyear"), 0, 'cron');
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
if (!empty($user->rights->accounting->fiscalyear->write))
|
if (!empty($user->rights->accounting->fiscalyear->write))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,7 +49,7 @@ if ($id) {
|
|||||||
|
|
||||||
$head = fiscalyear_prepare_head($object);
|
$head = fiscalyear_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron');
|
print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), 0, 'cron');
|
||||||
|
|
||||||
print '<table width="100%"><tr><td>';
|
print '<table width="100%"><tr><td>';
|
||||||
dol_print_object_info($object);
|
dol_print_object_info($object);
|
||||||
|
|||||||
@ -582,7 +582,7 @@ if ($id)
|
|||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
print '<input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
print '<div name="'.(!empty($obj->rowid) ? $obj->rowid : $obj->code).'"></div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -405,7 +405,7 @@ if ($result)
|
|||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
$buttonsave = '<input type="submit" class="button" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">';
|
$buttonsave = '<input type="submit" class="button button-save" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">';
|
||||||
//print '<br><div class="center">'.$buttonsave.'</div>';
|
//print '<br><div class="center">'.$buttonsave.'</div>';
|
||||||
|
|
||||||
$texte = $langs->trans("ListOfProductsServices");
|
$texte = $langs->trans("ListOfProductsServices");
|
||||||
@ -610,7 +610,7 @@ if ($result)
|
|||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
|
if (empty($defaultvalue)) $defaultvalue = $compta_prodbuy;
|
||||||
$codesell = length_accountg($obj->accountancy_code_buy);
|
$codesell = length_accountg($obj->accountancy_code_buy);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
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 $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
|
||||||
// Accounting account buy intra (In EEC)
|
// Accounting account buy intra (In EEC)
|
||||||
@ -620,7 +620,7 @@ if ($result)
|
|||||||
$codesell = length_accountg($obj->accountancy_code_buy_intra);
|
$codesell = length_accountg($obj->accountancy_code_buy_intra);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
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 $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
|
||||||
// Accounting account buy export (Out of EEC)
|
// Accounting account buy export (Out of EEC)
|
||||||
@ -630,7 +630,7 @@ if ($result)
|
|||||||
$codesell = length_accountg($obj->accountancy_code_buy_export);
|
$codesell = length_accountg($obj->accountancy_code_buy_export);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
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 $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
|
||||||
// Accounting account sell
|
// Accounting account sell
|
||||||
@ -640,7 +640,7 @@ if ($result)
|
|||||||
$codesell = length_accountg($obj->accountancy_code_sell);
|
$codesell = length_accountg($obj->accountancy_code_sell);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
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 $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
|
||||||
// Accounting account sell intra (In EEC)
|
// Accounting account sell intra (In EEC)
|
||||||
@ -650,7 +650,7 @@ if ($result)
|
|||||||
$codesell = length_accountg($obj->accountancy_code_sell_intra);
|
$codesell = length_accountg($obj->accountancy_code_sell_intra);
|
||||||
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
//var_dump($defaultvalue.' - '.$codesell.' - '.$compta_prodsell);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
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 $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
// Accounting account sell export (Out of EEC)
|
// Accounting account sell export (Out of EEC)
|
||||||
@ -659,13 +659,13 @@ if ($result)
|
|||||||
if (empty($defaultvalue)) $defaultvalue = $compta_prodsell;
|
if (empty($defaultvalue)) $defaultvalue = $compta_prodsell;
|
||||||
$codesell = length_accountg($obj->accountancy_code_sell_export);
|
$codesell = length_accountg($obj->accountancy_code_sell_export);
|
||||||
if (!empty($obj->aaid)) $defaultvalue = ''; // Do not suggest default new value is code is already valid
|
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 $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checkbox select
|
// Checkbox select
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<input type="checkbox" class="checkforselect" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
|
print '<input type="checkbox" class="checkforselect productforselectcodeventil_'.$product_static->id.'" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -689,7 +689,17 @@ if ($result)
|
|||||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||||
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||||
}
|
}
|
||||||
jQuery(".checkforselect, #checkallactions").click(function() {
|
|
||||||
|
jQuery(".checkforselect").change(function() {
|
||||||
|
init_savebutton();
|
||||||
|
});
|
||||||
|
jQuery(".productforselect").change(function() {
|
||||||
|
console.log($(this).attr("id")+" "+$(this).val());
|
||||||
|
if ($(this).val() && $(this).val() != -1) {
|
||||||
|
$(".productforselect"+$(this).attr("id")).prop(\'checked\', true);
|
||||||
|
} else {
|
||||||
|
$(".productforselect"+$(this).attr("id")).prop(\'checked\', false);
|
||||||
|
}
|
||||||
init_savebutton();
|
init_savebutton();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
419
htdocs/accountancy/admin/subaccount.php
Normal file
419
htdocs/accountancy/admin/subaccount.php
Normal file
@ -0,0 +1,419 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
|
* Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/accountancy/admin/subaccount.php
|
||||||
|
* \ingroup Accountancy (Double entries)
|
||||||
|
* \brief List of accounting sub-account (auxiliary accounts)
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "hrm", "errors"));
|
||||||
|
|
||||||
|
$mesg = '';
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
$id = GETPOST('id', 'int');
|
||||||
|
$rowid = GETPOST('rowid', 'int');
|
||||||
|
$massaction = GETPOST('massaction', 'aZ09');
|
||||||
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'accountingsubaccountlist'; // To manage different context of search
|
||||||
|
|
||||||
|
$search_subaccount = GETPOST('search_subaccount', 'alpha');
|
||||||
|
$search_label = GETPOST('search_label', 'alpha');
|
||||||
|
$search_type = GETPOST('search_type', 'int');
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
if ($user->socid > 0) accessforbidden();
|
||||||
|
if (!$user->rights->accounting->chartofaccount) accessforbidden();
|
||||||
|
|
||||||
|
// Load variable for pagination
|
||||||
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if (!$sortfield) $sortfield = "label";
|
||||||
|
if (!$sortorder) $sortorder = "ASC";
|
||||||
|
|
||||||
|
$arrayfields = array(
|
||||||
|
'subaccount'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||||
|
'label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
|
'type'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
|
||||||
|
'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1)
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL < 2) unset($arrayfields['reconcilable']);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||||
|
if (!GETPOST('confirmmassaction', 'alpha')) { $massaction = ''; }
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
if (!empty($cancel)) $action = '';
|
||||||
|
|
||||||
|
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 test are required to be compatible with all browsers
|
||||||
|
{
|
||||||
|
$search_subaccount = "";
|
||||||
|
$search_label = "";
|
||||||
|
$search_type = "";
|
||||||
|
$search_array_options = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title = $langs->trans('ChartOfIndividualAccountsOfSubsidiaryLedger');
|
||||||
|
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
// Customer
|
||||||
|
$sql = "SELECT sa.rowid, sa.nom as label, sa.code_compta as subaccount, '1' as type, sa.entity";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."societe sa";
|
||||||
|
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
||||||
|
$sql .= " AND sa.code_compta <> ''";
|
||||||
|
//print $sql;
|
||||||
|
if (strlen(trim($search_subaccount))) {
|
||||||
|
$lengthpaddingaccount = 0;
|
||||||
|
if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||||
|
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||||
|
}
|
||||||
|
$search_subaccount_tmp = $search_subaccount;
|
||||||
|
$weremovedsomezero = 0;
|
||||||
|
if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
|
||||||
|
for ($i = 0; $i < $lengthpaddingaccount; $i++) {
|
||||||
|
if (preg_match('/0$/', $search_subaccount_tmp)) {
|
||||||
|
$weremovedsomezero++;
|
||||||
|
$search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($search_subaccount); exit;
|
||||||
|
if ($search_subaccount_tmp) {
|
||||||
|
if ($weremovedsomezero) {
|
||||||
|
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||||
|
$search_subaccount_clean = $search_subaccount;
|
||||||
|
$startchar = '%';
|
||||||
|
if (strpos($search_subaccount_tmp, '^') === 0)
|
||||||
|
{
|
||||||
|
$startchar = '';
|
||||||
|
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
||||||
|
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
||||||
|
}
|
||||||
|
$sql .= " AND (sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
||||||
|
$sql .= " OR sa.code_compta LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
||||||
|
} else $sql .= natural_search("sa.code_compta", $search_subaccount_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strlen(trim($search_label))) $sql .= natural_search("sa.nom", $search_label);
|
||||||
|
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
|
||||||
|
// Supplier
|
||||||
|
$sql .= " UNION ";
|
||||||
|
$sql .= " SELECT sa.rowid, sa.nom as label, sa.code_compta_fournisseur as subaccount, '2' as type, sa.entity FROM ".MAIN_DB_PREFIX."societe sa";
|
||||||
|
$sql .= " WHERE sa.entity IN (".getEntity('societe').")";
|
||||||
|
$sql .= " AND sa.code_compta_fournisseur <> ''";
|
||||||
|
//print $sql;
|
||||||
|
if (strlen(trim($search_subaccount))) {
|
||||||
|
$lengthpaddingaccount = 0;
|
||||||
|
if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||||
|
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||||
|
}
|
||||||
|
$search_subaccount_tmp = $search_subaccount;
|
||||||
|
$weremovedsomezero = 0;
|
||||||
|
if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
|
||||||
|
for ($i = 0; $i < $lengthpaddingaccount; $i++) {
|
||||||
|
if (preg_match('/0$/', $search_subaccount_tmp)) {
|
||||||
|
$weremovedsomezero++;
|
||||||
|
$search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($search_subaccount); exit;
|
||||||
|
if ($search_subaccount_tmp) {
|
||||||
|
if ($weremovedsomezero) {
|
||||||
|
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||||
|
$search_subaccount_clean = $search_subaccount;
|
||||||
|
$startchar = '%';
|
||||||
|
if (strpos($search_subaccount_tmp, '^') === 0)
|
||||||
|
{
|
||||||
|
$startchar = '';
|
||||||
|
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
||||||
|
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
||||||
|
}
|
||||||
|
$sql .= " AND (sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
||||||
|
$sql .= " OR sa.code_compta_fournisseur LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
||||||
|
} else $sql .= natural_search("sa.code_compta_fournisseur", $search_subaccount_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strlen(trim($search_label))) $sql .= natural_search("sa.nom", $search_label);
|
||||||
|
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
|
||||||
|
// User
|
||||||
|
$sql .= " UNION ";
|
||||||
|
$sql .= " SELECT u.rowid, u.lastname as label, u.accountancy_code as subaccount, '3' as type, u.entity FROM ".MAIN_DB_PREFIX."user u";
|
||||||
|
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||||
|
$sql .= " AND u.accountancy_code <> ''";
|
||||||
|
//print $sql;
|
||||||
|
if (strlen(trim($search_subaccount))) {
|
||||||
|
$lengthpaddingaccount = 0;
|
||||||
|
if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) {
|
||||||
|
$lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT);
|
||||||
|
}
|
||||||
|
$search_subaccount_tmp = $search_subaccount;
|
||||||
|
$weremovedsomezero = 0;
|
||||||
|
if (strlen($search_subaccount_tmp) <= $lengthpaddingaccount) {
|
||||||
|
for ($i = 0; $i < $lengthpaddingaccount; $i++) {
|
||||||
|
if (preg_match('/0$/', $search_subaccount_tmp)) {
|
||||||
|
$weremovedsomezero++;
|
||||||
|
$search_subaccount_tmp = preg_replace('/0$/', '', $search_subaccount_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//var_dump($search_subaccount); exit;
|
||||||
|
if ($search_subaccount_tmp) {
|
||||||
|
if ($weremovedsomezero) {
|
||||||
|
$search_subaccount_tmp_clean = $search_subaccount_tmp;
|
||||||
|
$search_subaccount_clean = $search_subaccount;
|
||||||
|
$startchar = '%';
|
||||||
|
if (strpos($search_subaccount_tmp, '^') === 0)
|
||||||
|
{
|
||||||
|
$startchar = '';
|
||||||
|
$search_subaccount_tmp_clean = preg_replace('/^\^/', '', $search_subaccount_tmp);
|
||||||
|
$search_subaccount_clean = preg_replace('/^\^/', '', $search_subaccount);
|
||||||
|
}
|
||||||
|
$sql .= " AND (u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_tmp_clean)."'";
|
||||||
|
$sql .= " OR u.accountancy_code LIKE '".$db->escape($startchar.$search_subaccount_clean)."%')";
|
||||||
|
} else $sql .= natural_search("u.accountancy_code", $search_subaccount_tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strlen(trim($search_label))) $sql .= natural_search("u.lastname", $search_label);
|
||||||
|
if (!empty($search_type) && $search_type >= 0) $sql .= " HAVING type LIKE '".$db->escape($search_type)."'";
|
||||||
|
|
||||||
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
|
// Count total nb of records
|
||||||
|
$nbtotalofrecords = '';
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
|
{
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
$nbtotalofrecords = $db->num_rows($resql);
|
||||||
|
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
|
||||||
|
{
|
||||||
|
$page = 0;
|
||||||
|
$offset = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql .= $db->plimit($limit + 1, $offset);
|
||||||
|
|
||||||
|
dol_syslog('accountancy/admin/subaccount.php:: $sql='.$sql);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
$param = '';
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
if ($search_subaccount) $param .= '&search_subaccount='.urlencode($search_subaccount);
|
||||||
|
if ($search_label) $param .= '&search_label='.urlencode($search_label);
|
||||||
|
if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
|
||||||
|
|
||||||
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
|
||||||
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
|
print '<div class="warning">'.$langs->trans("WarningCreateSubAccounts").'</div>';
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
|
|
||||||
|
$moreforfilter = '';
|
||||||
|
$massactionbutton = '';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
// Line for search fields
|
||||||
|
print '<tr class="liste_titre_filter">';
|
||||||
|
if (!empty($arrayfields['subaccount']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_subaccount" value="'.$search_subaccount.'"></td>';
|
||||||
|
if (!empty($arrayfields['label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="'.$search_label.'"></td>';
|
||||||
|
if (!empty($arrayfields['type']['checked'])) print '<td class="liste_titre center">'.$form->selectarray('search_type', array('1'=>$langs->trans('Customer'), '2'=>$langs->trans('Supplier'), '3'=>$langs->trans('Employee')), $search_type, 1).'</td>';
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['reconcilable']['checked'])) print '<td class="liste_titre"> </td>'; }
|
||||||
|
print '<td class="liste_titre maxwidthsearch">';
|
||||||
|
$searchpicto = $form->showFilterAndCheckAddButtons($massactionbutton ? 1 : 0, 'checkforselect', 1);
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (!empty($arrayfields['subaccount']['checked'])) print_liste_field_titre($arrayfields['subaccount']['label'], $_SERVER["PHP_SELF"], "subaccount", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['label']['checked'])) print_liste_field_titre($arrayfields['label']['label'], $_SERVER["PHP_SELF"], "label", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['type']['checked'])) print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { if (!empty($arrayfields['reconcilable']['checked'])) print_liste_field_titre($arrayfields['reconcilable']['label'], $_SERVER["PHP_SELF"], 'reconcilable', '', $param, '', $sortfield, $sortorder, 'center '); }
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$i = 0;
|
||||||
|
while ($i < min($num, $limit))
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Account number
|
||||||
|
if (!empty($arrayfields['subaccount']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
print length_accounta($obj->subaccount);
|
||||||
|
print "</td>\n";
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Subaccount label
|
||||||
|
if (!empty($arrayfields['label']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
print $obj->label;
|
||||||
|
print "</td>\n";
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Type
|
||||||
|
if (!empty($arrayfields['type']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="center">';
|
||||||
|
$s = '';
|
||||||
|
// Customer
|
||||||
|
if ($obj->type == 1)
|
||||||
|
{
|
||||||
|
$s .= '<a class="customer-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->rowid.'">'.$langs->trans("Customer").'</a>';
|
||||||
|
}
|
||||||
|
// Supplier
|
||||||
|
elseif ($obj->type == 2)
|
||||||
|
{
|
||||||
|
$s .= '<a class="vendor-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->rowid.'">'.$langs->trans("Supplier").'</a>';
|
||||||
|
}
|
||||||
|
// User
|
||||||
|
elseif ($obj->type == 3)
|
||||||
|
{
|
||||||
|
$s .= '<a class="user-back" style="padding-left: 6px; padding-right: 6px" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?id='.$obj->id.'">'.$langs->trans("Employee").'</a>';
|
||||||
|
}
|
||||||
|
print $s;
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||||
|
// Activated or not reconciliation on accounting account
|
||||||
|
if (!empty($arrayfields['reconcilable']['checked'])) {
|
||||||
|
print '<td class="center">';
|
||||||
|
if (empty($obj->reconcilable)) {
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||||
|
print '</a>';
|
||||||
|
} else {
|
||||||
|
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1">';
|
||||||
|
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||||
|
print '</a>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Action
|
||||||
|
print '<td class="center">';
|
||||||
|
$e = '';
|
||||||
|
// Customer
|
||||||
|
if ($obj->type == 1)
|
||||||
|
{
|
||||||
|
$e .= '<a class="editfielda" title="'.$langs->trans("Customer").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
|
}
|
||||||
|
// Supplier
|
||||||
|
elseif ($obj->type == 2)
|
||||||
|
{
|
||||||
|
$e .= '<a class="editfielda" title="'.$langs->trans("Supplier").'" href="'.DOL_URL_ROOT.'/societe/card.php?action=edit&socid='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
|
}
|
||||||
|
// User
|
||||||
|
elseif ($obj->type == 3)
|
||||||
|
{
|
||||||
|
$e .= '<a class="editfielda" title="'.$langs->trans("Employee").'" href="'.DOL_URL_ROOT.'/user/card.php?action=edit&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit().'</a>';
|
||||||
|
}
|
||||||
|
print $e;
|
||||||
|
print '</td>'."\n";
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
|
||||||
|
print '</tr>'."\n";
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$db->free($resql);
|
||||||
|
|
||||||
|
$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 "</table>";
|
||||||
|
print "</div>";
|
||||||
|
|
||||||
|
print '</form>';
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -227,8 +227,8 @@ if ($action != 'export_csv')
|
|||||||
$moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0);
|
$moreforfilter .= $form->selectDate($search_date_end ? $search_date_end : -1, 'date_end', 0, 0, 1, '', 1, 0);
|
||||||
|
|
||||||
$moreforfilter .= ' - ';
|
$moreforfilter .= ' - ';
|
||||||
$moreforfilter .= $langs->trans('ShowSubtotalByGroup').': ';
|
$moreforfilter .= '<label for="show_subgroup">'.$langs->trans('ShowSubtotalByGroup').'</label>: ';
|
||||||
$moreforfilter .= '<input type="checkbox" name="show_subgroup" value="show_subgroup"'.($show_subgroup == 'show_subgroup' ? ' checked' : '').'>';
|
$moreforfilter .= '<input type="checkbox" name="show_subgroup" id="show_subgroup" value="show_subgroup"'.($show_subgroup == 'show_subgroup' ? ' checked' : '').'>';
|
||||||
|
|
||||||
|
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
@ -272,6 +272,8 @@ if ($action != 'export_csv')
|
|||||||
$total_credit = 0;
|
$total_credit = 0;
|
||||||
$sous_total_debit = 0;
|
$sous_total_debit = 0;
|
||||||
$sous_total_credit = 0;
|
$sous_total_credit = 0;
|
||||||
|
$total_opening_balance = 0;
|
||||||
|
$sous_total_opening_balance = 0;
|
||||||
$displayed_account = "";
|
$displayed_account = "";
|
||||||
|
|
||||||
$accountingaccountstatic = new AccountingAccount($db);
|
$accountingaccountstatic = new AccountingAccount($db);
|
||||||
@ -302,7 +304,13 @@ if ($action != 'export_csv')
|
|||||||
$link = '';
|
$link = '';
|
||||||
$total_debit += $line->debit;
|
$total_debit += $line->debit;
|
||||||
$total_credit += $line->credit;
|
$total_credit += $line->credit;
|
||||||
$root_account_description = $object->get_compte_racine($line->numero_compte);
|
$opening_balance = isset($opening_balances["'".$line->numero_compte."'"]) ? $opening_balances["'".$line->numero_compte."'"] : 0;
|
||||||
|
$total_opening_balance += $opening_balance;
|
||||||
|
|
||||||
|
$tmparrayforrootaccount = $object->getRootAccount($line->numero_compte);
|
||||||
|
$root_account_description = $tmparrayforrootaccount['label'];
|
||||||
|
$root_account_number = $tmparrayforrootaccount['account_number'];
|
||||||
|
|
||||||
if (empty($accountingaccountstatic->account_number)) {
|
if (empty($accountingaccountstatic->account_number)) {
|
||||||
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>';
|
$link = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?action=create&accountingaccount='.length_accountg($line->numero_compte).'">'.img_edit_add().'</a>';
|
||||||
}
|
}
|
||||||
@ -311,14 +319,14 @@ if ($action != 'export_csv')
|
|||||||
if (!empty($show_subgroup))
|
if (!empty($show_subgroup))
|
||||||
{
|
{
|
||||||
// Show accounting account
|
// Show accounting account
|
||||||
if (empty($displayed_account) || $root_account_description != $displayed_account) {
|
if (empty($displayed_account) || $root_account_number != $displayed_account) {
|
||||||
// Show subtotal per accounting account
|
// Show subtotal per accounting account
|
||||||
if ($displayed_account != "") {
|
if ($displayed_account != "") {
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td class="right" colspan="2">'.$langs->trans("SubTotal").':</td>';
|
print '<td class="right" colspan="2">'.$langs->trans("SubTotal").':</td>';
|
||||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||||
print '<td class="nowrap right">'.price(price2num($sous_total_credit - $sous_total_debit)).'</td>';
|
print '<td class="nowrap right">'.price(price2num($sous_total_opening_balance + $sous_total_credit - $sous_total_debit)).'</td>';
|
||||||
print "<td></td>\n";
|
print "<td></td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
@ -328,18 +336,18 @@ if ($action != 'export_csv')
|
|||||||
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
|
print '<td colspan="6" style="font-weight:bold; border-bottom: 1pt solid black;">'.$line->numero_compte.($root_account_description ? ' - '.$root_account_description : '').'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$displayed_account = $root_account_description;
|
$displayed_account = $root_account_number;
|
||||||
$sous_total_debit = 0;
|
$sous_total_debit = 0;
|
||||||
$sous_total_credit = 0;
|
$sous_total_credit = 0;
|
||||||
|
$sous_total_opening_balance = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $object->get_compte_racine($line->numero_compte);
|
|
||||||
print '<td>'.$accounting_account.'</td>';
|
print '<td>'.$accounting_account.'</td>';
|
||||||
print '<td class="nowraponall right">'.price($opening_balances["'".$line->numero_compte."'"]).'</td>';
|
print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
||||||
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
print '<td class="nowraponall right">'.price($line->debit).'</td>';
|
||||||
print '<td class="nowraponall right">'.price($line->credit).'</td>';
|
print '<td class="nowraponall right">'.price($line->credit).'</td>';
|
||||||
print '<td class="nowraponall right">'.price($line->debit - $line->credit).'</td>';
|
print '<td class="nowraponall right">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||||
print '<td class="center">'.$link;
|
print '<td class="center">'.$link;
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
@ -347,16 +355,17 @@ if ($action != 'export_csv')
|
|||||||
// Records the sub-total
|
// Records the sub-total
|
||||||
$sous_total_debit += $line->debit;
|
$sous_total_debit += $line->debit;
|
||||||
$sous_total_credit += $line->credit;
|
$sous_total_credit += $line->credit;
|
||||||
|
$sous_total_opening_balance += $opening_balance;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($show_subgroup))
|
if (!empty($show_subgroup))
|
||||||
{
|
{
|
||||||
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 '<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_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')).'</td>';
|
||||||
print "<td></td>\n";
|
print "<td></td>\n";
|
||||||
print '</tr>';
|
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_debit - $total_credit)).'</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_opening_balance + $total_debit - $total_credit, 'MT')).'</td>';
|
||||||
print "<td></td>\n";
|
print "<td></td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -128,8 +128,7 @@ if ($action == "confirm_update") {
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
if ($mode != '_tmp')
|
if ($mode != '_tmp') {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,14 +164,14 @@ if ($action == "confirm_update") {
|
|||||||
$object->label_operation = $label_operation;
|
$object->label_operation = $label_operation;
|
||||||
$object->debit = $debit;
|
$object->debit = $debit;
|
||||||
$object->credit = $credit;
|
$object->credit = $credit;
|
||||||
$object->doc_date = GETPOST('doc_date', 'alpha');
|
$object->doc_date = (string) GETPOST('doc_date', 'alpha');
|
||||||
$object->doc_type = GETPOST('doc_type', 'alpha');
|
$object->doc_type = (string) GETPOST('doc_type', 'alpha');
|
||||||
$object->piece_num = $piece_num;
|
$object->piece_num = $piece_num;
|
||||||
$object->doc_ref = GETPOST('doc_ref', 'alpha');
|
$object->doc_ref = (string) GETPOST('doc_ref', 'alpha');
|
||||||
$object->code_journal = $journal_code;
|
$object->code_journal = $journal_code;
|
||||||
$object->journal_label = $journal_label;
|
$object->journal_label = $journal_label;
|
||||||
$object->fk_doc = (int) GETPOST('fk_doc', 'int');
|
$object->fk_doc = GETPOSTINT('fk_doc');
|
||||||
$object->fk_docdet = (int) GETPOST('fk_docdet', 'int');
|
$object->fk_docdet = GETPOSTINT('fk_docdet');
|
||||||
|
|
||||||
if (floatval($debit) != 0.0) {
|
if (floatval($debit) != 0.0) {
|
||||||
$object->montant = $debit; // deprecated
|
$object->montant = $debit; // deprecated
|
||||||
@ -190,8 +189,7 @@ if ($action == "confirm_update") {
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
if ($mode != '_tmp')
|
if ($mode != '_tmp') {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,7 +326,7 @@ llxHeader('', $langs->trans("CreateMvts"));
|
|||||||
|
|
||||||
// Confirmation to delete the command
|
// Confirmation to delete the command
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&mode='.$mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1);
|
$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"].'?id='.$id.'&mode='.$mode, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'confirm_delete', '', 0, 1);
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,7 +349,7 @@ if ($action == 'create')
|
|||||||
print '<input type="hidden" name="next_num_mvt" value="'.$next_num_mvt.'">'."\n";
|
print '<input type="hidden" name="next_num_mvt" value="'.$next_num_mvt.'">'."\n";
|
||||||
print '<input type="hidden" name="mode" value="_tmp">'."\n";
|
print '<input type="hidden" name="mode" value="_tmp">'."\n";
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -386,12 +384,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Create").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="button" value="'.$langs->trans("Cancel").'" class="button" onclick="history.go(-1)" />';
|
print '<input type="button" value="'.$langs->trans("Cancel").'" class="button button-cancel" onclick="history.go(-1)" />';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
@ -415,7 +413,7 @@ if ($action == 'create')
|
|||||||
$head[$h][2] = 'transaction';
|
$head[$h][2] = 'transaction';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
dol_fiche_head($head, 'transaction', '', -1);
|
print dol_get_fiche_head($head, 'transaction', '', -1);
|
||||||
|
|
||||||
//dol_banner_tab($object, '', $backlink);
|
//dol_banner_tab($object, '', $backlink);
|
||||||
|
|
||||||
@ -573,7 +571,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
print '</div></div><!-ee-->';
|
print '</div></div><!-ee-->';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div style="clear:both"></div>';
|
print '<div style="clear:both"></div>';
|
||||||
|
|
||||||
@ -707,7 +705,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
|
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<a class="button" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">'.$langs->trans("Cancel").'</a>';
|
print '<a class="button button-cancel" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">'.$langs->trans("Cancel").'</a>';
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
@ -719,7 +717,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -108,7 +108,7 @@ $hookmanager->initHooks(array('bookkeepinglist'));
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !isset($_POST['begin']) && !isset($_GET['begin']) && !isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
|
if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
|
||||||
{
|
{
|
||||||
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
|
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
|
||||||
{
|
{
|
||||||
@ -529,7 +529,7 @@ if ($action == 'export_file' && $user->rights->accounting->mouvements->export) {
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$formfile = new FormFile($db);
|
$formfile = new FormFile($db);
|
||||||
|
|
||||||
$title_page = $langs->trans("Bookkeeping");
|
$title_page = $langs->trans("Operations").' - '.$langs->trans("Journals");
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
$nbtotalofrecords = '';
|
$nbtotalofrecords = '';
|
||||||
@ -608,26 +608,28 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
'default' => $deljournal
|
'default' => $deljournal
|
||||||
);
|
);
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
//$param=''; param started before
|
//$param=''; param started before
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
|
||||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="list">';
|
print '<input type="hidden" name="action" value="list">';
|
||||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.urlencode($optioncss).'">';
|
||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
|
||||||
|
|
||||||
if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
|
if (count($filter)) $buttonLabel = $langs->trans("ExportFilteredList");
|
||||||
else $buttonLabel = $langs->trans("ExportList");
|
else $buttonLabel = $langs->trans("ExportList");
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
// Button re-export
|
// Button re-export
|
||||||
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
if (!empty($conf->global->ACCOUNTING_REEXPORT)) {
|
||||||
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
|
$newcardbutton = '<a class="valignmiddle" href="'.$_SERVER['PHP_SELF'].'?action=setreexport&token='.newToken().'&value=0'.($param ? '&'.$param : '').'">'.img_picto($langs->trans("Activated"), 'switch_on').'</a> ';
|
||||||
@ -638,13 +640,15 @@ $newcardbutton .= '<span class="valignmiddle marginrightonly">'.$langs->trans("I
|
|||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
$newcardbutton .= dolGetButtonTitle($buttonLabel, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', 'fa fa-file-export paddingleft', $_SERVER["PHP_SELF"].'?action=export_file'.($param ? '&'.$param : ''), $user->rights->accounting->mouvements->export);
|
||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly'));
|
||||||
|
|
||||||
$url = './card.php?action=create';
|
$url = './card.php?action=create';
|
||||||
if (!empty($socid)) $url .= '&socid='.$socid;
|
if (!empty($socid)) $url .= '&socid='.$socid;
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
|
||||||
|
}
|
||||||
|
|
||||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit);
|
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
@ -670,12 +674,10 @@ if (!empty($arrayfields['t.doc_date']['checked']))
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From').' ';
|
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||||
print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -703,25 +705,25 @@ if (!empty($arrayfields['t.subledger_account']['checked']))
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From').' ';
|
|
||||||
// TODO For the moment we keep a free 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.
|
// use setup of keypress to select thirdparty and this hang browser on large database.
|
||||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
|
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
|
||||||
{
|
{
|
||||||
|
print $langs->trans('From').' ';
|
||||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="maxwidth100" 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.'" placeholder="'.$langs->trans("From").'">';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
|
||||||
// TODO For the moment we keep a free 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.
|
// use setup of keypress to select thirdparty and this hang browser on large database.
|
||||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
|
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
|
||||||
{
|
{
|
||||||
|
print $langs->trans('to').' ';
|
||||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
|
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
|
||||||
} else {
|
} else {
|
||||||
print '<input type="text" class="maxwidth100" 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.'" placeholder="'.$langs->trans("to").'">';
|
||||||
}
|
}
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -771,12 +773,10 @@ if (!empty($arrayfields['t.date_creation']['checked']))
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From').' ';
|
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||||
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -785,12 +785,10 @@ if (!empty($arrayfields['t.tms']['checked']))
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From').' ';
|
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -799,12 +797,10 @@ if (!empty($arrayfields['t.date_export']['checked']))
|
|||||||
{
|
{
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From').' ';
|
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to').' ';
|
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||||
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -1049,10 +1045,10 @@ while ($i < min($num, $limit))
|
|||||||
print '<td class="nowraponall center">';
|
print '<td class="nowraponall center">';
|
||||||
if (empty($line->date_export)) {
|
if (empty($line->date_export)) {
|
||||||
if ($user->rights->accounting->mouvements->creer) {
|
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>';
|
print '<a class="editfielda paddingleft marginrightonly" 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) {
|
if ($user->rights->accounting->mouvements->supprimer) {
|
||||||
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>';
|
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
@ -33,11 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("accountancy"));
|
$langs->loadLangs(array("accountancy", "compta"));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||||
@ -55,6 +54,7 @@ if ($search_accountancy_code_end == - 1) {
|
|||||||
}
|
}
|
||||||
$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
|
$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
|
||||||
$search_label_operation = GETPOST('search_label_operation', 'alpha');
|
$search_label_operation = GETPOST('search_label_operation', 'alpha');
|
||||||
|
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||||
$search_direction = GETPOST('search_direction', 'alpha');
|
$search_direction = GETPOST('search_direction', 'alpha');
|
||||||
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
||||||
$search_debit = GETPOST('search_debit', 'alpha');
|
$search_debit = GETPOST('search_debit', 'alpha');
|
||||||
@ -86,7 +86,7 @@ $hookmanager->initHooks(array('bookkeepingbyaccountlist'));
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if (empty($search_date_start) && empty($search_date_end) && GETPOSTISSET('search_date_startday') && GETPOSTISSET('search_date_startmonth') && GETPOSTISSET('search_date_starthour')) {
|
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('search_date_startday') && !GETPOSTISSET('search_date_startmonth') && !GETPOSTISSET('search_date_starthour')) {
|
||||||
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||||
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
||||||
$sql .= $db->plimit(1);
|
$sql .= $db->plimit(1);
|
||||||
@ -149,6 +149,7 @@ if (empty($reshook))
|
|||||||
$search_label_account = '';
|
$search_label_account = '';
|
||||||
$search_doc_ref = '';
|
$search_doc_ref = '';
|
||||||
$search_label_operation = '';
|
$search_label_operation = '';
|
||||||
|
$search_mvt_num = '';
|
||||||
$search_direction = '';
|
$search_direction = '';
|
||||||
$search_ledger_code = '';
|
$search_ledger_code = '';
|
||||||
$search_date_start = '';
|
$search_date_start = '';
|
||||||
@ -193,6 +194,10 @@ if (empty($reshook))
|
|||||||
$filter['t.label_compte'] = $search_label_account;
|
$filter['t.label_compte'] = $search_label_account;
|
||||||
$param .= '&search_label_compte='.urlencode($search_label_account);
|
$param .= '&search_label_compte='.urlencode($search_label_account);
|
||||||
}
|
}
|
||||||
|
if (!empty($search_mvt_num)) {
|
||||||
|
$filter['t.piece_num'] = $search_mvt_num;
|
||||||
|
$param .= '&search_mvt_num='.urlencode($search_mvt_num);
|
||||||
|
}
|
||||||
if (!empty($search_doc_ref)) {
|
if (!empty($search_doc_ref)) {
|
||||||
$filter['t.doc_ref'] = $search_doc_ref;
|
$filter['t.doc_ref'] = $search_doc_ref;
|
||||||
$param .= '&search_doc_ref='.urlencode($search_doc_ref);
|
$param .= '&search_doc_ref='.urlencode($search_doc_ref);
|
||||||
@ -294,7 +299,7 @@ $formfile = new FormFile($db);
|
|||||||
$formother = new FormOther($db);
|
$formother = new FormOther($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
$title_page = $langs->trans("Bookkeeping").' '.strtolower($langs->trans("By")).' '.strtolower($langs->trans("AccountAccounting"));
|
$title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccounting").' ('.$langs->trans("Bookkeeping").')';
|
||||||
|
|
||||||
llxHeader('', $title_page);
|
llxHeader('', $title_page);
|
||||||
|
|
||||||
@ -358,7 +363,7 @@ if ($action == 'delbookkeepingyear') {
|
|||||||
'default' => $deljournal
|
'default' => $deljournal
|
||||||
);
|
);
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||||
print $formconfirm;
|
print $formconfirm;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,16 +375,22 @@ if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$opt
|
|||||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('VueByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
|
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
$newcardbutton .= ' ';
|
||||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', './card.php?action=create');
|
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
|
||||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $viewflat.$newcardbutton, '', $limit);
|
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $result, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
@ -394,10 +405,10 @@ $moreforfilter = '';
|
|||||||
// Accountancy account
|
// Accountancy account
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
||||||
$moreforfilter .= '<div class="nowrap">';
|
$moreforfilter .= '<div class="nowrap inline-block">';
|
||||||
$moreforfilter .= $langs->trans('From').' ';
|
$moreforfilter .= $langs->trans('From').' ';
|
||||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
|
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
|
||||||
$moreforfilter .= $langs->trans('to').' ';
|
$moreforfilter .= ' '.$langs->trans('to').' ';
|
||||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
|
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
@ -425,12 +436,10 @@ if (!empty($arrayfields['t.code_journal']['checked'])) {
|
|||||||
if (!empty($arrayfields['t.doc_date']['checked'])) {
|
if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From') . ': ';
|
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to') . ': ';
|
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||||
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -697,10 +706,10 @@ while ($i < min($num, $limit))
|
|||||||
print '<td class="nowraponall center">';
|
print '<td class="nowraponall center">';
|
||||||
if (empty($line->date_export)) {
|
if (empty($line->date_export)) {
|
||||||
if ($user->rights->accounting->mouvements->creer) {
|
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>';
|
print '<a class="editfielda" 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) {
|
if ($user->rights->accounting->mouvements->supprimer) {
|
||||||
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>';
|
print ' <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|||||||
770
htdocs/accountancy/bookkeeping/listbysubaccount.php
Normal file
770
htdocs/accountancy/bookkeeping/listbysubaccount.php
Normal file
@ -0,0 +1,770 @@
|
|||||||
|
<?php
|
||||||
|
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||||
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \file htdocs/accountancy/bookkeeping/listbysubaccount.php
|
||||||
|
* \ingroup Accountancy (Double entries)
|
||||||
|
* \brief List operation of ledger ordered by subaccount number
|
||||||
|
*/
|
||||||
|
|
||||||
|
require '../../main.inc.php';
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("accountancy", "compta"));
|
||||||
|
|
||||||
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||||
|
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||||
|
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||||
|
|
||||||
|
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||||
|
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||||
|
if ($search_accountancy_code_start == - 1) {
|
||||||
|
$search_accountancy_code_start = '';
|
||||||
|
}
|
||||||
|
$search_accountancy_code_end = GETPOST('search_accountancy_code_end', 'alpha');
|
||||||
|
if ($search_accountancy_code_end == - 1) {
|
||||||
|
$search_accountancy_code_end = '';
|
||||||
|
}
|
||||||
|
$search_doc_ref = GETPOST('search_doc_ref', 'alpha');
|
||||||
|
$search_label_operation = GETPOST('search_label_operation', 'alpha');
|
||||||
|
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||||
|
$search_direction = GETPOST('search_direction', 'alpha');
|
||||||
|
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
||||||
|
$search_debit = GETPOST('search_debit', 'alpha');
|
||||||
|
$search_credit = GETPOST('search_credit', 'alpha');
|
||||||
|
$search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
||||||
|
$search_not_reconciled = GETPOST('search_reconciled_option', 'alpha');
|
||||||
|
|
||||||
|
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||||
|
$action = 'delbookkeepingyear';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load variable for pagination
|
||||||
|
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||||
|
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||||
|
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||||
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
|
if (empty($page) || $page < 0) { $page = 0; }
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
|
if ($sortorder == "") $sortorder = "ASC";
|
||||||
|
if ($sortfield == "") $sortfield = "t.doc_date,t.rowid";
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$object = new BookKeeping($db);
|
||||||
|
$formfile = new FormFile($db);
|
||||||
|
$hookmanager->initHooks(array('bookkeepingbysubaccountlist'));
|
||||||
|
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('search_date_startday') && !GETPOSTISSET('search_date_startmonth') && !GETPOSTISSET('search_date_starthour')) {
|
||||||
|
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
|
||||||
|
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
|
||||||
|
$sql .= $db->plimit(1);
|
||||||
|
$res = $db->query($sql);
|
||||||
|
|
||||||
|
if ($res->num_rows > 0) {
|
||||||
|
$fiscalYear = $db->fetch_object($res);
|
||||||
|
$search_date_start = strtotime($fiscalYear->date_start);
|
||||||
|
$search_date_end = strtotime($fiscalYear->date_end);
|
||||||
|
} else {
|
||||||
|
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||||
|
$year_start = dol_print_date(dol_now(), '%Y');
|
||||||
|
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
|
||||||
|
$year_end = $year_start + 1;
|
||||||
|
$month_end = $month_start - 1;
|
||||||
|
if ($month_end < 1)
|
||||||
|
{
|
||||||
|
$month_end = 12;
|
||||||
|
$year_end--;
|
||||||
|
}
|
||||||
|
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
|
||||||
|
$search_date_end = dol_get_last_day($year_end, $month_end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$arrayfields = array(
|
||||||
|
// 't.subledger_account'=>array('label'=>$langs->trans("SubledgerAccount"), 'checked'=>1),
|
||||||
|
't.code_journal'=>array('label'=>$langs->trans("Codejournal"), 'checked'=>1),
|
||||||
|
't.piece_num'=>array('label'=>$langs->trans("TransactionNumShort"), 'checked'=>1),
|
||||||
|
't.doc_date'=>array('label'=>$langs->trans("Docdate"), 'checked'=>1),
|
||||||
|
't.doc_ref'=>array('label'=>$langs->trans("Piece"), 'checked'=>1),
|
||||||
|
't.label_operation'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||||
|
't.debit'=>array('label'=>$langs->trans("Debit"), 'checked'=>1),
|
||||||
|
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||||
|
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) unset($arrayfields['t.lettering_code']);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Action
|
||||||
|
*/
|
||||||
|
if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
|
||||||
|
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
|
||||||
|
|
||||||
|
$parameters = array('socid'=>$socid);
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
|
{
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers
|
||||||
|
{
|
||||||
|
$search_doc_date = '';
|
||||||
|
$search_accountancy_code = '';
|
||||||
|
$search_accountancy_code_start = '';
|
||||||
|
$search_accountancy_code_end = '';
|
||||||
|
$search_label_account = '';
|
||||||
|
$search_doc_ref = '';
|
||||||
|
$search_label_operation = '';
|
||||||
|
$search_mvt_num = '';
|
||||||
|
$search_direction = '';
|
||||||
|
$search_ledger_code = '';
|
||||||
|
$search_date_start = '';
|
||||||
|
$search_date_end = '';
|
||||||
|
$search_date_startyear = '';
|
||||||
|
$search_date_startmonth = '';
|
||||||
|
$search_date_startday = '';
|
||||||
|
$search_date_endyear = '';
|
||||||
|
$search_date_endmonth = '';
|
||||||
|
$search_date_endday = '';
|
||||||
|
$search_debit = '';
|
||||||
|
$search_credit = '';
|
||||||
|
$search_lettering_code = '';
|
||||||
|
$search_not_reconciled = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
$param .= '&search_date_startmonth='.GETPOST('search_date_startmonth', 'int').'&search_date_startday='.GETPOST('search_date_startday', 'int').'&search_date_startyear='.GETPOST('search_date_startyear', 'int');
|
||||||
|
}
|
||||||
|
if (!empty($search_date_end)) {
|
||||||
|
$filter['t.doc_date<='] = $search_date_end;
|
||||||
|
$param .= '&search_date_endmonth='.GETPOST('search_date_endmonth', 'int').'&search_date_endday='.GETPOST('search_date_endday', 'int').'&search_date_endyear='.GETPOST('search_date_endyear', 'int');
|
||||||
|
}
|
||||||
|
if (!empty($search_doc_date)) {
|
||||||
|
$filter['t.doc_date'] = $search_doc_date;
|
||||||
|
$param .= '&doc_datemonth='.GETPOST('doc_datemonth', 'int').'&doc_dateday='.GETPOST('doc_dateday', 'int').'&doc_dateyear='.GETPOST('doc_dateyear', 'int');
|
||||||
|
}
|
||||||
|
if (!empty($search_accountancy_code_start)) {
|
||||||
|
$filter['t.subledger_account>='] = $search_accountancy_code_start;
|
||||||
|
$param .= '&search_accountancy_code_start='.urlencode($search_accountancy_code_start);
|
||||||
|
}
|
||||||
|
if (!empty($search_accountancy_code_end)) {
|
||||||
|
$filter['t.subledger_account<='] = $search_accountancy_code_end;
|
||||||
|
$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
|
||||||
|
}
|
||||||
|
if (!empty($search_label_account)) {
|
||||||
|
$filter['t.label_compte'] = $search_label_account;
|
||||||
|
$param .= '&search_label_compte='.urlencode($search_label_account);
|
||||||
|
}
|
||||||
|
if (!empty($search_mvt_num)) {
|
||||||
|
$filter['t.piece_num'] = $search_mvt_num;
|
||||||
|
$param .= '&search_mvt_num='.urlencode($search_mvt_num);
|
||||||
|
}
|
||||||
|
if (!empty($search_doc_ref)) {
|
||||||
|
$filter['t.doc_ref'] = $search_doc_ref;
|
||||||
|
$param .= '&search_doc_ref='.urlencode($search_doc_ref);
|
||||||
|
}
|
||||||
|
if (!empty($search_label_operation)) {
|
||||||
|
$filter['t.label_operation'] = $search_label_operation;
|
||||||
|
$param .= '&search_label_operation='.urlencode($search_label_operation);
|
||||||
|
}
|
||||||
|
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_debit)) {
|
||||||
|
$filter['t.debit'] = $search_debit;
|
||||||
|
$param .= '&search_debit='.urlencode($search_debit);
|
||||||
|
}
|
||||||
|
if (!empty($search_credit)) {
|
||||||
|
$filter['t.credit'] = $search_credit;
|
||||||
|
$param .= '&search_credit='.urlencode($search_credit);
|
||||||
|
}
|
||||||
|
if (!empty($search_lettering_code)) {
|
||||||
|
$filter['t.lettering_code'] = $search_lettering_code;
|
||||||
|
$param .= '&search_lettering_code='.urlencode($search_lettering_code);
|
||||||
|
}
|
||||||
|
if (!empty($search_not_reconciled)) {
|
||||||
|
$filter['t.reconciled_option'] = $search_not_reconciled;
|
||||||
|
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||||
|
$import_key = GETPOST('importkey', 'alpha');
|
||||||
|
|
||||||
|
if (!empty($import_key)) {
|
||||||
|
$result = $object->deleteByImportkey($import_key);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a redirect to avoid to launch the delete later after a back button
|
||||||
|
header("Location: listbyaccount.php".($param ? '?'.$param : ''));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($action == 'delbookkeepingyearconfirm' && $user->rights->accounting->mouvements->supprimer_tous) {
|
||||||
|
$delmonth = GETPOST('delmonth', 'int');
|
||||||
|
$delyear = GETPOST('delyear', 'int');
|
||||||
|
if ($delyear == -1) {
|
||||||
|
$delyear = 0;
|
||||||
|
}
|
||||||
|
$deljournal = GETPOST('deljournal', 'alpha');
|
||||||
|
if ($deljournal == -1) {
|
||||||
|
$deljournal = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($delmonth) || !empty($delyear) || !empty($deljournal))
|
||||||
|
{
|
||||||
|
$result = $object->deleteByYearAndJournal($delyear, $deljournal, '', ($delmonth > 0 ? $delmonth : 0));
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make a redirect to avoid to launch the delete later after a back button
|
||||||
|
header("Location: listbysubaccount.php".($param ? '?'.$param : ''));
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
setEventMessages("NoRecordDeleted", null, 'warnings');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($action == 'delmouvconfirm' && $user->rights->accounting->mouvements->supprimer) {
|
||||||
|
$mvt_num = GETPOST('mvt_num', 'int');
|
||||||
|
|
||||||
|
if (!empty($mvt_num)) {
|
||||||
|
$result = $object->deleteMvtNum($mvt_num);
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
} else {
|
||||||
|
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
|
||||||
|
header("Location: listbysubaccount.php?noreset=1".($param ? '&'.$param : ''));
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* View
|
||||||
|
*/
|
||||||
|
|
||||||
|
$formaccounting = new FormAccounting($db);
|
||||||
|
$formfile = new FormFile($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccounting").' ('.$langs->trans("BookkeepingSubAccount").')';
|
||||||
|
|
||||||
|
llxHeader('', $title_page);
|
||||||
|
|
||||||
|
|
||||||
|
// List
|
||||||
|
$nbtotalofrecords = '';
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||||
|
$nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter, 'AND', 1);
|
||||||
|
if ($nbtotalofrecords < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $object->fetchAllByAccount($sortorder, $sortfield, $limit, $offset, $filter, 'AND', 1);
|
||||||
|
|
||||||
|
if ($result < 0) {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
$num = count($object->lines);
|
||||||
|
|
||||||
|
|
||||||
|
if ($action == 'delmouv') {
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
|
||||||
|
print $formconfirm;
|
||||||
|
}
|
||||||
|
if ($action == 'delbookkeepingyear') {
|
||||||
|
$form_question = array();
|
||||||
|
$delyear = GETPOST('delyear', 'int');
|
||||||
|
$deljournal = GETPOST('deljournal', 'alpha');
|
||||||
|
|
||||||
|
if (empty($delyear)) {
|
||||||
|
$delyear = dol_print_date(dol_now(), '%Y');
|
||||||
|
}
|
||||||
|
$month_array = array();
|
||||||
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
|
$month_array[$i] = $langs->trans("Month".sprintf("%02d", $i));
|
||||||
|
}
|
||||||
|
$year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
||||||
|
$journal_array = $formaccounting->select_journal($deljournal, 'deljournal', '', 1, 1, 1, '', 0, 1);
|
||||||
|
|
||||||
|
$form_question['delmonth'] = array(
|
||||||
|
'name' => 'delmonth',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $langs->trans('DelMonth'),
|
||||||
|
'values' => $month_array,
|
||||||
|
'default' => ''
|
||||||
|
);
|
||||||
|
$form_question['delyear'] = array(
|
||||||
|
'name' => 'delyear',
|
||||||
|
'type' => 'select',
|
||||||
|
'label' => $langs->trans('DelYear'),
|
||||||
|
'values' => $year_array,
|
||||||
|
'default' => $delyear
|
||||||
|
);
|
||||||
|
$form_question['deljournal'] = array(
|
||||||
|
'name' => 'deljournal',
|
||||||
|
'type' => 'other', // We don't use select here, the journal_array is already a select html component
|
||||||
|
'label' => $langs->trans('DelJournal'),
|
||||||
|
'value' => $journal_array,
|
||||||
|
'default' => $deljournal
|
||||||
|
);
|
||||||
|
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||||
|
print $formconfirm;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="action" value="list">';
|
||||||
|
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||||
|
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||||
|
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||||
|
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||||
|
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$newcardbutton = dolGetButtonTitle($langs->trans('ViewAccountList'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php', '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||||
|
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?action=create');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||||
|
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
// Reverse sort order
|
||||||
|
if (preg_match('/^asc/i', $sortorder)) $sortorder = "asc";
|
||||||
|
else $sortorder = "desc";
|
||||||
|
|
||||||
|
$moreforfilter = '';
|
||||||
|
|
||||||
|
// Accountancy account
|
||||||
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
|
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
||||||
|
$moreforfilter .= '<div class="nowrap inline-block">';
|
||||||
|
$moreforfilter .= $langs->trans('From').' ';
|
||||||
|
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, 'maxwidth200');
|
||||||
|
$moreforfilter .= ' '.$langs->trans('to').' ';
|
||||||
|
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, 'maxwidth200');
|
||||||
|
$moreforfilter .= '</div>';
|
||||||
|
$moreforfilter .= '</div>';
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
|
||||||
|
else $moreforfilter = $hookmanager->resPrint;
|
||||||
|
|
||||||
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
|
print $moreforfilter;
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="tagtable liste centpercent">';
|
||||||
|
|
||||||
|
// Filters lines
|
||||||
|
print '<tr class="liste_titre_filter">';
|
||||||
|
|
||||||
|
// Code journal
|
||||||
|
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||||
|
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="'.dol_escape_htmltag($search_ledger_code).'"></td>';
|
||||||
|
}
|
||||||
|
// Date document
|
||||||
|
if (!empty($arrayfields['t.doc_date']['checked'])) {
|
||||||
|
print '<td class="liste_titre center">';
|
||||||
|
print '<div class="nowrap">';
|
||||||
|
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||||
|
print '</div>';
|
||||||
|
print '<div class="nowrap">';
|
||||||
|
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||||
|
print '</div>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
// Movement number
|
||||||
|
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="'.dol_escape_htmltag($search_mvt_num).'"></td>';
|
||||||
|
}
|
||||||
|
// Ref document
|
||||||
|
if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
||||||
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="'.dol_escape_htmltag($search_doc_ref).'"/></td>';
|
||||||
|
}
|
||||||
|
// Label operation
|
||||||
|
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||||
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).'"/></td>';
|
||||||
|
}
|
||||||
|
// Debit
|
||||||
|
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||||
|
print '<td class="liste_titre right"><input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).'"></td>';
|
||||||
|
}
|
||||||
|
// Credit
|
||||||
|
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||||
|
print '<td class="liste_titre right"><input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'"></td>';
|
||||||
|
}
|
||||||
|
// Lettering code
|
||||||
|
if (!empty($arrayfields['t.lettering_code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre center">';
|
||||||
|
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||||
|
print '<br><span class="nowrap"><input type="checkbox" name="search_reconciled_option" value="notreconciled"'.($search_not_reconciled == 'notreconciled' ? ' checked' : '').'>'.$langs->trans("NotReconciled").'</span>';
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
print '<td class="liste_titre center">';
|
||||||
|
$searchpicto = $form->showFilterButtons();
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
if (!empty($arrayfields['t.code_journal']['checked'])) print_liste_field_titre($arrayfields['t.code_journal']['label'], $_SERVER['PHP_SELF'], "t.code_journal", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['t.doc_date']['checked'])) print_liste_field_titre($arrayfields['t.doc_date']['label'], $_SERVER['PHP_SELF'], "t.doc_date", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['t.piece_num']['checked'])) print_liste_field_titre($arrayfields['t.piece_num']['label'], $_SERVER['PHP_SELF'], "t.piece_num", "", $param, '', $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['t.doc_ref']['checked'])) print_liste_field_titre($arrayfields['t.doc_ref']['label'], $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['t.label_operation']['checked'])) print_liste_field_titre($arrayfields['t.label_operation']['label'], $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||||
|
if (!empty($arrayfields['t.debit']['checked'])) print_liste_field_titre($arrayfields['t.debit']['label'], $_SERVER['PHP_SELF'], "t.debit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (!empty($arrayfields['t.credit']['checked'])) print_liste_field_titre($arrayfields['t.credit']['label'], $_SERVER['PHP_SELF'], "t.credit", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
|
if (!empty($arrayfields['t.lettering_code']['checked'])) print_liste_field_titre($arrayfields['t.lettering_code']['label'], $_SERVER['PHP_SELF'], "t.lettering_code", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
// 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;
|
||||||
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
$total_debit = 0;
|
||||||
|
$total_credit = 0;
|
||||||
|
$sous_total_debit = 0;
|
||||||
|
$sous_total_credit = 0;
|
||||||
|
$displayed_account_number = null; // Start with undefined to be able to distinguish with empty
|
||||||
|
|
||||||
|
// Loop on record
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
$i = 0;
|
||||||
|
$totalarray = array();
|
||||||
|
while ($i < min($num, $limit))
|
||||||
|
{
|
||||||
|
$line = $object->lines[$i];
|
||||||
|
|
||||||
|
$total_debit += $line->debit;
|
||||||
|
$total_credit += $line->credit;
|
||||||
|
|
||||||
|
$accountg = length_accounta($line->subledger_account);
|
||||||
|
//if (empty($accountg)) $accountg = '-';
|
||||||
|
|
||||||
|
// Is it a break ?
|
||||||
|
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||||
|
$colspan = $totalarray['nbfield'] - 3;
|
||||||
|
$colspanend = $totalarray['nbfield'] - 7;
|
||||||
|
// Show a subtotal by accounting account
|
||||||
|
if (isset($displayed_account_number)) {
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.length_accounta($displayed_account_number).':</td>';
|
||||||
|
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||||
|
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||||
|
print '<td colspan="'.$colspanend.'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
// Show balance of last shown account
|
||||||
|
$balance = $sous_total_debit - $sous_total_credit;
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
||||||
|
if ($balance > 0)
|
||||||
|
{
|
||||||
|
print '<td class="nowraponall right">';
|
||||||
|
print price($sous_total_debit - $sous_total_credit);
|
||||||
|
print '</td>';
|
||||||
|
print '<td></td>';
|
||||||
|
} else {
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td class="nowraponall right">';
|
||||||
|
print price($sous_total_credit - $sous_total_debit);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print '<td colspan="'.$colspanend.'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the break account
|
||||||
|
print "<tr>";
|
||||||
|
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 9).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||||
|
if ($line->subledger_account != "" && $line->subledger_account != '-1') print length_accounta($line->subledger_account).' : '.$object->get_compte_desc($line->numero_compte);
|
||||||
|
else print '<span class="error">'.$langs->trans("Unknown").'</span>';
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$displayed_account_number = $accountg;
|
||||||
|
//if (empty($displayed_account_number)) $displayed_account_number='-';
|
||||||
|
$sous_total_debit = 0;
|
||||||
|
$sous_total_credit = 0;
|
||||||
|
|
||||||
|
$colspan = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
|
// Journal code
|
||||||
|
if (!empty($arrayfields['t.code_journal']['checked']))
|
||||||
|
{
|
||||||
|
$accountingjournal = new AccountingJournal($db);
|
||||||
|
$result = $accountingjournal->fetch('', $line->code_journal);
|
||||||
|
$journaltoshow = (($result > 0) ? $accountingjournal->getNomUrl(0, 0, 0, '', 0) : $line->code_journal);
|
||||||
|
print '<td class="center">'.$journaltoshow.'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Document date
|
||||||
|
if (!empty($arrayfields['t.doc_date']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="center">'.dol_print_date($line->doc_date, 'day').'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Piece number
|
||||||
|
if (!empty($arrayfields['t.piece_num']['checked']))
|
||||||
|
{
|
||||||
|
print '<td>';
|
||||||
|
$object->id = $line->id;
|
||||||
|
$object->piece_num = $line->piece_num;
|
||||||
|
print $object->getNomUrl(1, '', 0, '', 1);
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Document ref
|
||||||
|
if (!empty($arrayfields['t.doc_ref']['checked']))
|
||||||
|
{
|
||||||
|
if ($line->doc_type == 'customer_invoice')
|
||||||
|
{
|
||||||
|
$langs->loadLangs(array('bills'));
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
$objectstatic = new Facture($db);
|
||||||
|
$objectstatic->fetch($line->fk_doc);
|
||||||
|
//$modulepart = 'facture';
|
||||||
|
|
||||||
|
$filename = dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
|
} elseif ($line->doc_type == 'supplier_invoice')
|
||||||
|
{
|
||||||
|
$langs->loadLangs(array('bills'));
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
|
$objectstatic = new FactureFournisseur($db);
|
||||||
|
$objectstatic->fetch($line->fk_doc);
|
||||||
|
//$modulepart = 'invoice_supplier';
|
||||||
|
|
||||||
|
$filename = dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($line->fk_doc, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$subdir = get_exdir($objectstatic->id, 2, 0, 0, $objectstatic, $modulepart).dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $subdir, $filedir);
|
||||||
|
} elseif ($line->doc_type == 'expense_report')
|
||||||
|
{
|
||||||
|
$langs->loadLangs(array('trips'));
|
||||||
|
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||||
|
$objectstatic = new ExpenseReport($db);
|
||||||
|
$objectstatic->fetch($line->fk_doc);
|
||||||
|
//$modulepart = 'expensereport';
|
||||||
|
|
||||||
|
$filename = dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$filedir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($line->doc_ref);
|
||||||
|
$urlsource = $_SERVER['PHP_SELF'].'?id='.$objectstatic->id;
|
||||||
|
$documentlink = $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
|
} else {
|
||||||
|
// Other type
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
|
// Picto + Ref
|
||||||
|
print '<td class="nobordernopadding nowrap">';
|
||||||
|
|
||||||
|
if ($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice' || $line->doc_type == 'expense_report')
|
||||||
|
{
|
||||||
|
print $objectstatic->getNomUrl(1, '', 0, 0, '', 0, -1, 1);
|
||||||
|
print $documentlink;
|
||||||
|
} else {
|
||||||
|
print $line->doc_ref;
|
||||||
|
}
|
||||||
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
print "</td>\n";
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Label operation
|
||||||
|
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||||
|
// Affiche un lien vers la facture client/fournisseur
|
||||||
|
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
|
||||||
|
print strlen(length_accounta($line->subledger_account)) == 0 ? '<td>'.$line->label_operation.'</td>' : '<td>'.$line->label_operation.'<br><span style="font-size:0.8em">('.length_accounta($line->subledger_account).')</span></td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Amount debit
|
||||||
|
if (!empty($arrayfields['t.debit']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totaldebit';
|
||||||
|
$totalarray['val']['totaldebit'] += $line->debit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Amount credit
|
||||||
|
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||||
|
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'totalcredit';
|
||||||
|
$totalarray['val']['totalcredit'] += $line->credit;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Lettering code
|
||||||
|
if (!empty($arrayfields['t.lettering_code']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fields from hook
|
||||||
|
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
print '<td class="nowraponall center">';
|
||||||
|
if (empty($line->date_export)) {
|
||||||
|
if ($user->rights->accounting->mouvements->creer) {
|
||||||
|
print '<a class="editfielda" 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 ' <a class="paddingleft" 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']++;
|
||||||
|
|
||||||
|
// Comptabilise le sous-total
|
||||||
|
$sous_total_debit += $line->debit;
|
||||||
|
$sous_total_credit += $line->credit;
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show sub-total of last shown account
|
||||||
|
$colspan = $totalarray['nbfield'] - 3;
|
||||||
|
$colspanend = $totalarray['nbfield'] - 8;
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
|
||||||
|
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||||
|
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||||
|
print '<td colspan="'.$colspanend.'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
// Show balance of last shown account
|
||||||
|
$balance = $sous_total_debit - $sous_total_credit;
|
||||||
|
print '<tr class="liste_total">';
|
||||||
|
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("Balance").':</td>';
|
||||||
|
if ($balance > 0)
|
||||||
|
{
|
||||||
|
print '<td class="nowraponall right">';
|
||||||
|
print price($sous_total_debit - $sous_total_credit);
|
||||||
|
print '</td>';
|
||||||
|
print '<td></td>';
|
||||||
|
} else {
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td class="nowraponall right">';
|
||||||
|
print price($sous_total_credit - $sous_total_debit);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print '<td colspan="'.$colspanend.'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Show total line
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
|
|
||||||
|
print "</table>";
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
|
// TODO Replace this with mass delete action
|
||||||
|
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>';
|
||||||
|
|
||||||
|
// End of page
|
||||||
|
llxFooter();
|
||||||
|
$db->close();
|
||||||
@ -135,13 +135,13 @@ $head = societe_prepare_head($object);
|
|||||||
|
|
||||||
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
||||||
|
|
||||||
dol_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company');
|
print dol_get_fiche_head($head, 'lettering_customer', $langs->trans("ThirdParty"), 0, 'company');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
|
$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.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -41,7 +41,7 @@ $massaction = GETPOST('massaction', 'alpha');
|
|||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
|
$socid = GETPOST('socid', 'int') ? ((int) GETPOST('socid', 'int')) : ((int) GETPOST('id', 'int'));
|
||||||
|
|
||||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -134,13 +134,13 @@ $head = societe_prepare_head($object);
|
|||||||
|
|
||||||
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
dol_htmloutput_mesg(is_numeric($error) ? '' : $error, $errors, 'error');
|
||||||
|
|
||||||
dol_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company');
|
print dol_get_fiche_head($head, 'lettering_supplier', $langs->trans("ThirdParty"), 0, 'company');
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/societe/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
$sql = "SELECT bk.rowid, bk.doc_date, bk.doc_type, bk.doc_ref, ";
|
$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.subledger_account, bk.numero_compte , bk.label_compte, bk.debit, ";
|
||||||
|
|||||||
@ -57,6 +57,8 @@ class AccountancyExport
|
|||||||
public static $EXPORT_TYPE_OPENCONCERTO = 100;
|
public static $EXPORT_TYPE_OPENCONCERTO = 100;
|
||||||
public static $EXPORT_TYPE_LDCOMPTA = 110;
|
public static $EXPORT_TYPE_LDCOMPTA = 110;
|
||||||
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
||||||
|
public static $EXPORT_TYPE_GESTINUMV3 = 130;
|
||||||
|
public static $EXPORT_TYPE_GESTINUMV5 = 135;
|
||||||
public static $EXPORT_TYPE_FEC = 1000;
|
public static $EXPORT_TYPE_FEC = 1000;
|
||||||
|
|
||||||
|
|
||||||
@ -113,10 +115,12 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
||||||
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'),
|
||||||
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
|
self::$EXPORT_TYPE_SAGE50_SWISS => $langs->trans('Modelcsv_Sage50_Swiss'),
|
||||||
|
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
||||||
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
|
||||||
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
|
||||||
|
self::$EXPORT_TYPE_GESTINUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
|
||||||
|
self::$EXPORT_TYPE_GESTINUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||||
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
ksort($listofexporttypes, SORT_NUMERIC);
|
ksort($listofexporttypes, SORT_NUMERIC);
|
||||||
@ -145,8 +149,11 @@ class AccountancyExport
|
|||||||
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
self::$EXPORT_TYPE_AGIRIS => 'agiris',
|
||||||
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto',
|
||||||
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
|
self::$EXPORT_TYPE_SAGE50_SWISS => 'sage50ch',
|
||||||
|
self::$EXPORT_TYPE_CHARLEMAGNE => 'charlemagne',
|
||||||
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
self::$EXPORT_TYPE_LDCOMPTA => 'ldcompta',
|
||||||
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
|
self::$EXPORT_TYPE_LDCOMPTA10 => 'ldcompta10',
|
||||||
|
self::$EXPORT_TYPE_GESTINUMV3 => 'gestinumv3',
|
||||||
|
self::$EXPORT_TYPE_GESTINUMV5 => 'gestinumv5',
|
||||||
self::$EXPORT_TYPE_FEC => 'fec',
|
self::$EXPORT_TYPE_FEC => 'fec',
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -203,28 +210,30 @@ class AccountancyExport
|
|||||||
),
|
),
|
||||||
self::$EXPORT_TYPE_OPENCONCERTO => array(
|
self::$EXPORT_TYPE_OPENCONCERTO => array(
|
||||||
'label' => $langs->trans('Modelcsv_openconcerto'),
|
'label' => $langs->trans('Modelcsv_openconcerto'),
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
|
||||||
),
|
),
|
||||||
self::$EXPORT_TYPE_SAGE50_SWISS => array(
|
self::$EXPORT_TYPE_SAGE50_SWISS => array(
|
||||||
'label' => $langs->trans('Modelcsv_Sage50_Swiss'),
|
'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_LDCOMPTA10 => array(
|
|
||||||
'label' => $langs->trans('Modelcsv_LDCompta10'),
|
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
|
||||||
),
|
|
||||||
self::$EXPORT_TYPE_FEC => array(
|
|
||||||
'label' => $langs->trans('Modelcsv_FEC'),
|
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
|
||||||
),
|
),
|
||||||
self::$EXPORT_TYPE_CHARLEMAGNE => array(
|
self::$EXPORT_TYPE_CHARLEMAGNE => array(
|
||||||
'label' => $langs->trans('Modelcsv_charlemagne'),
|
'label' => $langs->trans('Modelcsv_charlemagne'),
|
||||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||||
),
|
),
|
||||||
|
self::$EXPORT_TYPE_LDCOMPTA => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_LDCompta'),
|
||||||
|
),
|
||||||
|
self::$EXPORT_TYPE_LDCOMPTA10 => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_LDCompta10'),
|
||||||
|
),
|
||||||
|
self::$EXPORT_TYPE_GESTINUMV3 => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_Gestinumv3'),
|
||||||
|
),
|
||||||
|
self::$EXPORT_TYPE_GESTINUMV5 => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_Gestinumv5'),
|
||||||
|
),
|
||||||
|
self::$EXPORT_TYPE_FEC => array(
|
||||||
|
'label' => $langs->trans('Modelcsv_FEC'),
|
||||||
|
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
'cr'=> array(
|
'cr'=> array(
|
||||||
'1' => $langs->trans("Unix"),
|
'1' => $langs->trans("Unix"),
|
||||||
@ -295,17 +304,23 @@ class AccountancyExport
|
|||||||
case self::$EXPORT_TYPE_SAGE50_SWISS :
|
case self::$EXPORT_TYPE_SAGE50_SWISS :
|
||||||
$this->exportSAGE50SWISS($TData);
|
$this->exportSAGE50SWISS($TData);
|
||||||
break;
|
break;
|
||||||
|
case self::$EXPORT_TYPE_CHARLEMAGNE :
|
||||||
|
$this->exportCharlemagne($TData);
|
||||||
|
break;
|
||||||
case self::$EXPORT_TYPE_LDCOMPTA :
|
case self::$EXPORT_TYPE_LDCOMPTA :
|
||||||
$this->exportLDCompta($TData);
|
$this->exportLDCompta($TData);
|
||||||
break;
|
break;
|
||||||
case self::$EXPORT_TYPE_LDCOMPTA10 :
|
case self::$EXPORT_TYPE_LDCOMPTA10 :
|
||||||
$this->exportLDCompta10($TData);
|
$this->exportLDCompta10($TData);
|
||||||
break;
|
break;
|
||||||
|
case self::$EXPORT_TYPE_GESTINUMV3 :
|
||||||
|
$this->exportGestimumV3($TData);
|
||||||
|
break;
|
||||||
|
case self::$EXPORT_TYPE_GESTINUMV5 :
|
||||||
|
$this->exportGestimumV5($TData);
|
||||||
|
break;
|
||||||
case self::$EXPORT_TYPE_FEC :
|
case self::$EXPORT_TYPE_FEC :
|
||||||
$this->exportFEC($TData);
|
$this->exportFEC($TData);
|
||||||
break;
|
|
||||||
case self::$EXPORT_TYPE_CHARLEMAGNE :
|
|
||||||
$this->exportCharlemagne($TData);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
||||||
@ -386,6 +401,7 @@ class AccountancyExport
|
|||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||||
|
|
||||||
print $date.$separator;
|
print $date.$separator;
|
||||||
print $line->code_journal.$separator;
|
print $line->code_journal.$separator;
|
||||||
print length_accountg($line->numero_compte).$separator;
|
print length_accountg($line->numero_compte).$separator;
|
||||||
@ -394,7 +410,7 @@ class AccountancyExport
|
|||||||
print price($line->debit).$separator;
|
print price($line->debit).$separator;
|
||||||
print price($line->credit).$separator;
|
print price($line->credit).$separator;
|
||||||
print 'E'.$separator;
|
print 'E'.$separator;
|
||||||
print length_accountg($line->subledger_account).$separator;
|
print length_accounta($line->subledger_account).$separator;
|
||||||
print $end_line;
|
print $end_line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -785,7 +801,7 @@ class AccountancyExport
|
|||||||
public function exportFEC($objectLines)
|
public function exportFEC($objectLines)
|
||||||
{
|
{
|
||||||
$separator = "\t";
|
$separator = "\t";
|
||||||
$end_line = "\n";
|
$end_line = "\r\n";
|
||||||
|
|
||||||
print "JournalCode".$separator;
|
print "JournalCode".$separator;
|
||||||
print "JournalLib".$separator;
|
print "JournalLib".$separator;
|
||||||
@ -808,8 +824,12 @@ class AccountancyExport
|
|||||||
print $end_line;
|
print $end_line;
|
||||||
|
|
||||||
foreach ($objectLines as $line) {
|
foreach ($objectLines as $line) {
|
||||||
|
if ($line->debit == 0 && $line->credit == 0) {
|
||||||
|
unset($array[$line]);
|
||||||
|
} else {
|
||||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||||
|
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||||
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
$date_validation = dol_print_date($line->date_validated, '%Y%m%d');
|
||||||
|
|
||||||
// FEC:JournalCode
|
// FEC:JournalCode
|
||||||
@ -843,7 +863,7 @@ class AccountancyExport
|
|||||||
print dol_string_unaccent($date_creation).$separator;
|
print dol_string_unaccent($date_creation).$separator;
|
||||||
|
|
||||||
// FEC:EcritureLib
|
// FEC:EcritureLib
|
||||||
print $line->label_operation.$separator;
|
print dol_string_unaccent($line->label_operation).$separator;
|
||||||
|
|
||||||
// FEC:Debit
|
// FEC:Debit
|
||||||
print price2fec($line->debit).$separator;
|
print price2fec($line->debit).$separator;
|
||||||
@ -855,7 +875,7 @@ class AccountancyExport
|
|||||||
print $line->lettering_code.$separator;
|
print $line->lettering_code.$separator;
|
||||||
|
|
||||||
// FEC:DateLet
|
// FEC:DateLet
|
||||||
print $line->date_lettering.$separator;
|
print $date_lettering.$separator;
|
||||||
|
|
||||||
// FEC:ValidDate
|
// FEC:ValidDate
|
||||||
print $date_validation.$separator;
|
print $date_validation.$separator;
|
||||||
@ -869,6 +889,7 @@ class AccountancyExport
|
|||||||
print $end_line;
|
print $end_line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export format : SAGE50SWISS
|
* Export format : SAGE50SWISS
|
||||||
@ -1468,6 +1489,136 @@ class AccountancyExport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export format : Gestimum V3
|
||||||
|
*
|
||||||
|
* @param array $objectLines data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function exportGestimumV3($objectLines)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$this->separator = ',';
|
||||||
|
|
||||||
|
$invoices_infos = array();
|
||||||
|
$supplier_invoices_infos = array();
|
||||||
|
foreach ($objectLines as $line) {
|
||||||
|
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||||
|
|
||||||
|
$invoice_ref = $line->doc_ref;
|
||||||
|
$company_name = "";
|
||||||
|
|
||||||
|
if (($line->doc_type == 'customer_invoice' || $line->doc_type == 'supplier_invoice') && $line->fk_doc > 0) {
|
||||||
|
if (($line->doc_type == 'customer_invoice' && !isset($invoices_infos[$line->fk_doc])) ||
|
||||||
|
($line->doc_type == 'supplier_invoice' && !isset($supplier_invoices_infos[$line->fk_doc]))) {
|
||||||
|
if ($line->doc_type == 'customer_invoice') {
|
||||||
|
// Get new customer invoice ref and company name
|
||||||
|
$sql = 'SELECT f.facnumber, s.nom FROM ' . MAIN_DB_PREFIX . 'facture as f';
|
||||||
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON f.fk_soc = s.rowid';
|
||||||
|
$sql .= ' WHERE f.rowid = ' . $line->fk_doc;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
if ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
// Save invoice infos
|
||||||
|
$invoices_infos[$line->fk_doc] = array('ref' => $obj->facnumber, 'company_name' => $obj->nom);
|
||||||
|
$invoice_ref = $obj->facnumber;
|
||||||
|
$company_name = $obj->nom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Get new supplier invoice ref and company name
|
||||||
|
$sql = 'SELECT ff.ref, s.nom FROM ' . MAIN_DB_PREFIX . 'facture_fourn as ff';
|
||||||
|
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe AS s ON ff.fk_soc = s.rowid';
|
||||||
|
$sql .= ' WHERE ff.rowid = ' . $line->fk_doc;
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if ($resql) {
|
||||||
|
if ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
// Save invoice infos
|
||||||
|
$supplier_invoices_infos[$line->fk_doc] = array('ref' => $obj->ref, 'company_name' => $obj->nom);
|
||||||
|
$invoice_ref = $obj->ref;
|
||||||
|
$company_name = $obj->nom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif ($line->doc_type == 'customer_invoice') {
|
||||||
|
// Retrieve invoice infos
|
||||||
|
$invoice_ref = $invoices_infos[$line->fk_doc]['ref'];
|
||||||
|
$company_name = $invoices_infos[$line->fk_doc]['company_name'];
|
||||||
|
} else {
|
||||||
|
// Retrieve invoice infos
|
||||||
|
$invoice_ref = $supplier_invoices_infos[$line->fk_doc]['ref'];
|
||||||
|
$company_name = $supplier_invoices_infos[$line->fk_doc]['company_name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print $line->id . $this->separator;
|
||||||
|
print $date . $this->separator;
|
||||||
|
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||||
|
|
||||||
|
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||||
|
print length_accountg($line->subledger_account) . $this->separator;
|
||||||
|
} else {
|
||||||
|
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||||
|
}
|
||||||
|
//Libellé Auto
|
||||||
|
print $this->separator;
|
||||||
|
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||||
|
//Libellé manuel
|
||||||
|
print dol_trunc(str_replace('"', '', $invoice_ref . (!empty($company_name) ? ' - ' : '') . $company_name), 40, 'right', 'UTF-8', 1) . $this->separator;
|
||||||
|
//Numéro de pièce
|
||||||
|
print dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1) . $this->separator;
|
||||||
|
//Devise
|
||||||
|
print 'EUR' . $this->separator;
|
||||||
|
//Montant
|
||||||
|
print price2num(abs($line->montant)) . $this->separator;
|
||||||
|
//Sens
|
||||||
|
print $line->sens . $this->separator;
|
||||||
|
//Code lettrage
|
||||||
|
print $this->separator;
|
||||||
|
//Date Echéance
|
||||||
|
print $date;
|
||||||
|
print $this->end_line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Export format : Gestimum V5
|
||||||
|
*
|
||||||
|
* @param array $objectLines data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function exportGestimumV5($objectLines)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->separator = ',';
|
||||||
|
|
||||||
|
foreach ($objectLines as $line) {
|
||||||
|
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||||
|
|
||||||
|
print $line->id . $this->separator;
|
||||||
|
print $date . $this->separator;
|
||||||
|
print substr($line->code_journal, 0, 4) . $this->separator;
|
||||||
|
if ((substr($line->numero_compte, 0, 3) == '411') || (substr($line->numero_compte, 0, 3) == '401')) {
|
||||||
|
print length_accountg($line->subledger_account) . $this->separator;
|
||||||
|
} else {
|
||||||
|
print substr(length_accountg($line->numero_compte), 0, 15) . $this->separator;
|
||||||
|
}
|
||||||
|
print $this->separator;
|
||||||
|
//print '"'.dol_trunc(str_replace('"', '', $line->label_operation),40,'right','UTF-8',1).'"' . $this->separator;
|
||||||
|
print '"'.dol_trunc(str_replace('"', '', $line->doc_ref), 40, 'right', 'UTF-8', 1).'"' . $this->separator;
|
||||||
|
print '"'.dol_trunc(str_replace('"', '', $line->piece_num), 10, 'right', 'UTF-8', 1).'"'.$this->separator;
|
||||||
|
print price2num($line->montant).$this->separator;
|
||||||
|
print $line->sens.$this->separator;
|
||||||
|
print $date . $this->separator;
|
||||||
|
print $this->separator;
|
||||||
|
print $this->separator;
|
||||||
|
print 'EUR';
|
||||||
|
print $this->end_line;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* trunc
|
* trunc
|
||||||
|
|||||||
@ -448,26 +448,27 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param int $notooltip 1=Disable tooltip
|
* @param int $notooltip 1=Disable tooltip
|
||||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||||
* @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label)
|
* @param int $withcompletelabel 0=Short label (field short label), 1=Complete label (field label)
|
||||||
* @param string $option 'bookkeeping', 'bookkeepinglistbyaccount', 'accountcard'
|
* @param string $option 'ledger', 'journals', 'accountcard'
|
||||||
* @return string String with URL
|
* @return string String with URL
|
||||||
*/
|
*/
|
||||||
public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
|
public function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1, $withcompletelabel = 0, $option = '')
|
||||||
{
|
{
|
||||||
global $langs, $conf, $user;
|
global $langs, $conf;
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||||
|
|
||||||
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
if (empty($option) || $option == 'bookkeeping') {
|
$url = ''; $labelurl = '';
|
||||||
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/list.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number;
|
if (empty($option) || $option == 'ledger') {
|
||||||
$labelurl = $langs->trans("ShowAccountingAccountInBookKeeping");
|
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
|
||||||
} elseif ($option == 'bookkeepinglistbyaccount') {
|
$labelurl = $langs->trans("ShowAccountingAccountInLedger");
|
||||||
$url = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . $this->account_number . '&search_accountancy_code_end=' . $this->account_number;
|
} elseif ($option == 'journals') {
|
||||||
$labelurl = $langs->trans("ShowAccountingAccountInBookKeepingByAccount");
|
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?search_accountancy_code_start='.urlencode($this->account_number).'&search_accountancy_code_end='.urlencode($this->account_number);
|
||||||
|
$labelurl = $langs->trans("ShowAccountingAccountInJournals");
|
||||||
} elseif ($option == 'accountcard') {
|
} elseif ($option == 'accountcard') {
|
||||||
$url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id;
|
$url = DOL_URL_ROOT.'/accountancy/admin/card.php?id='.urlencode($this->id);
|
||||||
$labelurl = $langs->trans("ShowAccountingAccount");
|
$labelurl = $langs->trans("ShowAccountingAccount");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,11 +617,8 @@ class AccountingAccount extends CommonObject
|
|||||||
// phpcs:enable
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if ($mode == 0)
|
|
||||||
{
|
|
||||||
$fieldtouse = 'active';
|
$fieldtouse = 'active';
|
||||||
} elseif ($mode == 1)
|
if ($mode == 1) {
|
||||||
{
|
|
||||||
$fieldtouse = 'reconcilable';
|
$fieldtouse = 'reconcilable';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class AccountingJournal extends CommonObject
|
|||||||
public $table_element = 'accounting_journal';
|
public $table_element = 'accounting_journal';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
* @var string Fieldname with ID of parent key if this field has a parent
|
||||||
*/
|
*/
|
||||||
public $fk_element = '';
|
public $fk_element = '';
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2015-2017 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2015-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -768,10 +768,11 @@ class BookKeeping extends CommonObject
|
|||||||
* @param int $offset offset limit
|
* @param int $offset offset limit
|
||||||
* @param array $filter filter array
|
* @param array $filter filter array
|
||||||
* @param string $filtermode filter mode (AND or OR)
|
* @param string $filtermode filter mode (AND or OR)
|
||||||
|
* @param int $option option (0: general account or 1: subaccount)
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
public function fetchAllByAccount($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $option = 0)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -836,7 +837,13 @@ class BookKeeping extends CommonObject
|
|||||||
$sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere);
|
$sql .= ' AND '.implode(' '.$filtermode.' ', $sqlwhere);
|
||||||
}
|
}
|
||||||
// Affichage par compte comptable
|
// Affichage par compte comptable
|
||||||
|
if (!empty($option)) {
|
||||||
|
$sql .= ' AND t.subledger_account IS NOT NULL';
|
||||||
|
$sql .= ' ORDER BY t.subledger_account ASC';
|
||||||
|
} else {
|
||||||
$sql .= ' ORDER BY t.numero_compte ASC';
|
$sql .= ' ORDER BY t.numero_compte ASC';
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($sortfield)) {
|
if (!empty($sortfield)) {
|
||||||
$sql .= ', '.$sortfield.' '.$sortorder;
|
$sql .= ', '.$sortfield.' '.$sortorder;
|
||||||
}
|
}
|
||||||
@ -1530,14 +1537,14 @@ class BookKeeping extends CommonObject
|
|||||||
$this->label_compte = 'Customer';
|
$this->label_compte = 'Customer';
|
||||||
$this->label_operation = 'Sales of pea';
|
$this->label_operation = 'Sales of pea';
|
||||||
$this->debit = 99.9;
|
$this->debit = 99.9;
|
||||||
$this->credit = '';
|
$this->credit = 0.0;
|
||||||
$this->montant = '';
|
$this->amount = 0.0;
|
||||||
$this->sens = 'D';
|
$this->sens = 'D';
|
||||||
$this->fk_user_author = $user->id;
|
$this->fk_user_author = $user->id;
|
||||||
$this->import_key = '';
|
$this->import_key = '20201027';
|
||||||
$this->code_journal = 'VT';
|
$this->code_journal = 'VT';
|
||||||
$this->journal_label = 'Journal de vente';
|
$this->journal_label = 'Journal de vente';
|
||||||
$this->piece_num = '';
|
$this->piece_num = 1234;
|
||||||
$this->date_creation = $now;
|
$this->date_creation = $now;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1891,23 +1898,22 @@ class BookKeeping extends CommonObject
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Description of a root accounting account
|
* Return id and description of a root accounting account.
|
||||||
|
* This function takes the parent of parent to get the root account !
|
||||||
*
|
*
|
||||||
* @param string $account Accounting account
|
* @param string $account Accounting account
|
||||||
* @return string Root account
|
* @return string Root account
|
||||||
*/
|
*/
|
||||||
public function get_compte_racine($account = null)
|
public function getRootAccount($account = null)
|
||||||
{
|
{
|
||||||
// phpcs:enable
|
|
||||||
global $conf;
|
global $conf;
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
$sql = "SELECT root.account_number, root.label as label";
|
$sql = "SELECT root.rowid, root.account_number, root.label as label";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||||
$sql .= " AND asy.rowid = ".$pcgver;
|
$sql .= " AND asy.rowid = ".((int) $pcgver);
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as parent ON aa.account_parent = parent.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as root ON parent.account_parent = root.rowid";
|
||||||
$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
|
$sql .= " WHERE aa.account_number = '".$this->db->escape($account)."'";
|
||||||
@ -1923,7 +1929,7 @@ class BookKeeping extends CommonObject
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj->label;
|
return array('id'=>$obj->rowid, 'account_number'=>$obj->account_number, 'label'=>$obj->label);
|
||||||
} else {
|
} else {
|
||||||
$this->error = "Error ".$this->db->lasterror();
|
$this->error = "Error ".$this->db->lasterror();
|
||||||
dol_syslog(__METHOD__." ".$this->error, LOG_ERR);
|
dol_syslog(__METHOD__." ".$this->error, LOG_ERR);
|
||||||
@ -2006,7 +2012,21 @@ class BookKeepingLine
|
|||||||
public $label_operation;
|
public $label_operation;
|
||||||
public $debit;
|
public $debit;
|
||||||
public $credit;
|
public $credit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float Amount
|
||||||
|
* @deprecated see $amount
|
||||||
|
*/
|
||||||
public $montant;
|
public $montant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var float Amount
|
||||||
|
*/
|
||||||
|
public $amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Sens
|
||||||
|
*/
|
||||||
public $sens;
|
public $sens;
|
||||||
public $lettering_code;
|
public $lettering_code;
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ if (!empty($id)) {
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans('CustomersVentilation'), '', 'title_accountancy');
|
print load_fiche_titre($langs->trans('CustomersVentilation'), '', 'title_accountancy');
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -137,12 +137,12 @@ if (!empty($id)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -133,7 +133,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
setEventMessages($langs->trans("Save"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
|
|||||||
@ -357,12 +357,6 @@ if ($result) {
|
|||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoCustomer").'</span></br><br>';
|
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoCustomer").'</span></br><br>';
|
||||||
|
|
||||||
/*$topicmail="Information";
|
|
||||||
$modelmail="project";
|
|
||||||
$objecttmp=new Project($db);
|
|
||||||
$trackid='prj'.$object->id;
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';*/
|
|
||||||
|
|
||||||
if ($msg) print $msg.'<br>';
|
if ($msg) print $msg.'<br>';
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if (!empty($id)) {
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans('ExpenseReportsVentilation'), '', 'title_accountancy');
|
print load_fiche_titre($langs->trans('ExpenseReportsVentilation'), '', 'title_accountancy');
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -146,12 +146,12 @@ if (!empty($id)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -123,7 +123,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
setEventMessages($langs->trans("Save"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
@ -166,7 +166,7 @@ print '<script type="text/javascript">
|
|||||||
$sql = "SELECT er.ref, er.rowid as erid,";
|
$sql = "SELECT er.ref, er.rowid as erid,";
|
||||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
|
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht, erd.fk_code_ventilation, erd.tva_tx, erd.vat_src_code, erd.date,";
|
||||||
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
|
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label,";
|
||||||
$sql .= " u.rowid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
|
$sql .= " u.rowid as userid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
|
||||||
$sql .= " aa.label, aa.labelshort, aa.account_number";
|
$sql .= " aa.label, aa.labelshort, aa.account_number";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
|
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
||||||
@ -311,7 +311,7 @@ if ($result) {
|
|||||||
$expensereportstatic->ref = $objp->ref;
|
$expensereportstatic->ref = $objp->ref;
|
||||||
$expensereportstatic->id = $objp->erid;
|
$expensereportstatic->id = $objp->erid;
|
||||||
|
|
||||||
$userstatic->id = $objp->rowid;
|
$userstatic->id = $objp->userid;
|
||||||
$userstatic->ref = $objp->label;
|
$userstatic->ref = $objp->label;
|
||||||
$userstatic->login = $objp->login;
|
$userstatic->login = $objp->login;
|
||||||
$userstatic->statut = $objp->statut;
|
$userstatic->statut = $objp->statut;
|
||||||
|
|||||||
@ -190,7 +190,7 @@ if (empty($chartaccountcode))
|
|||||||
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut, er.date_valid,";
|
$sql = "SELECT er.ref, er.rowid as erid, er.date_debut, er.date_valid,";
|
||||||
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,";
|
$sql .= " erd.rowid, erd.fk_c_type_fees, erd.comments, erd.total_ht as price, erd.fk_code_ventilation, erd.tva_tx as tva_tx_line, erd.vat_src_code, erd.date,";
|
||||||
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
|
$sql .= " f.id as type_fees_id, f.code as type_fees_code, f.label as type_fees_label, f.accountancy_code as code_buy,";
|
||||||
$sql .= " u.rowid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
|
$sql .= " u.rowid as userid, u.login, u.lastname, u.firstname, u.email, u.gender, u.employee, u.photo, u.statut,";
|
||||||
$sql .= " aa.rowid as aarowid";
|
$sql .= " aa.rowid as aarowid";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
|
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport as er";
|
||||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."expensereport_det as erd ON er.rowid = erd.fk_expensereport";
|
||||||
@ -285,12 +285,6 @@ if ($result) {
|
|||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoExpenseReport").'</span></br><br>';
|
print '<span class="opacitymedium">'.$langs->trans("DescVentilTodoExpenseReport").'</span></br><br>';
|
||||||
|
|
||||||
/*$topicmail="Information";
|
|
||||||
$modelmail="project";
|
|
||||||
$objecttmp=new Project($db);
|
|
||||||
$trackid='prj'.$object->id;
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';*/
|
|
||||||
|
|
||||||
if ($msg) print $msg.'<br>';
|
if ($msg) print $msg.'<br>';
|
||||||
|
|
||||||
$moreforfilter = '';
|
$moreforfilter = '';
|
||||||
@ -356,7 +350,7 @@ if ($result) {
|
|||||||
$expensereport_static->ref = $objp->ref;
|
$expensereport_static->ref = $objp->ref;
|
||||||
$expensereport_static->id = $objp->erid;
|
$expensereport_static->id = $objp->erid;
|
||||||
|
|
||||||
$userstatic->id = $objp->rowid;
|
$userstatic->id = $objp->userid;
|
||||||
$userstatic->ref = $objp->label;
|
$userstatic->ref = $objp->label;
|
||||||
$userstatic->login = $objp->login;
|
$userstatic->login = $objp->login;
|
||||||
$userstatic->statut = $objp->statut;
|
$userstatic->statut = $objp->statut;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
@ -103,13 +103,19 @@ if ($conf->accounting->enabled)
|
|||||||
|
|
||||||
// STEPS
|
// STEPS
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -118,60 +124,45 @@ if ($conf->accounting->enabled)
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', $textlink, $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
if (!empty($conf->tax->enabled))
|
if (!empty($conf->tax->enabled))
|
||||||
{
|
{
|
||||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', $textlink, $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
/*if (! empty($conf->salaries->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
// htdocs/admin/salaries.php
|
|
||||||
print "<br>\n";
|
|
||||||
print "<br>\n";
|
|
||||||
}*/
|
|
||||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (! empty($conf->loan->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
if (! empty($conf->don->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
if (! empty($conf->adherents->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
@ -188,26 +179,34 @@ if ($conf->accounting->enabled)
|
|||||||
$langs->loadLangs(array('bills', 'trips'));
|
$langs->loadLangs(array('bills', 'trips'));
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
|
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))."<br>\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))."<br>\n";
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||||
*
|
*
|
||||||
@ -73,15 +73,18 @@ $date_endmonth = GETPOST('date_endmonth', 'int');
|
|||||||
$date_endday = GETPOST('date_endday', 'int');
|
$date_endday = GETPOST('date_endday', 'int');
|
||||||
$date_endyear = GETPOST('date_endyear', 'int');
|
$date_endyear = GETPOST('date_endyear', 'int');
|
||||||
$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09');
|
$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09');
|
||||||
if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
|
if ($in_bookkeeping == '') {
|
||||||
|
$in_bookkeeping = 'notyet';
|
||||||
|
}
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0 && empty($id_journal))
|
if ($user->socid > 0 && empty($id_journal)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -93,8 +96,7 @@ $error = 0;
|
|||||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||||
|
|
||||||
if (empty($date_startmonth) || empty($date_endmonth))
|
if (empty($date_startmonth) || empty($date_endmonth)) {
|
||||||
{
|
|
||||||
// Period by default on transfer
|
// Period by default on transfer
|
||||||
$dates = getDefaultDatesForTransfer();
|
$dates = getDefaultDatesForTransfer();
|
||||||
$date_start = $dates['date_start'];
|
$date_start = $dates['date_start'];
|
||||||
@ -103,8 +105,7 @@ if (empty($date_startmonth) || empty($date_endmonth))
|
|||||||
$pastmonth = $dates['pastmonth'];
|
$pastmonth = $dates['pastmonth'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
|
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
|
||||||
{
|
|
||||||
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
||||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||||
}
|
}
|
||||||
@ -124,19 +125,18 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
|
||||||
$sql .= " WHERE ba.fk_accountancy_journal=".$id_journal;
|
$sql .= " WHERE ba.fk_accountancy_journal=".$id_journal;
|
||||||
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||||
if ($date_start && $date_end)
|
if ($date_start && $date_end) {
|
||||||
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
|
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
|
||||||
|
}
|
||||||
// Define begin binding date
|
// Define begin binding date
|
||||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||||
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||||
}
|
}
|
||||||
// Already in bookkeeping or not
|
// Already in bookkeeping or not
|
||||||
if ($in_bookkeeping == 'already')
|
if ($in_bookkeeping == 'already') {
|
||||||
{
|
|
||||||
$sql .= " AND (b.rowid IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
$sql .= " AND (b.rowid IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
||||||
}
|
}
|
||||||
if ($in_bookkeeping == 'notyet')
|
if ($in_bookkeeping == 'notyet') {
|
||||||
{
|
|
||||||
$sql .= " AND (b.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
$sql .= " AND (b.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY b.datev";
|
$sql .= " ORDER BY b.datev";
|
||||||
@ -198,23 +198,28 @@ if ($result) {
|
|||||||
// one line for bank record = tabbq
|
// one line for bank record = tabbq
|
||||||
// one line for thirdparty record = tabtp
|
// one line for thirdparty record = tabtp
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
$lineisapurchase = -1;
|
$lineisapurchase = -1;
|
||||||
$lineisasale = -1;
|
$lineisasale = -1;
|
||||||
// Old method to detect if it's a sale or purchase
|
// Old method to detect if it's a sale or purchase
|
||||||
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase = 1;
|
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') {
|
||||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale = 1;
|
$lineisapurchase = 1;
|
||||||
// Try a more reliable method to detect if record is a supplier payment or a customer payment
|
}
|
||||||
if ($lineisapurchase < 0)
|
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') {
|
||||||
{
|
$lineisasale = 1;
|
||||||
if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
|
}
|
||||||
|
// Try a more reliable method to detect if record is a supplier payment or a customer payment
|
||||||
|
if ($lineisapurchase < 0) {
|
||||||
|
if ($obj->typeop_payment_supplier == 'payment_supplier') {
|
||||||
|
$lineisapurchase = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($lineisasale < 0) {
|
||||||
|
if ($obj->typeop_payment == 'payment') {
|
||||||
|
$lineisasale = 1;
|
||||||
}
|
}
|
||||||
if ($lineisasale < 0)
|
|
||||||
{
|
|
||||||
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
|
|
||||||
}
|
}
|
||||||
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
|
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
|
||||||
//var_dump($lineisapurchase); //var_dump($lineisasale);
|
//var_dump($lineisapurchase); //var_dump($lineisasale);
|
||||||
@ -224,10 +229,12 @@ if ($result) {
|
|||||||
|
|
||||||
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
|
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
|
||||||
$compta_soc = 'NotDefined';
|
$compta_soc = 'NotDefined';
|
||||||
if ($lineisapurchase > 0)
|
if ($lineisapurchase > 0) {
|
||||||
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
|
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
|
||||||
if ($lineisasale > 0)
|
}
|
||||||
|
if ($lineisasale > 0) {
|
||||||
$compta_soc = (!empty($obj->code_compta) ? $obj->code_compta : $account_customer);
|
$compta_soc = (!empty($obj->code_compta) ? $obj->code_compta : $account_customer);
|
||||||
|
}
|
||||||
|
|
||||||
$tabcompany[$obj->rowid] = array(
|
$tabcompany[$obj->rowid] = array(
|
||||||
'id' => $obj->socid,
|
'id' => $obj->socid,
|
||||||
@ -264,10 +271,6 @@ if ($result) {
|
|||||||
// Load of url links to the line into llx_bank
|
// Load of url links to the line into llx_bank
|
||||||
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
||||||
|
|
||||||
//var_dump($i);
|
|
||||||
//var_dump($tabpay);
|
|
||||||
//var_dump($tabcompany);
|
|
||||||
|
|
||||||
// By default
|
// By default
|
||||||
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
|
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
|
||||||
$tabtype[$obj->rowid] = 'unknown';
|
$tabtype[$obj->rowid] = 'unknown';
|
||||||
@ -277,17 +280,14 @@ if ($result) {
|
|||||||
if (is_array($links) && count($links) > 0) {
|
if (is_array($links) && count($links) > 0) {
|
||||||
// Now loop on each link of record in bank.
|
// Now loop on each link of record in bank.
|
||||||
foreach ($links as $key => $val) {
|
foreach ($links as $key => $val) {
|
||||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various')))
|
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
|
||||||
{
|
|
||||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||||
|
|
||||||
// We save tabtype for a future use, to remember what kind of payment it is
|
// We save tabtype for a future use, to remember what kind of payment it is
|
||||||
$tabpay[$obj->rowid]['type'] = $links[$key]['type'];
|
$tabpay[$obj->rowid]['type'] = $links[$key]['type'];
|
||||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||||
} elseif (in_array($links[$key]['type'], array('company', 'user')))
|
} elseif (in_array($links[$key]['type'], array('company', 'user'))) {
|
||||||
{
|
if ($tabpay[$obj->rowid]['type'] == 'unknown') {
|
||||||
if ($tabpay[$obj->rowid]['type'] == 'unknown')
|
|
||||||
{
|
|
||||||
// We can guess here it is a bank record for a thirdparty company or a user.
|
// We can guess here it is a bank record for a thirdparty company or a user.
|
||||||
// But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty.
|
// But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty.
|
||||||
}
|
}
|
||||||
@ -312,16 +312,23 @@ if ($result) {
|
|||||||
$societestatic->name = $links[$key]['label'];
|
$societestatic->name = $links[$key]['label'];
|
||||||
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
||||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
||||||
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
if ($compta_soc) {
|
||||||
|
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||||
|
}
|
||||||
} elseif ($links[$key]['type'] == 'user') {
|
} elseif ($links[$key]['type'] == 'user') {
|
||||||
$userstatic->id = $links[$key]['url_id'];
|
$userstatic->id = $links[$key]['url_id'];
|
||||||
$userstatic->name = $links[$key]['label'];
|
$userstatic->name = $links[$key]['label'];
|
||||||
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
||||||
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
|
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
|
||||||
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
|
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
|
||||||
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
if ($userstatic->id > 0) {
|
||||||
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
||||||
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
} else {
|
||||||
|
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
||||||
|
}
|
||||||
|
if ($compta_user) {
|
||||||
|
$tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
||||||
|
}
|
||||||
} elseif ($links[$key]['type'] == 'sc') {
|
} elseif ($links[$key]['type'] == 'sc') {
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
$chargestatic->id = $links[$key]['url_id'];
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
$chargestatic->ref = $links[$key]['url_id'];
|
||||||
@ -329,8 +336,9 @@ if ($result) {
|
|||||||
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
|
||||||
$reg = array();
|
$reg = array();
|
||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||||
if ($reg[1] == 'socialcontribution')
|
if ($reg[1] == 'socialcontribution') {
|
||||||
$reg[1] = 'SocialContribution';
|
$reg[1] = 'SocialContribution';
|
||||||
|
}
|
||||||
$chargestatic->label = $langs->trans($reg[1]);
|
$chargestatic->label = $langs->trans($reg[1]);
|
||||||
} else {
|
} else {
|
||||||
$chargestatic->label = $links[$key]['label'];
|
$chargestatic->label = $links[$key]['label'];
|
||||||
@ -339,7 +347,7 @@ if ($result) {
|
|||||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||||
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
||||||
|
|
||||||
// Retreive the accounting code of the social contribution of the payment from link of payment.
|
// Retrieve the accounting code of the social contribution of the payment from link of payment.
|
||||||
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
||||||
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
$sqlmid = 'SELECT cchgsoc.accountancy_code';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
||||||
@ -430,28 +438,29 @@ if ($result) {
|
|||||||
|
|
||||||
// If no links were found to know the amount on thirdparty, we try to guess it.
|
// If no links were found to know the amount on thirdparty, we try to guess it.
|
||||||
// This may happens on bank entries without the links lines to 'company'.
|
// This may happens on bank entries without the links lines to 'company'.
|
||||||
if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) // If we dont find 'company' link because it is an old 'withdraw' record
|
if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) { // If we dont find 'company' link because it is an old 'withdraw' record
|
||||||
{
|
|
||||||
foreach ($links as $key => $val) {
|
foreach ($links as $key => $val) {
|
||||||
if ($links[$key]['type'] == 'payment') {
|
if ($links[$key]['type'] == 'payment') {
|
||||||
// Get thirdparty
|
// Get thirdparty
|
||||||
$tmppayment->fetch($links[$key]['url_id']);
|
$tmppayment->fetch($links[$key]['url_id']);
|
||||||
$arrayofamounts = $tmppayment->getAmountsArray();
|
$arrayofamounts = $tmppayment->getAmountsArray();
|
||||||
foreach ($arrayofamounts as $invoiceid => $amount)
|
if (is_array($arrayofamounts)) {
|
||||||
{
|
foreach ($arrayofamounts as $invoiceid => $amount) {
|
||||||
$tmpinvoice->fetch($invoiceid);
|
$tmpinvoice->fetch($invoiceid);
|
||||||
$tmpinvoice->fetch_thirdparty();
|
$tmpinvoice->fetch_thirdparty();
|
||||||
if ($tmpinvoice->thirdparty->code_compta)
|
if ($tmpinvoice->thirdparty->code_compta) {
|
||||||
{
|
|
||||||
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
|
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
|
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
|
||||||
if (empty($tabtp[$obj->rowid])) $tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
|
if (empty($tabtp[$obj->rowid])) {
|
||||||
|
$tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
|
||||||
|
}
|
||||||
|
|
||||||
// Check account number is ok
|
// Check account number is ok
|
||||||
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
||||||
@ -492,8 +501,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($tabpay as $key => $val) // $key is rowid into llx_bank
|
foreach ($tabpay as $key => $val) { // $key is rowid into llx_bank
|
||||||
{
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
@ -511,17 +519,18 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
var_dump($tabbq);exit;*/
|
var_dump($tabbq);exit;*/
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
if (!$errorforline && is_array($tabbq[$key]))
|
if (!$errorforline && is_array($tabbq[$key])) {
|
||||||
{
|
|
||||||
// Line into bank account
|
// Line into bank account
|
||||||
foreach ($tabbq[$key] as $k => $mt)
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
{
|
if ($mt) {
|
||||||
if ($mt)
|
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
||||||
if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
if (!empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||||
|
}
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
@ -554,8 +563,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
@ -570,18 +578,16 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (!$errorforline)
|
if (!$errorforline) {
|
||||||
{
|
if (is_array($tabtp[$key])) {
|
||||||
if (is_array($tabtp[$key]))
|
|
||||||
{
|
|
||||||
// Line into thirdparty account
|
// Line into thirdparty account
|
||||||
foreach ($tabtp[$key] as $k => $mt) {
|
foreach ($tabtp[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
if (!empty($val['lib'])) {
|
||||||
if ($tabtype[$key] == 'banktransfert')
|
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'banktransfert') {
|
||||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||||
} else {
|
} else {
|
||||||
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
||||||
@ -681,8 +687,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else {
|
} else {
|
||||||
if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
|
if ($tabtype[$key] == 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty.
|
||||||
{
|
|
||||||
// Temporary account
|
// Temporary account
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
@ -700,8 +705,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
@ -715,10 +719,11 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
} else { // If thirdparty unknown, output the waiting account
|
} else { // If thirdparty unknown, output the waiting account
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
@ -745,8 +750,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
@ -761,23 +765,20 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))
|
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Try to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors');
|
setEventMessages('Try to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$errorforline)
|
if (!$errorforline) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
//print 'KO for line '.$key.' '.$error.'<br>';
|
//print 'KO for line '.$key.' '.$error.'<br>';
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
$MAXNBERRORS = 5;
|
$MAXNBERRORS = 5;
|
||||||
if ($error >= $MAXNBERRORS)
|
if ($error >= $MAXNBERRORS) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors');
|
setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors');
|
||||||
break; // Break in the foreach
|
break; // Break in the foreach
|
||||||
}
|
}
|
||||||
@ -786,8 +787,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
if (empty($error) && count($tabpay) > 0) {
|
if (empty($error) && count($tabpay) > 0) {
|
||||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||||
} elseif (count($tabpay) == $error)
|
} elseif (count($tabpay) == $error) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||||
@ -796,8 +796,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$action = '';
|
$action = '';
|
||||||
|
|
||||||
// Must reload data, so we make a redirect
|
// Must reload data, so we make a redirect
|
||||||
if (count($tabpay) != $error)
|
if (count($tabpay) != $error) {
|
||||||
{
|
|
||||||
$param = 'id_journal='.$id_journal;
|
$param = 'id_journal='.$id_journal;
|
||||||
$param .= '&date_startday='.$date_startday;
|
$param .= '&date_startday='.$date_startday;
|
||||||
$param .= '&date_startmonth='.$date_startmonth;
|
$param .= '&date_startmonth='.$date_startmonth;
|
||||||
@ -835,26 +834,28 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
|
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
foreach ($tabpay as $key => $val)
|
foreach ($tabpay as $key => $val) {
|
||||||
{
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
||||||
if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
if (!empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||||
|
}
|
||||||
|
|
||||||
print '"'.$key.'"'.$sep;
|
print '"'.$key.'"'.$sep;
|
||||||
print '"'.$date.'"'.$sep;
|
print '"'.$date.'"'.$sep;
|
||||||
print '"'.$val["type_payment"].'"'.$sep;
|
print '"'.$val["type_payment"].'"'.$sep;
|
||||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||||
print " ".$sep;
|
print " ".$sep;
|
||||||
print '"'.$reflabel.'"'.$sep;
|
print '"'.$reflabel.'"'.$sep;
|
||||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||||
@ -868,12 +869,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ($tabtp[$key] as $k => $mt) {
|
foreach ($tabtp[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
if (!empty($val['lib'])) {
|
||||||
if ($tabtype[$key] == 'banktransfert')
|
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'banktransfert') {
|
||||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||||
} else {
|
} else {
|
||||||
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
||||||
@ -882,7 +883,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.$key.'"'.$sep;
|
print '"'.$key.'"'.$sep;
|
||||||
print '"'.$date.'"'.$sep;
|
print '"'.$date.'"'.$sep;
|
||||||
print '"'.$val["type_payment"].'"'.$sep;
|
print '"'.$val["type_payment"].'"'.$sep;
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
if ($tabtype[$key] == 'payment_supplier') {
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
||||||
} elseif ($tabtype[$key] == 'payment') {
|
} elseif ($tabtype[$key] == 'payment') {
|
||||||
@ -892,7 +893,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
} elseif ($tabtype[$key] == 'payment_salary') {
|
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||||
print '"'.$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT.'"'.$sep;
|
print '"'.$conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT.'"'.$sep;
|
||||||
} else {
|
} else {
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
}
|
}
|
||||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.$reflabel.'"'.$sep;
|
print '"'.$reflabel.'"'.$sep;
|
||||||
@ -905,17 +906,18 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
}
|
}
|
||||||
} else { // If thirdparty unkown, output the waiting account
|
} else { // If thirdparty unkown, output the waiting account
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
||||||
|
|
||||||
print '"'.$key.'"'.$sep;
|
print '"'.$key.'"'.$sep;
|
||||||
print '"'.$date.'"'.$sep;
|
print '"'.$date.'"'.$sep;
|
||||||
print '"'.$val["type_payment"].'"'.$sep;
|
print '"'.$val["type_payment"].'"'.$sep;
|
||||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
||||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
print '"'.length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE).'"'.$sep;
|
||||||
print "".$sep;
|
print "".$sep;
|
||||||
print '"'.$reflabel.'"'.$sep;
|
print '"'.$reflabel.'"'.$sep;
|
||||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||||
@ -965,15 +967,18 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
||||||
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
|
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj->nb > 0)
|
if ($obj->nb > 0) {
|
||||||
{
|
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
|
||||||
print '<br>'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
|
$desc = ' : '.$langs->trans("AccountancyAreaDescBank", 9, '{link}');
|
||||||
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>');
|
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>', $desc);
|
||||||
|
print $desc;
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
} else dol_print_error($db);
|
|
||||||
|
|
||||||
|
|
||||||
// Button to write into Ledger
|
// Button to write into Ledger
|
||||||
@ -987,14 +992,19 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
print '<div class="tabsAction tabsActionNoBottom">';
|
print '<div class="tabsAction tabsActionNoBottom">';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
|
||||||
|
print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||||
|
}
|
||||||
|
|
||||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
||||||
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||||
} else {
|
} else {
|
||||||
if ($in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />';
|
if ($in_bookkeeping == 'notyet') {
|
||||||
else print '<a class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>';
|
print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />';
|
||||||
|
} else {
|
||||||
|
print '<a class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -1037,21 +1047,22 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
$r = '';
|
$r = '';
|
||||||
|
|
||||||
foreach ($tabpay as $key => $val) // $key is rowid in llx_bank
|
foreach ($tabpay as $key => $val) { // $key is rowid in llx_bank
|
||||||
{
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ($tabbq[$key] as $k => $mt)
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
{
|
if ($mt) {
|
||||||
if ($mt)
|
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= $val['lib']." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= $val['lib']." - ";
|
||||||
|
}
|
||||||
$reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref'];
|
$reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref'];
|
||||||
if (!empty($val['soclib'])) $reflabel .= " - ".$val['soclib'];
|
if (!empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - ".$val['soclib'];
|
||||||
|
}
|
||||||
|
|
||||||
//var_dump($tabpay[$key]);
|
//var_dump($tabpay[$key]);
|
||||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||||
@ -1061,10 +1072,11 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Ledger account
|
// Ledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accounttoshow = length_accountg($k);
|
$accounttoshow = length_accountg($k);
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||||
{
|
|
||||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||||
} else print $accounttoshow;
|
} else {
|
||||||
|
print $accounttoshow;
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
@ -1088,12 +1100,12 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ($tabtp[$key] as $k => $mt) {
|
foreach ($tabtp[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= $val['lib'].($val['soclib'] ? " - " : "");
|
if (!empty($val['lib'])) {
|
||||||
if ($tabtype[$key] == 'banktransfert')
|
$reflabel .= $val['lib'].($val['soclib'] ? " - " : "");
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'banktransfert') {
|
||||||
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
||||||
} else {
|
} else {
|
||||||
$reflabel .= $val['soclib'];
|
$reflabel .= $val['soclib'];
|
||||||
@ -1107,21 +1119,32 @@ if (empty($action) || $action == 'view') {
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
$account_ledger = $k;
|
$account_ledger = $k;
|
||||||
// Try to force general ledger account depending on type
|
// Try to force general ledger account depending on type
|
||||||
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
if ($tabtype[$key] == 'payment') {
|
||||||
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
}
|
||||||
if ($tabtype[$key] == 'payment_salary') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
|
$account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
|
}
|
||||||
if ($tabtype[$key] == 'payment_various') $account_ledger = $tabpay[$key]["account_various"];
|
if ($tabtype[$key] == 'payment_expensereport') {
|
||||||
$accounttoshow = length_accounta($account_ledger);
|
$account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
}
|
||||||
{
|
if ($tabtype[$key] == 'payment_salary') {
|
||||||
if ($tabtype[$key] == 'unknown')
|
$account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_vat') {
|
||||||
|
$account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'member') {
|
||||||
|
$account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_various') {
|
||||||
|
$account_ledger = $tabpay[$key]["account_various"];
|
||||||
|
}
|
||||||
|
$accounttoshow = length_accountg($account_ledger);
|
||||||
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||||
|
if ($tabtype[$key] == 'unknown') {
|
||||||
// We will accept writing, but into a waiting account
|
// We will accept writing, but into a waiting account
|
||||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1')
|
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
|
||||||
{
|
|
||||||
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||||
@ -1129,32 +1152,42 @@ if (empty($action) || $action == 'view') {
|
|||||||
} else {
|
} else {
|
||||||
// We will refuse writing
|
// We will refuse writing
|
||||||
$errorstring = 'UnknownAccountForThirdpartyBlocking';
|
$errorstring = 'UnknownAccountForThirdpartyBlocking';
|
||||||
if ($tabtype[$key] == 'payment') $errorstring = 'MainAccountForCustomersNotDefined';
|
if ($tabtype[$key] == 'payment') {
|
||||||
if ($tabtype[$key] == 'payment_supplier') $errorstring = 'MainAccountForSuppliersNotDefined';
|
$errorstring = 'MainAccountForCustomersNotDefined';
|
||||||
if ($tabtype[$key] == 'payment_expensereport') $errorstring = 'MainAccountForUsersNotDefined';
|
}
|
||||||
if ($tabtype[$key] == 'payment_salary') $errorstring = 'MainAccountForUsersNotDefined';
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
if ($tabtype[$key] == 'payment_vat') $errorstring = 'MainAccountForVatPaymentNotDefined';
|
$errorstring = 'MainAccountForSuppliersNotDefined';
|
||||||
if ($tabtype[$key] == 'member') $errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_expensereport') {
|
||||||
|
$errorstring = 'MainAccountForUsersNotDefined';
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_salary') {
|
||||||
|
$errorstring = 'MainAccountForUsersNotDefined';
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_vat') {
|
||||||
|
$errorstring = 'MainAccountForVatPaymentNotDefined';
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'member') {
|
||||||
|
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
||||||
|
}
|
||||||
print '<span class="error">'.$langs->trans($errorstring).'</span>';
|
print '<span class="error">'.$langs->trans($errorstring).'</span>';
|
||||||
}
|
}
|
||||||
} else print $accounttoshow;
|
} else {
|
||||||
|
print $accounttoshow;
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) // Type of payment with subledger
|
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger
|
||||||
{
|
|
||||||
$accounttoshowsubledger = length_accounta($k);
|
$accounttoshowsubledger = length_accounta($k);
|
||||||
if ($accounttoshow != $accounttoshowsubledger)
|
if ($accounttoshow != $accounttoshowsubledger) {
|
||||||
{
|
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
|
||||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
|
||||||
{
|
|
||||||
/*var_dump($tabpay[$key]);
|
/*var_dump($tabpay[$key]);
|
||||||
var_dump($tabtype[$key]);
|
var_dump($tabtype[$key]);
|
||||||
var_dump($tabbq[$key]);*/
|
var_dump($tabbq[$key]);*/
|
||||||
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||||
if (!empty($tabcompany[$key]['code_compta']))
|
if (!empty($tabcompany[$key]['code_compta'])) {
|
||||||
{
|
|
||||||
if (in_array($tabtype[$key], array('payment_various'))) {
|
if (in_array($tabtype[$key], array('payment_various'))) {
|
||||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||||
@ -1164,7 +1197,9 @@ if (empty($action) || $action == 'view') {
|
|||||||
} else {
|
} else {
|
||||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||||
}
|
}
|
||||||
} else print $accounttoshowsubledger;
|
} else {
|
||||||
|
print $accounttoshowsubledger;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -1177,10 +1212,11 @@ if (empty($action) || $action == 'view') {
|
|||||||
}
|
}
|
||||||
} else { // Waiting account
|
} else { // Waiting account
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= $val['lib']." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= $val['lib']." - ";
|
||||||
|
}
|
||||||
$reflabel .= 'WaitingAccount';
|
$reflabel .= 'WaitingAccount';
|
||||||
|
|
||||||
print '<!-- Wait bank.rowid='.$key.' -->';
|
print '<!-- Wait bank.rowid='.$key.' -->';
|
||||||
@ -1264,78 +1300,67 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sqlmid = '';
|
$sqlmid = '';
|
||||||
if ($typerecord == 'payment')
|
if ($typerecord == 'payment') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
||||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"];
|
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("Invoice");
|
$ref = $langs->transnoentitiesnoconv("Invoice");
|
||||||
} elseif ($typerecord == 'payment_supplier')
|
} elseif ($typerecord == 'payment_supplier') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
|
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
$sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".$val["paymentsupplierid"];
|
$sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".$val["paymentsupplierid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("SupplierInvoice");
|
$ref = $langs->transnoentitiesnoconv("SupplierInvoice");
|
||||||
} elseif ($typerecord == 'payment_expensereport')
|
} elseif ($typerecord == 'payment_expensereport') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT e.rowid as id, e.ref';
|
$sqlmid = 'SELECT e.rowid as id, e.ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as pe, ".MAIN_DB_PREFIX."expensereport as e";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as pe, ".MAIN_DB_PREFIX."expensereport as e";
|
||||||
$sqlmid .= " WHERE pe.rowid=".$val["paymentexpensereport"]." AND pe.fk_expensereport = e.rowid";
|
$sqlmid .= " WHERE pe.rowid=".$val["paymentexpensereport"]." AND pe.fk_expensereport = e.rowid";
|
||||||
$ref = $langs->transnoentitiesnoconv("ExpenseReport");
|
$ref = $langs->transnoentitiesnoconv("ExpenseReport");
|
||||||
} elseif ($typerecord == 'payment_salary')
|
} elseif ($typerecord == 'payment_salary') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT s.rowid as ref';
|
$sqlmid = 'SELECT s.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||||
$sqlmid .= " WHERE s.rowid=".$val["paymentsalid"];
|
$sqlmid .= " WHERE s.rowid=".$val["paymentsalid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("SalaryPayment");
|
$ref = $langs->transnoentitiesnoconv("SalaryPayment");
|
||||||
} elseif ($typerecord == 'sc')
|
} elseif ($typerecord == 'sc') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT sc.rowid as ref';
|
$sqlmid = 'SELECT sc.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc";
|
||||||
$sqlmid .= " WHERE sc.rowid=".$val["paymentscid"];
|
$sqlmid .= " WHERE sc.rowid=".$val["paymentscid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("SocialContribution");
|
$ref = $langs->transnoentitiesnoconv("SocialContribution");
|
||||||
} elseif ($typerecord == 'payment_vat')
|
} elseif ($typerecord == 'payment_vat') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT v.rowid as ref';
|
$sqlmid = 'SELECT v.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v";
|
||||||
$sqlmid .= " WHERE v.rowid=".$val["paymentvatid"];
|
$sqlmid .= " WHERE v.rowid=".$val["paymentvatid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("PaymentVat");
|
$ref = $langs->transnoentitiesnoconv("PaymentVat");
|
||||||
} elseif ($typerecord == 'payment_donation')
|
} elseif ($typerecord == 'payment_donation') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT payd.fk_donation as ref';
|
$sqlmid = 'SELECT payd.fk_donation as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd";
|
||||||
$sqlmid .= " WHERE payd.fk_donation=".$val["paymentdonationid"];
|
$sqlmid .= " WHERE payd.fk_donation=".$val["paymentdonationid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("Donation");
|
$ref = $langs->transnoentitiesnoconv("Donation");
|
||||||
} elseif ($typerecord == 'payment_loan')
|
} elseif ($typerecord == 'payment_loan') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT l.rowid as ref';
|
$sqlmid = 'SELECT l.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l";
|
||||||
$sqlmid .= " WHERE l.rowid=".$val["paymentloanid"];
|
$sqlmid .= " WHERE l.rowid=".$val["paymentloanid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("LoanPayment");
|
$ref = $langs->transnoentitiesnoconv("LoanPayment");
|
||||||
} elseif ($typerecord == 'payment_various')
|
} elseif ($typerecord == 'payment_various') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT v.rowid as ref';
|
$sqlmid = 'SELECT v.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||||
$sqlmid .= " WHERE v.rowid=".$val["paymentvariousid"];
|
$sqlmid .= " WHERE v.rowid=".$val["paymentvariousid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("VariousPayment");
|
$ref = $langs->transnoentitiesnoconv("VariousPayment");
|
||||||
}
|
}
|
||||||
// Add warning
|
// Add warning
|
||||||
if (empty($sqlmid))
|
if (empty($sqlmid)) {
|
||||||
{
|
|
||||||
dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING);
|
dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sqlmid)
|
if ($sqlmid) {
|
||||||
{
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG);
|
||||||
$resultmid = $db->query($sqlmid);
|
$resultmid = $db->query($sqlmid);
|
||||||
if ($resultmid)
|
if ($resultmid) {
|
||||||
{
|
while ($objmid = $db->fetch_object($resultmid)) {
|
||||||
while ($objmid = $db->fetch_object($resultmid))
|
|
||||||
{
|
|
||||||
$ref .= ' '.$objmid->ref;
|
$ref .= ' '.$objmid->ref;
|
||||||
}
|
}
|
||||||
} else dol_print_error($db);
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
|
$ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
|
||||||
|
|||||||
@ -669,7 +669,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '""'.$sep;
|
print '""'.$sep;
|
||||||
print '"'.$langs->trans("VAT").' - '.$def_tva[$key].'"'.$sep;
|
print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
||||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||||
|
|||||||
@ -628,7 +628,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||||
print '""'.$sep;
|
print '""'.$sep;
|
||||||
print '"'.$langs->trans("VAT").' - '.$def_tva[$key].' %"'.$sep;
|
print '"'.$langs->trans("VAT").' - '.join(', ', $def_tva[$key][$k]).' %"'.$sep;
|
||||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '').'"'.$sep;
|
||||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if (!empty($id)) {
|
|||||||
|
|
||||||
print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_accountancy');
|
print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_accountancy');
|
||||||
|
|
||||||
dol_fiche_head();
|
print dol_get_fiche_head();
|
||||||
|
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
|
|
||||||
@ -141,12 +141,12 @@ if (!empty($id)) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
dol_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '<div class="center">';
|
print '<div class="center">';
|
||||||
print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
|
print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -135,7 +135,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
|||||||
}
|
}
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$db->commit();
|
$db->commit();
|
||||||
setEventMessages($langs->trans('Save'), null, 'mesgs');
|
setEventMessages($langs->trans("Save"), null, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user