Compare commits
309 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfd01b6060 | ||
|
|
a2e93056f7 | ||
|
|
6905842794 | ||
|
|
e536e10269 | ||
|
|
06754068ff | ||
|
|
96bc2023f3 | ||
|
|
46d122c43a | ||
|
|
97030b05ce | ||
|
|
70b73f2d51 | ||
|
|
5afed31265 | ||
|
|
80989fd2c9 | ||
|
|
ff6dc32827 | ||
|
|
299e34f3ee | ||
|
|
68ee482915 | ||
|
|
ebdaf7dfa6 | ||
|
|
c40c695d20 | ||
|
|
98351d6fec | ||
|
|
67bdfa2617 | ||
|
|
686348a0d6 | ||
|
|
da959c5cf0 | ||
|
|
c6093fff3e | ||
|
|
d4466a652a | ||
|
|
c9e8c362a5 | ||
|
|
de1625b9de | ||
|
|
8b633aee66 | ||
|
|
d30c64413d | ||
|
|
2d3915b88c | ||
|
|
932c3f9172 | ||
|
|
7e03aaee23 | ||
|
|
96b6f0d8fb | ||
|
|
67462a81a8 | ||
|
|
b0b5e95c7f | ||
|
|
9334cf8fd1 | ||
|
|
ba9796a438 | ||
|
|
298396a57e | ||
|
|
6ed87f43de | ||
|
|
b1b2038d71 | ||
|
|
0df45f10c1 | ||
|
|
a136e90749 | ||
|
|
41cdb65521 | ||
|
|
dd3f5a32d3 | ||
|
|
ebf68ecbe0 | ||
|
|
c1c0fa88c2 | ||
|
|
b47dc8a394 | ||
|
|
61df71cc64 | ||
|
|
11042fe499 | ||
|
|
064fad136e | ||
|
|
0dc4130a17 | ||
|
|
056ab63680 | ||
|
|
480111c6b1 | ||
|
|
5c8731b197 | ||
|
|
aa7e74f4c8 | ||
|
|
1b67a9faf1 | ||
|
|
eaacfabdf6 | ||
|
|
c215898c52 | ||
|
|
7af4d91828 | ||
|
|
452feca64a | ||
|
|
2a137cd126 | ||
|
|
3d6f1d911a | ||
|
|
70354def7c | ||
|
|
5f4947e3c1 | ||
|
|
cdc408a84c | ||
|
|
21f7271e51 | ||
|
|
7e98cfd5b6 | ||
|
|
02e053acc6 | ||
|
|
e6ec797af8 | ||
|
|
7c1fc2fee1 | ||
|
|
1435a3eec7 | ||
|
|
198e2cdcfa | ||
|
|
cb7f29b332 | ||
|
|
dfbc2814e7 | ||
|
|
23e727048e | ||
|
|
3e3dbf850f | ||
|
|
b9aa80c4ca | ||
|
|
84ee18a11b | ||
|
|
c5054c41cf | ||
|
|
e37fc87cd5 | ||
|
|
1978eebb69 | ||
|
|
4b741c6b9c | ||
|
|
a462cd232d | ||
|
|
4a88c9ea9f | ||
|
|
c3acee56e2 | ||
|
|
9e2a056221 | ||
|
|
3fea57f83b | ||
|
|
8edf3c65c6 | ||
|
|
99c99570cc | ||
|
|
4e9b339439 | ||
|
|
c0862762a5 | ||
|
|
3f9efc537b | ||
|
|
a209d18649 | ||
|
|
02784c89f9 | ||
|
|
b3ed99ddc1 | ||
|
|
955fad910d | ||
|
|
00aa5aace7 | ||
|
|
7d7a978ba0 | ||
|
|
d2b221cfd1 | ||
|
|
eb98bd1e78 | ||
|
|
12702ee128 | ||
|
|
3dec67ffdf | ||
|
|
7105fabb79 | ||
|
|
64e35255ae | ||
|
|
a7d03af4af | ||
|
|
1694481df8 | ||
|
|
c86d4b51b1 | ||
|
|
a7020506aa | ||
|
|
10a925f7b4 | ||
|
|
7bad058f47 | ||
|
|
ee08c4afc4 | ||
|
|
b4160c7f81 | ||
|
|
281eaf2987 | ||
|
|
bd632cf2b0 | ||
|
|
eb504ffacc | ||
|
|
b1122b55d4 | ||
|
|
4a0ea97772 | ||
|
|
38957f7fb7 | ||
|
|
e6806611a6 | ||
|
|
901f952cb9 | ||
|
|
e72f4cb063 | ||
|
|
ae87a270e4 | ||
|
|
2ce00b2956 | ||
|
|
cbcb79b1eb | ||
|
|
e6033369a8 | ||
|
|
1b9039af36 | ||
|
|
208bf2545f | ||
|
|
37da315af6 | ||
|
|
9a2259c681 | ||
|
|
a6d8f943df | ||
|
|
1608fec937 | ||
|
|
f353464bce | ||
|
|
a1a5eba2de | ||
|
|
041fa8d3f3 | ||
|
|
bc6d04e495 | ||
|
|
ddd0f8224f | ||
|
|
ad087a75e6 | ||
|
|
85d788d43a | ||
|
|
1caf148dc6 | ||
|
|
c8da4ee9f3 | ||
|
|
8c0dffd24e | ||
|
|
973e42d10f | ||
|
|
677cba01ce | ||
|
|
a30f7d543a | ||
|
|
91ce70a6e9 | ||
|
|
da51a28766 | ||
|
|
7bde781206 | ||
|
|
d64664f5a7 | ||
|
|
dc6496fdf3 | ||
|
|
4481c4f978 | ||
|
|
295d83001a | ||
|
|
54b6ff02c0 | ||
|
|
a456d21249 | ||
|
|
758b8e1f7e | ||
|
|
c04743aa84 | ||
|
|
3fbe10a578 | ||
|
|
9f27e2323f | ||
|
|
4bf6cf4e65 | ||
|
|
e8fc5f0d3a | ||
|
|
eba5832d3a | ||
|
|
e31a8f25a2 | ||
|
|
c0d29d2a15 | ||
|
|
30f0b6e2e8 | ||
|
|
c77eaeaa77 | ||
|
|
94fdff9a46 | ||
|
|
07d24a9a05 | ||
|
|
45d6635bf6 | ||
|
|
2dedea8736 | ||
|
|
5dba9ef54e | ||
|
|
ee4eb13fff | ||
|
|
07226d32ec | ||
|
|
4233d24f4b | ||
|
|
80f19de223 | ||
|
|
0c4f7a1b22 | ||
|
|
a627e32fca | ||
|
|
1f8b05264f | ||
|
|
6c379029fa | ||
|
|
f615927d24 | ||
|
|
85a58f666a | ||
|
|
0cbf8ca1dd | ||
|
|
28196a5fd9 | ||
|
|
5082b1cc66 | ||
|
|
bd368fd1e5 | ||
|
|
508b11733a | ||
|
|
2f1a1c5111 | ||
|
|
835700bb25 | ||
|
|
04ffe1c7f0 | ||
|
|
76eeb0d2f1 | ||
|
|
0e511027f6 | ||
|
|
9693982f27 | ||
|
|
d16efbaf24 | ||
|
|
21880589d0 | ||
|
|
a7d2bdc2c1 | ||
|
|
c21354101f | ||
|
|
53fb085766 | ||
|
|
ec7e4cb3d4 | ||
|
|
0880b13142 | ||
|
|
be460b6cbf | ||
|
|
8e9e2911ae | ||
|
|
73da011461 | ||
|
|
0a92849de3 | ||
|
|
85068ec4e9 | ||
|
|
06f752b250 | ||
|
|
43f3999234 | ||
|
|
c3b7bbfb3b | ||
|
|
6895daa5e9 | ||
|
|
b4af55ab40 | ||
|
|
b75923871c | ||
|
|
5b1e20494b | ||
|
|
85c0ed39f1 | ||
|
|
2a2155a239 | ||
|
|
93be4305c4 | ||
|
|
bad28c6d92 | ||
|
|
eac80d7db4 | ||
|
|
c7546dbad2 | ||
|
|
b3be7f65cd | ||
|
|
81a8933256 | ||
|
|
f65829ec42 | ||
|
|
816bacc37e | ||
|
|
924db5b8aa | ||
|
|
8925717bbe | ||
|
|
9a9be97c2c | ||
|
|
52bd90f950 | ||
|
|
019575d9ed | ||
|
|
aaa6f00d11 | ||
|
|
f041c017e9 | ||
|
|
b0419557b1 | ||
|
|
98c32fa1ec | ||
|
|
71fa347e8e | ||
|
|
350345ecca | ||
|
|
722a133b31 | ||
|
|
d4aeb8b3bc | ||
|
|
04aba8ce96 | ||
|
|
9b8bb114cd | ||
|
|
c639e82062 | ||
|
|
e6ab6bdb8e | ||
|
|
7a0206adce | ||
|
|
98b887edae | ||
|
|
42ae4e10b3 | ||
|
|
6b98c50510 | ||
|
|
4a96fc5f62 | ||
|
|
972c364c37 | ||
|
|
0ce7cad48c | ||
|
|
57f0d0b327 | ||
|
|
7673a73a65 | ||
|
|
8377d6967a | ||
|
|
a6f0baefc1 | ||
|
|
0cab08b2f3 | ||
|
|
d69e76168f | ||
|
|
f0a3bca4c2 | ||
|
|
a4fafae109 | ||
|
|
4a52d3c1b1 | ||
|
|
84a152dc2e | ||
|
|
01854b3259 | ||
|
|
728f469c1e | ||
|
|
3bbedf1795 | ||
|
|
b4c3804c91 | ||
|
|
d36a463221 | ||
|
|
875d1d078d | ||
|
|
3d04de201e | ||
|
|
b0be2b04c7 | ||
|
|
f6b8c3a130 | ||
|
|
121d2beb80 | ||
|
|
f220f584ce | ||
|
|
126b5d6eca | ||
|
|
f33157033c | ||
|
|
87a102f5c8 | ||
|
|
4d11205a01 | ||
|
|
600dbced7e | ||
|
|
8d829dca32 | ||
|
|
e78ebf041a | ||
|
|
58cac2d895 | ||
|
|
fe78996026 | ||
|
|
375e61de2e | ||
|
|
5777c16b72 | ||
|
|
fdf9617e42 | ||
|
|
d499fafdb9 | ||
|
|
60debe31c4 | ||
|
|
cbff03ca08 | ||
|
|
316b7453e4 | ||
|
|
80d2445540 | ||
|
|
ad82135879 | ||
|
|
75bcb7e53f | ||
|
|
f566b38296 | ||
|
|
fa088eb6cc | ||
|
|
b0cf9bd0be | ||
|
|
63d447d1a7 | ||
|
|
9b797c1831 | ||
|
|
015dedc3ab | ||
|
|
e1ea2215a3 | ||
|
|
0543a31920 | ||
|
|
f319976e5d | ||
|
|
fb34f25701 | ||
|
|
14ec86047f | ||
|
|
4bb21fd218 | ||
|
|
f3421bcf6d | ||
|
|
77371af35a | ||
|
|
69ac75bef8 | ||
|
|
337643e53e | ||
|
|
c534f5bcd5 | ||
|
|
876ab4bb59 | ||
|
|
c0136daeb5 | ||
|
|
d4ee183662 | ||
|
|
09f3cd6f1d | ||
|
|
497bc91493 | ||
|
|
0b4a1b827a | ||
|
|
826cc6db1b | ||
|
|
df4f09e72f | ||
|
|
384c89dcef | ||
|
|
e886c89e06 | ||
|
|
00f0aff6f0 | ||
|
|
f3ef9b868f |
418
.travis.yml
@@ -1,146 +1,306 @@
|
||||
# This script is used by Travis CI to run automatically Continuous test integration
|
||||
# from Dolibarr GitHub repository.
|
||||
# Command run is phpunit
|
||||
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
|
||||
|
||||
sudo: required
|
||||
|
||||
language: php
|
||||
|
||||
php:
|
||||
- '5.3'
|
||||
- '5.4'
|
||||
- '5.5'
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
- nightly
|
||||
|
||||
addons:
|
||||
mariadb: '10.0'
|
||||
# FIXME: find a way to import a MySQL dump into PostgreSQL
|
||||
#postgresql: '9.3'
|
||||
apt:
|
||||
packages:
|
||||
# We need a webserver to test the webservices
|
||||
# Let's install Apache with.
|
||||
- apache2
|
||||
# mod_php is not supported by Travis. Add fcgi. We install FPM later on.
|
||||
- libapache2-mod-fastcgi
|
||||
|
||||
# Start on every boot
|
||||
services:
|
||||
- memcached
|
||||
|
||||
env:
|
||||
global:
|
||||
# Set to true for very verbose output
|
||||
- DEBUG=false
|
||||
matrix:
|
||||
# MariaDB overrides MySQL installation so it's not possible to test both yet
|
||||
#- DB=mysql
|
||||
- DB=mariadb
|
||||
# FIXME: find a way to import a MySQL dump into PostgreSQL
|
||||
#- DB=postgresql
|
||||
# TODO
|
||||
#- DB=sqlite
|
||||
# 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
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: '7.0'
|
||||
- php: nightly
|
||||
# FIXME
|
||||
#- env: DB=postgresql
|
||||
# TODO
|
||||
#- env: DB=sqlite
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never # [always|never|change] default: change
|
||||
on_failure: change # [always|never|change] default: always
|
||||
|
||||
addons:
|
||||
postgresql: "9.3"
|
||||
irc:
|
||||
channels:
|
||||
- "chat.freenode.net#dolibarr"
|
||||
on_success: change
|
||||
on_failure: always
|
||||
use_notice: true
|
||||
|
||||
services:
|
||||
- memcached # will start memcached
|
||||
before_install:
|
||||
- |
|
||||
echo "Disabling Xdebug for composer"
|
||||
export PHP_VERSION_NAME=$(phpenv version-name)
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/conf.d/xdebug.ini /tmp/xdebug.ini
|
||||
phpenv config-rm xdebug.ini
|
||||
echo
|
||||
|
||||
# This will tell travis to run phpunit
|
||||
language: php
|
||||
php:
|
||||
# - "5.2" is not supported because pyrus to install PHP_Codesniffer is not available
|
||||
- 5.3
|
||||
- 5.4
|
||||
- 5.5
|
||||
- 5.6
|
||||
- 7.0
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: 7.0
|
||||
install:
|
||||
- |
|
||||
echo "Updating Composer"
|
||||
composer self-update
|
||||
echo
|
||||
|
||||
env:
|
||||
- DB=mysql
|
||||
# - DB=postgres
|
||||
- |
|
||||
echo "Installing Parallel Lint"
|
||||
composer -n require jakub-onderka/php-parallel-lint ^0
|
||||
composer -n require jakub-onderka/php-console-highlighter ^0
|
||||
echo
|
||||
|
||||
before_script:
|
||||
- echo Start travis
|
||||
- echo Current dir is `pwd`
|
||||
- echo Home dir is `echo ~`
|
||||
- export PHPV=`phpenv version-name`
|
||||
- echo PHP version $PHPV
|
||||
# - echo Update composer
|
||||
# - ~/.phpenv/versions/$(phpenv version-name)/bin/composer.phar self-update
|
||||
- echo PHPUnit version
|
||||
- which phpunit
|
||||
- phpunit --version
|
||||
- echo Install phpcs then show installed rules
|
||||
- pyrus install pear/PHP_CodeSniffer
|
||||
- phpenv rehash
|
||||
- which phpcs
|
||||
- phpcs --version
|
||||
- phpcs -i
|
||||
- echo Create dir $(pwd)/htdocs/documents
|
||||
- sudo mkdir -p $(pwd)/htdocs/documents/admin/temp;
|
||||
- sudo touch $(pwd)/htdocs/documents/dolibarr.log;
|
||||
- sudo chmod a+rwx /home; sudo chmod a+rwx /home/travis; sudo chmod -R a+rwx /home/travis/build;
|
||||
- sudo chmod -R a+rwx $(pwd);
|
||||
- sudo chown -R www-data:travis $(pwd)/htdocs/documents;
|
||||
- find $(pwd)/htdocs/documents -type d -exec ls -alt {} \;
|
||||
- echo Edit php.ini file
|
||||
- echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
# - echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
|
||||
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'extension = apc.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
|
||||
- sh -c "if [ '$PHPV' = '5.3' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
|
||||
- sh -c "if [ '$PHPV' = '5.4' ]; then echo 'zend_extension_ts = xdebug.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi"
|
||||
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- echo Mysql version
|
||||
# INSTALL MYSQL 5.6
|
||||
# (https://github.com/piwik/piwik/commit/20bd2e1c24e5d673dce3feb256204ad48c29f160)
|
||||
# TODO: Remove when mysql 5.6 is provided by travis.
|
||||
# Otherwise, our migrations will raise a syntax error.
|
||||
- "sudo apt-get remove mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5"
|
||||
- "sudo apt-get autoremove"
|
||||
- "sudo apt-get install libaio1"
|
||||
- "wget -O mysql-5.6.14.deb http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-debian6.0-x86_64.deb/from/http://cdn.mysql.com/"
|
||||
- "sudo dpkg -i mysql-5.6.14.deb"
|
||||
- "sudo cp /opt/mysql/server-5.6/support-files/mysql.server /etc/init.d/mysql.server"
|
||||
- "sudo ln -s /opt/mysql/server-5.6/bin/* /usr/bin/"
|
||||
- "sudo sed -i'' 's/table_cache/table_open_cache/' /etc/mysql/my.cnf"
|
||||
- "sudo sed -i'' 's/log_slow_queries/slow_query_log/' /etc/mysql/my.cnf"
|
||||
- "sudo sed -i'' 's/basedir[^=]\\+=.*$/basedir = \\/opt\\/mysql\\/server-5.6/' /etc/mysql/my.cnf"
|
||||
- "sudo /etc/init.d/mysql.server start"
|
||||
- mysql --version
|
||||
- mysql -e "SELECT VERSION();"
|
||||
# /END MYSQL 5.6- mysql --version
|
||||
- echo Init database
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS myapp_test;' -U postgres; fi"
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE myapp_test;' -U postgres; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'DROP DATABASE IF EXISTS myapp_test;'; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS myapp_test;'; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -D myapp_test < $(pwd)/dev/initdata/mysqldump_dolibarr_3.5.0.sql; fi"
|
||||
- echo Create config file htdocs/conf/conf.php
|
||||
- echo '<?php ' > htdocs/conf/conf.php
|
||||
- sh -c "if [ '$DB' = 'pgsql' ]; then echo '$'dolibarr_main_db_type=\'pgsql\'';' >> htdocs/conf/conf.php; fi"
|
||||
- sh -c "if [ '$DB' = 'mysql' ]; then echo '$'dolibarr_main_db_type=\'mysqli\'';' >> htdocs/conf/conf.php; fi"
|
||||
- echo '$'dolibarr_main_url_root=\'http://localhost/\'';' >> htdocs/conf/conf.php
|
||||
- echo '$'dolibarr_main_document_root=\'$(pwd)/htdocs\'';' >> htdocs/conf/conf.php
|
||||
- echo '$'dolibarr_main_data_root=\'$(pwd)/htdocs/documents\'';' >> htdocs/conf/conf.php
|
||||
- echo '$'dolibarr_main_db_host=\'localhost\'';' >> htdocs/conf/conf.php
|
||||
- echo '$'dolibarr_main_db_name=\'myapp_test\'';' >> htdocs/conf/conf.php
|
||||
- echo '$'dolibarr_main_db_user=\'travis\'';' >> htdocs/conf/conf.php
|
||||
- echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> htdocs/conf/conf.php
|
||||
- echo '?>' >> htdocs/conf/conf.php
|
||||
- echo Show conf.php content
|
||||
- cat htdocs/conf/conf.php
|
||||
- echo Install apache server
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 php5-curl php5-mysql php5-pgsql php5-intl
|
||||
- sudo sed -i -e "s,/var/www,$(pwd)/htdocs,g" /etc/apache2/sites-available/default
|
||||
- echo Show default virtual host
|
||||
- sudo cat /etc/apache2/sites-available/default
|
||||
- sudo /etc/init.d/apache2 restart
|
||||
- wget http://localhost/
|
||||
- sudo cat /etc/apache2/envvars
|
||||
- sudo cat /var/log/apache2/error.log
|
||||
- cat index.html
|
||||
- |
|
||||
echo "Installing PHP Unit"
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ] || [ "$TRAVIS_PHP_VERSION" = '5.5' ]; then
|
||||
composer -n require phpunit/phpunit ^4
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.6' ] || [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
composer -n require phpunit/phpunit ^5
|
||||
fi
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Installing PHP CodeSniffer"
|
||||
composer require squizlabs/php_codesniffer ^2
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Adding Composer binaries to the path"
|
||||
export PATH="$TRAVIS_BUILD_DIR/htdocs/includes/bin:$PATH"
|
||||
echo
|
||||
|
||||
script:
|
||||
- cd htdocs/install
|
||||
- date
|
||||
# - php upgrade.php 3.4.0 3.5.0 ignoredbversion > upgrade340350.log
|
||||
# - php upgrade2.php 3.4.0 3.5.0 ignoredbversion > upgrade340350-2.log
|
||||
- php upgrade.php 3.5.0 3.6.0 ignoredbversion > upgrade350360.log
|
||||
- php upgrade2.php 3.5.0 3.6.0 ignoredbversion > upgrade350360-2.log
|
||||
- php upgrade.php 3.6.0 3.7.0 ignoredbversion > upgrade360370.log
|
||||
- php upgrade2.php 3.6.0 3.7.0 ignoredbversion > upgrade360370-2.log
|
||||
- php upgrade.php 3.7.0 3.8.0 ignoredbversion > upgrade370380.log
|
||||
# - cat upgrade370380.log
|
||||
- php upgrade2.php 3.7.0 3.8.0 ignoredbversion > upgrade370380-2.log
|
||||
# - cat upgrade370380-2.log
|
||||
- cd ../..
|
||||
- date
|
||||
- phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php
|
||||
- date
|
||||
# - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1
|
||||
- phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/htdocs/conf/conf.php,/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1
|
||||
- date
|
||||
before_script:
|
||||
- |
|
||||
echo Start travis
|
||||
echo Current dir is `pwd`
|
||||
echo Home dir is `echo ~`
|
||||
echo TRAVIS_BUILD_DIR is $TRAVIS_BUILD_DIR
|
||||
|
||||
- |
|
||||
echo "Re-enabling Xdebug for PHP CodeSniffer and PHP Unit"
|
||||
phpenv config-add /tmp/xdebug.ini
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Setting up PHP"
|
||||
echo
|
||||
echo "Set timezone"
|
||||
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
|
||||
echo
|
||||
echo "Enabling APC for PHP <= 5.4"
|
||||
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
|
||||
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
echo
|
||||
echo "Enabling Memcached for PHP <= 5.4"
|
||||
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!
|
||||
echo 'extension = memcached.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
fi
|
||||
phpenv rehash
|
||||
echo
|
||||
|
||||
- |
|
||||
if [ "$DEBUG" = true ]; then
|
||||
echo "Debugging informations"
|
||||
# Check PHP
|
||||
php -i
|
||||
# Check PHP CodeSniffer installation
|
||||
which phpcs
|
||||
phpcs --version
|
||||
phpcs -i
|
||||
# Check PHPUnit installation
|
||||
which phpunit
|
||||
phpunit --version
|
||||
# Check MySQL
|
||||
mysql --version
|
||||
mysql -e "SELECT VERSION();"
|
||||
echo
|
||||
fi
|
||||
|
||||
- |
|
||||
echo "Setting up database"
|
||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
|
||||
echo "MySQL"
|
||||
mysql -e 'DROP DATABASE IF EXISTS travis;'
|
||||
mysql -e 'CREATE DATABASE IF NOT EXISTS travis;'
|
||||
mysql -D travis < dev/initdata/mysqldump_dolibarr_3.5.0.sql
|
||||
fi
|
||||
# FIXME: find a way to import a MySQL dump into PostgreSQL
|
||||
#if [ "$DB" = 'postgresql' ]; then
|
||||
# pgsql travis < dev/initdata/mysqldump_dolibarr_3.5.0.sql
|
||||
#fi
|
||||
# TODO: SQLite
|
||||
echo
|
||||
|
||||
- |
|
||||
export CONF_FILE=htdocs/conf/conf.php
|
||||
echo "Setting up Dolibarr $CONF_FILE"
|
||||
echo '<?php ' > $CONF_FILE
|
||||
echo '$'dolibarr_main_url_root=\'http://127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_document_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_data_root=\'$TRAVIS_BUILD_DIR/documents\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_host=\'127.0.0.1\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_name=\'travis\'';' >> $CONF_FILE
|
||||
echo '$'dolibarr_main_db_user=\'travis\'';' >> $CONF_FILE
|
||||
if [ "$DB" = 'mysql' ] || [ "$DB" = 'mariadb' ]; then
|
||||
echo '$'dolibarr_main_db_type=\'mysqli\'';' >> $CONF_FILE
|
||||
fi
|
||||
# FIXME
|
||||
#if [ "$DB" = 'postgresql' ]; then
|
||||
# echo '$'dolibarr_main_db_type=\'pgsql\'';' >> $CONF_FILE
|
||||
#fi
|
||||
# TODO: SQLite
|
||||
echo '$'dolibarr_main_authentication=\'dolibarr\'';' >> $CONF_FILE
|
||||
cat $CONF_FILE
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Create documents directory and set permissions"
|
||||
# and admin/temp subdirectory needed for unit tests
|
||||
mkdir -p documents/admin/temp
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Setting up Apache + FPM"
|
||||
# enable php-fpm
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ] || [ "$TRAVIS_PHP_VERSION" = 'nightly' ]; then
|
||||
# Copy the included pool
|
||||
cp ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.d/www.conf
|
||||
fi
|
||||
if [ "$DEBUG" = true ]; then
|
||||
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php-fpm.conf
|
||||
fi
|
||||
sudo a2enmod rewrite actions fastcgi alias
|
||||
echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
if [ "$DEBUG" = true ]; then
|
||||
cat ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
|
||||
fi
|
||||
~/.phpenv/versions/$PHP_VERSION_NAME/sbin/php-fpm
|
||||
# configure apache virtual hosts
|
||||
sudo cp -f build/travis-ci/apache.conf /etc/apache2/sites-available/default
|
||||
sudo sed -e "s?%TRAVIS_BUILD_DIR%?$TRAVIS_BUILD_DIR?g" --in-place /etc/apache2/sites-available/default
|
||||
if [ "$DEBUG" = true ]; then
|
||||
sudo cat /etc/apache2/sites-available/default
|
||||
fi
|
||||
sudo service apache2 restart
|
||||
echo
|
||||
|
||||
script:
|
||||
- |
|
||||
echo "Checking webserver availability"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
wget http://127.0.0.1
|
||||
if [ "$DEBUG" = true ]; then
|
||||
cat index.html
|
||||
fi
|
||||
set +e
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Checking PHP syntax errors"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
parallel-lint --exclude htdocs/includes --blame .
|
||||
set +e
|
||||
echo
|
||||
|
||||
# TODO: dev/* checks
|
||||
|
||||
- |
|
||||
echo "Checking coding style"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
phpcs -s -n -p -d memory_limit=-1 --colors --tab-width=4 --standard=dev/codesniffer/ruleset.xml --encoding=utf-8 .
|
||||
set +e
|
||||
echo
|
||||
|
||||
# TODO: Check Javascript (jshint?)
|
||||
|
||||
# TODO: Check CSS (csslint?)
|
||||
|
||||
# TODO: check SQL syntax (pgsanity?)
|
||||
|
||||
- |
|
||||
echo "Upgrading Dolibarr"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
cd htdocs/install
|
||||
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
|
||||
php upgrade2.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360-2.log
|
||||
php upgrade.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370.log
|
||||
php upgrade2.php 3.6.0 3.7.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade360370-2.log
|
||||
php upgrade.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380.log
|
||||
php upgrade2.php 3.7.0 3.8.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade370380-2.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Unit testing"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
|
||||
set +e
|
||||
echo
|
||||
|
||||
after_success:
|
||||
|
||||
after_failure:
|
||||
- |
|
||||
if [ "$DEBUG" = true ]; then
|
||||
echo "Debugging informations"
|
||||
# Upgrade log files
|
||||
cat *.log
|
||||
# Dolibarr log file
|
||||
cat documents/dolibarr.log
|
||||
# Apache log file
|
||||
sudo cat /var/log/apache2/error.log
|
||||
# MariaDB log file
|
||||
sudo cat /var/log/mysql/error.log
|
||||
# TODO: PostgreSQL log file
|
||||
echo
|
||||
fi
|
||||
|
||||
after_script:
|
||||
# - echo Output dolibarr log file; cat $(pwd)/htdocs/documents/dolibarr.log
|
||||
- echo Output apache log file; sudo cat /var/log/apache2/error.log
|
||||
- echo End travis
|
||||
|
||||
|
||||
276
ChangeLog
@@ -9,6 +9,141 @@ Upgrading to any other version or any other database system is abolutely require
|
||||
make a Dolibarr upgrade.
|
||||
|
||||
|
||||
***** ChangeLog for 3.8.3 compared to 3.8.2 *****
|
||||
FIX: #3805
|
||||
FIX: #3231 [Members] Public subscription page displays GeoIP error
|
||||
FIX: #3240
|
||||
FIX: #3293 Login page form icons not shown
|
||||
FIX: #3508 Useless tooltip in 3.8 boxes
|
||||
FIX: #3661 Margin is not selected correctly when adding a product
|
||||
FIX: #3679 Error when deleting a Localtax2 special payment
|
||||
FIX: #3707 Thirdparty bank account page table has a glitch
|
||||
FIX: #3726 When upload file, don't test if PRODUCT_USE_OLD_PATH_FOR_PHOTO variable is empty or not
|
||||
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
|
||||
FIX: #3836 Unable to upload a document to an invoice under some circunstances
|
||||
FIX: #3878 Storing and deleting files on emailing was done at wrong place
|
||||
FIX: #3880
|
||||
FIX: #3882
|
||||
FIX: #3890 Expected transactions bank account page, shows negative numbers
|
||||
FIX: #3912
|
||||
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
|
||||
FIX: #3953 Don't round supplier price
|
||||
FIX: #3953 rounding of buying price
|
||||
FIX: #3980 Search field in "product by supplier" list sends empty result 3.8 and 3.7
|
||||
FIX: #3987 Undefined variable $newref in CommandeFournisseur::approve
|
||||
FIX: #3988 Undefined variable $conf and $error in CommandeFournisseur::addline
|
||||
FIX: #3989 Undefined variable $conf in CommandeFournisseur::getNomUrl
|
||||
FIX: #3990
|
||||
FIX: #3992 CommandeFournisseur::ref is marked as deprecated and it shouldn't be
|
||||
FIX: #3996 Dictionnary hooks are not working in 3.8
|
||||
FIX: #3997 Wrong permission key used for Margins > Read all
|
||||
FIX: #4016 User link is not correctly formed in emailing receivers
|
||||
FIX: #4018 SQL error if trying to access the mailing/card.php page without an ID defined
|
||||
FIX: #4036 Direct printing module without any driver configured, shows an unformatted error message
|
||||
FIX: #4043 Incorrect translation in error mesage in menu creation admin page
|
||||
FIX: #4049 PHP warning when trying to access a non-existing product/service
|
||||
FIX: #4055 SQL error when trying to access a non-existing expedition
|
||||
FIX: #4081 Added missing translation
|
||||
FIX: #4097 Public holiday calculation
|
||||
FIX: #4182 SQL error when deleting an unexisting bank entry
|
||||
FIX: #4242 Allow disabling dashes in documents
|
||||
FIX: #4243 sql injection
|
||||
FIX: #4281
|
||||
FIX: #4282 Defined shipping time were not shown in Customer order's PDF documents
|
||||
FIX: #4285 SQL query shown when accessing an unexisting invoice
|
||||
FIX: #4287 SQL error when accessing an unexisting proposal
|
||||
FIX: #4302 Undefined variable $conf in Commande::LibStatut
|
||||
FIX: Allow to search on alias name into select
|
||||
FIX: Add a protection to not make release if ChangeLog was not generated.
|
||||
FIX: autofocus on input search product
|
||||
FIX: bad calculation for stock value
|
||||
FIX: Better compatibility for users that used the not supported option MAIN_USE_JQUERY_MULTISELECT set to 1.
|
||||
FIX: Bug: $this is not accessible in static context in Mailing::libStatutDest #4050
|
||||
FIX: can not have access to the new ids or propal lines on PROPAL_CLONE
|
||||
FIX: Can't update line's duration
|
||||
FIX: Can use formated float number on old expense report module.
|
||||
FIX: change object statut on close shipping and remove erratic db commit
|
||||
FIX: change order date on clone (as everywhere else)
|
||||
FIX: event's data lost on user assign update
|
||||
FIX: export propal and order with extrafields
|
||||
FIX: export with category contact extrafields
|
||||
FIX: jquery select of project generate js error on change event
|
||||
FIX: label of line is set in description field if empty
|
||||
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
|
||||
FIX: mail isn't display in title on event in mode view
|
||||
FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
|
||||
FIX: NB task and percent progress in box project
|
||||
FIX: Not delete a product when have customer price
|
||||
FIX: Not deleting contrats on element_element table
|
||||
FIX: Not use localtaxes when invoice some orders
|
||||
FIX: only active customer should be available into select list thirdparty on invoice creation
|
||||
FIX: only active customer should be return into new invoice creation select list
|
||||
FIX: AWP calculation
|
||||
FIX: product link in project box
|
||||
FIX: Remove column creation for table llx_product_fournisseur_price, the column use un calss is fk_supplier_price_expression, and fk_price_expression does not exist into lx_product_fournisseur_price sql file declaration
|
||||
FIX: Show category selector if we have permission to view products or services
|
||||
FIX: showrefnav htmlspecialchar instead of < >
|
||||
FIX: The label hidden was not supported when using jmobile
|
||||
FIX: Too many information were hidden. A lot of users still need bank account on PDF.
|
||||
FIX: Use "WHERE true" instead of "WHERE 1" #4132
|
||||
|
||||
***** ChangeLog for 3.8.2 compared to 3.8.1 *****
|
||||
FIX: Add a protection to not make release if ChangeLog was not generated.
|
||||
FIX: 1/ update_extra() function must not be in "if(!empty(MAIN_DISABLE_CONTACTS_TAB)" test. 2/ Reindented code
|
||||
FIX: #3240
|
||||
FIX: #3541 Bypass authentication when user was created using LDAP
|
||||
FIX: #3605 deleting a shipping
|
||||
FIX: #3661 Margin is not selected correctly when adding a product
|
||||
FIX: #3689 Bug on workflow module
|
||||
FIX: #3724 Bug: Blank page after cloning proposal if we changed client
|
||||
FIX: #3726 Better support for PRODUCT_USE_OLD_PATH_FOR_PHOTO
|
||||
FIX: #3726 Not showing images on product card
|
||||
FIX: #3757 Can't set amount in a social contribution with some languages
|
||||
FIX: #3786 Translation of select box.
|
||||
FIX: #3841 creation of a task completed has not status set to finished by default
|
||||
FIX: #3878 Storing and deleting files on emailing was done at wrong place
|
||||
FIX: #3880
|
||||
FIX: #3882
|
||||
FIX: action not appear before an update because of a lack of line in action ressource
|
||||
FIX: add tag myuser_job into ODT replacement
|
||||
FIX: Avoid changing the state to a thirdparty who shouldn't be contacted anymore
|
||||
FIX: bad calculation for stock value
|
||||
FIX: Bad parameters
|
||||
FIX: Bad picto for expense report
|
||||
FIX: bad property so after creating an event from calendar, filter were lost.
|
||||
FIX: bad stock valorisation
|
||||
FIX: better fix to generate a PROV ref after clone
|
||||
FIX: bug invoice classified in propale next update commonobject class in 3.8
|
||||
FIX: Can export a field into task time table with export project profile
|
||||
FIX: change order date on clone (as everywhere else)
|
||||
FIX: clone customer order create new order with validate ref and not with PROV
|
||||
FIX: Contacts are not added to the list with the status "no contact"
|
||||
FIX: Default thirdparty when cloning invoice was not set.
|
||||
FIX: double db escape add too quote
|
||||
FIX: event's data lost on user assign update
|
||||
FIX: Filter in customer price per product of a thirdparty returned error
|
||||
FIX: filters on supplier invoices list are not used, search_status instead
|
||||
FIX: fix HTML into formconfirm box
|
||||
FIX: IF autocomplete was set on thirdparty list, it was not possible to open list of extrafields.
|
||||
FIX: If no end date is set on survey, we should be able to vote.
|
||||
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
|
||||
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
|
||||
FIX: pmp calculation
|
||||
FIX: Preview pages was not using correct style for ref
|
||||
FIX: project was not retrieved on invoice creation form
|
||||
FIX: Revert option WORKFLOW_PROPAL_CAN_CLASSIFIED_BILLED_WITHOUT_INVOICES into option WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED for better compatibility with old versions
|
||||
FIX: Search status not saved into list
|
||||
FIX: search_status not used in mergefusiontool
|
||||
FIX: Show category selector if we have permission to view products or services
|
||||
FIX: Show product image on getNomUrl()
|
||||
FIX: skeleton class must use db->order rather than ORDER BY into fetchAll
|
||||
FIX: Societe::set_parent() function needs societe object to be fetched to update parent
|
||||
FIX: supplier rights for orderToInvoice
|
||||
FIX: tag object_total_vat_x need x to be a string with unknown decimal lenght. Now use for x the real vat real with no more decimal (x = 20 or x = 8.5 or x = 5.99, ...)
|
||||
FIX: The preview of PDF was never refreshed if PDF document was changed
|
||||
FIX: The thumb of user into top menu was using the image in full size. This make a large download at each page call. We must use the mini thumbs.
|
||||
FIX: Total in summary was not same than into detail on the referrer page.
|
||||
|
||||
***** ChangeLog for 3.8.1 compared to 3.8.0 *****
|
||||
FIX: #3521 postgresql migration error
|
||||
FIX: #3524
|
||||
@@ -294,25 +429,94 @@ Dolibarr better:
|
||||
to make difference between creation from contact or not.
|
||||
- Function get_exdir require now 6 parameters. This is to prepare a future feature.
|
||||
|
||||
|
||||
***** ChangeLog for 3.7.2 compared to 3.7.1 *****
|
||||
FIX [ bug #2855 ] Wrong translation key in localtax report page
|
||||
FIX [ bug #1852 ] JS error when editing a customer order line
|
||||
FIX [ bug #2900 ] Courtesy title is not stored in create thirdparty form
|
||||
FIX [ bug #3055 ] Product image thumbnails were not deleted after deleting the image
|
||||
FIX [ bug 1634 ] Error deleting a project when it had many linked objects
|
||||
FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
|
||||
FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne
|
||||
FIX: Not showing delivery date on rouget pdf
|
||||
FIX: #2957 : missing $langs object for trigger
|
||||
FIX: #2983 Load gravatar avatar images securely over HTTPS
|
||||
FIX: #3009: Better filtering to prevent SQL injection
|
||||
FIX: #3091 TotalHT amount in supplier order is bold unlike the rest of Dolibarr
|
||||
FIX: #3262 Webservice getProductsForCategory()
|
||||
FIX: #3318
|
||||
FIX: [ #3460 ] Selected bank account was not saved when an error happened when trying to create a customer invoice
|
||||
FIX: #3530
|
||||
FIX: #3630 - Wrong balance report when module salaries and donation disabled
|
||||
FIX: #3679 Error when deleting a Localtax2 special payment
|
||||
FIX: #3707 Thirdparty bank account page table has a glitch
|
||||
FIX: #3724 Bug: Blank page after cloning proposal with changed client
|
||||
FIX: #3836 Unable to upload a document to an invoice under some circunstances
|
||||
FIX: #3841 creation of a task completed has not status set to finished by default
|
||||
FIX: Add a protection to not make release if ChangeLog was not generated.
|
||||
FIX: adjusted test for affecting supplier reference
|
||||
FIX: Admin fiche inter page do not take good action
|
||||
FIX: Avoid warning strict mode when hosting server do not have php5_curl installed
|
||||
FIX: bad calculation for stock value
|
||||
FIX: Bad condition into invoice export request making reporting too many rows.
|
||||
FIX: bad stock valorisation
|
||||
FIX: Bad visualization of suppliers name on Incomes-Expenses mode
|
||||
FIX: Better management error into the color conversion functions
|
||||
FIX: [ bug 1634 ] Error deleting a project when it had many linked objects
|
||||
FIX: [ bug 1925 ] "Link to order" option in supplier invoices is not working properly
|
||||
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
|
||||
FIX: [ bug #3211 ] Error about sold to pay (Montant encours)
|
||||
FIX: [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
|
||||
FIX: [ bug #3358 ] Tasks box does not work with PostgreSQL
|
||||
FIX: [ bug #3383 ] Company name is overlapped with company direction in PDF models
|
||||
FIX: [ bug #3426 ] Unable to create an invoice from a contract with extrafields
|
||||
FIX: [ bug #3431 ] Invoice bank account is not respected
|
||||
FIX: [ bug #3432 ] Spaces should be removed from IBAN when formatting it
|
||||
FIX: Can create Proposal on close thridparty #3526
|
||||
FIX: change order date on clone (as everywhere else)
|
||||
FIX: Close #2835 Customer prices of a product shows incorrect history order
|
||||
FIX: Close #2837 Product list table column header does not match column body
|
||||
FIX: Close bug #2855 Wrong translation key in localtax report page
|
||||
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
|
||||
FIX: Close bug #2891 Category hooks do not work
|
||||
FIX: Close bug #2900 Courtesy title is not stored in create thirdparty form
|
||||
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
|
||||
FIX: contact country had wrong display if the country dont have translate
|
||||
FIX: Display country name instead of country id (display country id makes no sense on vcard files)
|
||||
FIX: display error on extrafields on ficheinter
|
||||
FIX: double db escape add too quote
|
||||
FIX: Email selector contact must not include inactive contact
|
||||
FIX: End log must use same level then start log.
|
||||
FIX: error in SQL due to a previous fix
|
||||
FIX: event's data lost on user assign update
|
||||
FIX: Export of tags for contact and member
|
||||
FIX: facturestat bad sql when customer view is limited
|
||||
FIX: if multicompany enabled, call to undifend method _setCookie instead of setCookie
|
||||
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
|
||||
FIX: keep filter by category or by not enough stock if we switch page
|
||||
FIX: Line break display as a block
|
||||
FIX: load propal langs for availability traduction
|
||||
FIX: loss data also if update was cancel by error of ended state with no end date, try a generic patch
|
||||
FIX: Mass Mailing activity don't display all status
|
||||
FIX: Missing to set context into workflow actions, so triggers can't know we are creating an invoice from order or an order from a proposal.
|
||||
FIX: multientity warehouse management
|
||||
FIX: New adherent from, always redirect on entity
|
||||
FIX: No check warehouse is provided if module stock is not enabled.
|
||||
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
|
||||
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
|
||||
FIX: Not showing task extrafields when creating from left menu
|
||||
FIX [ bug #3288 ] Tasks box is not properly drawn
|
||||
FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts
|
||||
FIX [ bug #3321 ] Users with certain permissions were shown a "forbidden access" page even if they had the rights
|
||||
FIX [ bug #3426 ] Unable to create an invoice from a contract with extrafields
|
||||
FIX [ bug #3431 ] Invoice bank account is not respected
|
||||
FIX [ bug #3432 ] Spaces should be removed from IBAN when formatting it
|
||||
FIX [ bug #3358 ] Tasks box does not work with PostgreSQL
|
||||
FIX [ bug #3383 ] Company name is overlapped with company direction in PDF models
|
||||
FIX [ bug #3460 ] Bank account is not saved when creating a customer invoice and facing an error message
|
||||
FIX: only active customer should be return into new invoice creation select list
|
||||
FIX: Payed invoices are showed as canceled FIX: Bad date filter on customer order
|
||||
FIX: WAP calculation
|
||||
FIX: Save of filters into export profiles failed.
|
||||
FIX: supplier rights for orderToInvoice
|
||||
FIX: Syntax error in Debian Apache configuration
|
||||
FIX: The hours of date filter aren't correct
|
||||
FIX: tool export handle the type "select" extrafields and return the value instead of id
|
||||
FIX: total amount in tpl linked object are not reset
|
||||
FIX: translate Jabberid on contact page with edit view
|
||||
FIX: translation for 1 word do not work if product/service module are disabled because the translation search in products.lang
|
||||
FIX: update2.php test res befre assign it
|
||||
FIX: When delete actioncomm also delete actioncomm_resources
|
||||
FIX: when fetch_optionnal_by_label in Extrafields with $this->db cannot work because this->db is never instanciated
|
||||
FIX: when mailing is deleted, the targets list was kept in database
|
||||
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
|
||||
FIX: When we add an user on event in create mode, we lose linked object
|
||||
FIX: When we automatically creta an order from a proposal with workflow module, if some extrafields of propal don't exist in order object, insertExtraFields() function tries to insert extrafields in unexistant column of commande_extrafields table.
|
||||
FIX: When we clone a propal, if it has a project which is not assigned to a third, it was not on new propal because fk_project was always set to empty string if new propal is for another third.
|
||||
FIX: XSS security using the onerror and missing escapement on type of member page.
|
||||
|
||||
NEW: Created new ContratLigne::insert function
|
||||
|
||||
@@ -533,9 +737,43 @@ Dolibarr better:
|
||||
warehouse module and your Point Of Sale module setup if you use one.
|
||||
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
|
||||
|
||||
|
||||
***** ChangeLog for 3.6.5 compared to 3.6.4 *****
|
||||
- Fix: [ bug #1776 ] Undefined $deliverycompany variable in pdf_build_address
|
||||
- Fix: [ bug #1794 ] Error when cloning Proposal gives error in a malformed page
|
||||
FIX: #2957 : missing $langs object for trigger
|
||||
FIX: #2983 Load gravatar avatar images securely over HTTPS
|
||||
FIX: #3009: Better filtering to prevent SQL injection
|
||||
FIX: #3841 creation of a task completed has not status set to finished by default
|
||||
FIX: #3890 Expected transactions bank account page, shows negative numbers
|
||||
FIX: #3928 Creating a Customer order and a Customer invoice from a project, does not inherit payment conditions and method of payment of customer card
|
||||
FIX: bad calculation for stock value
|
||||
FIX: bad stock valo
|
||||
FIX: bad stock valorisation
|
||||
FIX: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
|
||||
FIX: button create payment hide if tax amount is less than 1
|
||||
FIX: change object statut on close shipping and remove erratic db commit
|
||||
FIX: change order date on clone (as everywhere else)
|
||||
FIX: Close #2835 Customer prices of a product shows incorrect history order
|
||||
FIX: Close #2837 Product list table column header does not match column body
|
||||
FIX: Close bug #2861 Undefined variable $res when migrating from 3.6.2 to 3.7.0
|
||||
FIX: Close bug #2891 Category hooks do not work
|
||||
FIX: Close bug #2976: "Report" tab is the current tab but it is not marked as selected by the UI
|
||||
FIX: contact country had wrong display if the country dont have translate
|
||||
FIX: double db escape add too quote
|
||||
FIX: End log must use same level then start log.
|
||||
FIX: error in SQL due to a previous fix
|
||||
FIX: event for restricted user was restricted if company null
|
||||
FIX: facturestat bad sql when customer view is limited
|
||||
FIX: If supplier invoice block linked element is display after other block total HT amount is not reset to 0 and sum other block (like customer orders values)
|
||||
FIX: keep filter by category or by not enough stock if we switch page
|
||||
FIX: no need to remove file into mail form, the temp dir will be deleted after any sending
|
||||
FIX: no projet_task_time id from trigger TASK_TIMESPENT_CREATE
|
||||
FIX: pmp
|
||||
FIX: send mail, copy sendto don't read the list of contact
|
||||
FIX: The hours of date filter aren't correct
|
||||
FIX: tool export handle the type "select" extrafields and return the value instead of id
|
||||
FIX: top links menu have target attribute with wrong value
|
||||
FIX: total amount in tpl linked object are not reset
|
||||
FIX: when multicompany was enabled, this function didn't check just on the good entity (problem when both company use same mask)
|
||||
|
||||
***** ChangeLog for 3.6.4 compared to 3.6.3 *****
|
||||
- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask
|
||||
|
||||
0
build/.gitignore
vendored
Executable file → Normal file
0
build/aps/APP-META-1.1.xml
Executable file → Normal file
0
build/aps/APP-META-1.2.xml
Executable file → Normal file
0
build/aps/README
Executable file → Normal file
1
build/aps/install.forced.php.install
Executable file → Normal file
@@ -21,4 +21,3 @@ $force_install_databaserootpass='';
|
||||
$force_install_dolibarrlogin='admin';
|
||||
$force_install_nophpinfo='1';
|
||||
$force_install_lockinstall='444';
|
||||
?>
|
||||
2
build/debian/conf.php.install
Executable file → Normal file
@@ -226,5 +226,3 @@ $dolibarr_main_prod='0';
|
||||
# Default value: 0 (use database value if exist)
|
||||
# Examples:
|
||||
# $dolibarr_mailing_limit_sendbyweb='0';
|
||||
|
||||
?>
|
||||
|
||||
0
build/debian/dolibarr.install
Executable file → Normal file
0
build/debian/dolibarr.lintian-overrides
Executable file → Normal file
0
build/debian/dolibarr.templates.futur
Executable file → Normal file
2
build/debian/install.forced.php.install
Executable file → Normal file
@@ -42,5 +42,3 @@ $force_install_lockinstall='444';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
//$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf';
|
||||
|
||||
?>
|
||||
0
build/debian/po/POTFILES.in
Executable file → Normal file
0
build/debian/po/fr.po
Executable file → Normal file
0
build/doxygen/doxygen_footer.html
Executable file → Normal file
0
build/doxygen/doxygen_header.html
Executable file → Normal file
@@ -22,7 +22,8 @@ $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||
|
||||
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
%REQUIREMENTPUBLISH=(
|
||||
"SF"=>"git ssh rsync",
|
||||
"ASSO"=>"git ssh rsync"
|
||||
@@ -351,6 +352,28 @@ if ($nboftargetok) {
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
|
||||
# Test that the ChangeLog is ok
|
||||
$ret=`grep "ChangeLog for $MAJOR.$MINOR\.$BUILD" "$SOURCE/ChangeLog" 2>&1`;
|
||||
if (! $ret)
|
||||
{
|
||||
print "Error: The ChangeLogFile was not updated. Run the following command first:\n";
|
||||
if (! $BUILD)
|
||||
{
|
||||
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
|
||||
}
|
||||
print "\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'\n";
|
||||
}
|
||||
|
||||
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
|
||||
if ($ret =~ /already exists/)
|
||||
@@ -472,6 +495,8 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/calling*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/bootstrap*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
||||
@@ -483,6 +508,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||
# Removed other test files
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`; # This is a dev tool
|
||||
@@ -499,17 +525,29 @@ if ($nboftargetok) {
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available
|
||||
$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 -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
||||
$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/php-iban/docs`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PCLZip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.txt`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/PHPExcel/Shared/PDF`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/PHPExcel/Shared/PCLZip`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
||||
$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/freefont-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ beta version of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in ChangeLog.
|
||||
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x-1.y-1.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x.y.z-1 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
- Update version number with x.y.z-w in htdocs/filefunc.inc.php
|
||||
- Commit all changes.
|
||||
|
||||
@@ -31,8 +31,8 @@ complete release of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in ChangeLog.
|
||||
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x-1.y-1.0 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log `git merge-base x.y.z-1 origin/develop`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0, you can do "cd ~/git/dolibarr_x.y; git log `git rev-list --boundary x.y..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
- Update version number with x.y.z in htdocs/filefunc.inc.php
|
||||
- Commit all changes.
|
||||
|
||||
|
||||
0
build/rpm/conf.php
Executable file → Normal file
0
build/rpm/dolibarr-forrpm.patch
Executable file → Normal file
0
build/rpm/dolibarr.desktop
Executable file → Normal file
0
build/rpm/file_contexts.dolibarr
Executable file → Normal file
2
build/rpm/install.forced.php.fedora
Executable file → Normal file
@@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf';
|
||||
|
||||
?>
|
||||
1
build/rpm/install.forced.php.generic
Executable file → Normal file
@@ -20,4 +20,3 @@ $force_install_lockinstall='444';
|
||||
|
||||
// Value to overwrite path to use shared libraries/fonts instead of embedded one
|
||||
// We don't force any external lib with generic package
|
||||
?>
|
||||
2
build/rpm/install.forced.php.mandriva
Executable file → Normal file
@@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/TTF/dejavu/DejaVuSans-Bold.ttf';
|
||||
|
||||
?>
|
||||
2
build/rpm/install.forced.php.opensuse
Executable file → Normal file
@@ -31,5 +31,3 @@ $force_dolibarr_lib_TCPDF_PATH='';
|
||||
//$force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui';
|
||||
//$force_dolibarr_js_JQUERY_FLOT='/javascript/flot';
|
||||
$force_dolibarr_font_DOL_DEFAULT_TTF_BOLD='/usr/share/fonts/truetype/DejaVuSans-Bold.ttf';
|
||||
|
||||
?>
|
||||
18
build/travis-ci/apache.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
<VirtualHost *:80>
|
||||
DocumentRoot %TRAVIS_BUILD_DIR%/htdocs
|
||||
|
||||
<Directory "%TRAVIS_BUILD_DIR%/htdocs">
|
||||
Options FollowSymLinks MultiViews ExecCGI
|
||||
AllowOverride All
|
||||
Order deny,allow
|
||||
Allow from all
|
||||
</Directory>
|
||||
|
||||
# Wire up Apache to use Travis CI's php-fpm.
|
||||
<IfModule mod_fastcgi.c>
|
||||
AddHandler php5-fcgi .php
|
||||
Action php5-fcgi /php5-fcgi
|
||||
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
|
||||
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization
|
||||
</IfModule>
|
||||
</VirtualHost>
|
||||
@@ -6,9 +6,11 @@
|
||||
"homepage": "http://www.dolibarr.org",
|
||||
"license": "GPL-3.0+",
|
||||
"support": {
|
||||
"issues": "https://doliforge.org/projects/dolibarr",
|
||||
"issues": "https://github.com/Dolibarr/dolibarr/issues",
|
||||
"forum": "http://www.dolibarr.org/forum",
|
||||
"wiki": "http://wiki.dolibarr.org"
|
||||
"wiki": "http://wiki.dolibarr.org",
|
||||
"irc": "irc://chat.freenode.net/dolibarr",
|
||||
"source": "https://github.com/Dolibarr/dolibarr"
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0",
|
||||
@@ -17,16 +19,23 @@
|
||||
"restler/framework": "3.0.*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mysqli": "*",
|
||||
"ext-pgsql": "*",
|
||||
"ext-mssql": "*",
|
||||
"ext-pdo_sqlite": "*",
|
||||
"ext-imagick": "*",
|
||||
"ext-mcrypt": "*",
|
||||
"ext-openssl": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-soap": "*",
|
||||
"ext-zip": "*",
|
||||
"ext-xml": "*"
|
||||
"ext-mysqlnd": "To use with MySQL or MariaDB",
|
||||
"ext-mysqli": "To use with MySQL or MariaDB",
|
||||
"ext-pgsql": "To use with PostgreSQL",
|
||||
"ext-mssql": "To use with MSSQL (experimental)",
|
||||
"ext-pdo_sqlite": "To use with SQLite (experimental)",
|
||||
"ext-gd": "Image manipulation (Required but maybe built-in PHP)",
|
||||
"ext-imagick": "Image manipulation (TCPDF)",
|
||||
"ext-mcrypt": "(Required but maybe built-in PHP)",
|
||||
"ext-openssl": "Secure connections (Emails, SOAP…)",
|
||||
"ext-mbstring": "Handle non UTF-8 databases",
|
||||
"ext-soap": "Native SOAP",
|
||||
"ext-zip": "ODT and Excel support",
|
||||
"ext-xml": "Excel support",
|
||||
"firephp/firephp-core": "Logging to Firebug console support",
|
||||
"raven/raven": "Sentry logging server support"
|
||||
},
|
||||
"config": {
|
||||
"vendor-dir": "htdocs/includes"
|
||||
}
|
||||
}
|
||||
|
||||
0
dev/codesniffer/README
Executable file → Normal file
0
dev/codesniffer/php.ini
Executable file → Normal file
0
dev/codesniffer/ruleset.dtd
Executable file → Normal file
17
dev/codesniffer/ruleset.xml
Executable file → Normal file
@@ -124,7 +124,7 @@
|
||||
<!-- Tweaks to metrics -->
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
||||
<properties>
|
||||
<property name="complexity" value="80" />
|
||||
<property name="complexity" value="120" />
|
||||
<property name="absoluteComplexity" value="250" />
|
||||
</properties>
|
||||
</rule>
|
||||
@@ -289,6 +289,15 @@
|
||||
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature" />
|
||||
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
@@ -304,12 +313,6 @@
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<rule ref="PEAR.Functions.ValidDefaultValue" />
|
||||
|
||||
|
||||
0
dev/codetemplates/README
Executable file → Normal file
0
dev/codetemplates/codetemplates.dtd
Executable file → Normal file
0
dev/codetemplates/codetemplates.xml
Executable file → Normal file
0
dev/examples/README
Executable file → Normal file
@@ -171,15 +171,20 @@ export list="
|
||||
--ignore-table=$base.llx_abonne_extrafields
|
||||
--ignore-table=$base.llx_abonne_type
|
||||
--ignore-table=$base.llx_abonnement
|
||||
--ignore-table=$base.llx_advanced_extrafields
|
||||
--ignore-table=$base.llx_advanced_extrafields_options
|
||||
--ignore-table=$base.llx_advanced_extrafields_values
|
||||
--ignore-table=$base.llx_bookkeeping
|
||||
--ignore-table=$base.llx_bootstrap
|
||||
--ignore-table=$base.llx_bt_namemap
|
||||
--ignore-table=$base.llx_bt_speedlimit
|
||||
--ignore-table=$base.llx_bt_summary
|
||||
--ignore-table=$base.llx_bt_timestamps
|
||||
--ignore-table=$base.llx_bt_webseedfiles
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--ignore-table=$base.llx_c_civilite
|
||||
--ignore-table=$base.llx_c_dolicloud_plans
|
||||
--ignore-table=$base.llx_c_lead_status
|
||||
--ignore-table=$base.llx_c_source
|
||||
--ignore-table=$base.llx_cabinetmed_c_banques
|
||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||
@@ -191,16 +196,34 @@ export list="
|
||||
--ignore-table=$base.llx_cabinetmed_motifcons
|
||||
--ignore-table=$base.llx_cabinetmed_patient
|
||||
--ignore-table=$base.llx_cabinetmed_societe
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||
--ignore-table=$base.llx_domain
|
||||
--ignore-table=$base.llx_element_rang
|
||||
--ignore-table=$base.llx_entity
|
||||
--ignore-table=$base.llx_filemanager_roots
|
||||
--ignore-table=$base.llx_fournisseur_ca
|
||||
--ignore-table=$base.llx_google_maps
|
||||
--ignore-table=$base.llx_monitoring_probes
|
||||
--ignore-table=$base.llx_notes
|
||||
--ignore-table=$base.llx_pos_cash
|
||||
--ignore-table=$base.llx_pos_control_cash
|
||||
--ignore-table=$base.llx_pos_facture
|
||||
--ignore-table=$base.llx_pos_moviments
|
||||
--ignore-table=$base.llx_pos_ticketdet
|
||||
--ignore-table=$base.llx_pos_paiement_ticket
|
||||
--ignore-table=$base.llx_pos_places
|
||||
--ignore-table=$base.llx_pos_ticket
|
||||
--ignore-table=$base.llx_printer_ipp
|
||||
--ignore-table=$base.llx_publi_c_contact_list
|
||||
--ignore-table=$base.llx_publi_c_dnd_list
|
||||
--ignore-table=$base.llx_publi_c_method_list
|
||||
--ignore-table=$base.llx_residence
|
||||
--ignore-table=$base.llx_residence_building
|
||||
--ignore-table=$base.llx_residence_building_links
|
||||
--ignore-table=$base.llx_ultimatepdf
|
||||
--ignore-table=$base.llx_update_modules
|
||||
--ignore-table=$base.llx_ventilation_achat
|
||||
"
|
||||
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
|
||||
|
||||
0
dev/iso-normes/GURULABS-RPM-GUIDE-v1.0.PDF
Executable file → Normal file
0
dev/iso-normes/address_format.txt
Executable file → Normal file
0
dev/iso-normes/banknumber_format.txt
Executable file → Normal file
0
dev/iso-normes/xmlexport.txt
Executable file → Normal file
0
dev/phpunit/README
Executable file → Normal file
0
dev/phpunit/eclipse_setup_for_pti_phpunit.png
Executable file → Normal file
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
0
dev/skeletons/build_webservice_from_class.php
Normal file → Executable file
0
dev/test/testtcpdf.php
Executable file → Normal file
0
doc/images/appicon_128.png
Executable file → Normal file
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
0
doc/images/appicon_16.ico
Executable file → Normal file
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
doc/images/appicon_16.png
Executable file → Normal file
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
0
doc/images/appicon_32.png
Executable file → Normal file
|
Before Width: | Height: | Size: 867 B After Width: | Height: | Size: 867 B |
0
doc/images/appicon_48.ico
Executable file → Normal file
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
0
doc/images/appicon_64.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
doc/images/dolibarr_73x73.png
Executable file → Normal file
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
doc/images/dolibarr_logo.png
Executable file → Normal file
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
1
htdocs/.gitignore
vendored
@@ -15,3 +15,4 @@
|
||||
/dolimed*
|
||||
/allscreens*
|
||||
/ecommerce/
|
||||
/cabinetmed*
|
||||
|
||||
@@ -76,7 +76,7 @@ if ($action == 'disable') {
|
||||
|
||||
$action = 'update';
|
||||
if ($result < 0) {
|
||||
setEventMessage($accounting->error, 'errors');
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
} else if ($action == 'enable') {
|
||||
if ($accounting->fetch($id)) {
|
||||
@@ -84,7 +84,7 @@ if ($action == 'disable') {
|
||||
}
|
||||
$action = 'update';
|
||||
if ($result < 0) {
|
||||
setEventMessage($accounting->error, 'errors');
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ else if ($action == 'delete')
|
||||
}
|
||||
|
||||
if ($result < 0) {
|
||||
setEventMessage($accounting->error, 'errors');
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ $htmlacc = new FormVentilation($db);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print_fiche_titre($langs->trans('NewAccount'));
|
||||
print load_fiche_titre($langs->trans('NewAccount'));
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
@@ -148,14 +148,14 @@ if ($action == 'create')
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
|
||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent');
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
@@ -204,13 +204,13 @@ else if ($id)
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td width="25%">' . $langs->trans("AccountNumber") . '</td>';
|
||||
print '<tr><td width="25%"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $accounting->account_number . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Label") . '</td>';
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $accounting->label . '"</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent');
|
||||
print $htmlacc->select_account($accounting->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
|
||||
@@ -30,6 +30,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@@ -52,6 +53,7 @@ if ($sortfield == "")
|
||||
$offset = $conf->liste_limit * $page;
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
{
|
||||
@@ -74,7 +76,20 @@ if ($action == 'delbookkeeping') {
|
||||
$result = $object->delete_by_importkey($import_key);
|
||||
Header("Location: list.php");
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($action == 'delbookkeepingyear') {
|
||||
|
||||
$delyear = GETPOST('delyear', 'int');
|
||||
|
||||
if (! empty($delyear)) {
|
||||
$object = new BookKeeping($db);
|
||||
$result = $object->delete_by_year($delyear);
|
||||
Header("Location: list.php");
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} // Export
|
||||
@@ -86,7 +101,7 @@ else if ($action == 'export_csv') {
|
||||
$object = new BookKeeping($db);
|
||||
$result = $object->export_bookkeping('ebp');
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
foreach ( $object->linesexport as $line ) {
|
||||
@@ -147,7 +162,7 @@ else {
|
||||
|
||||
print_barre_liste($langs->trans("Bookkeeping"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num);
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
/*print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeeping">';
|
||||
|
||||
@@ -155,6 +170,16 @@ else {
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
print '</form>';*/
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="delbookkeepingyear">';
|
||||
|
||||
print $formother->select_year(GETPOST('delyear'),'delyear');
|
||||
|
||||
print '<div class="inline-block divButAction"><input type="submit" class="butAction" value="' . $langs->trans("DelBookKeeping") . '" /></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?PHP
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/customer/card.php
|
||||
* \ingroup Accounting Expert
|
||||
* \ingroup Accountancy
|
||||
* \brief Card customer ventilation
|
||||
*/
|
||||
|
||||
@@ -88,7 +88,6 @@ if (! empty($id)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
||||
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 1) . ")";
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/customer/list.php
|
||||
* \ingroup Accounting Expert
|
||||
* \ingroup Accountancy
|
||||
* \brief Ventilation page from customers invoices
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
@@ -87,10 +87,9 @@ if (! $user->rights->accounting->ventilation->dispatch)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT);
|
||||
$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
|
||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT,1);
|
||||
$aarowid_p = $accounting->fetch('',$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT,1);
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) {
|
||||
@@ -165,16 +164,27 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
* Customer Invoice lines
|
||||
*/
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod";
|
||||
$sql .= " , aa.rowid as aarowid";
|
||||
$sql .= " , l.product_type as type_l, l.tva_tx as tva_tx_line";
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype, l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql .= " aa.rowid as aarowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_sell = aa.account_number";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
|
||||
$sql .= " WHERE f.fk_statut > 0";
|
||||
$sql .= " AND fk_code_ventilation <= 0";
|
||||
$sql .= " AND product_type <= 2";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
|
||||
|
||||
// Add search filter like
|
||||
@@ -231,7 +241,7 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"],"l.total_ht","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre($langs->trans("Ventilate") . '<br><label id="select-all">' . $langs->trans('All') . '</label>/<label id="unselect-all">' . $langs->trans('None') . '</label>', '', '', '', '', 'align="center"');
|
||||
@@ -281,12 +291,14 @@ if ($result) {
|
||||
}
|
||||
if ($objp->type_l == 1) {
|
||||
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||
if ($objp->aarowid == '')
|
||||
if ($objp->aarowid == '') {
|
||||
$objp->aarowid_suggest = $aarowid_s;
|
||||
}
|
||||
} elseif ($objp->type_l == 0) {
|
||||
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
|
||||
if ($objp->aarowid == '')
|
||||
if ($objp->aarowid == '') {
|
||||
$objp->aarowid_suggest = $aarowid_p;
|
||||
}
|
||||
}
|
||||
if ($objp->code_sell_l != $objp->code_sell_p)
|
||||
$code_sell_p_l_differ = 'color:red';
|
||||
@@ -322,7 +334,7 @@ if ($result) {
|
||||
if ($objp->code_sell_l == $objp->code_sell_p) {
|
||||
print $objp->code_sell_l;
|
||||
} else {
|
||||
print 'lines=' . $objp->code_sell_l . '<br />product=' . $objp->code_sell_p;
|
||||
print $langs->trans("Purchase") . ' = ' . $objp->code_sell_l . '<br />' . $langs->trans("Sell") . ' = ' . $objp->code_sell_p;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/bankjournal.php
|
||||
* \ingroup Accounting Expert
|
||||
* \brief Page with sells journal
|
||||
* \brief Page with bank journal
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@@ -56,7 +56,7 @@ $langs->load("bank");
|
||||
$langs->load('bills');
|
||||
$langs->load("accountancy");
|
||||
|
||||
$id_accountancy_journal = GETPOST('id_account');
|
||||
$id_bank_account = GETPOST('id_account','int');
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth');
|
||||
$date_startday = GETPOST('date_startday');
|
||||
@@ -66,18 +66,15 @@ $date_endday = GETPOST('date_endday');
|
||||
$date_endyear = GETPOST('date_endyear');
|
||||
$action = GETPOST('action');
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
if ($user->societe_id > 0 && empty($id_bank_account))
|
||||
accessforbidden();
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
if (empty($id_accountancy_journal))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
@@ -104,7 +101,7 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
|
||||
$sql .= " WHERE ba.rowid=".$id_accountancy_journal;
|
||||
$sql .= " WHERE ba.rowid=".$id_bank_account;
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
$sql .= " AND ba.entity = " . $conf->entity;
|
||||
}
|
||||
@@ -121,7 +118,12 @@ $chargestatic = new ChargeSociales($db);
|
||||
$paymentvatstatic = new TVA($db);
|
||||
$paymentsalstatic = new PaymentSalary($db);
|
||||
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sql=" . $sql, LOG_DEBUG);
|
||||
// Get code of finance journal
|
||||
$bank_code_journal = new Account($db);
|
||||
$result=$bank_code_journal->fetch($id_bank_account);
|
||||
$journal=$bank_code_journal->accountancy_journal;
|
||||
|
||||
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
||||
@@ -278,8 +280,10 @@ if ($result) {
|
||||
*/
|
||||
|
||||
// Write bookkeeping
|
||||
if ($action == 'writeBookKeeping')
|
||||
if ($action == 'writebookkeeping')
|
||||
{
|
||||
$now=dol_now();
|
||||
|
||||
$error = 0;
|
||||
foreach ( $tabpay as $key => $val )
|
||||
{
|
||||
@@ -299,8 +303,9 @@ if ($action == 'writeBookKeeping')
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_create=$now;
|
||||
|
||||
if ($tabtype[$key] == 'payment') {
|
||||
|
||||
@@ -317,7 +322,7 @@ if ($action == 'writeBookKeeping')
|
||||
}
|
||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
||||
|
||||
$sqlmid = 'SELECT facf.facnumber';
|
||||
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
||||
@@ -326,14 +331,14 @@ if ($action == 'writeBookKeeping')
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
||||
$bookkeeping->doc_ref = $objmid->ref_supplier.' ('.$objmid->ref.')';;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
// Third party
|
||||
@@ -350,8 +355,9 @@ if ($action == 'writeBookKeeping')
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_create=$now;
|
||||
|
||||
if ($tabtype[$key] == 'sc') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
@@ -373,7 +379,7 @@ if ($action == 'writeBookKeeping')
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
||||
|
||||
$sqlmid = 'SELECT facf.facnumber';
|
||||
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
||||
@@ -382,7 +388,7 @@ if ($action == 'writeBookKeeping')
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
||||
$bookkeeping->doc_ref = $objmid->ref_supplier.' ('.$objmid->ref.')';
|
||||
}
|
||||
$bookkeeping->code_tiers = $k;
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
@@ -410,20 +416,19 @@ if ($action == 'writeBookKeeping')
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
// Export
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$bank_journal = $conf->global->ACCOUNTING_BANK_JOURNAL;
|
||||
|
||||
header('Content-Type: text/csv');
|
||||
header('Content-Disposition: attachment;filename=journal_banque.csv');
|
||||
@@ -434,16 +439,20 @@ if ($action == 'export_csv')
|
||||
{
|
||||
$sep = ";";
|
||||
|
||||
foreach ( $tabpay as $key => $val ) {
|
||||
foreach ($tabpay as $key => $val)
|
||||
{
|
||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
|
||||
$date = dol_print_date($db->jdate($val["date"]), '%d%m%Y');
|
||||
|
||||
// Bank
|
||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||
print $date . $sep;
|
||||
print $bank_journal . $sep;
|
||||
print $journal . $sep;
|
||||
print length_accountg(html_entity_decode($k)) . $sep;
|
||||
print $sep;
|
||||
print ($mt < 0 ? 'C' : 'D') . $sep;
|
||||
@@ -461,7 +470,7 @@ if ($action == 'export_csv')
|
||||
if ($mt)
|
||||
{
|
||||
print $date . $sep;
|
||||
print $bank_journal . $sep;
|
||||
print $journal . $sep;
|
||||
if ($val["lib"] == '(SupplierInvoicePayment)') {
|
||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) . $sep;
|
||||
} else {
|
||||
@@ -483,8 +492,8 @@ if ($action == 'export_csv')
|
||||
if (1)
|
||||
{
|
||||
print $date . $sep;
|
||||
print $bank_journal . $sep;
|
||||
print $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . $sep;
|
||||
print $journal . $sep;
|
||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . $sep;
|
||||
print $sep;
|
||||
print ($mt < 0 ? 'D' : 'C') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
@@ -538,7 +547,7 @@ if ($action == 'export_csv')
|
||||
{
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . '"' . $sep;
|
||||
print '"' . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . '"' . $sep;
|
||||
print '"' . $langs->trans("Bank") . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
@@ -548,67 +557,25 @@ if ($action == 'export_csv')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
} else {
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("BankJournal"));
|
||||
llxHeader('', $langs->trans("FinanceJournal"));
|
||||
|
||||
$namereport = $langs->trans("BankJournal");
|
||||
$description = $langs->trans("DescBankJournal");
|
||||
$nom = $langs->trans("FinanceJournal" . ' - ' . $journal);
|
||||
$builddate = time();
|
||||
$description = $langs->trans("DescFinanceJournal") . '<br>';
|
||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||
|
||||
// Report
|
||||
$h=0;
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal;
|
||||
$head[$h][1] = $langs->trans("Report");
|
||||
$head[$h][2] = 'card';
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans("BankJournal"), 0, 'payment');
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id_account='.$id_accountancy_journal.'">';
|
||||
print '<table width="100%" class="border">';
|
||||
|
||||
// Title
|
||||
print '<tr>';
|
||||
print '<td width="110">'.$langs->trans("ReportName").'</td>';
|
||||
print '<td colspan="3">'.$namereport.'</td>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Period report
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ReportPeriod").'</td>';
|
||||
if (! $periodlink) print '<td colspan="3">';
|
||||
else print '<td>';
|
||||
if ($period) print $period;
|
||||
if ($periodlink) print '</td><td colspan="2">'.$periodlink;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Description
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("ReportDescription").'</td>';
|
||||
print '<td colspan="3">'.$description.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td colspan="4" align="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
// End report
|
||||
|
||||
$varlink = 'id_account='.$id_bank_account;
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
|
||||
print '<input type="button" class="button" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||
|
||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writeBookKeeping();" />';
|
||||
|
||||
print '<input type="button" class="button" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
function launch_export() {
|
||||
@@ -616,8 +583,8 @@ else
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
function writeBookKeeping() {
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writeBookKeeping");
|
||||
function writebookkeeping() {
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
@@ -687,7 +654,7 @@ else
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $reflabel . "</td>";
|
||||
print "<td>" . $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE . "</td>";
|
||||
print "<td>" . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . "</td>";
|
||||
print "<td>" . $langs->trans('ThirdParty') . "</td>";
|
||||
print "<td> </td>";
|
||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
|
||||
@@ -84,7 +84,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
$idpays = $p[0];
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,";
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.datef as df, f.libelle,f.ref_supplier,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.total_ttc, fd.tva_tx, fd.total_ht, fd.tva as total_tva, fd.product_type,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta_fournisseur, s.fournisseur,";
|
||||
$sql .= " s.code_compta_fournisseur, p.accountancy_code_buy , ct.accountancy_code_buy as account_tva, aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||
@@ -135,7 +135,7 @@ if ($result) {
|
||||
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
|
||||
|
||||
$tabfac[$obj->rowid]["date"] = $obj->df;
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->ref;
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->ref_supplier.' ('.$obj->ref.')';
|
||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||
$tabfac[$obj->rowid]["description"] = $obj->description;
|
||||
$tabfac[$obj->rowid]["fk_facturefourndet"] = $obj->fdid;
|
||||
@@ -183,7 +183,7 @@ if ($action == 'writebookkeeping') {
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ if ($action == 'writebookkeeping') {
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,14 +244,14 @@ if ($action == 'writebookkeeping') {
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ if ($action == 'writebookkeeping')
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ if ($action == 'writebookkeeping')
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -280,14 +280,14 @@ if ($action == 'writebookkeeping')
|
||||
$result = $bookkeeping->create();
|
||||
if ($result < 0) {
|
||||
$error ++;
|
||||
setEventMessage($object->errors, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs');
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/card.php
|
||||
* \ingroup Accounting Expert
|
||||
* \ingroup Accountancy
|
||||
* \brief Card supplier ventilation
|
||||
*/
|
||||
|
||||
@@ -88,7 +88,6 @@ if (! empty($id)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
||||
|
||||
if (! empty($conf->multicompany->enabled)) {
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 1) . ")";
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/supplier/list.php
|
||||
* \ingroup Accounting Expert
|
||||
* \ingroup Accountancy
|
||||
* \brief Ventilation page from suppliers invoices
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
@@ -94,8 +94,8 @@ $formventilation = new FormVentilation($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
||||
$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT);
|
||||
$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT);
|
||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT,1);
|
||||
$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT,1);
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
@@ -171,19 +171,27 @@ if ($action == 'ventil' && !empty($btn_ventil)) {
|
||||
*
|
||||
*/
|
||||
|
||||
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.tva_tx as tva_tx_line, ";
|
||||
if (! empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)) {
|
||||
$limit = $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION;
|
||||
} else if ($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION <= 0) {
|
||||
$limit = $conf->liste_limit;
|
||||
} else {
|
||||
$limit = $conf->liste_limit;
|
||||
}
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql = "SELECT f.ref, f.rowid as facid, f.ref_supplier, f.datef, l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, ";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod";
|
||||
$sql .= " , aa.rowid as aarowid";
|
||||
$sql .= " , f.datef";
|
||||
$sql .= " , l.product_type as type_l";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accountingaccount as aa ON p.accountancy_code_buy = aa.account_number";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND fk_code_ventilation <= 0";
|
||||
$sql .= " AND product_type <= 2";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_buy ='')";
|
||||
|
||||
// Add search filter like
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= " AND (f.ref like '%" . $search_invoice . "%')";
|
||||
|
||||
@@ -594,7 +594,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print '<table class="nobordernopadding">';
|
||||
print "<tr><td><label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
$example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code);
|
||||
print ($example!="LocalTax1IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
|
||||
@@ -602,8 +602,8 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
{
|
||||
print '<tr><td align="left"><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||
$formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
$opcions=array($langs->trans("CalcLocaltax1").' '.$langs->trans("CalcLocaltax1Desc"),$langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc"),$langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc"));
|
||||
|
||||
@@ -614,7 +614,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</td></tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"nolt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
@@ -639,14 +639,14 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print '<table class="nobordernopadding">';
|
||||
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
$example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code);
|
||||
print ($example!="LocalTax2IsUsedExample"?"<tr><td><i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."</i></td></tr>\n":"");
|
||||
print '<tr><td align="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
|
||||
if(! isOnlyOneLocalTax(2))
|
||||
{
|
||||
$formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
|
||||
print '<tr><td align="left"><label for="lt2">'.$langs->trans("LTRate").'</label>: ';
|
||||
$formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2");
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '<tr><td align="left"><label for="clt2">'.$langs->trans("CalcLocaltax").'</label>: ';
|
||||
@@ -656,7 +656,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</td></tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
@@ -988,7 +988,7 @@ else
|
||||
/*
|
||||
* Local Taxes
|
||||
*/
|
||||
if ($mysoc->useLocalTax(1))
|
||||
if ($mysoc->useLocalTax(1)) // True if we found at least on vat with a setup adding a localtax 1
|
||||
{
|
||||
// Local Tax 1
|
||||
print '<br>';
|
||||
@@ -1028,7 +1028,7 @@ else
|
||||
print "</td></tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".($conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off"?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"no_lt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
@@ -1039,7 +1039,7 @@ else
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
if ($mysoc->useLocalTax(2))
|
||||
if ($mysoc->useLocalTax(2)) // True if we found at least on vat with a setup adding a localtax 1
|
||||
{
|
||||
// Local Tax 2
|
||||
print '<br>';
|
||||
@@ -1080,7 +1080,7 @@ else
|
||||
print "</td></tr>\n";
|
||||
|
||||
$var=!$var;
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".($conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off"?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print "<tr ".$bc[$var]."><td width=\"140\"><input ".$bc[$var]." type=\"radio\" name=\"optionlocaltax2\" id=\"nolt2\" disabled value=\"localtax2off\"".((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"nolt2\">".$langs->transcountry("LocalTax2IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
|
||||
@@ -147,7 +147,7 @@ if ($action == 'add')
|
||||
}
|
||||
if (! $error && ! $_POST['url'])
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Url")), 'errors');
|
||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("URL")), 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ $hookmanager->initHooks(array('actioncard','globalcard'));
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$listUserAssignedUpdated = false;
|
||||
// Remove user to assigned list
|
||||
if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
|
||||
{
|
||||
@@ -114,6 +114,8 @@ if (GETPOST('removedassigned') || GETPOST('removedassigned') == '0')
|
||||
$donotclearsession=1;
|
||||
if ($action == 'add') $action = 'create';
|
||||
if ($action == 'update') $action = 'edit';
|
||||
|
||||
$listUserAssignedUpdated = true;
|
||||
}
|
||||
|
||||
// Add user to assigned list
|
||||
@@ -133,6 +135,8 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
|
||||
$donotclearsession=1;
|
||||
if ($action == 'add') $action = 'create';
|
||||
if ($action == 'update') $action = 'edit';
|
||||
|
||||
$listUserAssignedUpdated = true;
|
||||
}
|
||||
|
||||
// Action clone object
|
||||
@@ -838,6 +842,28 @@ if ($id > 0)
|
||||
$result4=$object->fetch_userassigned();
|
||||
$result5=$object->fetch_optionals($id,$extralabels);
|
||||
|
||||
if($listUserAssignedUpdated || $donotclearsession) {
|
||||
|
||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]);
|
||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]);
|
||||
|
||||
$object->fk_action = dol_getIdFromCode($db, GETPOST("actioncode"), 'c_actioncomm');
|
||||
$object->label = GETPOST("label");
|
||||
$object->datep = $datep;
|
||||
$object->datef = $datef;
|
||||
$object->percentage = $percentage;
|
||||
$object->priority = GETPOST("priority");
|
||||
$object->fulldayevent= GETPOST("fullday")?1:0;
|
||||
$object->location = GETPOST('location');
|
||||
$object->socid = GETPOST("socid");
|
||||
$object->contactid = GETPOST("contactid",'int');
|
||||
//$object->societe->id = $_POST["socid"]; // deprecated
|
||||
//$object->contact->id = $_POST["contactid"]; // deprecated
|
||||
$object->fk_project = GETPOST("projectid",'int');
|
||||
|
||||
$object->note = GETPOST("note");
|
||||
}
|
||||
|
||||
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
|
||||
{
|
||||
dol_print_error($db,$object->error);
|
||||
@@ -1147,7 +1173,7 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
// Title
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.dol_htmlentities($object->label).'</td></tr>';
|
||||
|
||||
// Full day event
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
|
||||
|
||||
@@ -196,6 +196,7 @@ class ActionComm extends CommonObject
|
||||
// Check parameters
|
||||
if (empty($this->userownerid))
|
||||
{
|
||||
dol_syslog("You tried to create an event but mandatory property ownerid was not defined", LOG_WARNING);
|
||||
$this->errors[]='ErrorPropertyUserowneridNotDefined';
|
||||
return -1;
|
||||
}
|
||||
@@ -840,7 +841,7 @@ class ActionComm extends CommonObject
|
||||
if (! empty($elementtype))
|
||||
{
|
||||
if ($elementtype == 'project') $sql.= ' AND a.fk_project = '.$fk_element;
|
||||
else $sql.= " AND a.fk_element = ".$fk_element." AND a.elementtype = '".$elementtype."'";
|
||||
else $sql.= " AND a.fk_element = ".(int) $fk_element." AND a.elementtype = '".$elementtype."'";
|
||||
}
|
||||
if (! empty($filter)) $sql.= $filter;
|
||||
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
|
||||
|
||||
@@ -762,7 +762,7 @@ if ($id > 0)
|
||||
{
|
||||
$contratstatic=new Contrat($db);
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc";
|
||||
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_supplier as refsup";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
|
||||
$sql.= " WHERE c.fk_soc = s.rowid ";
|
||||
$sql.= " AND s.rowid = ".$object->id;
|
||||
@@ -779,7 +779,7 @@ if ($id > 0)
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td colspan="6"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastContracts",($num<=$MAXLIST?"":$MAXLIST)).'</td>';
|
||||
print '<td align="right"><a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->id.'">'.$langs->trans("AllContracts").' <span class="badge">'.$num.'</span></a></td></tr></table></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -796,7 +796,9 @@ if ($id > 0)
|
||||
$contrat->ref=$objp->ref?$objp->ref:$objp->id;
|
||||
print $contrat->getNomUrl(1,12);
|
||||
print "</td>\n";
|
||||
print '<td class="nowrap">'.dol_trunc($objp->refsup,12)."</td>\n";
|
||||
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dc),'day')."</td>\n";
|
||||
print '<td align="right" width="80">'.dol_print_date($db->jdate($objp->dcon),'day')."</td>\n";
|
||||
print '<td width="20"> </td>';
|
||||
print '<td align="right" class="nowrap">';
|
||||
$contrat->fetch_lines();
|
||||
|
||||
@@ -544,7 +544,7 @@ if (empty($reshook))
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
dol_remove_file_process($_POST['removedfile'],0);
|
||||
dol_remove_file_process($_POST['removedfile'],0,0); // We really delete file linked to mailing
|
||||
|
||||
$action="edit";
|
||||
}
|
||||
@@ -1093,7 +1093,10 @@ else
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print "</div>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
print "\n";
|
||||
print '<form name="edit_mailing" action="card.php" method="post" enctype="multipart/form-data">'."\n";
|
||||
@@ -1103,6 +1106,9 @@ else
|
||||
|
||||
// Print mail content
|
||||
print_fiche_titre($langs->trans("EMail"),'','');
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Subject
|
||||
@@ -1168,7 +1174,9 @@ else
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Save").'" name="save">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'" name="cancel">';
|
||||
|
||||
@@ -485,13 +485,14 @@ if ($object->fetch($id) >= 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$m=new Adherent($db);
|
||||
$m->id=$obj->source_id;
|
||||
$m->fetch($obj->source_id);
|
||||
print $m->getNomUrl(2);
|
||||
}
|
||||
else if ($obj->source_type == 'user')
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
$m=new User($db);
|
||||
$m->fetch($obj->source_id);
|
||||
$m->id=$obj->source_id;
|
||||
print $m->getNomUrl(2);
|
||||
}
|
||||
@@ -499,7 +500,7 @@ if ($object->fetch($id) >= 0)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
$m=new Societe($db);
|
||||
$m->id=$obj->source_id;
|
||||
$m->fetch($obj->source_id);
|
||||
print $m->getNomUrl(2);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -196,7 +196,7 @@ class Mailing extends CommonObject
|
||||
$sql.= ", m.date_envoi";
|
||||
$sql.= ", m.extraparams";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing as m";
|
||||
$sql.= " WHERE m.rowid = ".$rowid;
|
||||
$sql.= " WHERE m.rowid = ".(int) $rowid;
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
@@ -556,11 +556,11 @@ class Mailing extends CommonObject
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
return $langs->trans($this->statut_dest[$statut]);
|
||||
return $langs->trans('MailingStatusError');
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
return $langs->trans($this->statut_dest[$statut]);
|
||||
return $langs->trans('MailingStatusSent');
|
||||
}
|
||||
if ($mode == 2)
|
||||
{
|
||||
|
||||
@@ -1162,7 +1162,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PROPAL_CLONE',$user);
|
||||
$result=$clonedObj->call_trigger('PROPAL_CLONE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ if ($result)
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($conf->categorie->enabled && $user->rights->produit->lire)
|
||||
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
|
||||
@@ -324,7 +324,7 @@ if (empty($reshook))
|
||||
for($i = 0; $i < $num; $i ++)
|
||||
{
|
||||
$label = (! empty($lines[$i]->label) ? $lines[$i]->label : '');
|
||||
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : $lines[$i]->libelle);
|
||||
$desc = (! empty($lines[$i]->desc) ? $lines[$i]->desc : '');
|
||||
$product_type = (! empty($lines[$i]->product_type) ? $lines[$i]->product_type : 0);
|
||||
|
||||
// Dates
|
||||
@@ -1239,8 +1239,10 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
if ($socid > 0)
|
||||
$res = $soc->fetch($socid);
|
||||
|
||||
if (! empty($origin) && ! empty($originid))
|
||||
{
|
||||
$projectid = 0;
|
||||
$remise_absolue = 0;
|
||||
|
||||
if (! empty($origin) && ! empty($originid)) {
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $subelement = $origin;
|
||||
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||
@@ -1250,6 +1252,20 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
|
||||
if ($element == 'project') {
|
||||
$projectid = $originid;
|
||||
|
||||
if (!$cond_reglement_id) {
|
||||
$cond_reglement_id = $soc->cond_reglement_id;
|
||||
}
|
||||
if (!$mode_reglement_id) {
|
||||
$mode_reglement_id = $soc->mode_reglement_id;
|
||||
}
|
||||
if (!$remise_percent) {
|
||||
$remise_percent = $soc->remise_percent;
|
||||
}
|
||||
if (!$dateorder) {
|
||||
// Do not set 0 here (0 for a date is 1970)
|
||||
$dateorder = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE_ODER)?-1:''):$dateorder);
|
||||
}
|
||||
} else {
|
||||
// For compatibility
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
@@ -1510,9 +1526,23 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<input type="hidden" name="origin" value="' . $objectsrc->element . '">';
|
||||
print '<input type="hidden" name="originid" value="' . $objectsrc->id . '">';
|
||||
|
||||
$newclassname = $classname;
|
||||
if ($newclassname == 'Propal')
|
||||
$newclassname = 'CommercialProposal';
|
||||
switch ($classname) {
|
||||
case 'Propal':
|
||||
$newclassname = 'CommercialProposal';
|
||||
break;
|
||||
case 'Commande':
|
||||
$newclassname = 'Order';
|
||||
break;
|
||||
case 'Expedition':
|
||||
$newclassname = 'Sending';
|
||||
break;
|
||||
case 'Contrat':
|
||||
$newclassname = 'Contract';
|
||||
break;
|
||||
default:
|
||||
$newclassname = $classname;
|
||||
}
|
||||
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
|
||||
|
||||
@@ -89,10 +89,39 @@ class Commande extends CommonOrder
|
||||
var $cond_reglement_id;
|
||||
var $cond_reglement_code;
|
||||
var $fk_account;
|
||||
/**
|
||||
* It holds the label of the payment mode. Use it in case translation cannot be found.
|
||||
* @var string
|
||||
*/
|
||||
var $mode_reglement;
|
||||
|
||||
/**
|
||||
* Payment mode id
|
||||
* @var int
|
||||
*/
|
||||
var $mode_reglement_id;
|
||||
|
||||
/**
|
||||
* Payment mode code
|
||||
* @var string
|
||||
*/
|
||||
var $mode_reglement_code;
|
||||
/**
|
||||
* Availability delivery time id
|
||||
* @var int
|
||||
*/
|
||||
var $availability_id;
|
||||
/**
|
||||
* Availability delivery time code
|
||||
* @var string
|
||||
*/
|
||||
var $availability_code;
|
||||
/**
|
||||
* Label of availability delivery time. Use it in case translation cannot be found.
|
||||
* @var string
|
||||
*/
|
||||
var $availability;
|
||||
|
||||
var $demand_reason_id;
|
||||
var $demand_reason_code;
|
||||
var $fk_delivery_address;
|
||||
@@ -453,7 +482,7 @@ class Commande extends CommonOrder
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We increment stock of product (and sub-products)
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderBackToDraftInDolibarr",$this->ref));
|
||||
if ($result < 0) { $error++; }
|
||||
}
|
||||
}
|
||||
@@ -637,7 +666,7 @@ class Commande extends CommonOrder
|
||||
{
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
// We increment stock of product (and sub-products)
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("OrderCanceledInDolibarr",$this->ref));
|
||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("OrderCanceledInDolibarr",$this->ref)); // price is 0, we don't want WAP to be changed
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
@@ -984,6 +1013,7 @@ class Commande extends CommonOrder
|
||||
// Clear fields
|
||||
$this->user_author_id = $user->id;
|
||||
$this->user_valid = '';
|
||||
$this->date = dol_now();
|
||||
$this->date_creation = '';
|
||||
$this->date_validation = '';
|
||||
$this->ref_client = '';
|
||||
@@ -1187,7 +1217,7 @@ class Commande extends CommonOrder
|
||||
{
|
||||
global $mysoc, $conf, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type, fk_unit=$fk_unit", LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit", LOG_DEBUG);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
@@ -1469,7 +1499,7 @@ class Commande extends CommonOrder
|
||||
$sql.= ", i.libelle as libelle_incoterms";
|
||||
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
|
||||
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
|
||||
$sql.= ', ca.code as availability_code';
|
||||
$sql.= ', ca.code as availability_code, ca.label as availability_label';
|
||||
$sql.= ', dr.code as demand_reason_code';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_payment_term as cr ON (c.fk_cond_reglement = cr.rowid)';
|
||||
@@ -1526,6 +1556,7 @@ class Commande extends CommonOrder
|
||||
$this->fk_account = $obj->fk_account;
|
||||
$this->availability_id = $obj->fk_availability;
|
||||
$this->availability_code = $obj->availability_code;
|
||||
$this->availability = $obj->availability_label;
|
||||
$this->demand_reason_id = $obj->fk_input_reason;
|
||||
$this->demand_reason_code = $obj->demand_reason_code;
|
||||
$this->date_livraison = $this->db->jdate($obj->date_livraison);
|
||||
@@ -2916,7 +2947,7 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
function LibStatut($statut,$billed,$mode)
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $conf;
|
||||
//print 'x'.$statut.'-'.$billed;
|
||||
if ($mode == 0)
|
||||
{
|
||||
|
||||
@@ -281,7 +281,7 @@ if ($resql)
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($conf->categorie->enabled && $user->rights->produit->lire)
|
||||
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -179,6 +180,7 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$object->origin_id = $orders_id[$ii];
|
||||
$object->linked_objects = $orders_id;
|
||||
$id = $object->create($user);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if ($id>0)
|
||||
{
|
||||
|
||||
@@ -1277,12 +1277,12 @@ class AccountLine extends CommonObject
|
||||
$nbko++;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class WHERE lineid=".(int) $this->rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result) $nbko++;
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank WHERE rowid=".(int) $this->rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result) $nbko++;
|
||||
@@ -1319,7 +1319,7 @@ class AccountLine extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$this->rowid;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".(int) $this->rowid;
|
||||
dol_syslog(get_class($this)."::delete_urls", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if (! $result) $nbko++;
|
||||
|
||||
@@ -99,11 +99,14 @@ if ($action == 'rappro' && $user->rights->banque->consolidate)
|
||||
if ($action == 'del')
|
||||
{
|
||||
$bankline=new AccountLine($db);
|
||||
$bankline->fetch($_GET["rowid"]);
|
||||
$result=$bankline->delete($user);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db,$bankline->error);
|
||||
|
||||
if ($bankline->fetch($_GET["rowid"]) > 0) {
|
||||
$result = $bankline->delete($user);
|
||||
if ($result < 0) {
|
||||
dol_print_error($db, $bankline->error);
|
||||
}
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008-2009 Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com
|
||||
*
|
||||
* 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
|
||||
@@ -309,7 +310,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
||||
print "</td>";
|
||||
print "<td>".$ref."</td>";
|
||||
print "<td>".$refcomp."</td>";
|
||||
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price($total_ttc)."</td><td> </td>"; };
|
||||
if ($obj->total_ttc < 0) { print "<td align=\"right\">".price(abs($total_ttc))."</td><td> </td>"; };
|
||||
if ($obj->total_ttc >= 0) { print "<td> </td><td align=\"right\">".price($total_ttc)."</td>"; };
|
||||
print '<td align="right">'.price($solde).'</td>';
|
||||
print "</tr>";
|
||||
|
||||
@@ -115,7 +115,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer)
|
||||
$error=0;
|
||||
|
||||
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
|
||||
$object->km = GETPOST('km','int');
|
||||
$object->km = price2num(GETPOST('km','alpha'), 'MU'); // Not 'int', it may be a formated amount
|
||||
$object->type = GETPOST('type','alpha');
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->fk_user = GETPOST('fk_user','int');
|
||||
@@ -174,7 +174,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer)
|
||||
$result = $object->fetch($id);
|
||||
|
||||
$object->date = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
|
||||
$object->km = GETPOST('km','int');
|
||||
$object->km = price2num(GETPOST('km','alpha'), 'MU'); // Not 'int', it may be a formated amount
|
||||
$object->type = GETPOST('type','alpha');
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->fk_user = GETPOST('fk_user','int');
|
||||
|
||||
@@ -1841,6 +1841,8 @@ if ($action == 'create')
|
||||
$res = $soc->fetch($socid);
|
||||
|
||||
// Load objectsrc
|
||||
$remise_absolue = 0;
|
||||
|
||||
if (! empty($origin) && ! empty($originid))
|
||||
{
|
||||
// Parse element/subelement (ex: project_task)
|
||||
@@ -1852,6 +1854,20 @@ if ($action == 'create')
|
||||
|
||||
if ($element == 'project') {
|
||||
$projectid = $originid;
|
||||
|
||||
if (!$cond_reglement_id) {
|
||||
$cond_reglement_id = $soc->cond_reglement_id;
|
||||
}
|
||||
if (!$mode_reglement_id) {
|
||||
$mode_reglement_id = $soc->mode_reglement_id;
|
||||
}
|
||||
if (!$remise_percent) {
|
||||
$remise_percent = $soc->remise_percent;
|
||||
}
|
||||
if (!$dateinvoice) {
|
||||
// Do not set 0 here (0 for a date is 1970)
|
||||
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice);
|
||||
}
|
||||
} else {
|
||||
// For compatibility
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
@@ -1896,7 +1912,6 @@ if ($action == 'create')
|
||||
$objectsrc->fetch_optionals($originid);
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
}
|
||||
$dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ? -1 : ''; // Dot not set 0 here (0 for a date is 1970)
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1907,6 +1922,7 @@ if ($action == 'create')
|
||||
$remise_absolue = 0;
|
||||
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970)
|
||||
}
|
||||
|
||||
$absolute_discount = $soc->getAvailableDiscounts();
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
@@ -1957,7 +1973,7 @@ if ($action == 'create')
|
||||
else
|
||||
{
|
||||
print '<td colspan="2">';
|
||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 1);
|
||||
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3) AND status=1', 1);
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>' . "\n";
|
||||
|
||||
@@ -1074,7 +1074,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error='Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql;
|
||||
$this->error='Bill with id '.$rowid.' or ref '.$ref.' not found';
|
||||
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
|
||||
return 0;
|
||||
}
|
||||
@@ -1890,7 +1890,7 @@ class Facture extends CommonInvoice
|
||||
$mouvP = new MouvementStock($this->db);
|
||||
$mouvP->origin = &$this;
|
||||
// We decrease stock for product
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, 0, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
@@ -2128,8 +2128,8 @@ class Facture extends CommonInvoice
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($fk_prev_id)) $fk_prev_id = 'null';
|
||||
if (is_null($situation_percent) || $situation_percent > 100) $situation_percent = 100;
|
||||
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
@@ -2315,7 +2315,7 @@ class Facture extends CommonInvoice
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($special_code) || $special_code == 3) $special_code=0;
|
||||
if ($situation_percent > 100 || is_null($situation_percent) || $situation_percent == "") $situation_percent = 100;
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent = price2num($remise_percent);
|
||||
$qty = price2num($qty);
|
||||
@@ -3672,23 +3672,27 @@ class Facture extends CommonInvoice
|
||||
/**
|
||||
* Checks if the invoice is the last in its cycle
|
||||
*
|
||||
* @return int 0 or 1 if OK, -1 if error
|
||||
* @return bool Last of the cycle status
|
||||
*
|
||||
*/
|
||||
function is_last_in_cycle()
|
||||
{
|
||||
$sql = 'SELECT max(situation_counter) FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_cycle_ref = ' . $this->situation_cycle_ref;
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql && $resql->num_rows > 0) {
|
||||
$res = $this->db->fetch_array($resql);
|
||||
$last = $res['max(situation_counter)'];
|
||||
return ($last == $this->situation_counter);
|
||||
if (!empty($this->situation_cycle_ref)) {
|
||||
// No point in testing anything if we're not inside a cycle
|
||||
$sql = 'SELECT max(situation_counter) FROM ' . MAIN_DB_PREFIX . 'facture WHERE situation_cycle_ref = ' . $this->situation_cycle_ref;
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql && $resql->num_rows > 0) {
|
||||
$res = $this->db->fetch_array($resql);
|
||||
$last = $res['max(situation_counter)'];
|
||||
return ($last == $this->situation_counter);
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3893,7 +3897,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (empty($this->fk_prev_id)) $this->fk_prev_id = 'null';
|
||||
if (empty($this->situation_percent)) $this->situation_percent = 0;
|
||||
if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
|
||||
|
||||
if (empty($this->pa_ht)) $this->pa_ht=0;
|
||||
|
||||
@@ -4088,7 +4092,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
if (empty($this->special_code)) $this->special_code=0;
|
||||
if (empty($this->product_type)) $this->product_type=0;
|
||||
if (empty($this->fk_parent_line)) $this->fk_parent_line=0;
|
||||
if (is_null($this->situation_percent)) $this->situation_percent=100;
|
||||
if (! isset($this->situation_percent) || $this->situation_percent > 100 || (string) $this->situation_percent == '') $this->situation_percent = 100;
|
||||
|
||||
// Check parameters
|
||||
if ($this->product_type < 0) return -1;
|
||||
|
||||
@@ -296,7 +296,7 @@ if ($resql)
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
// If the user can view prospects other than his'
|
||||
if ($conf->categorie->enabled && $user->rights->produit->lire)
|
||||
if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
|
||||
@@ -70,6 +70,11 @@ $diroutputpdf=$conf->facture->dir_output . '/unpaid/temp';
|
||||
if (! $user->rights->societe->client->voir || $socid) $diroutputpdf.='/private/'.$user->id; // If user has no permission to see all, output dir is specific to user
|
||||
|
||||
$resultmasssend='';
|
||||
if (GETPOST('buttonsendremind'))
|
||||
{
|
||||
$action='presend';
|
||||
$mode='sendmassremind';
|
||||
}
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
|
||||
{
|
||||
@@ -122,15 +127,90 @@ if ($action == 'presend' && GETPOST('sendmail'))
|
||||
$nbsent = 0;
|
||||
$nbignored = 0;
|
||||
|
||||
for ($i = 0; $i < $countToSend; $i++)
|
||||
$arrayofinvoices=GETPOST('toSend','array');
|
||||
|
||||
$thirdparty=new Societe($db);
|
||||
$invoicetmp=new Facture($db);
|
||||
$listofinvoicesid=array();
|
||||
$listofinvoicesthirdparties=array();
|
||||
$listofinvoicesref=array();
|
||||
foreach($arrayofinvoices as $invoiceid)
|
||||
{
|
||||
$object = new Facture($db);
|
||||
$result = $object->fetch($_POST['toSend'][$i]);
|
||||
|
||||
if ($result > 0) // Invoice was found
|
||||
$invoicetmp=new Facture($db); // must create new instance because instance is saved into $listofinvoicesref array for future use
|
||||
$result=$invoicetmp->fetch($invoiceid);
|
||||
if ($result > 0)
|
||||
{
|
||||
$listoinvoicesid[$invoiceid]=$invoiceid;
|
||||
$thirdpartyid=$invoicetmp->fk_soc?$invoicetmp->fk_soc:$invoicetmp->socid;
|
||||
$listofinvoicesthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||
$listofinvoicesref[$thirdpartyid][$invoiceid]=$invoicetmp;
|
||||
}
|
||||
}
|
||||
//var_dump($listofinvoicesref);exit;
|
||||
|
||||
foreach ($listofinvoicesthirdparties as $thirdpartyid)
|
||||
{
|
||||
$result = $thirdparty->fetch($thirdpartyid);
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define recipient $sendto and $sendtocc
|
||||
if (trim($_POST['sendto']))
|
||||
{
|
||||
// Recipient is provided into free text
|
||||
$sendto = trim($_POST['sendto']);
|
||||
$sendtoid = 0;
|
||||
}
|
||||
elseif ($_POST['receiver'] != '-1')
|
||||
{
|
||||
// Recipient was provided from combo list
|
||||
if ($_POST['receiver'] == 'thirdparty') // Id of third party
|
||||
{
|
||||
$sendto = $thirdparty->email;
|
||||
$sendtoid = 0;
|
||||
}
|
||||
else // Id du contact
|
||||
{
|
||||
$sendto = $thirdparty->contact_get_property((int) $_POST['receiver'],'email');
|
||||
$sendtoid = $_POST['receiver'];
|
||||
}
|
||||
}
|
||||
if (trim($_POST['sendtocc']))
|
||||
{
|
||||
$sendtocc = trim($_POST['sendtocc']);
|
||||
}
|
||||
elseif ($_POST['receivercc'] != '-1')
|
||||
{
|
||||
// Recipient was provided from combo list
|
||||
if ($_POST['receivercc'] == 'thirdparty') // Id of third party
|
||||
{
|
||||
$sendtocc = $thirdparty->email;
|
||||
}
|
||||
else // Id du contact
|
||||
{
|
||||
$sendtocc = $thirdparty->contact_get_property((int) $_POST['receivercc'],'email');
|
||||
}
|
||||
}
|
||||
|
||||
//var_dump($listofinvoicesref[$thirdpartyid]);
|
||||
|
||||
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
|
||||
$listofqualifiedinvoice=array();
|
||||
$listofqualifiedref=array();
|
||||
foreach($listofinvoicesref[$thirdpartyid] as $invoiceid => $invoice)
|
||||
{
|
||||
//var_dump($invoice);
|
||||
$object = $invoice;
|
||||
//$object = new Facture($db);
|
||||
//$result = $object->fetch();
|
||||
//var_dump($thirdpartyid.' - '.$invoiceid.' - '.$object->statut);
|
||||
|
||||
if ($object->statut != Facture::STATUS_VALIDATED)
|
||||
{
|
||||
$nbignored++;
|
||||
continue; // Payment done or started or canceled
|
||||
}
|
||||
|
||||
@@ -144,108 +224,30 @@ if ($action == 'presend' && GETPOST('sendmail'))
|
||||
|
||||
if (dol_is_file($file))
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
$sendto = $object->thirdparty->email;
|
||||
if (empty($sendto)) // For the case, no recipient were set (multi thirdparties send)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
$sendto = $object->thirdparty->email;
|
||||
}
|
||||
|
||||
if (empty($sendto)) $nbignored++;
|
||||
if (empty($sendto))
|
||||
{
|
||||
$nbignored++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (dol_strlen($sendto))
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email .'>';
|
||||
$replyto = $from;
|
||||
$subject = GETPOST('subject');
|
||||
$message = GETPOST('message');
|
||||
$sendtocc = GETPOST('sentocc');
|
||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||
|
||||
$substitutionarray=array(
|
||||
'__ID__' => $object->id,
|
||||
'__EMAIL__' => $object->thirdparty->email,
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$obj2->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
//'__LASTNAME__' => $obj2->lastname,
|
||||
//'__FIRSTNAME__' => $obj2->firstname,
|
||||
'__FACREF__' => $object->ref, // For backward compatibility
|
||||
'__REF__' => $object->ref,
|
||||
'__REFCLIENT__' => $object->thirdparty->name
|
||||
);
|
||||
|
||||
$subject=make_substitutions($subject, $substitutionarray);
|
||||
$message=make_substitutions($message, $substitutionarray);
|
||||
|
||||
$actiontypecode='AC_FAC';
|
||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($message)
|
||||
{
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
|
||||
// Create form object
|
||||
$attachedfiles=array('paths'=>array($file), 'names'=>array($filename), 'mimes'=>array($mime));
|
||||
$filepath = $attachedfiles['paths'];
|
||||
$filename = $attachedfiles['names'];
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
// Send mail
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resultmasssend.='<div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
$resultmasssend.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain "
|
||||
|
||||
$error=0;
|
||||
|
||||
// Initialisation donnees
|
||||
$object->sendtoid = 0;
|
||||
$object->actiontypecode = $actiontypecode;
|
||||
$object->actionmsg = $actionmsg; // Long text
|
||||
$object->actionmsg2 = $actionmsg2; // Short text
|
||||
$object->fk_element = $object->id;
|
||||
$object->elementtype = $object->element;
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$resultmasssend.=$langs->trans("MailSent").': '.$sendto."<br>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$nbsent++;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("other");
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resultmasssend.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
|
||||
$resultmasssend.='<br><div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$resultmasssend.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$attachedfiles=array(
|
||||
'paths'=>array_merge($attachedfiles['paths'],array($file)),
|
||||
'names'=>array_merge($attachedfiles['names'],array($filename)),
|
||||
'mimes'=>array_merge($attachedfiles['mimes'],array($mime))
|
||||
);
|
||||
}
|
||||
|
||||
$listofqualifiedinvoice[$invoiceid]=$invoice;
|
||||
$listofqualifiedref[$invoiceid]=$invoice->ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -253,6 +255,109 @@ if ($action == 'presend' && GETPOST('sendmail'))
|
||||
$langs->load("other");
|
||||
$resultmasssend.='<div class="error">'.$langs->trans('ErrorCantReadFile',$file).'</div>';
|
||||
dol_syslog('Failed to read file: '.$file, LOG_WARNING);
|
||||
continue;
|
||||
}
|
||||
|
||||
//var_dump($listofqualifiedref);
|
||||
}
|
||||
|
||||
if (count($listofqualifiedinvoice) > 0)
|
||||
{
|
||||
$langs->load("commercial");
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email .'>';
|
||||
$replyto = $from;
|
||||
$subject = GETPOST('subject');
|
||||
$message = GETPOST('message');
|
||||
$sendtocc = GETPOST('sentocc');
|
||||
$sendtobcc = (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)?'':$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO);
|
||||
|
||||
$substitutionarray=array(
|
||||
'__ID__' => join(', ',array_keys($listofqualifiedinvoice)),
|
||||
'__EMAIL__' => $thirdparty->email,
|
||||
'__CHECK_READ__' => '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>',
|
||||
//'__LASTNAME__' => $obj2->lastname,
|
||||
//'__FIRSTNAME__' => $obj2->firstname,
|
||||
'__FACREF__' => join(', ',$listofqualifiedref), // For backward compatibility
|
||||
'__REF__' => join(', ',$listofqualifiedref),
|
||||
'__REFCLIENT__' => $thirdparty->name
|
||||
);
|
||||
|
||||
$subject=make_substitutions($subject, $substitutionarray);
|
||||
$message=make_substitutions($message, $substitutionarray);
|
||||
|
||||
$filepath = $attachedfiles['paths'];
|
||||
$filename = $attachedfiles['names'];
|
||||
$mimetype = $attachedfiles['mimes'];
|
||||
|
||||
//var_dump($filepath);
|
||||
|
||||
// Send mail
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
|
||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resultmasssend.='<div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$mailfile->sendfile();
|
||||
if ($result)
|
||||
{
|
||||
$resultmasssend.=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); // Must not contain "
|
||||
|
||||
$error=0;
|
||||
|
||||
foreach($listofqualifiedinvoice as $invid => $object)
|
||||
{
|
||||
$actiontypecode='AC_FAC';
|
||||
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto;
|
||||
if ($message)
|
||||
{
|
||||
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $message);
|
||||
}
|
||||
|
||||
// Initialisation donnees
|
||||
$object->sendtoid = 0;
|
||||
$object->actiontypecode = $actiontypecode;
|
||||
$object->actionmsg = $actionmsg; // Long text
|
||||
$object->actionmsg2 = $actionmsg2; // Short text
|
||||
$object->fk_element = $invid;
|
||||
$object->elementtype = $invoice->element;
|
||||
|
||||
// Appel des triggers
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers('BILL_SENTBYMAIL',$object,$user,$langs,$conf);
|
||||
if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||
// Fin appel triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$resultmasssend.=$langs->trans("MailSent").': '.$sendto."<br>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
$nbsent++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$langs->load("other");
|
||||
if ($mailfile->error)
|
||||
{
|
||||
$resultmasssend.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
|
||||
$resultmasssend.='<br><div class="error">'.$mailfile->error.'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$resultmasssend.='<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -417,7 +522,6 @@ $search_societe = GETPOST("search_societe");
|
||||
$search_paymentmode = GETPOST("search_paymentmode");
|
||||
$search_montant_ht = GETPOST("search_montant_ht");
|
||||
$search_montant_ttc = GETPOST("search_montant_ttc");
|
||||
$search_status = GETPOST("search_status");
|
||||
$late = GETPOST("late");
|
||||
|
||||
// Do we click on purge search criteria ?
|
||||
@@ -429,7 +533,6 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_paymentmode='';
|
||||
$search_montant_ht='';
|
||||
$search_montant_ttc='';
|
||||
$search_status='';
|
||||
}
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@@ -485,7 +588,6 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmo
|
||||
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
|
||||
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
|
||||
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
|
||||
if ($search_status) $sql .= " AND f.fk_statut = ".$search_status;
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0)
|
||||
@@ -531,7 +633,6 @@ if ($resql)
|
||||
if ($search_societe) $param.='&search_paymentmode='.urlencode($search_paymentmode);
|
||||
if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
||||
if ($search_montant_ttc) $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||
if ($search_status) $param.='&search_status='.urlencode($search_status);
|
||||
if ($late) $param.='&late='.urlencode($late);
|
||||
if ($mode) $param.='&mode='.urlencode($mode);
|
||||
$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
@@ -551,6 +652,31 @@ if ($resql)
|
||||
print_fiche_titre($titre,$link);
|
||||
//print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',0); // We don't want pagination on this page
|
||||
|
||||
$arrayofinvoices=GETPOST('toSend','array');
|
||||
if ($action == 'presend' && count($arrayofinvoices) == 0 && ! GETPOST('cancel'))
|
||||
{
|
||||
setEventMessages($langs->trans("InvoiceNotChecked"), null, 'errors');
|
||||
$action='list';
|
||||
$mode='sendmassremind';
|
||||
}
|
||||
else
|
||||
{
|
||||
$invoicetmp=new Facture($db);
|
||||
$listofinvoicesid=array();
|
||||
$listofinvoicesthirdparties=array();
|
||||
$listofinvoicesref=array();
|
||||
foreach($arrayofinvoices as $invoiceid)
|
||||
{
|
||||
$result=$invoicetmp->fetch($invoiceid);
|
||||
if ($result > 0)
|
||||
{
|
||||
$listofinvoicesid[$invoiceid]=$invoiceid;
|
||||
$thirdpartyid=$invoicetmp->fk_soc?$invoicetmp->fk_soc:$invoicetmp->socid;
|
||||
$listofinvoicesthirdparties[$thirdpartyid]=$thirdpartyid;
|
||||
$listofinvoicesref[$thirdpartyid][$invoiceid]=$invoicetmp->ref;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<form id="form_unpaid" method="POST" action="'.$_SERVER["PHP_SELF"].'?sortfield='. $sortfield .'&sortorder='. $sortorder .'">';
|
||||
|
||||
if (GETPOST('modelselected')) {
|
||||
@@ -575,10 +701,25 @@ if ($resql)
|
||||
$formmail->fromname = $user->getFullName($langs);
|
||||
$formmail->frommail = $user->email;
|
||||
$formmail->withfrom=1;
|
||||
$liste=array();
|
||||
$formmail->withto=$langs->trans("AllRecipientSelectedForRemind");
|
||||
$liste=$langs->trans("AllRecipientSelectedForRemind");
|
||||
if (count($listofinvoicesthirdparties) == 1)
|
||||
{
|
||||
$liste=array();
|
||||
$thirdpartyid=array_shift($listofinvoicesthirdparties);
|
||||
$soc=new Societe($db);
|
||||
$soc->fetch($thirdpartyid);
|
||||
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
|
||||
{
|
||||
$liste[$key]=$value;
|
||||
}
|
||||
$formmail->withtoreadonly=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$formmail->withtoreadonly=1;
|
||||
}
|
||||
$formmail->withto=$liste;
|
||||
$formmail->withtofree=0;
|
||||
$formmail->withtoreadonly=1;
|
||||
$formmail->withtocc=1;
|
||||
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withtopic=$langs->transnoentities($topicmail, '__FACREF__', '__REFCLIENT__');
|
||||
@@ -597,7 +738,7 @@ if ($resql)
|
||||
$formmail->param['action']=$action;
|
||||
$formmail->param['models']=$modelmail;
|
||||
$formmail->param['models_id']=GETPOST('modelmailselected','int');
|
||||
$formmail->param['facid']=$object->id;
|
||||
$formmail->param['facid']=join(',',$arrayofinvoices);
|
||||
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
|
||||
print $formmail->get_form();
|
||||
@@ -822,7 +963,9 @@ if ($resql)
|
||||
{
|
||||
// Checkbox to send remind
|
||||
print '<td class="nowrap" align="center">';
|
||||
if ($objp->email) print '<input class="flat checkforsend" type="checkbox" name="toSend[]" value="'.$objp->facid.'">';
|
||||
$selected=0;
|
||||
if (in_array($objp->facid, $arrayofinvoices)) $selected=1;
|
||||
if ($objp->email) print '<input class="flat checkforsend" type="checkbox" name="toSend[]" value="'.$objp->facid.'"'.($selected?' checked="checked"':'').'>';
|
||||
else print img_picto($langs->trans("NoEMail"), 'warning.png');
|
||||
print '</td>' ;
|
||||
}
|
||||
@@ -869,7 +1012,7 @@ if ($resql)
|
||||
if ($action != 'presend')
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=sendremind&action=presend" class="butAction" name="buttonsendremind" value="'.dol_escape_htmltag($langs->trans("SendRemind")).'">'.$langs->trans("SendRemind").'</a>';
|
||||
print '<input type="submit" class="butAction" name="buttonsendremind" value="'.dol_escape_htmltag($langs->trans("SendRemind")).'">';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@@ -104,7 +105,7 @@ if ($_GET["action"] == 'delete')
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php');
|
||||
header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php?localTaxType='.$localtax->ltt);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@@ -1014,6 +1015,13 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Delete linked object
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Delete contratdet_log
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
/* Copyright (C) 2010-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* 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
|
||||
@@ -20,12 +20,13 @@
|
||||
* \brief File to return Ajax response on Row move
|
||||
*/
|
||||
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
|
||||
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disable token renewal
|
||||
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
|
||||
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
|
||||
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php';
|
||||
|
||||
@@ -115,7 +115,7 @@ class box_project extends ModeleBoxes
|
||||
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
|
||||
$sql.=" WHERE p.entity = ".$conf->entity;
|
||||
|
||||
$sql.=" AND p.rowid = ".$objp->rowid;
|
||||
$resultTask = $db->query($sql);
|
||||
if ($resultTask) {
|
||||
$objTask = $db->fetch_object($resultTask);
|
||||
|
||||
@@ -287,7 +287,10 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty"
|
||||
// Url
|
||||
if (! empty($contents[$i][$j]['url']) && empty($contents[$i][$j]['logo']))
|
||||
{
|
||||
$out.= '<a href="'.$contents[$i][$j]['url'].'" title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
|
||||
$out.= '<a href="'.$contents[$i][$j]['url'].'"';
|
||||
if (!empty($tooltip)) {
|
||||
$out .= ' title="'.dol_escape_htmltag($langs->trans("Show").' '.$tooltip, 1).'" class="classfortooltip"';
|
||||
}
|
||||
//$out.= ' alt="'.$textwithnotags.'"'; // Pas de alt sur un "<a href>"
|
||||
$out.= isset($contents[$i][$j]['target'])?' target="'.$contents[$i][$j]['target'].'"':'';
|
||||
$out.= '>';
|
||||
|
||||
@@ -449,7 +449,7 @@ class Conf
|
||||
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,askpricesupplier,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later.
|
||||
|
||||
// Enable select2
|
||||
if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT)) $this->global->MAIN_USE_JQUERY_MULTISELECT='select2';
|
||||
if (empty($this->global->MAIN_USE_JQUERY_MULTISELECT) || $this->global->MAIN_USE_JQUERY_MULTISELECT == '1') $this->global->MAIN_USE_JQUERY_MULTISELECT='select2';
|
||||
|
||||
// Timeouts
|
||||
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;
|
||||
|
||||
@@ -58,18 +58,15 @@ class DolGeoIP
|
||||
// Here, function exists (embedded into PHP or exists because we made include)
|
||||
if (empty($type) || empty($datfile))
|
||||
{
|
||||
//dol_syslog("DolGeoIP::DolGeoIP parameter datafile not defined", LOG_ERR);
|
||||
$this->errorlabel='DolGeoIP constructor was called with no datafile parameter';
|
||||
//dol_print_error('','DolGeoIP constructor was called with no datafile parameter');
|
||||
print $this->errorlabel;
|
||||
$this->errorlabel='Constructor was called with no datafile parameter';
|
||||
dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR);
|
||||
return 0;
|
||||
}
|
||||
if (! file_exists($datfile) || ! is_readable($datfile))
|
||||
{
|
||||
//dol_syslog("DolGeoIP::DolGeoIP datafile ".$datfile." can not be read", LOG_ERR);
|
||||
$this->error='ErrorGeoIPClassNotInitialized';
|
||||
$this->errorlabel="Datafile ".$datfile." not found";
|
||||
print $this->errorlabel; // To be sure to understand when it fails on screens
|
||||
dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class dolprintIPP
|
||||
*/
|
||||
function list_jobs($module)
|
||||
{
|
||||
global $conf, $db, $bc;
|
||||
global $conf, $db, $bc, $langs;
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||
$ipp = new CupsPrintIPP();
|
||||
$ipp->setLog(DOL_DATA_ROOT.'/printipp.log','file',3); // logging very verbose
|
||||
@@ -96,7 +96,8 @@ class dolprintIPP
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
print $e->getMessage();
|
||||
setEventMessage('[printipp] '.$langs->trans('CoreErrorMessage'), 'errors');
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
}
|
||||
|
||||
print '<table width="100%" class="noborder">';
|
||||
|
||||
@@ -258,7 +258,7 @@ class ExtraFields
|
||||
|
||||
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname) && ! is_numeric($attrname))
|
||||
{
|
||||
if(is_array($param) and count($param) > 0)
|
||||
if(is_array($param) && count($param) > 0)
|
||||
{
|
||||
$params = $this->db->escape(serialize($param));
|
||||
}
|
||||
@@ -818,7 +818,7 @@ class ExtraFields
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqlwhere.= ' WHERE 1';
|
||||
$sqlwhere.= ' WHERE 1=1';
|
||||
}
|
||||
if (in_array($InfoFieldList[0],array('tablewithentity'))) $sqlwhere.= ' AND entity = '.$conf->entity; // Some tables may have field, some other not. For the moment we disable it.
|
||||
$sql.=$sqlwhere;
|
||||
@@ -986,7 +986,7 @@ class ExtraFields
|
||||
$sqlwhere .= ' WHERE ' . $InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1';
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
if (in_array($InfoFieldList[0], array (
|
||||
'tablewithentity'
|
||||
|
||||
@@ -148,7 +148,9 @@ class HookManager
|
||||
'printAddress',
|
||||
'printSearchForm',
|
||||
'formatEvent',
|
||||
'addCalendarChoice'
|
||||
'addCalendarChoice',
|
||||
'createDictionaryFieldList',
|
||||
'editDictionaryFieldlist'
|
||||
)
|
||||
)) $hooktype='addreplace';
|
||||
// Deprecated hook types ('returnvalue')
|
||||
|
||||
@@ -891,7 +891,7 @@ class Form
|
||||
$outarray=array();
|
||||
|
||||
// On recherche les societes
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
|
||||
@@ -967,6 +967,10 @@ class Form
|
||||
$label=$obj->name;
|
||||
}
|
||||
|
||||
if(!empty($obj->name_alias)) {
|
||||
$label.=' ('.$obj->name_alias.')';
|
||||
}
|
||||
|
||||
if ($showtype)
|
||||
{
|
||||
if ($obj->client || $obj->fournisseur) $label.=' (';
|
||||
@@ -1022,7 +1026,7 @@ class Form
|
||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
||||
$sql.= " re.description, re.fk_facture_source";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX ."societe_remise_except as re";
|
||||
$sql.= " WHERE fk_soc = ".$socid;
|
||||
$sql.= " WHERE fk_soc = ".(int) $socid;
|
||||
if ($filter) $sql.= " AND ".$filter;
|
||||
$sql.= " ORDER BY re.description ASC";
|
||||
|
||||
@@ -1255,10 +1259,11 @@ class Form
|
||||
* @param string $show_every 0=default list, 1=add also a value "Everybody" at beginning of list
|
||||
* @param string $enableonlytext If option $enableonly is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty.
|
||||
* @param string $morecss More css
|
||||
* @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on).
|
||||
* @return string HTML select string
|
||||
* @see select_dolgroups
|
||||
*/
|
||||
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='')
|
||||
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@@ -1318,7 +1323,7 @@ class Form
|
||||
if (! empty($user->societe_id)) $sql.= " AND u.fk_soc = ".$user->societe_id;
|
||||
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
|
||||
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
|
||||
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut <> 0";
|
||||
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql.= " AND u.statut <> 0";
|
||||
if (! empty($morefilter)) $sql.=" ".$morefilter;
|
||||
$sql.= " ORDER BY u.lastname ASC";
|
||||
|
||||
@@ -1544,7 +1549,7 @@ class Form
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' autofocus />';
|
||||
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->PRODUCT_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
if ($hidelabel == 3) {
|
||||
print img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
@@ -1640,13 +1645,13 @@ class Form
|
||||
foreach ($scrit as $crit)
|
||||
{
|
||||
if ($i > 0) $sql.=" AND ";
|
||||
$sql.="(p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%'";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$prefix.$crit."%'";
|
||||
$sql.="(p.ref LIKE '".$db->escape($prefix.$crit)."%' OR p.label LIKE '".$db->escape($prefix.$crit)."%'";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.=" OR pl.label LIKE '".$db->escape($prefix.$crit)."%'";
|
||||
$sql.=")";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql.=")";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$db->escape($prefix.$filterkey)."%'";
|
||||
$sql.=')';
|
||||
}
|
||||
$sql.= $db->order("p.ref");
|
||||
@@ -2009,7 +2014,7 @@ class Form
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND p.tobuy = 1";
|
||||
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype;
|
||||
if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$this->db->escape($filtertype);
|
||||
if (! empty($filtre)) $sql.=" ".$filtre;
|
||||
// Add criteria on ref/label
|
||||
if ($filterkey != '')
|
||||
@@ -2023,11 +2028,11 @@ class Form
|
||||
foreach ($scrit as $crit)
|
||||
{
|
||||
if ($i > 0) $sql.=" AND ";
|
||||
$sql.="(pfp.ref_fourn LIKE '".$prefix.$crit."%' OR p.ref LIKE '".$prefix.$crit."%' OR p.label LIKE '".$prefix.$crit."%')";
|
||||
$sql.="(pfp.ref_fourn LIKE '".$this->db->escape($prefix.$crit)."%' OR p.ref LIKE '".$this->db->escape($prefix.$crit)."%' OR p.label LIKE '".$this->db->escape($prefix.$crit)."%')";
|
||||
$i++;
|
||||
}
|
||||
if (count($scrit) > 1) $sql.=")";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$prefix.$filterkey."%'";
|
||||
if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
|
||||
$sql.=')';
|
||||
}
|
||||
$sql.= " ORDER BY pfp.ref_fourn DESC, pfp.quantity ASC";
|
||||
@@ -4159,7 +4164,7 @@ class Form
|
||||
else
|
||||
{
|
||||
// Day
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" name="'.$prefix.'day">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" id="'.$prefix.'day" name="'.$prefix.'day">';
|
||||
|
||||
if ($emptydate || $set_time == -1)
|
||||
{
|
||||
@@ -4173,7 +4178,7 @@ class Form
|
||||
|
||||
$retstring.="</select>";
|
||||
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" name="'.$prefix.'month">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" id="'.$prefix.'month" name="'.$prefix.'month">';
|
||||
if ($emptydate || $set_time == -1)
|
||||
{
|
||||
$retstring.='<option value="0" selected> </option>';
|
||||
@@ -4191,11 +4196,11 @@ class Form
|
||||
// Year
|
||||
if ($emptydate || $set_time == -1)
|
||||
{
|
||||
$retstring.='<input'.($disabled?' disabled':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" name="'.$prefix.'year" value="'.$syear.'">';
|
||||
$retstring.='<input'.($disabled?' disabled':'').' placeholder="'.dol_escape_htmltag($langs->trans("Year")).'" class="flat" type="text" size="3" maxlength="4" id="'.$prefix.'year" name="'.$prefix.'year" value="'.$syear.'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" name="'.$prefix.'year">';
|
||||
$retstring.='<select'.($disabled?' disabled':'').' class="flat" id="'.$prefix.'year" name="'.$prefix.'year">';
|
||||
|
||||
for ($year = $syear - 5; $year < $syear + 10 ; $year++)
|
||||
{
|
||||
@@ -5057,8 +5062,8 @@ class Form
|
||||
|
||||
//$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'</a>':'';
|
||||
//$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'</a>':'';
|
||||
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'<':' ').'</a>':'';
|
||||
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'>':' ').'</a>':'';
|
||||
$previous_ref = $object->ref_previous?'<a data-role="button" data-icon="arrow-l" data-iconpos="left" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_previous).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'<':' ').'</a>':'';
|
||||
$next_ref = $object->ref_next?'<a data-role="button" data-icon="arrow-r" data-iconpos="right" href="'.$_SERVER["PHP_SELF"].'?'.$paramid.'='.urlencode($object->ref_next).$moreparam.'">'.(empty($conf->dol_use_jmobile)?'>':' ').'</a>':'';
|
||||
|
||||
//print "xx".$previous_ref."x".$next_ref;
|
||||
$ret.='<div style="vertical-align: middle"><div class="inline-block floatleft refid'.(($shownav && ($previous_ref || $next_ref))?' refidpadding':'').'">';
|
||||
|
||||
@@ -871,6 +871,7 @@ class FormMail extends Form
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num=$this->db->num_rows($resql);
|
||||
$this->lines_model=array();
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
|
||||
@@ -148,7 +148,7 @@ class FormProjets
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
|
||||
$comboenhancement = ajax_combobox($htmlname, array(), 0, $forcefocus);
|
||||
$out.=$comboenhancement;
|
||||
$nodatarole=($comboenhancement?' data-role="none"':'');
|
||||
$minmax='minwidth100 maxwidth300';
|
||||
@@ -422,9 +422,10 @@ class FormProjets
|
||||
* @param string $table_element Table of the element to update
|
||||
* @param int $socid If of thirdparty to use as filter
|
||||
* @param string $morecss More CSS
|
||||
* @param int $limitonstatus Add filters to limit length of list to opened status (for example to avoid ERR_RESPONSE_HEADERS_TOO_BIG on project/element.php page). TODO To implement
|
||||
* @return int|string The HTML select list of element or '' if nothing or -1 if KO
|
||||
*/
|
||||
function select_element($table_element, $socid=0, $morecss='')
|
||||
function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@@ -433,7 +434,9 @@ class FormProjets
|
||||
$linkedtothirdparty=false;
|
||||
if (! in_array($table_element, array('don','expensereport_det','expensereport'))) $linkedtothirdparty=true;
|
||||
|
||||
$sqlfilter='';
|
||||
$projectkey="fk_projet";
|
||||
//print $table_element;
|
||||
switch ($table_element)
|
||||
{
|
||||
case "facture":
|
||||
@@ -443,7 +446,8 @@ class FormProjets
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||
break;
|
||||
case "commande_fourn":
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||
case "commande_fournisseur":
|
||||
$sql = "SELECT t.rowid, t.ref, t.ref_supplier";
|
||||
break;
|
||||
case "facture_rec":
|
||||
$sql = "SELECT t.rowid, t.titre as ref";
|
||||
@@ -457,6 +461,11 @@ class FormProjets
|
||||
/*$sql = "SELECT rowid, '' as ref"; // table is llx_expensereport_det
|
||||
$projectkey="fk_projet";
|
||||
break;*/
|
||||
case "commande":
|
||||
case "contrat":
|
||||
case "fichinter":
|
||||
$sql = "SELECT t.rowid, t.ref";
|
||||
break;
|
||||
default:
|
||||
$sql = "SELECT t.rowid, t.ref";
|
||||
break;
|
||||
@@ -468,6 +477,7 @@ class FormProjets
|
||||
if (! empty($socid) && $linkedtothirdparty) $sql.= " AND t.fk_soc=".$socid;
|
||||
if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND t.entity='.getEntity('project');
|
||||
if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc";
|
||||
if ($sqlfilter) $sql.= " AND ".$sqlfilter;
|
||||
$sql.= " ORDER BY ref DESC";
|
||||
|
||||
dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
|
||||
|
||||