mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-12 12:03:03 +01:00
Compare commits
476 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8104c97f77 | ||
|
|
7b853d8981 | ||
|
|
d808add499 | ||
|
|
d07ec07896 | ||
|
|
ed467aa74b | ||
|
|
1becbb8805 | ||
|
|
afc1938676 | ||
|
|
5411699256 | ||
|
|
8ce723b4c9 | ||
|
|
19adbaf84b | ||
|
|
337d6d9f08 | ||
|
|
7767f03e9c | ||
|
|
711bbe0afb | ||
|
|
76efc31b00 | ||
|
|
69c47aa7d9 | ||
|
|
13cb806436 | ||
|
|
d28188d19d | ||
|
|
fef6440ff2 | ||
|
|
0b808fa2aa | ||
|
|
c4b3dc40c3 | ||
|
|
888e5ed2c5 | ||
|
|
90964d25ce | ||
|
|
26e537e328 | ||
|
|
7c30b3ca5d | ||
|
|
ea5c54ad9c | ||
|
|
ec8db116f8 | ||
|
|
884fc5d249 | ||
|
|
b5bfc3e2c7 | ||
|
|
be84b52d19 | ||
|
|
7c690ae8b8 | ||
|
|
17b286ef59 | ||
|
|
6a05645295 | ||
|
|
4a63e6b6ec | ||
|
|
f510f3062b | ||
|
|
30a9e40f4e | ||
|
|
7ba2dd8397 | ||
|
|
93cf135d5e | ||
|
|
537a551bb5 | ||
|
|
8866683a72 | ||
|
|
7f807986d7 | ||
|
|
c5f30f0d80 | ||
|
|
04f4a81736 | ||
|
|
dc790e62ce | ||
|
|
15c8515d53 | ||
|
|
0dfbc8d72f | ||
|
|
eacb221ffe | ||
|
|
76f1dbe16b | ||
|
|
49982b36ac | ||
|
|
1002923dea | ||
|
|
7f420f3246 | ||
|
|
59571b1ce1 | ||
|
|
c5287e68b1 | ||
|
|
3cc7f66e90 | ||
|
|
919d29fdf7 | ||
|
|
fe55feb82f | ||
|
|
4c7b39f49e | ||
|
|
d2c23ebc8d | ||
|
|
35ae0e435d | ||
|
|
485b1ba88e | ||
|
|
d3d6fca350 | ||
|
|
cef7b9c92d | ||
|
|
4b92e2a705 | ||
|
|
270aba99fa | ||
|
|
adb3827d1e | ||
|
|
554a640c2b | ||
|
|
3a7aea48d7 | ||
|
|
1bb5408d83 | ||
|
|
73494a23df | ||
|
|
ef61407d95 | ||
|
|
5776a948c4 | ||
|
|
84173f3759 | ||
|
|
2ca5f2e27e | ||
|
|
339d1eb124 | ||
|
|
e1b4788bc2 | ||
|
|
72108c3a4e | ||
|
|
8f19ffd097 | ||
|
|
76c3fe1260 | ||
|
|
cafcbe03e1 | ||
|
|
5240217144 | ||
|
|
d68abf8237 | ||
|
|
03ffbe55ce | ||
|
|
a918fd1cf2 | ||
|
|
21959aec8f | ||
|
|
68c9d08909 | ||
|
|
e61032a313 | ||
|
|
fc5c9ad2f2 | ||
|
|
1daa0204aa | ||
|
|
7706020805 | ||
|
|
77fea1983c | ||
|
|
5e2cc05047 | ||
|
|
052e025537 | ||
|
|
6a0ef4b561 | ||
|
|
f87614e2d3 | ||
|
|
ddeca6cc06 | ||
|
|
cec91ae837 | ||
|
|
13d5471dd0 | ||
|
|
8123562ded | ||
|
|
14e1306b20 | ||
|
|
f4ddce7274 | ||
|
|
cc7aee6c3e | ||
|
|
d5966f944f | ||
|
|
caf4ca7451 | ||
|
|
949eef82f0 | ||
|
|
815d0aff90 | ||
|
|
848bc0779a | ||
|
|
f5bc9c08b1 | ||
|
|
7375afca3e | ||
|
|
978702d04b | ||
|
|
f936b17d68 | ||
|
|
9838199de1 | ||
|
|
70b11f18b5 | ||
|
|
c11ff4a18c | ||
|
|
aba907d1a8 | ||
|
|
0c01c7ceba | ||
|
|
6ac1b6e82e | ||
|
|
0536d6cbed | ||
|
|
278bcfa8da | ||
|
|
52ebdcc27f | ||
|
|
4c97f5514d | ||
|
|
c6f7687bbb | ||
|
|
8536d0f6e9 | ||
|
|
4043141ae3 | ||
|
|
31721165b5 | ||
|
|
eaee8ee586 | ||
|
|
f76b675e09 | ||
|
|
99149b5cfe | ||
|
|
196c5c1267 | ||
|
|
2c3428a1bf | ||
|
|
94368accc1 | ||
|
|
ee774f1bf9 | ||
|
|
bb73da4c5e | ||
|
|
39acb46139 | ||
|
|
9e29ea8011 | ||
|
|
97e8974fdf | ||
|
|
279988bd60 | ||
|
|
ff7a17eb96 | ||
|
|
5bb4590348 | ||
|
|
e4767b1a51 | ||
|
|
058b690e25 | ||
|
|
8986640a10 | ||
|
|
5e4b500b5d | ||
|
|
bb6b3db0ac | ||
|
|
087e22ab94 | ||
|
|
48ae76e295 | ||
|
|
7b8699f54c | ||
|
|
59f644a3e2 | ||
|
|
17eec5f9e9 | ||
|
|
45b5819b8d | ||
|
|
97d5c067ac | ||
|
|
9dfd4bb430 | ||
|
|
ff7b542bfa | ||
|
|
8b9b99ac40 | ||
|
|
cce1549f66 | ||
|
|
affaec2a6f | ||
|
|
c52e593ea8 | ||
|
|
5d920be880 | ||
|
|
062152c723 | ||
|
|
84359a0078 | ||
|
|
5d068083e5 | ||
|
|
42399952ea | ||
|
|
4bc8773417 | ||
|
|
9e7108ff60 | ||
|
|
22b2446c05 | ||
|
|
d9947f2374 | ||
|
|
2de76d733b | ||
|
|
2798726dba | ||
|
|
f16d88fd53 | ||
|
|
69f86fc0af | ||
|
|
53c73054f4 | ||
|
|
b80b7bbcb9 | ||
|
|
225d78c767 | ||
|
|
a38bbdcc05 | ||
|
|
047f01888a | ||
|
|
f2d092c815 | ||
|
|
8392158ee3 | ||
|
|
93defa5f59 | ||
|
|
24436b550d | ||
|
|
ed8e08b78a | ||
|
|
f0983353f2 | ||
|
|
dbb50d7b16 | ||
|
|
2d7916f77d | ||
|
|
7d5dc08a0a | ||
|
|
fe1ce5b3ac | ||
|
|
9523bf5fbd | ||
|
|
ed013c1b7e | ||
|
|
aafc108260 | ||
|
|
3b56663e4d | ||
|
|
d7b84bd35f | ||
|
|
4b8862c1ec | ||
|
|
fed3165b53 | ||
|
|
6d40f797d2 | ||
|
|
f2cd96b9c0 | ||
|
|
dc38ec5051 | ||
|
|
38621b622e | ||
|
|
9b22f046f5 | ||
|
|
a5a08006e9 | ||
|
|
e0eef2080e | ||
|
|
60078300b8 | ||
|
|
58b49f9a08 | ||
|
|
3deacaa5c4 | ||
|
|
c44a5ede43 | ||
|
|
e11c7a08ea | ||
|
|
939d33cce7 | ||
|
|
0744b5d91b | ||
|
|
f68d31d7c5 | ||
|
|
6e3174e71a | ||
|
|
d572e1ddad | ||
|
|
30eb03af4c | ||
|
|
f0e0df2660 | ||
|
|
cd888a2149 | ||
|
|
e038e1a2f5 | ||
|
|
681c2a67bd | ||
|
|
44405e5415 | ||
|
|
e9bc5b719d | ||
|
|
2fdad0f11d | ||
|
|
6da5a6b82f | ||
|
|
029f1c411f | ||
|
|
206e44431d | ||
|
|
31b5ca17f1 | ||
|
|
5a68d69067 | ||
|
|
19e780c53f | ||
|
|
e9912c020e | ||
|
|
646e8713f2 | ||
|
|
b87ce172c3 | ||
|
|
a300a635d8 | ||
|
|
61a0f04bbe | ||
|
|
214bad26db | ||
|
|
e9e6a8e5ad | ||
|
|
26385fa10d | ||
|
|
d13c4b7b84 | ||
|
|
c315ad7801 | ||
|
|
762b4eb876 | ||
|
|
67e9b65a2e | ||
|
|
a8fdf0b5ea | ||
|
|
7404a6cf98 | ||
|
|
db02c32a9f | ||
|
|
c1c75208ec | ||
|
|
bb53146192 | ||
|
|
23c5b0366f | ||
|
|
310e912a9d | ||
|
|
c498ce3c41 | ||
|
|
8b20c5edab | ||
|
|
a6a142753a | ||
|
|
17da808325 | ||
|
|
03fe9d4e97 | ||
|
|
d4c20a919d | ||
|
|
1a389b6faf | ||
|
|
34f08ce082 | ||
|
|
20ed279489 | ||
|
|
da2f971345 | ||
|
|
835cd43565 | ||
|
|
7dbd0bd355 | ||
|
|
7c743eb7da | ||
|
|
863c575580 | ||
|
|
f92eded0a2 | ||
|
|
a97b87d2cd | ||
|
|
faaebbf5e1 | ||
|
|
6701ad8b73 | ||
|
|
b9af2d6b97 | ||
|
|
3393947dbc | ||
|
|
7648d300b5 | ||
|
|
bde293af22 | ||
|
|
e43b13968e | ||
|
|
b5c30ea679 | ||
|
|
451adb077f | ||
|
|
4bbd42123e | ||
|
|
17310da0f8 | ||
|
|
33e2179b65 | ||
|
|
032f54dd1a | ||
|
|
9fa85a5831 | ||
|
|
016ed12c11 | ||
|
|
d26b2a694d | ||
|
|
9b35793608 | ||
|
|
9cc344f8cc | ||
|
|
5a75e14a8a | ||
|
|
f5e14c9d70 | ||
|
|
237270a27e | ||
|
|
f5ccd943f1 | ||
|
|
53f5513476 | ||
|
|
e599e47e84 | ||
|
|
52986c5c07 | ||
|
|
d4ff877fdd | ||
|
|
d66fac5662 | ||
|
|
a158f5ab9d | ||
|
|
67b5353861 | ||
|
|
4dd58a94f3 | ||
|
|
1821be87e9 | ||
|
|
1154f871f1 | ||
|
|
c22e8cfc01 | ||
|
|
61ee071f43 | ||
|
|
2c3a696b78 | ||
|
|
03bbb340f8 | ||
|
|
869c8a4ead | ||
|
|
65b6b142bd | ||
|
|
f3b1f89bae | ||
|
|
3126676ffb | ||
|
|
eb9e8c9dfc | ||
|
|
ac7f1035e1 | ||
|
|
3108f5bf0d | ||
|
|
c108f11c01 | ||
|
|
f92129dcdb | ||
|
|
09e9254f35 | ||
|
|
7c722def0f | ||
|
|
227c8a96c8 | ||
|
|
9fe1d8462a | ||
|
|
5ba13a9500 | ||
|
|
d018bd4892 | ||
|
|
0d0b7f8af2 | ||
|
|
4660bc58fc | ||
|
|
223e1b1cd4 | ||
|
|
0fc8a0f840 | ||
|
|
2768878618 | ||
|
|
ffb408f440 | ||
|
|
ac08dec2c3 | ||
|
|
d88a75b666 | ||
|
|
cf49c274a6 | ||
|
|
1a956cce9a | ||
|
|
d9008cd302 | ||
|
|
be63eb8cef | ||
|
|
2ab12f54ff | ||
|
|
6a3d110d3a | ||
|
|
e71409b7c8 | ||
|
|
0a67ca53d4 | ||
|
|
b65db49868 | ||
|
|
3e4a7ba97c | ||
|
|
2c4e8cbb4a | ||
|
|
a3085cb44a | ||
|
|
5a81073cd8 | ||
|
|
c028771ad0 | ||
|
|
70cbaeb423 | ||
|
|
d5a9d32778 | ||
|
|
bfc5f01e1e | ||
|
|
d3c95e030b | ||
|
|
45136de664 | ||
|
|
4998eb3061 | ||
|
|
991a33f7b6 | ||
|
|
2cf924ab74 | ||
|
|
6c202c5fa1 | ||
|
|
8ca2bbecc6 | ||
|
|
945fb61e59 | ||
|
|
044feab00f | ||
|
|
dabd882056 | ||
|
|
e862ba9daf | ||
|
|
d96a83adac | ||
|
|
7218a9de0e | ||
|
|
8f01db10a6 | ||
|
|
eebaff95cf | ||
|
|
22ca29a51f | ||
|
|
e9cdf85286 | ||
|
|
07f7db1b6d | ||
|
|
1523b2ef80 | ||
|
|
075a138e14 | ||
|
|
73a799b0ce | ||
|
|
3d5edba574 | ||
|
|
21a7fcb01a | ||
|
|
0ce51fcb87 | ||
|
|
570c683b99 | ||
|
|
1f64f9dfcc | ||
|
|
b3642708b3 | ||
|
|
f6604f6578 | ||
|
|
c382ca22b8 | ||
|
|
52a2073152 | ||
|
|
54afb2f1af | ||
|
|
80af01c20f | ||
|
|
526ccc870b | ||
|
|
1ce1899a46 | ||
|
|
896c8b4a78 | ||
|
|
d800d10766 | ||
|
|
7916a2a648 | ||
|
|
ba3581354a | ||
|
|
5cc02ac97f | ||
|
|
08da8ef09d | ||
|
|
4052e15565 | ||
|
|
c8f323b706 | ||
|
|
c91f70cbf4 | ||
|
|
a01bb27d7e | ||
|
|
3f806f83e3 | ||
|
|
4445c34af0 | ||
|
|
782b85ba13 | ||
|
|
91644d2145 | ||
|
|
3e7ed752ea | ||
|
|
98f5fbab5d | ||
|
|
da34ea6b11 | ||
|
|
533881e620 | ||
|
|
d8ead2693f | ||
|
|
7d9a18a63d | ||
|
|
fbac1cfe1e | ||
|
|
9684c8b4bc | ||
|
|
ef31c47c15 | ||
|
|
2416c387f5 | ||
|
|
326d3df63f | ||
|
|
982fca541d | ||
|
|
ad39c30c21 | ||
|
|
7da1b215f3 | ||
|
|
ab37794f61 | ||
|
|
ccb5344d32 | ||
|
|
9079d2890c | ||
|
|
bf1f60b31e | ||
|
|
1b1d1a8d0b | ||
|
|
947acfffe2 | ||
|
|
6b5b10fc94 | ||
|
|
f3ef6448d7 | ||
|
|
52a8692a85 | ||
|
|
29e656ec7e | ||
|
|
4da49dfc2d | ||
|
|
cabe7c696c | ||
|
|
e3370b6a98 | ||
|
|
e25a428118 | ||
|
|
2492b9968a | ||
|
|
6dda2f3670 | ||
|
|
aae24c26a3 | ||
|
|
97dbb40ad6 | ||
|
|
18ca96e285 | ||
|
|
206d46cbb7 | ||
|
|
41ce4886fd | ||
|
|
256f6e410c | ||
|
|
d5d337c631 | ||
|
|
71818da6a5 | ||
|
|
c53aef9955 | ||
|
|
a18995d3dc | ||
|
|
a17e4434be | ||
|
|
d2955cb32f | ||
|
|
5b0e6297bb | ||
|
|
749355abc2 | ||
|
|
7c3640a4c3 | ||
|
|
ca3b3b9843 | ||
|
|
9be342bd25 | ||
|
|
4a310f36d8 | ||
|
|
e647b5562b | ||
|
|
9ffcd9e922 | ||
|
|
599f6426a5 | ||
|
|
e8a2680e31 | ||
|
|
f5993a2507 | ||
|
|
9782937138 | ||
|
|
7aff424d1c | ||
|
|
d7be62b7da | ||
|
|
84d584f607 | ||
|
|
68c31c55c5 | ||
|
|
5a0641a30e | ||
|
|
ac3a270e17 | ||
|
|
aeba02fb22 | ||
|
|
1101a1094f | ||
|
|
64aed24539 | ||
|
|
b77fe285dc | ||
|
|
874d61bb6d | ||
|
|
c793e847bc | ||
|
|
112a6f7b44 | ||
|
|
398733ff9a | ||
|
|
744f0ab198 | ||
|
|
f2d5bcbbdd | ||
|
|
323a6e34b5 | ||
|
|
3330f040ba | ||
|
|
4d26dffa7d | ||
|
|
9d4d85ca9d | ||
|
|
d37d1a033a | ||
|
|
dcd1a089b1 | ||
|
|
9ad2a9ac85 | ||
|
|
5c53081007 | ||
|
|
f375c41950 | ||
|
|
2a59dbbc89 | ||
|
|
d5d92c6290 | ||
|
|
e96eadb5e7 | ||
|
|
593d06e91e | ||
|
|
ca3cdfabec | ||
|
|
bfa8630feb | ||
|
|
0bf4ac6fb3 | ||
|
|
a7c1ff402a | ||
|
|
0960473c9b | ||
|
|
fd38a55f51 | ||
|
|
76bee57553 | ||
|
|
d791476708 | ||
|
|
975fd0a6d3 | ||
|
|
2be75420ca | ||
|
|
c2a89ae58e | ||
|
|
1c157c7c3d | ||
|
|
e039f7cc22 |
48
.travis.yml
48
.travis.yml
@@ -2,19 +2,15 @@
|
||||
# from Dolibarr GitHub repository.
|
||||
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
|
||||
|
||||
# We use dist: precise to have php 5.3 available
|
||||
dist: precise
|
||||
sudo: required
|
||||
|
||||
language: php
|
||||
|
||||
php:
|
||||
- '5.3'
|
||||
- '5.4'
|
||||
- '5.5'
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
- nightly
|
||||
# Start on every boot
|
||||
services:
|
||||
- memcached
|
||||
|
||||
addons:
|
||||
mariadb: '10.0'
|
||||
@@ -33,10 +29,16 @@ addons:
|
||||
- libapache2-mod-fastcgi
|
||||
# We need pgloader for import mysql database into pgsql
|
||||
- pgloader
|
||||
|
||||
# Start on every boot
|
||||
services:
|
||||
- memcached
|
||||
|
||||
php:
|
||||
- '5.3'
|
||||
- '5.4'
|
||||
- '5.5'
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
- '7.1'
|
||||
#- hhvm only with dist: trusty
|
||||
- nightly
|
||||
|
||||
env:
|
||||
global:
|
||||
@@ -57,11 +59,22 @@ env:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
allow_failures:
|
||||
- php: 7.1
|
||||
- php: hhvm
|
||||
- php: nightly
|
||||
#- env: DB=postgresql
|
||||
# TODO
|
||||
#- env: DB=sqlite
|
||||
# We exclude some combinations not usefull to save Travis CPU
|
||||
exclude:
|
||||
- php: '5.4'
|
||||
env: DB=postgresql
|
||||
- php: '5.5'
|
||||
env: DB=postgresql
|
||||
- php: '5.6'
|
||||
env: DB=postgresql
|
||||
- php: '7.0'
|
||||
env: DB=postgresql
|
||||
- php: hhvm
|
||||
env: DB=postgresql
|
||||
- php: nightly
|
||||
env: DB=postgresql
|
||||
|
||||
notifications:
|
||||
email:
|
||||
@@ -305,6 +318,9 @@ script:
|
||||
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log
|
||||
php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||
php upgrade.php 6.0.0 7.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade600700.log
|
||||
php upgrade2.php 6.0.0 7.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade600700-2.log
|
||||
php step5.php 6.0.0 7.0.0 > $TRAVIS_BUILD_DIR/upgrade600700-3.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
|
||||
117
ChangeLog
117
ChangeLog
@@ -2,6 +2,83 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
|
||||
|
||||
FIX: #7148
|
||||
FIX: #7288
|
||||
FIX: #7366 renaming table with pgsql
|
||||
FIX: #7435 Can't add payment term
|
||||
FIX: #7461
|
||||
FIX: #7464
|
||||
FIX: #7471
|
||||
FIX: #7473 Mass update of vat rates and other bugs on localtax
|
||||
FIX: #7475
|
||||
FIX: #7486 Empty value for multicurrency rate must be forbidden
|
||||
FIX: #7490
|
||||
FIX: #7505
|
||||
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
|
||||
FIX: #7514
|
||||
FIX: #7531 #7537
|
||||
FIX: #7541
|
||||
FIX: #7546
|
||||
FIX: #7550
|
||||
FIX: #7554
|
||||
FIX: #7567
|
||||
FIX: Accountancy export model for Agiris Isacompta
|
||||
FIX: Allow create shipping if STOCK_SUPPORTS_SERVICES option is enabled
|
||||
FIX: Bad preview on scroping when special file names
|
||||
FIX: Generation of invoice from bulk action "Bill Orders"
|
||||
FIX: Implementation of a Luracast recommandation for the REST api server (#7370)
|
||||
FIX: Missing space in request
|
||||
FIX: Only modified values must be modified
|
||||
FIX: replenish if line test GETPOST on line 0
|
||||
FIX: Stripe not working on live mode
|
||||
FIX: wrong basePath in the swagger view
|
||||
FIX: Implementation of a Luracast recommandation for the REST api server
|
||||
|
||||
***** ChangeLog for 6.0.1 compared to 6.0.* *****
|
||||
|
||||
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
||||
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
||||
FIX: #7330
|
||||
FIX: #7359
|
||||
FIX: #7367
|
||||
FIX: #7368
|
||||
FIX: #7391
|
||||
FIX: #7420
|
||||
FIX: Add some missing attributes in Adherent:makeSubstitution (type, phone…
|
||||
FIX: Bad const name
|
||||
FIX: Bad link to unpayed suppliers invoices
|
||||
FIX: Better protection to no send email when we change limit
|
||||
FIX: Calculation in the activity box
|
||||
FIX: Clean bad parameters when inserting line of template invoice
|
||||
FIX: dateSelector was not taken into account
|
||||
FIX: hidden option MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN
|
||||
FIX: journalization for bank journal should not rely on a label.
|
||||
FIX: menu enty when url is external link
|
||||
FIX: missing supplier qty and supplier discount in available fields for product export.
|
||||
FIX: multicompany better accuracy in rounding and with revenue stamp.
|
||||
FIX: Must use pdf format page as default for merging PDF.
|
||||
FIX: PDF output was sharing 2 different currencies in same total
|
||||
FIX: Position of signature on strato template
|
||||
FIX: Protection to avoid to apply credit note discount > remain to pay
|
||||
FIX: Remove warning when using log into syslog
|
||||
FIX: Responsive
|
||||
FIX: Security fixes (filter onload js, less verbose error message in
|
||||
FIX: SEPA recording payment must save one payment in bank per customer
|
||||
FIX: Several problem with the last event box on project/tasks
|
||||
FIX: Sign of amount in origin currency on credit note created from lines
|
||||
FIX: Some page of admin were not responsive
|
||||
FIX: SQL injection
|
||||
FIX: time.php crashed without project id in param
|
||||
FIX: transfer of line extrafields from order to invoice
|
||||
FIX: Upgrade missing on field
|
||||
FIX: View of timespent for another user
|
||||
FIX: ODT generation
|
||||
FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-14241,
|
||||
CVE-2017-14242
|
||||
|
||||
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
||||
|
||||
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
|
||||
@@ -9,7 +86,7 @@ NEW: Add a payment module for Stripe.
|
||||
NEW: Add module "Product variant" (like red, blue for the product shoes)
|
||||
NEW: Accountancy - Activate multi-journal & Add journal_label to database (FEC)
|
||||
NEW: Add a tracking id into mass emailing.
|
||||
NEW: Tax system more compatible with the new tax roollout in India (IGST / CGST / SGST).
|
||||
NEW: Tax system more compatible with the new tax rollout in India (IGST / CGST / SGST).
|
||||
NEW: Add calculation function for Loan schedule
|
||||
NEW: Add "depends on" and "required by" into module informations
|
||||
NEW: Add hidden option THIRDPARTY_INCLUDE_PARENT_IN_LINKTO
|
||||
@@ -23,7 +100,7 @@ NEW: add property to show warnings when activating modules
|
||||
NEW: add rapport file for supplier paiement
|
||||
NEW: Add statistics on supplier tab.
|
||||
NEW: Add tooltip help on shipment weight and volume calculation
|
||||
NEW: An external module can hook and add mass actions
|
||||
NEW: An external module can hook and add mass actions.
|
||||
NEW: Better reponsive design
|
||||
NEW: Bookmarks are into a combo list.
|
||||
NEW: Bulk actions available on supplier orders
|
||||
@@ -152,6 +229,40 @@ Following changes may create regression for some external modules, but were nece
|
||||
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
||||
hook specifications so you must return output into "resprint".
|
||||
|
||||
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
|
||||
FIX: Removed a bad symbolic link into custom directory.
|
||||
FIX: Renaming a resource ref rename also the directory of attached files.
|
||||
|
||||
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
|
||||
FIX: #7075 : bad path for document
|
||||
FIX: #7156
|
||||
FIX: #7173
|
||||
FIX: #7224
|
||||
FIX: #7226
|
||||
FIX: #7239
|
||||
FIX: add supplierproposaldet without price (new product)
|
||||
FIX: amount overlap other amount when a pagebreak is done due to an image at the bottom of page.
|
||||
FIX: Bad tax calculation with expense report
|
||||
FIX: Best buy price calculation
|
||||
FIX: Buying prices must always be in positive value.
|
||||
FIX: calculate correct remain to pay for planned bank transactions
|
||||
FIX: delete linked element on facture rec
|
||||
FIX: edit sociale was emptying label
|
||||
FIX: Error when updating thirdparty not returned
|
||||
FIX: holidays with postgresql like on rowid integer
|
||||
FIX: id of user not saved when making a payment of expense report
|
||||
FIX: invoice page list
|
||||
FIX: invoice situation VAT total rounding into PDF crabe
|
||||
FIX: PgSQL compatibility.
|
||||
FIX: remove order rights on invoice page
|
||||
FIX: status were wrong on product referent list
|
||||
FIX: supplier id was not passed to hooks
|
||||
FIX: Support of vat code when using price per customer
|
||||
FIX: User id correction on holiday request
|
||||
FIX: value of user id filled to 0 in llx_bank_url when recording an expense report.
|
||||
FIX: we have to check if contact doesn't already exist on add_contact() function
|
||||
FIX: We should be able to insert data with value '0' into const
|
||||
FIX: install process with DoliWamp
|
||||
|
||||
***** ChangeLog for 5.0.4 compared to 5.0.3 *****
|
||||
FIX: #5640 Prices of a predefined product/service were incorrect under certain circumstances
|
||||
@@ -657,7 +768,7 @@ NEW: Disabled users are striked.
|
||||
NEW: Enhance navigation of project module
|
||||
NEW: fichinter lines ordered by rang AND DATE
|
||||
NEW: hidden conf to use input file multiple from mail form
|
||||
NEW: hidden feature: SUPPLIERORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
|
||||
NEW: hidden feature: SUPPLIER_ORDER_WITH_NOPRICEDEFINED allow supplier order even if no supplier price defined
|
||||
NEW: Hidden option MAIN_LANDING_PAGE to choose the first page to show after login works as a "global" option (llx_const) and as a "per user" option (llx_user_param).
|
||||
NEW: Holiday is a now a RH module. All RH module provides by default visilibity on users of its hierarchy.
|
||||
NEW: If error is reported during migration process, you can ignore it to avoid to be locked.
|
||||
|
||||
@@ -49,6 +49,8 @@ if (empty($argv[1]))
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
exit -1;
|
||||
}
|
||||
parse_str($argv[1]);
|
||||
|
||||
$i=0;
|
||||
while ($i < $argc)
|
||||
{
|
||||
@@ -98,9 +100,9 @@ foreach ($includeconstants as $countrycode => $tmp)
|
||||
print "\n";
|
||||
|
||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1);
|
||||
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
}
|
||||
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; }
|
||||
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||
$nboftargetok++;
|
||||
}
|
||||
@@ -366,7 +366,9 @@ if ($nboftargetok) {
|
||||
}
|
||||
else # For a maintenance release
|
||||
{
|
||||
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 '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 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\' | 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";
|
||||
if (! $ret)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# \file build/makepack-dolibarrmodule.pl
|
||||
# \brief Package builder (tgz, zip, rpm, deb, exe)
|
||||
# \author (c)2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
# \contributor (c)2017 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
use Cwd;
|
||||
@@ -134,7 +135,15 @@ foreach my $PROJECT (@PROJECTLIST) {
|
||||
# Get version $MAJOR, $MINOR and $BUILD
|
||||
print "Version detected for module ".$PROJECT.": ";
|
||||
$result=open(IN,"<".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php");
|
||||
if (! $result) { die "Error: Can't open descriptor file ".$SOURCE."/htdocs/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php for reading.\n"; }
|
||||
$custom=false;
|
||||
if (! $result) {
|
||||
$result=open(IN,"<".$SOURCE."/htdocs/custom/".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php");
|
||||
if (! $result) {
|
||||
die "Error: Can't open descriptor file ".$SOURCE."/htdocs/(or /htdocs/custom/)".$PROJECTLC."/core/modules/mod".$PROJECT.".class.php for reading.\n";
|
||||
}else{
|
||||
$custom = true;
|
||||
}
|
||||
}
|
||||
while(<IN>)
|
||||
{
|
||||
if ($_ =~ /this->version\s*=\s*'([\d\.]+)'/) { $PROJVERSION=$1; break; }
|
||||
@@ -294,8 +303,11 @@ foreach my $PROJECT (@PROJECTLIST) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.old`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf.php.postgres`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/conf/conf*sav*`;
|
||||
if($custom){
|
||||
$ret=`cp -r $BUILDROOT/$PROJECTLC/htdocs/custom/* $BUILDROOT/$PROJECTLC/htdocs/.`;
|
||||
}
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom2`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/htdocs/custom2`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/Thumbs.db $BUILDROOT/$PROJECTLC/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/Thumbs.db $BUILDROOT/$PROJECTLC/*/*/*/*/Thumbs.db`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECTLC/CVS* $BUILDROOT/$PROJECTLC/*/CVS* $BUILDROOT/$PROJECTLC/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/CVS* $BUILDROOT/$PROJECTLC/*/*/*/*/*/CVS*`;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
README (English)
|
||||
##################################################
|
||||
Install script for Virtualmin Pro
|
||||
Install script for Virtualmin Professional / GPL
|
||||
##################################################
|
||||
|
||||
This script will install automatically Dolibarr from Virtualmin Pro
|
||||
http://www.virtualmin.com
|
||||
This script will install automatically Dolibarr from Virtualmin.
|
||||
(Included in the professional version and can be added in the GPL version)
|
||||
|
||||
https://www.virtualmin.com
|
||||
http://www.webmin.com/virtualmin.html
|
||||
@@ -1,7 +1,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# \file dolibarr.pl
|
||||
# \brief Dolibarr script install for Virtualmin Pro
|
||||
# \author (c)2009-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
# \author (c)2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -30,7 +30,12 @@ return "Regis Houssin";
|
||||
# script_dolibarr_versions()
|
||||
sub script_dolibarr_versions
|
||||
{
|
||||
return ( "3.8.1", "3.7.1", "3.6.4", "3.5.7" );
|
||||
return ( "5.0.4", "4.0.6", "3.9.4" );
|
||||
}
|
||||
|
||||
sub script_dolibarr_release
|
||||
{
|
||||
return 2; # for mysqli fix
|
||||
}
|
||||
|
||||
sub script_dolibarr_category
|
||||
@@ -177,9 +182,9 @@ if ($opts->{'newdb'} && !$upgrade) {
|
||||
local ($dbtype, $dbname) = split(/_/, $opts->{'db'}, 2);
|
||||
local $dbuser = $dbtype eq "mysql" ? &mysql_user($d) : &postgres_user($d);
|
||||
local $dbpass = $dbtype eq "mysql" ? &mysql_pass($d) : &postgres_pass($d, 1);
|
||||
local $dbphptype = $dbtype eq "mysql" && $version >= 3.6 ? "mysql" :
|
||||
local $dbphptype = $dbtype eq "mysql" && $version < 3.6 ? "mysql" :
|
||||
$dbtype eq "mysql" ? "mysqli" : "pgsql";
|
||||
local $dbhost = &get_database_host($dbtype);
|
||||
local $dbhost = &get_database_host($dbtype, $d);
|
||||
local $dberr = &check_script_db_connection($dbtype, $dbname, $dbuser, $dbpass);
|
||||
return (0, "Database connection failed : $dberr") if ($dberr);
|
||||
|
||||
@@ -206,9 +211,6 @@ $pgcharset = $tmpl->{'postgres_encoding'};
|
||||
$charset = $dbtype eq "mysql" ? $mycharset : $pgcharset;
|
||||
$collate = $dbtype eq "mysql" ? $mycollate : "C";
|
||||
|
||||
# Install filename
|
||||
local $step = $version >= 3.8 ? "step" : "etape";
|
||||
|
||||
$path = &script_path_url($d, $opts);
|
||||
if ($path =~ /^https:/ || $d->{'ssl'}) {
|
||||
$url = "https://$d->{'dom'}";
|
||||
@@ -222,15 +224,11 @@ if ($opts->{'path'} =~ /\w/) {
|
||||
|
||||
if (!$upgrade) {
|
||||
local $cdef = "$opts->{'dir'}/conf/conf.php.example";
|
||||
&run_as_domain_user($d, "cp ".quotemeta($cdef)." ".quotemeta($cfile));
|
||||
©_source_dest_as_domain_user($d, $cdef, $cfile);
|
||||
&set_permissions_as_domain_user($d, 0777, $cfiledir);
|
||||
&set_permissions_as_domain_user($d, 0666, $cfile);
|
||||
©_source_dest_as_domain_user($d, $cfile);
|
||||
&run_as_domain_user($d, "mkdir ".quotemeta($docdir));
|
||||
&set_permissions_as_domain_user($d, 0777, $docdir);
|
||||
if (!$version >= 3.7.2) {
|
||||
&run_as_domain_user($d, "mkdir ".quotemeta($altdir));
|
||||
&set_permissions_as_domain_user($d, 0777, $altdir);
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Preserve old config file, documents and custom directory
|
||||
@@ -266,7 +264,8 @@ if ($upgrade) {
|
||||
[ "versionfrom", $upgrade->{'version'} ],
|
||||
[ "versionto", $ver ],
|
||||
);
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts);
|
||||
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||
|
||||
# Remove the installation directory.
|
||||
@@ -289,15 +288,17 @@ else {
|
||||
[ "main_force_https", $opts->{'forcehttps'} ],
|
||||
[ "dolibarr_main_db_character_set", $charset ],
|
||||
[ "dolibarr_main_db_collation", $collate ],
|
||||
[ "main_use_alt_dir", "1" ],
|
||||
[ "usealternaterootdir", "1" ],
|
||||
[ "main_alt_dir_name", "custom" ],
|
||||
);
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $step."1", $d, $opts);
|
||||
local $p = $ver >= 3.8 ? "step1" : "etape1";
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||
|
||||
# Second page (Populate database)
|
||||
local @params = ( [ "action", "set" ] );
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $step."2", $d, $opts);
|
||||
local $p = $ver >= 3.8 ? "step2" : "etape2";
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||
|
||||
# Third page (Add administrator account)
|
||||
@@ -306,7 +307,8 @@ else {
|
||||
[ "pass", $dompass ],
|
||||
[ "pass_verif", $dompass ],
|
||||
);
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $step."5", $d, $opts);
|
||||
local $p = $ver >= 3.8 ? "step5" : "etape5";
|
||||
local $err = &call_dolibarr_wizard_page(\@params, $p, $d, $opts);
|
||||
return (-1, "Dolibarr wizard failed : $err") if ($err);
|
||||
|
||||
# Remove the installation directory and protect config file.
|
||||
@@ -384,7 +386,10 @@ sub script_dolibarr_check_latest
|
||||
{
|
||||
local ($ver) = @_;
|
||||
local @vers = &osdn_package_versions("dolibarr",
|
||||
$ver >= 3.8 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 5.0 ? "dolibarr\\-(5\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 4.0 ? "dolibarr\\-(4\\.0\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.9 ? "dolibarr\\-(3\\.9\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.8 ? "dolibarr\\-(3\\.8\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.7 ? "dolibarr\\-(3\\.7\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.6 ? "dolibarr\\-(3\\.6\\.[0-9\\.]+)\\.tgz" :
|
||||
$ver >= 3.5 ? "dolibarr\\-(3\\.5\\.[0-9\\.]+)\\.tgz" :
|
||||
|
||||
@@ -163,6 +163,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/collab
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
|
||||
9423
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
9423
dev/initdemo/mysqldump_dolibarr_6.0.0.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -192,6 +192,7 @@ export list="
|
||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||
--ignore-table=$base.llx_cabinetmed_cons
|
||||
--ignore-table=$base.llx_cabinetmed_cons_extrafields
|
||||
--ignore-table=$base.llx_cabinetmed_diaglec
|
||||
--ignore-table=$base.llx_cabinetmed_examaut
|
||||
--ignore-table=$base.llx_cabinetmed_exambio
|
||||
@@ -207,7 +208,18 @@ export list="
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||
--ignore-table=$base.llx_dolireport_column
|
||||
--ignore-table=$base.llx_dolireport_criteria
|
||||
--ignore-table=$base.llx_dolireport_graph
|
||||
--ignore-table=$base.llx_dolireport_plot
|
||||
--ignore-table=$base.llx_dolireport_report
|
||||
--ignore-table=$base.llx_domain
|
||||
--ignore-table=$base.llx_ecommerce_commande
|
||||
--ignore-table=$base.llx_ecommerce_facture
|
||||
--ignore-table=$base.llx_ecommerce_product
|
||||
--ignore-table=$base.llx_ecommerce_site
|
||||
--ignore-table=$base.llx_ecommerce_societe
|
||||
--ignore-table=$base.llx_ecommerce_socpeople
|
||||
--ignore-table=$base.llx_element_rang
|
||||
--ignore-table=$base.llx_entity
|
||||
--ignore-table=$base.llx_filemanager_roots
|
||||
@@ -215,6 +227,8 @@ export list="
|
||||
--ignore-table=$base.llx_google_maps
|
||||
--ignore-table=$base.llx_milestone
|
||||
--ignore-table=$base.llx_monitoring_probes
|
||||
--ignore-table=$base.llx_m
|
||||
--ignore-table=$base.llx_m_extrafields
|
||||
--ignore-table=$base.llx_notes
|
||||
--ignore-table=$base.llx_pos_cash
|
||||
--ignore-table=$base.llx_pos_control_cash
|
||||
|
||||
@@ -145,12 +145,12 @@ else if ($action == 'update') {
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card");
|
||||
$helpurl = "";
|
||||
llxHeader("",$title,$helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("NewFiscalYear"));
|
||||
|
||||
@@ -419,7 +419,7 @@ class AccountancyExport
|
||||
|
||||
|
||||
/**
|
||||
* Export format : Agiris
|
||||
* Export format : Agiris Isacompta
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
@@ -433,30 +433,23 @@ class AccountancyExport
|
||||
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
|
||||
print $line->id . $this->separator;
|
||||
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
|
||||
print $line->piece_num . $this->separator;
|
||||
print $line->label_operation . $this->separator;
|
||||
print $date . $this->separator;
|
||||
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
|
||||
print $line->label_operation . $this->separator;
|
||||
|
||||
if (empty($line->subledger_account)) {
|
||||
print length_accountg($line->numero_compte) . $this->separator;
|
||||
} else {
|
||||
// FIXME Because the subledger_account is already an accounting account, does we really need
|
||||
// to concat 4011 or 401 to it ?
|
||||
if (substr($line->numero_compte, 0, 1) == 'C' || substr($line->numero_compte, 0, 1) == '9') {
|
||||
print '411' . substr(str_replace(" ", "", $line->subledger_account), 0, 5) . $this->separator;
|
||||
}
|
||||
if (substr($line->numero_compte, 0, 1) == 'F' || substr($line->numero_compte, 0, 1) == '0') {
|
||||
print '401' . substr(str_replace(" ", "", $line->subledger_account), 0, 5) . $this->separator;
|
||||
}
|
||||
print length_accounta($line->subledger_account) . $this->separator;
|
||||
}
|
||||
|
||||
print length_accounta($line->subledger_account) . $this->separator;
|
||||
print $line->doc_ref . $this->separator;
|
||||
print price($line->debit) . $this->separator;
|
||||
print price($line->credit) . $this->separator;
|
||||
print price($line->montant).$this->separator;
|
||||
print $line->sens.$this->separator;
|
||||
print $line->code_journal . $this->separator;
|
||||
print $line->code_journal;
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,8 +213,8 @@ for($i = 1; $i <= 12; $i ++) {
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
@@ -240,8 +240,20 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("Unknown");
|
||||
}
|
||||
else print length_accountg($row[0]);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
}
|
||||
else print $row[1];
|
||||
print '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
@@ -269,8 +281,8 @@ for($i = 1; $i <= 12; $i ++) {
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') . " AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
@@ -296,7 +308,20 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("Unknown");
|
||||
}
|
||||
else print length_accountg($row[0]);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
}
|
||||
else print $row[1];
|
||||
print '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -363,7 +388,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
}
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@@ -94,7 +94,7 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/expensereport/index.php');
|
||||
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
@@ -139,7 +139,7 @@ if ($action == 'validatehistory') {
|
||||
$sql1.= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.=")";
|
||||
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
@@ -194,8 +194,8 @@ for($i = 1; $i <= 12; $i ++) {
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
@@ -217,9 +217,21 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("Unknown");
|
||||
}
|
||||
else print length_accountg($row[0]);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
}
|
||||
else print $row[1];
|
||||
print '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right">' . price($row[13]) . '</td>';
|
||||
@@ -247,8 +259,8 @@ for($i = 1; $i <= 12; $i ++) {
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
@@ -270,9 +282,21 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("Unknown");
|
||||
}
|
||||
else print length_accountg($row[0]);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
}
|
||||
else print $row[1];
|
||||
print '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right">' . price($row[13]) . '</td>';
|
||||
@@ -292,9 +316,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
{
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
|
||||
@@ -302,7 +326,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
|
||||
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
@@ -314,12 +338,12 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
|
||||
dol_syslog('htdocs/accountancy/expensereport/index.php');
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>' . $row[0] . '</td>';
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
@@ -328,7 +352,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
} else {
|
||||
print $db->lasterror(); // Show last sql error
|
||||
|
||||
@@ -4,7 +4,7 @@ use Stripe\BankAccount;
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
@@ -104,12 +104,15 @@ $idpays = $mysoc->country_id;
|
||||
|
||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
|
||||
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
|
||||
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop,";
|
||||
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop";
|
||||
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop_company,";
|
||||
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop_user,";
|
||||
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
|
||||
$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 . "bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='user'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='payment'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu4 ON bu4.fk_bank = b.rowid AND bu4.type='payment_supplier'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on bu2.url_id=u.rowid";
|
||||
$sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal;
|
||||
@@ -147,6 +150,7 @@ $result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
//print $sql;
|
||||
|
||||
// Variables
|
||||
$account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
|
||||
@@ -172,13 +176,31 @@ if ($result) {
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// Set accountancy code (for bank and thirdparty)
|
||||
$lineisapurchase = -1;
|
||||
$lineisasale = -1;
|
||||
// Old method to detect if it's a sale or purchase
|
||||
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase=1;
|
||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale=1;
|
||||
// Try a more reliable method to detect if record is a supplier payment or a customer payment
|
||||
if ($lineisapurchase < 0)
|
||||
{
|
||||
if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
|
||||
}
|
||||
if ($lineisasale < 0)
|
||||
{
|
||||
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
|
||||
}
|
||||
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
|
||||
//var_dump($lineisapurchase); //var_dump($lineisasale);
|
||||
|
||||
// Set accountancy code for bank
|
||||
$compta_bank = $obj->account_number;
|
||||
|
||||
// Set accountancy code for thirdparty
|
||||
$compta_soc = 'NotDefined';
|
||||
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)')
|
||||
if ($lineisapurchase > 0)
|
||||
$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
|
||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)')
|
||||
if ($lineisasale > 0)
|
||||
$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
|
||||
|
||||
$tabcompany[$obj->rowid] = array (
|
||||
@@ -187,6 +209,7 @@ if ($result) {
|
||||
'code_compta' => $compta_soc,
|
||||
);
|
||||
|
||||
// Set accountancy code for user
|
||||
$compta_user = (! empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee);
|
||||
|
||||
$tabuser[$obj->rowid] = array (
|
||||
@@ -202,6 +225,7 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["type_payment"] = $obj->fk_type; // CHQ, VIR, LIQ, CB, ...
|
||||
$tabpay[$obj->rowid]["ref"] = $obj->label; // By default. Not unique. May be changed later
|
||||
$tabpay[$obj->rowid]["fk_bank"] = $obj->rowid;
|
||||
$tabpay[$obj->rowid]["bank_account_ref"] = $obj->baref;
|
||||
$tabpay[$obj->rowid]["fk_bank_account"] = $obj->fk_account;
|
||||
if (preg_match('/^\((.*)\)$/i', $obj->label, $reg)) {
|
||||
$tabpay[$obj->rowid]["lib"] = $langs->trans($reg[1]);
|
||||
@@ -214,7 +238,7 @@ if ($result) {
|
||||
//var_dump($tabpay);
|
||||
|
||||
// By default
|
||||
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or old record with no links in bank_url.
|
||||
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
|
||||
$tabtype[$obj->rowid] = 'unknown';
|
||||
|
||||
// get_url may return -1 which is not traversable
|
||||
@@ -604,6 +628,8 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Export
|
||||
if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
@@ -737,6 +763,22 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
|
||||
// Test that setup is complete
|
||||
$sql='SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj=$db->fetch_object($resql);
|
||||
if ($obj->nb > 0)
|
||||
{
|
||||
print img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>');
|
||||
}
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
|
||||
// Button to write into Ledger
|
||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
||||
|| empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1'
|
||||
@@ -797,8 +839,10 @@ if (empty($action) || $action == 'view') {
|
||||
// Bank
|
||||
foreach ( $tabbq[$key] as $k => $mt )
|
||||
{
|
||||
//var_dump($tabpay[$key]);
|
||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Bank bank.rowid=".$key."--></td>";
|
||||
print "<td></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $ref . "</td>";
|
||||
// Ledger account
|
||||
@@ -819,11 +863,14 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
else print $accounttoshow;*/
|
||||
print "</td>";
|
||||
if ($val['soclib'] == '') {
|
||||
print "<td>" . $langs->trans("Bank") . " - " . $reflabel . "</td>";
|
||||
} else {
|
||||
print "<td>" . $langs->trans("Bank") . " - " . $val['soclib'] . "</td>";
|
||||
print "<td>";
|
||||
//var_dump($tabpay[$key]);
|
||||
print $langs->trans("Bank");
|
||||
print ' '.$val['bank_account_ref'];
|
||||
if (! empty($val['soclib'])) {
|
||||
print " - " . $val['soclib'];
|
||||
}
|
||||
print "</td>";
|
||||
print "<td>" . $val["type_payment"] . "</td>";
|
||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
@@ -834,14 +881,15 @@ if (empty($action) || $action == 'view') {
|
||||
if (is_array($tabtp[$key])) {
|
||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||
if ($k != 'type') {
|
||||
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Thirdparty bank.rowid=".$key." --></td>";
|
||||
print "<td></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $ref . "</td>";
|
||||
// Ledger account
|
||||
print "<td>";
|
||||
$account_ledger = $k;
|
||||
|
||||
// Try to force general ledger account depending on type
|
||||
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
@@ -878,7 +926,11 @@ if (empty($action) || $action == 'view') {
|
||||
{
|
||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
/*var_dump($tabpay[$key]);
|
||||
var_dump($tabtype[$key]);
|
||||
var_dump($tabbq[$key]);*/
|
||||
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown").'</span>';
|
||||
}
|
||||
else print $accounttoshowsubledger;
|
||||
}
|
||||
@@ -893,8 +945,9 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
} else {
|
||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||
print '<!-- Wait bank.rowid='.$key.' -->';
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Wait bank.rowid=".$key." --></td>";
|
||||
print "<td></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $ref . "</td>";
|
||||
// Ledger account
|
||||
@@ -936,7 +989,7 @@ $db->close();
|
||||
* Return source for doc_ref of a bank transaction
|
||||
*
|
||||
* @param string $val Array of val
|
||||
* @param string $typerecord Type of record
|
||||
* @param string $typerecord Type of record ('payment', 'payment_supplier', 'payment_expensereport', 'payment_vat', ...)
|
||||
* @return string|unknown
|
||||
*/
|
||||
function getSourceDocRef($val, $typerecord)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
|
||||
@@ -190,8 +190,8 @@ for($i = 1; $i <= 12; $i ++) {
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
@@ -213,8 +213,20 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("Unknown");
|
||||
}
|
||||
else print length_accountg($row[0]);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
}
|
||||
else print $row[1];
|
||||
print '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
@@ -244,8 +256,8 @@ for($i = 1; $i <= 12; $i ++) {
|
||||
}
|
||||
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
|
||||
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'".$langs->trans('NotMatch')."'", 'aa.label') . " AS intitule,";
|
||||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
|
||||
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
|
||||
for($i = 1; $i <= 12; $i ++) {
|
||||
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
|
||||
}
|
||||
@@ -267,9 +279,21 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("Unknown");
|
||||
}
|
||||
else print length_accountg($row[0]);
|
||||
print '</td>';
|
||||
print '<td align="left">';
|
||||
if ($row[0] == 'tobind')
|
||||
{
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
|
||||
}
|
||||
else print $row[1];
|
||||
print '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
}
|
||||
print '<td align="right">' . price($row[13]) . '</td>';
|
||||
|
||||
@@ -68,6 +68,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
|
||||
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid;
|
||||
if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'";
|
||||
$sql.= " ORDER BY d.rowid ASC";
|
||||
@@ -123,7 +124,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
|
||||
{
|
||||
$nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY'];
|
||||
if ($nb <= 0) $nb=1; // Protection to avoid empty page
|
||||
|
||||
|
||||
for($j=0;$j<$nb;$j++)
|
||||
{
|
||||
$arrayofmembers[]=array(
|
||||
|
||||
@@ -158,6 +158,7 @@ class Adherent extends CommonObject
|
||||
$from=$conf->email_from;
|
||||
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
|
||||
|
||||
// Send email (substitutionarray must be done just before this)
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
|
||||
if ($mailfile->sendfile())
|
||||
@@ -198,6 +199,9 @@ class Adherent extends CommonObject
|
||||
$infos.= $langs->transnoentities("Town").": ".$this->town."\n";
|
||||
$infos.= $langs->transnoentities("Country").": ".$this->country."\n";
|
||||
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
|
||||
$infos.= $langs->transnoentities("PhonePro").": ".$this->phone."\n";
|
||||
$infos.= $langs->transnoentities("PhonePerso").": ".$this->phone_perso."\n";
|
||||
$infos.= $langs->transnoentities("PhoneMobile").": ".$this->phone_mobile."\n";
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
$infos.= $langs->transnoentities("Login").": ".$this->login."\n";
|
||||
@@ -242,6 +246,11 @@ class Adherent extends CommonObject
|
||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
'%TYPE%'=>$msgishtml?dol_htmlentitiesbr($this->type):$this->type,
|
||||
'%PHONE_PRO%'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
||||
'%PHONE_PERSO%'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
||||
'%PHONE_MOBILE%'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
||||
// For backward compatibility
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
|
||||
@@ -134,7 +134,7 @@ class AdherentType extends CommonObject
|
||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql.= "vote = '".$this->db->escape($this->vote)."',";
|
||||
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
||||
$sql .= " WHERE rowid =".$this->id;
|
||||
$sql.= " WHERE rowid =".$this->id;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
@@ -252,7 +252,7 @@ class AdherentType extends CommonObject
|
||||
|
||||
$sql = "SELECT rowid, libelle";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " WHERE entity IN (".getEntity('adherent').")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -249,8 +249,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,6 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
||||
if ($result < 0)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans($company->error);
|
||||
setEventMessages($company->error, $company->errors, 'errors');
|
||||
}
|
||||
else
|
||||
@@ -124,7 +123,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
||||
}
|
||||
else
|
||||
{
|
||||
$errmsg=$object->error;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +211,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$paymentdate=dol_mktime(0, 0, 0, $_POST["paymentmonth"], $_POST["paymentday"], $_POST["paymentyear"]);
|
||||
}
|
||||
$subscription=$_POST["subscription"]; // Amount of subscription
|
||||
$subscription=price2num(GETPOST("subscription",'alpha')); // Amount of subscription
|
||||
$label=$_POST["label"];
|
||||
|
||||
// Payment informations
|
||||
@@ -230,6 +229,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateSubscription"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
if (GETPOST('end') && ! $datesubend)
|
||||
@@ -237,6 +237,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorBadDateFormat",$langs->transnoentitiesnoconv("DateEndSubscription"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
if (! $datesubend)
|
||||
@@ -247,16 +248,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$error++;
|
||||
$errmsg=$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
|
||||
$amount = price2num(GETPOST("subscription",'alpha'));
|
||||
|
||||
// Check if a payment is mandatory or not
|
||||
if (! $error && $adht->subscription) // Member type need subscriptions
|
||||
{
|
||||
if (! is_numeric($_POST["subscription"]))
|
||||
if (! is_numeric($amount))
|
||||
{
|
||||
// If field is '' or not a numeric value
|
||||
$errmsg=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action='addsubscription';
|
||||
}
|
||||
@@ -274,7 +279,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
if ($_POST["accountid"]) $errmsg=$langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||
}
|
||||
if ($errmsg) $action='addsubscription';
|
||||
if ($errmsg)
|
||||
{
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action='addsubscription';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,6 +329,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$error++;
|
||||
$errmsg=$db->lasterror();
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -327,14 +337,16 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$error++;
|
||||
$errmsg=$acct->error;
|
||||
$errmsgs=$acct->errors;
|
||||
}
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errmsg=$acct->error;
|
||||
$errmsgs=$acct->errors;
|
||||
}
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// If option choosed, we create invoice
|
||||
@@ -352,6 +364,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$langs->load("errors");
|
||||
$errmsg=$langs->trans("ErrorMemberNotLinkedToAThirpartyLinkOrCreateFirst");
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -362,6 +375,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$customer->error;
|
||||
$errmsgs=$acct->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -379,6 +393,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$error++;
|
||||
$errmsg='ErrorNoPaymentTermRECEPFound';
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
}
|
||||
}
|
||||
$invoice->socid=$object->fk_soc;
|
||||
@@ -396,6 +411,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
$errmsgs=$invoice->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -416,6 +432,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
if ($result <= 0)
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -428,6 +445,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$invoice->error;
|
||||
$errmsgs=$invoice->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -455,6 +473,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
{
|
||||
$errmsg=$paiement->error;
|
||||
$errmsgs=$paiement->errors;
|
||||
setEventMessages($errmsg, $errmsgs, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -536,6 +555,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
if ($result < 0)
|
||||
{
|
||||
$errmsg=$object->error;
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -390,13 +390,13 @@ if ($rowid > 0)
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
$sql.= " AND d.statut IN (".$status.")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
$sql.= " AND d.statut IN (".$db->escape($status).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
}
|
||||
if ($action == 'search')
|
||||
{
|
||||
if (GETPOST('search'))
|
||||
{
|
||||
$sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search'));
|
||||
$sql.= natural_search(array("d.firstname","d.lastname"), GETPOST('search','alpha'));
|
||||
}
|
||||
}
|
||||
if (! empty($search_lastname))
|
||||
|
||||
@@ -131,12 +131,11 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
$wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
@@ -67,11 +67,11 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
|
||||
|
||||
$textobject=$langs->transnoentitiesnoconv("Agenda");
|
||||
|
||||
llxHeader('',$langs->trans("AgendaSetup"));
|
||||
$wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
$head=agenda_prepare_head();
|
||||
|
||||
|
||||
@@ -125,11 +125,11 @@ $formother=new FormOther($db);
|
||||
$arrayofjs=array();
|
||||
$arrayofcss=array();
|
||||
|
||||
llxHeader('',$langs->trans("AgendaSetup"),'','',0,0,$arrayofjs,$arrayofcss);
|
||||
$wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('',$langs->trans("AgendaSetup"),$wikihelp,'',0,0,$arrayofjs,$arrayofcss);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
print '<form name="extsitesconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@@ -210,7 +210,7 @@ while ($i <= $MAXAGENDA)
|
||||
$color='AGENDA_EXT_COLOR'.$key;
|
||||
$enabled='AGENDA_EXT_ENABLED'.$key;
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
|
||||
|
||||
@@ -42,7 +42,7 @@ $action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$param = GETPOST('param','alpha');
|
||||
$cancel = GETPOST('cancel','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type = 'action';
|
||||
|
||||
|
||||
@@ -174,12 +174,12 @@ else if ($action == 'setdoc')
|
||||
|
||||
$formactions=new FormActions($db);
|
||||
$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
|
||||
llxHeader();
|
||||
|
||||
$wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('', $langs->trans("AgendaSetup"),$wikihelp);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
print '<td align="center">'."\n";
|
||||
if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
@@ -286,7 +286,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@@ -373,11 +373,12 @@ $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AG
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// AGENDA_DEFAULT_FILTER_STATUS
|
||||
// TODO Remove to use the default generic feature
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n";
|
||||
print '<td align="center"> </td>'."\n";
|
||||
print '<td align="right">'."\n";
|
||||
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2);
|
||||
$formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// AGENDA_DEFAULT_VIEW
|
||||
|
||||
@@ -71,11 +71,11 @@ if ($actionsave)
|
||||
|
||||
if (! isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY=100;
|
||||
|
||||
llxHeader();
|
||||
$wikihelp='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"),$linkback,'title_setup');
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<form name="agendasetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
|
||||
@@ -43,7 +43,7 @@ if (!$user->admin)
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type = 'bankaccount';
|
||||
|
||||
|
||||
@@ -322,7 +322,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td align="center">' . "\n";
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&value=' . $name . '&scan_dir=' . $module->scandir . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -331,7 +331,7 @@ foreach ($dirmodels as $reldir)
|
||||
if ($conf->global->BANKADDON_PDF == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scandir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&value=' . $name . '&scan_dir=' . $module->scandir . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type = 'order';
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ $error=0;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
|
||||
|| ($action == 'updateedit') )
|
||||
{
|
||||
$tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0);
|
||||
@@ -63,19 +63,19 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM",$_POST["nom"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS",$_POST["address"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN",$_POST["town"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP",$_POST["zipcode"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE",$_POST["state_id"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MONNAIE",$_POST["currency"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL",$_POST["tel"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX",$_POST["fax"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL",$_POST["mail"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB",$_POST["web"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE",$_POST["note"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD",$_POST["barcode"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("address",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("town",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("zipcode",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
$varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/';
|
||||
if ($_FILES[$varforimage]["tmp_name"])
|
||||
{
|
||||
@@ -100,8 +100,8 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
if ($isimage > 0)
|
||||
{
|
||||
// Create thumbs
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
|
||||
// Create small thumb, Used on logon for example
|
||||
$imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality);
|
||||
if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg))
|
||||
@@ -143,27 +143,27 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS",$_POST["MAIN_INFO_SOCIETE_MANAGERS"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_CAPITAL",$_POST["capital"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE",$_POST["forme_juridique_code"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIREN",$_POST["siren"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIRET",$_POST["siret"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_APE",$_POST["ape"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_RCS",$_POST["rcs"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID5",$_POST["MAIN_INFO_PROFID5"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID6",$_POST["MAIN_INFO_PROFID6"],'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA",$_POST["tva"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT",$_POST["object"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START",$_POST["fiscalmonthstart"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "FACTURE_TVAOPTION",$_POST["optiontva"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("fiscalmonthstart",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
// Local taxes
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION",$_POST["optionlocaltax1"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION",$_POST["optionlocaltax2"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", GETPOST("optionlocaltax1",'alpha'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", GETPOST("optionlocaltax2",'alpha'),'chaine',0,'',$conf->entity);
|
||||
|
||||
if($_POST["optionlocaltax1"]=="localtax1on")
|
||||
{
|
||||
@@ -173,9 +173,9 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", $_POST["clt1"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
if($_POST["optionlocaltax2"]=="localtax2on")
|
||||
{
|
||||
@@ -185,9 +185,9 @@ if ( ($action == 'update' && empty($_POST["cancel"]))
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2'),'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", $_POST["clt2"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'alpha'),'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
if ($action != 'updateedit' && ! $error)
|
||||
@@ -207,7 +207,7 @@ if ($action == 'addthumb') // Regenerate thumbs
|
||||
if ($isimage > 0)
|
||||
{
|
||||
// Create thumbs
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
//$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get...
|
||||
|
||||
// Create small thumb. Used on logon for example
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality);
|
||||
@@ -309,72 +309,72 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
// Name
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM:$_POST["nom"]) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
|
||||
// Addresse
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:$_POST["address"]) . '</textarea></td></tr>'."\n";
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS: GETPOST("address",'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:$_POST["zipcode"]) . '"></td></tr>'."\n";
|
||||
print '<input class="minwidth100" name="zipcode" id="zipcode" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP: GETPOST("zipcode",'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:$_POST["town"]) . '"></td></tr>'."\n";
|
||||
print '<input name="town" class="minwidth100" id="town" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN: GETPOST("town",'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
|
||||
print $form->select_country($mysoc->country_id,'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement($conf->global->MAIN_INFO_SOCIETE_STATE,$mysoc->country_code,'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="currency">'.$langs->trans("CompanyCurrency").'</label></td><td>';
|
||||
print $form->selectCurrency($conf->currency,"currency");
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_SOCIETE_TEL . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_SOCIETE_FAX . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_SOCIETE_MAIL . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_SOCIETE_WEB . '"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
if (! empty($conf->barcode->enabled)) {
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'. $conf->global->MAIN_INFO_SOCIETE_GENCOD . '"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Logo
|
||||
|
||||
|
||||
print '<tr'.dol_bc($var,'hideonsmartphone').'><td><label for="logo">'.$langs->trans("Logo").' (png,jpg)</label></td><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<input type="file" class="flat class=minwidth200" name="logo" id="logo">';
|
||||
@@ -392,9 +392,9 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '</td></tr>';
|
||||
|
||||
// Note
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? $conf->global->MAIN_INFO_SOCIETE_NOTE : '').'</textarea></td></tr>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOST('note','none') ? GETPOST('note','none') : $conf->global->MAIN_INFO_SOCIETE_NOTE).'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@@ -409,17 +409,17 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
$langs->load("companies");
|
||||
|
||||
// Managing Director(s)
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '"></td></tr>';
|
||||
|
||||
// Capital
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||
print '<input name="capital" id="capital" class="minwidth100" value="' . $conf->global->MAIN_INFO_CAPITAL . '"></td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="forme_juridique_code">'.$langs->trans("JuridicalStatus").'</label></td><td>';
|
||||
if ($mysoc->country_code) {
|
||||
print $formcompany->select_juridicalstatus($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE, $mysoc->country_code, '', 'forme_juridique_code');
|
||||
@@ -431,7 +431,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfID1
|
||||
if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@@ -447,7 +447,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId2
|
||||
if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@@ -463,7 +463,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId3
|
||||
if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@@ -479,7 +479,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId4
|
||||
if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@@ -495,7 +495,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId5
|
||||
if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@@ -511,7 +511,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// ProfId6
|
||||
if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
@@ -525,13 +525,13 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
}
|
||||
|
||||
// TVA Intra
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
|
||||
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Object of the company
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="object">'.$langs->trans("CompanyObject").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows="'.ROWS_5.'">'.(! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? $conf->global->MAIN_INFO_SOCIETE_OBJECT : '').'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
@@ -546,7 +546,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fiscalmonthstart">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
||||
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'fiscalmonthstart',0,1) . '</td></tr>';
|
||||
|
||||
@@ -561,7 +561,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"use_vat\" value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@@ -570,7 +570,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"140\"><label><input type=\"radio\" name=\"optiontva\" id=\"no_vat\" value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@@ -593,7 +593,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td>'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
// 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 class=\"oddeven\"><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">';
|
||||
@@ -616,7 +616,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><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>";
|
||||
@@ -637,7 +637,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
// 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 class=\"oddeven\"><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">';
|
||||
@@ -657,7 +657,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><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>";
|
||||
@@ -693,22 +693,22 @@ else
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyInfo").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("CompanyName").'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).'</font>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyAddress").'</td><td>' . nl2br(empty($conf->global->MAIN_INFO_SOCIETE_ADDRESS)?'':$conf->global->MAIN_INFO_SOCIETE_ADDRESS) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyZip").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_ZIP)?'':$conf->global->MAIN_INFO_SOCIETE_ZIP) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyTown").'</td><td>' . (empty($conf->global->MAIN_INFO_SOCIETE_TOWN)?'':$conf->global->MAIN_INFO_SOCIETE_TOWN) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyCountry").'</td><td>';
|
||||
if ($mysoc->country_code)
|
||||
{
|
||||
@@ -719,13 +719,13 @@ else
|
||||
else print img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("State").'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE);
|
||||
else print ' ';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CompanyCurrency").'</td><td>';
|
||||
print currency_name($conf->currency,1);
|
||||
print ' ('.$conf->currency;
|
||||
@@ -733,28 +733,28 @@ else
|
||||
print ')';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Phone").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Fax").'</td><td>' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Mail").'</td><td>' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '</td></tr>';
|
||||
|
||||
// Web
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Web").'</td><td>' . dol_print_url($conf->global->MAIN_INFO_SOCIETE_WEB,'_blank',80) . '</td></tr>';
|
||||
|
||||
// Barcode
|
||||
if (! empty($conf->barcode->enabled))
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Gencod").'</td><td>' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . '</td></tr>';
|
||||
}
|
||||
|
||||
// Logo
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Logo").'</td><td>';
|
||||
|
||||
$tagtd='tagtd ';
|
||||
@@ -780,7 +780,7 @@ else
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("Note").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_NOTE) ? nl2br($conf->global->MAIN_INFO_SOCIETE_NOTE) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@@ -796,17 +796,17 @@ else
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Managing Director(s)
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ManagingDirectors").'</td><td>';
|
||||
print $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '</td></tr>';
|
||||
|
||||
// Capital
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Capital").'</td><td>';
|
||||
print $conf->global->MAIN_INFO_CAPITAL . '</td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("JuridicalStatus").'</td><td>';
|
||||
print getFormeJuridiqueLabel($conf->global->MAIN_INFO_SOCIETE_FORME_JURIDIQUE);
|
||||
print '</td></tr>';
|
||||
@@ -814,7 +814,7 @@ else
|
||||
// ProfId1
|
||||
if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId1",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SIREN))
|
||||
{
|
||||
@@ -830,7 +830,7 @@ else
|
||||
// ProfId2
|
||||
if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId2",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_SIRET))
|
||||
{
|
||||
@@ -846,7 +846,7 @@ else
|
||||
// ProfId3
|
||||
if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId3",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_APE))
|
||||
{
|
||||
@@ -862,7 +862,7 @@ else
|
||||
// ProfId4
|
||||
if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId4",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_RCS))
|
||||
{
|
||||
@@ -878,7 +878,7 @@ else
|
||||
// ProfId5
|
||||
if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId5",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_PROFID5))
|
||||
{
|
||||
@@ -894,7 +894,7 @@ else
|
||||
// ProfId6
|
||||
if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-')
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->transcountry("ProfId6",$mysoc->country_code).'</td><td>';
|
||||
if (! empty($conf->global->MAIN_INFO_PROFID6))
|
||||
{
|
||||
@@ -908,7 +908,7 @@ else
|
||||
}
|
||||
|
||||
// VAT
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VATIntra").'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->global->MAIN_INFO_TVAINTRA))
|
||||
@@ -944,8 +944,8 @@ else
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td class="tdtop">'.$langs->trans("CompanyObject").'</td><td>' . (! empty($conf->global->MAIN_INFO_SOCIETE_OBJECT) ? nl2br($conf->global->MAIN_INFO_SOCIETE_OBJECT) : '') . '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@@ -960,7 +960,7 @@ else
|
||||
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("FiscalMonthStart").'</td><td>';
|
||||
$monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1;
|
||||
print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '</td></tr>';
|
||||
@@ -977,7 +977,7 @@ else
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@@ -986,7 +986,7 @@ else
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
@@ -1011,7 +1011,7 @@ else
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled 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>";
|
||||
@@ -1039,7 +1039,7 @@ else
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" 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>";
|
||||
@@ -1061,7 +1061,7 @@ else
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled 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>";
|
||||
@@ -1090,7 +1090,7 @@ else
|
||||
print "</table>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" 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>";
|
||||
|
||||
@@ -37,7 +37,7 @@ if (!$user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='contract';
|
||||
|
||||
if (empty($conf->global->CONTRACT_ADDON))
|
||||
@@ -397,7 +397,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -409,7 +409,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -243,6 +243,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.dol_escape_htmltag($mode).'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
// Page
|
||||
@@ -301,13 +302,13 @@ print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="de
|
||||
print '</td>'."\n";
|
||||
// Field
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidth100" name="defaultkey" value="">';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="">';
|
||||
print '</td>';
|
||||
// Value
|
||||
if ($mode != 'focus')
|
||||
{
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat maxwidthonsmartphone" name="defaultvalue" value="">';
|
||||
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="">';
|
||||
print '</td>';
|
||||
}
|
||||
// Limit to superadmin
|
||||
@@ -409,6 +410,7 @@ else
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ $actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||
|
||||
$listoffset=GETPOST('listoffset');
|
||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
|
||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; // To avoid too long dictionaries
|
||||
$active = 1;
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@@ -600,7 +600,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||
if ($value == 'color' && empty($_POST['color'])) continue;
|
||||
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
||||
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
||||
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
|
||||
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
||||
)
|
||||
@@ -715,7 +716,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
|
||||
if ($listfieldvalue[$i] == 'sortorder') // For column name 'sortorder', we use the field name 'position'
|
||||
{
|
||||
$sql.="'".(int) $db->escape($_POST['position'])."'";
|
||||
}
|
||||
elseif ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
|
||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||
$i++;
|
||||
}
|
||||
@@ -764,7 +769,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
$sql.= $field."=";
|
||||
if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
|
||||
if ($listfieldvalue[$i] == 'sortorder') // For column name 'sortorder', we use the field name 'position'
|
||||
{
|
||||
$sql.="'".(int) $db->escape($_POST['position'])."'";
|
||||
}
|
||||
elseif ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
|
||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||
$i++;
|
||||
}
|
||||
@@ -990,6 +999,7 @@ if ($id)
|
||||
|
||||
$fieldlist=explode(',',$tabfield[$id]);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Line for title
|
||||
@@ -1118,7 +1128,7 @@ if ($id)
|
||||
}
|
||||
|
||||
if ($id == 4) print '<td></td>';
|
||||
print '<td colspan="3" align="right">';
|
||||
print '<td colspan="3" align="center">';
|
||||
if ($action != 'edit')
|
||||
{
|
||||
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
||||
@@ -1130,11 +1140,7 @@ if ($id)
|
||||
if ($id == 4) $colspan++;
|
||||
|
||||
print '</table>';
|
||||
|
||||
/*if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
|
||||
{
|
||||
print '* '.$langs->trans("LabelUsedByDefault").'.<br>';
|
||||
}*/
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
@@ -1154,11 +1160,13 @@ if ($id)
|
||||
$i = 0;
|
||||
|
||||
// There is several pages
|
||||
if ($num > $listlimit)
|
||||
if ($num > $listlimit || $page)
|
||||
{
|
||||
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page+1).'</span></li>');
|
||||
print '<div class="clearboth"></div>';
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Title line with search boxes
|
||||
@@ -1580,6 +1588,7 @@ if ($id)
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
@@ -1595,6 +1604,8 @@ else
|
||||
*/
|
||||
|
||||
$lastlineisempty=false;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
//print '<td>'.$langs->trans("Module").'</td>';
|
||||
@@ -1647,6 +1658,7 @@ else
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
@@ -1836,6 +1848,8 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position';
|
||||
|
||||
$classtd=''; $class='';
|
||||
if ($fieldlist[$field]=='code') $classtd='width100';
|
||||
if ($fieldlist[$field]=='affect') $class='maxwidth50';
|
||||
|
||||
@@ -45,7 +45,7 @@ if (! $user->admin)
|
||||
$action=GETPOST('action','alpha');
|
||||
$value=GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='shipping';
|
||||
|
||||
if (empty($conf->global->EXPEDITION_ADDON_NUMBER))
|
||||
@@ -263,7 +263,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&value='.$file.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a>';
|
||||
}
|
||||
@@ -402,7 +402,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@@ -440,7 +440,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td align="center">';
|
||||
if ($module->type == 'pdf')
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='expensereport';
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
@@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='ficheinter';
|
||||
|
||||
|
||||
@@ -221,9 +221,38 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
|
||||
$val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
|
||||
$val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '',
|
||||
$conf->entity);
|
||||
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -431,7 +460,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
@@ -439,7 +468,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -451,7 +480,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@@ -576,6 +605,40 @@ print '<input type="submit" class="button" value="' . $langs->trans("Modify") .
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// Use duration
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("UseDurationOnFichinter");
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"' . ($conf->global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
// use date without hour
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $langs->trans("UseDateWithoutHourOnFichinter");
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"' . ($conf->global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
@@ -70,13 +70,13 @@ if (! empty($conf->global->MAIN_MOTD_SETUPPAGE))
|
||||
|
||||
print $langs->trans("SetupDescription1").' ';
|
||||
print $langs->trans("AreaForAdminOnly").' ';
|
||||
print $langs->trans("SetupDescription2", $langs->trans("MenuCompanySetup"), $langs->trans("Modules"))."<br><br>";
|
||||
print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySetup"), $langs->transnoentities("Modules"))."<br><br>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Show info setup company
|
||||
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
|
||||
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->trans("Setup"), $langs->trans("MenuCompanySetup"));
|
||||
print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup"));
|
||||
if (! empty($setupcompanynotcomplete))
|
||||
{
|
||||
$langs->load("errors");
|
||||
@@ -88,7 +88,7 @@ print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Show info setup module
|
||||
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->trans("Setup"), $langs->trans("Modules"));
|
||||
print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules"));
|
||||
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
||||
@@ -44,7 +44,7 @@ if (!$user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='delivery';
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ foreach ($dirmodels as $reldir)
|
||||
if (in_array($name, $def))
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
@@ -393,7 +393,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -46,13 +46,18 @@ if ($action == 'test' || $action == 'send')
|
||||
}
|
||||
|
||||
$substitutionarrayfortest=array(
|
||||
'__LOGIN__' => $user->login,
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__EMAIL__' => 'TESTEMail',
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname',
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''),
|
||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__ID__' => 'RecipientIdRecord',
|
||||
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty))?'<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>':'',
|
||||
'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$usersignature:''), // Done into actions_sendmails
|
||||
'__LOGIN__' => 'RecipientLogin',
|
||||
'__LASTNAME__' => 'RecipientLastname',
|
||||
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||
'__ADDRESS__'=> 'RecipientAddress',
|
||||
'__ZIP__'=> 'RecipientZip',
|
||||
'__TOWN_'=> 'RecipientTown',
|
||||
'__COUNTRY__'=> 'RecipientCountry'
|
||||
);
|
||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||
|
||||
|
||||
@@ -465,6 +465,7 @@ print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Form to add a new line
|
||||
@@ -581,13 +582,13 @@ if ($action != 'edit')
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$colspan=count($fieldlist)+1;
|
||||
//print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
@@ -596,6 +597,7 @@ print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// List of available record in database
|
||||
@@ -840,6 +842,7 @@ else {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@@ -83,27 +83,27 @@ if ($action == 'update')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$menu = new Menubase($db);
|
||||
$result=$menu->fetch($_POST['menuId']);
|
||||
$result=$menu->fetch(GETPOST('menuId', 'int'));
|
||||
if ($result > 0)
|
||||
{
|
||||
$menu->titre=$_POST['titre'];
|
||||
$menu->leftmenu=$_POST['leftmenu'];
|
||||
$menu->url=$_POST['url'];
|
||||
$menu->langs=$_POST['langs'];
|
||||
$menu->position=$_POST['position'];
|
||||
$menu->enabled=$_POST['enabled'];
|
||||
$menu->perms=$_POST['perms'];
|
||||
$menu->target=$_POST['target'];
|
||||
$menu->user=$_POST['user'];
|
||||
if (is_numeric($_POST['menuIdParent']))
|
||||
$menu->titre=GETPOST('titre', 'alpha');
|
||||
$menu->leftmenu=GETPOST('leftmenu', 'alpha');
|
||||
$menu->url=GETPOST('url','alpha');
|
||||
$menu->langs=GETPOST('langs','alpha');
|
||||
$menu->position=GETPOST('position','int');
|
||||
$menu->enabled=GETPOST('enabled','alpha');
|
||||
$menu->perms=GETPOST('perms','alpha');
|
||||
$menu->target=GETPOST('target','alpha');
|
||||
$menu->user=GETPOST('user','alpha');
|
||||
if (is_numeric(GETPOST('menuIdParent','alpha')))
|
||||
{
|
||||
$menu->fk_menu=$_POST['menuIdParent'];
|
||||
$menu->fk_menu=GETPOST('menuIdParent','alpha');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($_POST['type'] == 'top') $menu->fk_menu=0;
|
||||
if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0;
|
||||
else $menu->fk_menu=-1;
|
||||
$menu->fk_mainmenu=$mainmenu;
|
||||
$menu->fk_leftmenu=$leftmenu;
|
||||
@@ -123,7 +123,6 @@ if ($action == 'update')
|
||||
{
|
||||
setEventMessages($menu->error, $menu->errors, 'errors');
|
||||
}
|
||||
$_GET["menuId"] = $_POST['menuId'];
|
||||
$action = "edit";
|
||||
}
|
||||
else
|
||||
@@ -148,9 +147,9 @@ if ($action == 'add')
|
||||
}
|
||||
|
||||
$leftmenu=''; $mainmenu='';
|
||||
if (! empty($_POST['menuId']) && ! is_numeric($_POST['menuId']))
|
||||
if (GETPOST('menuId','int') && ! is_numeric(GETPOST('menuId','int')))
|
||||
{
|
||||
$tmp=explode('&',$_POST['menuId']);
|
||||
$tmp=explode('&',GETPOST('menuId','int'));
|
||||
foreach($tmp as $s)
|
||||
{
|
||||
if (preg_match('/fk_mainmenu=/',$s))
|
||||
@@ -197,7 +196,7 @@ if ($action == 'add')
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
if (! $error && empty($_POST['menuId']) && $_POST['type'] == 'left')
|
||||
if (! $error && ! $_POST['menuId'] && $_POST['type'] == 'left')
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorLeftMenuMustHaveAParentId"), null, 'errors');
|
||||
$action = 'create';
|
||||
@@ -207,23 +206,23 @@ if ($action == 'add')
|
||||
if (! $error)
|
||||
{
|
||||
$menu = new Menubase($db);
|
||||
$menu->menu_handler=preg_replace('/_menu$/','',$_POST['menu_handler']);
|
||||
$menu->type=$_POST['type'];
|
||||
$menu->titre=$_POST['titre'];
|
||||
$menu->url=$_POST['url'];
|
||||
$menu->langs=$_POST['langs'];
|
||||
$menu->position=$_POST['position'];
|
||||
$menu->enabled=$_POST['enabled'];
|
||||
$menu->perms=$_POST['perms'];
|
||||
$menu->target=$_POST['target'];
|
||||
$menu->user=$_POST['user'];
|
||||
if (is_numeric($_POST['menuId']))
|
||||
$menu->menu_handler=preg_replace('/_menu$/','',GETPOST('menu_handler','aZ09'));
|
||||
$menu->type=GETPOST('type','alpha');
|
||||
$menu->titre=GETPOST('titre','alpha');
|
||||
$menu->url=GETPOST('url','alpha');
|
||||
$menu->langs=GETPOST('langs','alpha');
|
||||
$menu->position=GETPOST('position','int');
|
||||
$menu->enabled=GETPOST('enabled','alpha');
|
||||
$menu->perms=GETPOST('perms','alpha');
|
||||
$menu->target=GETPOST('target','alpha');
|
||||
$menu->user=GETPOST('user','alpha');
|
||||
if (is_numeric(GETPOST('menuId','int')))
|
||||
{
|
||||
$menu->fk_menu=$_POST['menuId'];
|
||||
$menu->fk_menu=GETPOST('menuId','int');
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($_POST['type'] == 'top') $menu->fk_menu=0;
|
||||
if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0;
|
||||
else $menu->fk_menu=-1;
|
||||
$menu->fk_mainmenu=$mainmenu;
|
||||
$menu->fk_leftmenu=$leftmenu;
|
||||
@@ -232,7 +231,7 @@ if ($action == 'add')
|
||||
$result=$menu->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".$_POST['menu_handler']);
|
||||
header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler','aZ09'));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -305,17 +304,17 @@ if ($action == 'create')
|
||||
</script>';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewMenu"),'','title_setup');
|
||||
|
||||
print '<form action="./edit.php?action=add&menuId='.$_GET['menuId'].'" method="post" name="formmenucreate">';
|
||||
|
||||
print '<form action="./edit.php?action=add&menuId='.GETPOST('menuId', 'int').'" method="post" name="formmenucreate">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Id
|
||||
$parent_rowid = $_GET['menuId'];
|
||||
if ($_GET['menuId'])
|
||||
$parent_rowid = GETPOST('menuId', 'int');
|
||||
if (GETPOST('menuId', 'int'))
|
||||
{
|
||||
$sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs FROM ".MAIN_DB_PREFIX."menu as m WHERE m.rowid = ".GETPOST('menuId', 'int');
|
||||
$res = $db->query($sql);
|
||||
@@ -375,40 +374,40 @@ if ($action == 'create')
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td><input type="text" size="48" id="menuId" name="menuId" value="'.($_POST["menuId"]?$_POST["menuId"]:'').'"></td>';
|
||||
print '<td><input type="text" size="48" id="menuId" name="menuId" value="'.(GETPOST("menuId", 'int')?GETPOST("menuId", 'int'):'').'"></td>';
|
||||
}
|
||||
print '<td>'.$langs->trans('DetailMenuIdParent');
|
||||
print ', '.$langs->trans("Example").': fk_mainmenu=abc&fk_leftmenu=def';
|
||||
print '</td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.$_POST["titre"].'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.dol_escape_htmltag(GETPOST("titre",'alpha')).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
|
||||
// URL
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" size="60" name="url" value="'.$_POST["url"].'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" size="60" name="url" value="'.GETPOST("url",'alpha').'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
|
||||
// Langs
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$parent_langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.(isset($_POST["position"])?$_POST["position"]:100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.dol_escape_htmltag(isset($_POST["position"])?$_POST["position"]:100).'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'>'.$langs->trans('').'</option>';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'> </option>';
|
||||
print '<option value="_blank"'.($menu->target=="_blank"?' selected':'').'>'.$langs->trans('_blank').'</option>';
|
||||
print '</select></td></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
// Enabled
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.$_POST["enabled"].'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Enabled').'</td><td><input type="text" size="60" name="enabled" value="'.GETPOST("enabled",'alpha').'"></td><td>'.$langs->trans('DetailEnabled').'</td></tr>';
|
||||
|
||||
// Perms
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.$_POST["perms"].'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Rights').'</td><td><input type="text" size="60" name="perms" value="'.GETPOST('perms','alpha').'"></td><td>'.$langs->trans('DetailRight').'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Boutons
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
@@ -426,14 +425,14 @@ elseif ($action == 'edit')
|
||||
print '<form action="./edit.php?action=update" method="POST" name="formmenuedit">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="handler_origine" value="'.$menu_handler.'">';
|
||||
print '<input type="hidden" name="menuId" value="'.$_GET['menuId'].'">';
|
||||
print '<input type="hidden" name="menuId" value="'.GETPOST('menuId', 'int').'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$menu = new Menubase($db);
|
||||
$result=$menu->fetch($_GET['menuId']);
|
||||
$result=$menu->fetch(GETPOST('menuId', 'int'));
|
||||
//var_dump($menu);
|
||||
|
||||
// Id
|
||||
@@ -472,20 +471,20 @@ elseif ($action == 'edit')
|
||||
//print '<tr><td>'.$langs->trans('Level').'</td><td>'.$menu->level.'</td><td>'.$langs->trans('DetailLevel').'</td></tr>';
|
||||
|
||||
// Title
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.$menu->titre.'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Title').'</td><td><input type="text" size="30" name="titre" value="'.dol_escape_htmltag($menu->titre).'"></td><td>'.$langs->trans('DetailTitre').'</td></tr>';
|
||||
|
||||
// Url
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('URL').'</td><td><input type="text" class="quatrevingtpercent" name="url" value="'.$menu->url.'"></td><td>'.$langs->trans('DetailUrl').'</td></tr>';
|
||||
|
||||
// Langs
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.$menu->langs.'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('LangFile').'</td><td><input type="text" size="30" name="langs" value="'.dol_escape_htmltag($menu->langs).'"></td><td>'.$langs->trans('DetailLangs').'</td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans('Position').'</td><td><input type="text" size="5" name="position" value="'.$menu->position.'"></td><td>'.$langs->trans('DetailPosition').'</td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans('Target').'</td><td><select class="flat" name="target">';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'>'.$langs->trans('').'</option>';
|
||||
print '<option value=""'.($menu->target==""?' selected':'').'> </option>';
|
||||
print '<option value="_blank"'.($menu->target=="_blank"?' selected':'').'>'.$langs->trans('_blank').'</option>';
|
||||
print '</select></td><td>'.$langs->trans('DetailTarget').'</td></tr>';
|
||||
|
||||
@@ -502,7 +501,7 @@ elseif ($action == 'edit')
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Bouton
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
|
||||
@@ -843,115 +843,111 @@ if ($mode == 'marketplace')
|
||||
|
||||
if ($mode == 'deploy')
|
||||
{
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
dol_fiche_head($head, $mode, '', -1);
|
||||
|
||||
$dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT);
|
||||
$allowonlineinstall=true;
|
||||
$allowfromweb=1;
|
||||
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
||||
|
||||
$allowonlineinstall=true;
|
||||
$allowfromweb=1;
|
||||
if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false;
|
||||
$fullurl='<a href="'.$urldolibarrmodules.'" target="_blank">'.$urldolibarrmodules.'</a>';
|
||||
$message='';
|
||||
if (! empty($allowonlineinstall))
|
||||
{
|
||||
if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt)))
|
||||
{
|
||||
$message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
|
||||
$allowfromweb=-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($dirins_ok)
|
||||
{
|
||||
if (! is_writable(dol_osencode($dirins)))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock'));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
|
||||
$fullurl='<a href="'.$urldolibarrmodules.'" target="_blank">'.$urldolibarrmodules.'</a>';
|
||||
$message='';
|
||||
if (! empty($allowonlineinstall))
|
||||
{
|
||||
if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt)))
|
||||
{
|
||||
$message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT));
|
||||
$allowfromweb=-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($dirins_ok)
|
||||
{
|
||||
if (! is_writable(dol_osencode($dirins)))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($allowfromweb < 1)
|
||||
{
|
||||
print $langs->trans("SomethingMakeInstallFromWebNotPossible");
|
||||
print $message;
|
||||
//print $langs->trans("SomethingMakeInstallFromWebNotPossible2");
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample"));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock'));
|
||||
$allowfromweb=0;
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
if ($allowfromweb < 1)
|
||||
{
|
||||
print $langs->trans("SomethingMakeInstallFromWebNotPossible");
|
||||
print $message;
|
||||
//print $langs->trans("SomethingMakeInstallFromWebNotPossible2");
|
||||
print '<br>';
|
||||
}
|
||||
if ($allowfromweb >= 0)
|
||||
{
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
|
||||
if ($allowfromweb >= 0)
|
||||
{
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
//print $langs->trans("ThisIsProcessToFollow").'<br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",1).'</b>: ';
|
||||
print $langs->trans("FindPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",2).'</b>: ';
|
||||
print $langs->trans("DownloadPackageFromWebSite",$fullurl).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",3).'</b>: ';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
if ($allowfromweb == 1)
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
print '</form>';
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
if (! empty($result['return']))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center"><div class="logo_setup"></div></div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print $langs->trans("UnpackPackageInModulesRoot",$dirins).'<br>';
|
||||
print '<b>'.$langs->trans("StepNb",4).'</b>: ';
|
||||
print $langs->trans("SetupIsReadyForUse").'<br>';
|
||||
}
|
||||
}
|
||||
foreach($result['return'] as $value)
|
||||
{
|
||||
echo $value.'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! empty($result['return']))
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
foreach($result['return'] as $value)
|
||||
{
|
||||
echo $value.'<br>';
|
||||
}
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
dol_fiche_end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
|
||||
@@ -78,34 +78,54 @@ if (preg_match('/del_(.*)/',$action,$reg))
|
||||
|
||||
if ($action == 'add_currency')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
$langs->loadCacheCurrencies('');
|
||||
|
||||
$code = GETPOST('code', 'alpha');
|
||||
$rate = GETPOST('rate', 'alpha');
|
||||
$rate = price2num(GETPOST('rate', 'alpha'));
|
||||
$currency = new MultiCurrency($db);
|
||||
$currency->code = $code;
|
||||
$currency->name = !empty($langs->cache_currencies[$code]['label']) ? $langs->cache_currencies[$code]['label'].' ('.$langs->getCurrencySymbol($code).')' : $code;
|
||||
|
||||
if ($currency->create($user) > 0)
|
||||
if (empty($rate))
|
||||
{
|
||||
if ($currency->addRate($rate)) setEventMessages($langs->trans('RecordSaved'), array());
|
||||
else setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Rate")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
if ($currency->create($user) > 0)
|
||||
{
|
||||
if ($currency->addRate($rate)) setEventMessages($langs->trans('RecordSaved'), array());
|
||||
else setEventMessages($langs->trans('ErrorAddRateFail'), array(), 'errors');
|
||||
}
|
||||
else setEventMessages($langs->trans('ErrorAddCurrencyFail'), $currency->errors, 'errors');
|
||||
}
|
||||
else setEventMessages($langs->trans('ErrorAddCurrencyFail'), $currency->errors, 'errors');
|
||||
}
|
||||
elseif ($action == 'update_currency')
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$submit = GETPOST('submit', 'alpha');
|
||||
|
||||
if ($submit == $langs->trans('Modify'))
|
||||
{
|
||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||
$rate = GETPOST('rate', 'float');
|
||||
$rate = price2num(GETPOST('rate', 'alpha'));
|
||||
$currency = new MultiCurrency($db);
|
||||
|
||||
if ($currency->fetch($fk_multicurrency) > 0)
|
||||
if (empty($rate))
|
||||
{
|
||||
$currency->updateRate($rate);
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Rate")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
if ($currency->fetch($fk_multicurrency) > 0)
|
||||
{
|
||||
$currency->updateRate($rate);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($submit == $langs->trans('Delete'))
|
||||
@@ -235,7 +255,7 @@ print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
print '<br />';
|
||||
print '<br>';
|
||||
|
||||
if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
||||
{
|
||||
@@ -279,7 +299,6 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION))
|
||||
print '</form>';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_alternateCurrencySource").'</td>';
|
||||
print '<td align="center" width="20"> </td>';
|
||||
@@ -325,8 +344,7 @@ print '</td></form></tr>';
|
||||
|
||||
foreach ($TCurrency as &$currency)
|
||||
{
|
||||
if($currency->code == $conf->currency) continue;
|
||||
|
||||
if ($currency->code == $conf->currency) continue;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$currency->code.' - '.$currency->name.'</td>';
|
||||
|
||||
@@ -36,7 +36,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='invoice';
|
||||
|
||||
if (empty($conf->global->PAYMENT_ADDON)) $conf->global->PAYMENT_ADDON = 'mod_payment_cicada.php';
|
||||
@@ -188,7 +188,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2012-2105 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2107 Juanjo Menent <jmenent@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
|
||||
@@ -56,7 +56,7 @@ if ($cancel) {
|
||||
if ($action == 'update')
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
|
||||
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", $_POST["MAIN_PDF_MARGIN_LEFT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", $_POST["MAIN_PDF_MARGIN_RIGHT"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", $_POST["MAIN_PDF_MARGIN_TOP"],'chaine',0,'',$conf->entity);
|
||||
@@ -74,7 +74,11 @@ if ($action == 'update')
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", $_POST["MAIN_PDF_USE_ISO_LOCATION"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"],'chaine',0,'',$conf->entity);
|
||||
|
||||
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", $_POST["MAIN_PDF_MAIN_HIDE_SECOND_TAX"],'chaine',0,'',$conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", $_POST["MAIN_PDF_MAIN_HIDE_THIRD_TAX"],'chaine',0,'',$conf->entity);
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
}
|
||||
@@ -130,7 +134,8 @@ if ($action == 'edit') // Edit
|
||||
|
||||
// Misc options
|
||||
print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'<br>';
|
||||
$var=true;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@@ -138,7 +143,7 @@ if ($action == 'edit') // Edit
|
||||
if (empty($selected)) $selected=dol_getDefaultFormat();
|
||||
|
||||
// Show pdf format
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
|
||||
print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT');
|
||||
print '</td></tr>';
|
||||
@@ -155,26 +160,28 @@ if ($action == 'edit') // Edit
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.(empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Addresses
|
||||
print load_fiche_titre($langs->trans("PDFAddressForging"),'','').'<br>';
|
||||
$var=true;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Hide VAT Intra on address
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
|
||||
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Show prof id 1 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
|
||||
@@ -192,7 +199,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
// Show prof id 2 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
|
||||
@@ -210,7 +217,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
// Show prof id 3 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
|
||||
@@ -228,7 +235,7 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
// Show prof id 4 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
|
||||
@@ -246,51 +253,88 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Localtaxes
|
||||
if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
|
||||
{
|
||||
$locales ='';
|
||||
$text='';
|
||||
|
||||
if ($mysoc->useLocalTax(1))
|
||||
{
|
||||
$locales = $langs->transcountry("LT1",$mysoc->country_code);
|
||||
$text ='<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . '</td><td>';
|
||||
$text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1);
|
||||
$text .= '</td></tr>';
|
||||
}
|
||||
|
||||
if ($mysoc->useLocalTax(2))
|
||||
{
|
||||
$locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code);
|
||||
|
||||
$text.= '<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . '</td><td>';
|
||||
$text.= $form->selectyesno('MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1);
|
||||
$text.= '</td></tr>';
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
|
||||
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
print $text;
|
||||
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
}
|
||||
|
||||
// Other
|
||||
print load_fiche_titre($langs->trans("Other"),'','').'<br>';
|
||||
$var=true;
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Hide any PDF informations
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Desc
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Ref
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Details
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Place customer adress to the ISO location
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
|
||||
print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td>';
|
||||
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
@@ -303,17 +347,16 @@ if ($action == 'edit') // Edit
|
||||
}
|
||||
else // Show
|
||||
{
|
||||
$var=true;
|
||||
|
||||
// Misc options
|
||||
print load_fiche_titre($langs->trans("DictionaryPaperFormat"),'','');
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Show pdf format
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
|
||||
|
||||
$pdfformatlabel='';
|
||||
@@ -352,24 +395,26 @@ else // Show
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
|
||||
print empty($conf->global->MAIN_PDF_MARGIN_BOTTOM)?10:$conf->global->MAIN_PDF_MARGIN_BOTTOM;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print load_fiche_titre($langs->trans("PDFAddressForging"),'','');
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Hide Intra VAT on address
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Show prof id 1 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
|
||||
@@ -387,7 +432,7 @@ else // Show
|
||||
}
|
||||
|
||||
// Show prof id 2 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
|
||||
@@ -405,7 +450,7 @@ else // Show
|
||||
}
|
||||
|
||||
// Show prof id 3 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
|
||||
@@ -423,7 +468,7 @@ else // Show
|
||||
}
|
||||
|
||||
// Show prof id 4 in address into pdf
|
||||
|
||||
|
||||
if (! $noCountryCode)
|
||||
{
|
||||
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
|
||||
@@ -441,18 +486,52 @@ else // Show
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Localtaxes
|
||||
if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
|
||||
{
|
||||
$locales ='';
|
||||
$text='';
|
||||
|
||||
if ($mysoc->useLocalTax(1))
|
||||
{
|
||||
$locales = $langs->transcountry("LT1",$mysoc->country_code);
|
||||
$text ='<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT1",$mysoc->country_code)) . '</td><td>';
|
||||
$text .= yn($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX,1);
|
||||
$text .= '</td></tr>';
|
||||
}
|
||||
|
||||
if ($mysoc->useLocalTax(2))
|
||||
{
|
||||
$locales.=($locales?' & ':'').$langs->transcountry("LT2",$mysoc->country_code);
|
||||
|
||||
$text.= '<tr class="oddeven"><td>' . $langs->trans("HideLocalTaxOnPDF",$langs->transcountry("LT2",$mysoc->country_code)) . '</td><td>';
|
||||
$text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1);
|
||||
$text.= '</td></tr>';
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("PDFLocaltax",$locales),'','');
|
||||
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
print $text;
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
}
|
||||
|
||||
// Other
|
||||
print load_fiche_titre($langs->trans("Other"),'','');
|
||||
$var=true;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
|
||||
// Encrypt and protect PDF
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
$text = $langs->trans("ProtectAndEncryptPdfFiles");
|
||||
@@ -480,48 +559,51 @@ else // Show
|
||||
print '</tr>';
|
||||
|
||||
// Hide any PDF informations
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Desc
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Ref
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
|
||||
print '</td></tr>';
|
||||
|
||||
//Details
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td colspan="2">';
|
||||
print yn($conf->global->MAIN_PDF_USE_ISO_LOCATION,1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td><td colspan="2">';
|
||||
print $arraydetailsforpdffoot[$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS];
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
* Library
|
||||
*/
|
||||
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("Library"));
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
@@ -529,10 +611,9 @@ else // Show
|
||||
print '<td>'.$langs->trans("Value").'</td>'."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
if (! empty($dolibarr_pdf_force_fpdf))
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>dolibarr_pdf_force_fpdf</td>'."\n";
|
||||
print '<td>';
|
||||
@@ -541,7 +622,7 @@ else // Show
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.$langs->trans("LibraryToBuildPDF").'</td>'."\n";
|
||||
print '<td>';
|
||||
@@ -580,6 +661,7 @@ else // Show
|
||||
print '</tr>'."\n";
|
||||
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
if (! empty($dolibarr_pdf_force_fpdf))
|
||||
{
|
||||
|
||||
@@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='propal';
|
||||
|
||||
/*
|
||||
@@ -443,7 +443,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -455,7 +455,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -130,6 +130,7 @@ dol_fiche_head($head, 'file', $langs->trans("Security"), -1);
|
||||
// Upload options
|
||||
$var=false;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
@@ -192,6 +193,7 @@ print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ accessforbidden();
|
||||
$type=GETPOST('type', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
|
||||
$specimenthirdparty=new Societe($db);
|
||||
$specimenthirdparty->initAsSpecimen();
|
||||
@@ -398,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
||||
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
|
||||
//{
|
||||
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
/*}
|
||||
@@ -411,7 +411,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -421,11 +421,11 @@ foreach ($dirmodels as $reldir)
|
||||
{
|
||||
//print img_picto($langs->trans("Default"),'on');
|
||||
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"),'on').'</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ $type=GETPOST('type', 'alpha');
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$action=GETPOST('action', 'alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
|
||||
$specimenthirdparty=new Societe($db);
|
||||
$specimenthirdparty->initAsSpecimen();
|
||||
@@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir)
|
||||
print '<td align="center">'."\n";
|
||||
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
|
||||
print img_picto($langs->trans("Enabled"),'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
@@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print '<td align="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='supplier_payment';
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&value='.preg_replace('/\.php$/','',$file).'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ if (! $user->admin) accessforbidden();
|
||||
$action = GETPOST('action','alpha');
|
||||
$value = GETPOST('value','alpha');
|
||||
$label = GETPOST('label','alpha');
|
||||
$scandir = GETPOST('scandir','alpha');
|
||||
$scandir = GETPOST('scan_dir','alpha');
|
||||
$type='supplier_proposal';
|
||||
|
||||
$error=0;
|
||||
@@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir)
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\">\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ foreach ($dirmodels as $reldir)
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@ print load_fiche_titre($langs->trans("FileCheckDolibarr"),'','title_setup');
|
||||
print $langs->trans("FileCheckDesc").'<br><br>';
|
||||
|
||||
// Version
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td width="300">'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
||||
@@ -63,6 +64,7 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE)) {
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -133,7 +135,7 @@ if (GETPOST('target') == 'local')
|
||||
if (GETPOST('target') == 'remote')
|
||||
{
|
||||
$xmlarray = getURLContent($xmlremote);
|
||||
|
||||
|
||||
// Return array('content'=>response,'curl_error_no'=>errno,'curl_error_msg'=>errmsg...)
|
||||
if (! $xmlarray['curl_error_no'] && $xmlarray['http_code'] != '404')
|
||||
{
|
||||
@@ -147,20 +149,21 @@ if (GETPOST('target') == 'remote')
|
||||
setEventMessages($errormsg, null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ($xml)
|
||||
{
|
||||
$checksumconcat = array();
|
||||
$file_list = array();
|
||||
$out = '';
|
||||
|
||||
|
||||
// Forced constants
|
||||
if (is_object($xml->dolibarr_constants[0]))
|
||||
{
|
||||
$out.=load_fiche_titre($langs->trans("ForcedConstants"));
|
||||
|
||||
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -175,13 +178,13 @@ if ($xml)
|
||||
$constname=$constant['name'];
|
||||
$constvalue=(string) $constant;
|
||||
$constvalue = (empty($constvalue)?'0':$constvalue);
|
||||
// Value found
|
||||
// Value found
|
||||
$value='';
|
||||
if ($constname && $conf->global->$constname != '') $value=$conf->global->$constname;
|
||||
$valueforchecksum=(empty($value)?'0':$value);
|
||||
|
||||
|
||||
$checksumconcat[]=$valueforchecksum;
|
||||
|
||||
|
||||
$i++;
|
||||
$out.='<tr class="oddeven">';
|
||||
$out.='<td>'.$i.'</td>' . "\n";
|
||||
@@ -196,10 +199,11 @@ if ($xml)
|
||||
$out.='<tr class="oddeven"><td colspan="4" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out.='</table>';
|
||||
|
||||
$out.='</div>';
|
||||
|
||||
$out.='<br>';
|
||||
}
|
||||
|
||||
|
||||
// Scan htdocs
|
||||
if (is_object($xml->dolibarr_htdocs_dir[0]))
|
||||
{
|
||||
@@ -223,10 +227,11 @@ if ($xml)
|
||||
$file_list['added'][]=array('filename'=>$tmprelativefilename, 'md5'=>$md5newfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Files missings
|
||||
$out.=load_fiche_titre($langs->trans("FilesMissing"));
|
||||
|
||||
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -247,18 +252,20 @@ if ($xml)
|
||||
$out.="</tr>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$out.='<tr class="oddeven"><td colspan="3" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
}
|
||||
$out.='</table>';
|
||||
$out.='</div>';
|
||||
|
||||
$out.='<br>';
|
||||
|
||||
// Files modified
|
||||
$out.=load_fiche_titre($langs->trans("FilesModified"));
|
||||
|
||||
|
||||
$totalsize=0;
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -295,18 +302,20 @@ if ($xml)
|
||||
$out.='<td align="right"></td>' . "\n";
|
||||
$out.="</tr>\n";
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out.='</table>';
|
||||
|
||||
$out.='</div>';
|
||||
|
||||
$out.='<br>';
|
||||
|
||||
|
||||
// Files added
|
||||
$out.=load_fiche_titre($langs->trans("FilesAdded"));
|
||||
|
||||
|
||||
$totalsize = 0;
|
||||
$out.='<div class="div-table-responsive-no-min">';
|
||||
$out.='<table class="noborder">';
|
||||
$out.='<tr class="liste_titre">';
|
||||
$out.='<td>#</td>';
|
||||
@@ -348,8 +357,9 @@ if ($xml)
|
||||
$out.='<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
$out.='</table>';
|
||||
|
||||
|
||||
$out.='</div>';
|
||||
|
||||
|
||||
// Show warning
|
||||
if (empty($tmpfilelist) && empty($tmpfilelist2) && empty($tmpfilelist3))
|
||||
{
|
||||
@@ -358,7 +368,7 @@ if ($xml)
|
||||
else
|
||||
{
|
||||
setEventMessage($langs->trans("FileIntegritySomeFilesWereRemovedOrModified"), 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -374,9 +384,9 @@ if ($xml)
|
||||
$file_list = array();
|
||||
$ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', ???, $checksumconcat); // Fill array $file_list
|
||||
}*/
|
||||
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
//var_dump($checksumconcat);
|
||||
$checksumget = md5(join(',',$checksumconcat));
|
||||
$checksumtoget = trim((string) $xml->dolibarr_htdocs_dir_checksum);
|
||||
@@ -397,10 +407,10 @@ if ($xml)
|
||||
{
|
||||
print '<span class="error">'.$checksumget.'</span>';
|
||||
}
|
||||
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
// Output detail
|
||||
print $out;
|
||||
}
|
||||
@@ -434,7 +444,7 @@ function getFilesUpdated(&$file_list, SimpleXMLElement $dir, $path = '', $pathre
|
||||
{
|
||||
$filename = $path.$file['name'];
|
||||
$file_list['insignature'][] = $filename;
|
||||
|
||||
|
||||
//if (preg_match('#'.$exclude.'#', $filename)) continue;
|
||||
|
||||
if (!file_exists($pathref.'/'.$filename))
|
||||
|
||||
@@ -40,26 +40,27 @@ if (!$user->admin) accessforbidden();
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
llxHeader('', $langs->trans("InfoWebServer"));
|
||||
|
||||
print load_fiche_titre($langs->trans("InfoWebServer"),'','title_setup');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\"><td>".$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
|
||||
print "<tr $bc[0]><td width=\"240\">".$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
|
||||
print "<tr $bc[1]><td>".$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n";
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter")."</td><td>".$langs->trans("Value")."</td></tr>\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$_SERVER["SERVER_SOFTWARE"]."</td></tr>\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VirtualServerName")."</td><td>" . $_SERVER["SERVER_NAME"] . "</td></tr>\n";
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("IP")."</td><td>".$_SERVER["SERVER_ADDR"]."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("Port")."</td><td>" . $_SERVER["SERVER_PORT"] . "</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DocumentRootServer")."</td><td>".$_SERVER["DOCUMENT_ROOT"]."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("DataRootServer")."</td><td>" . DOL_DATA_ROOT . "</td></tr>\n";
|
||||
$labeluser=dol_getwebuser('user');
|
||||
$labelgroup=dol_getwebuser('group');
|
||||
if ($labeluser && $labelgroup)
|
||||
{
|
||||
print "<tr $bc[0]><td>".$langs->trans("WebUserGroup")."</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n";
|
||||
print '<tr><td>'.$langs->trans("WebUserGroup")."</td><td>".$labeluser.'/'.$labelgroup."</td></tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
llxFooter();
|
||||
|
||||
|
||||
@@ -465,13 +465,17 @@ if (! empty($_SESSION["commandbackuplastdone"]))
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div> <!-- end div center button -->
|
||||
|
||||
<?php
|
||||
print '</td></tr></table>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div> <!-- end div fichehalfleft -->
|
||||
|
||||
<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">
|
||||
<div class="ficheaddleft">
|
||||
|
||||
@@ -481,6 +485,7 @@ $result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/
|
||||
print '<br>';
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -162,6 +162,7 @@ if ($action == 'delete')
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
|
||||
$wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración';
|
||||
@@ -233,6 +234,7 @@ if ($mode == 'overwrite')
|
||||
print '<input type="hidden" id="action" name="action" value="">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder);
|
||||
@@ -319,8 +321,8 @@ if ($mode == 'overwrite')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
|
||||
@@ -391,6 +393,7 @@ if ($mode == 'searchkey')
|
||||
print '<input type="hidden" id="action" name="action" value="search">';
|
||||
print '<input type="hidden" id="mode" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre( $langs->trans("Language").' (en_US, es_MX, ...)',$_SERVER["PHP_SELF"],'lang,transkey','',$param,'',$sortfield,$sortorder).'</td>';
|
||||
@@ -465,7 +468,7 @@ if ($mode == 'searchkey')
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@@ -128,7 +128,7 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain
|
||||
|
||||
// Show message
|
||||
$message='';
|
||||
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&userpassword=<strong>thepassword</strong>[&reset=1]';
|
||||
$url=$urlwithroot.'/api/index.php/login?login=<strong>auserlogin</strong>&password=<strong>thepassword</strong>[&reset=1]';
|
||||
$message.=$langs->trans("UrlToGetKeyToUseAPIs").':<br>';
|
||||
$message.=img_picto('','object_globe.png').' '.$url;
|
||||
print $message;
|
||||
|
||||
@@ -48,7 +48,7 @@ class DolibarrApi
|
||||
*/
|
||||
function __construct($db, $cachedir='', $refreshCache=false)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $dolibarr_main_url_root;
|
||||
|
||||
if (empty($cachedir)) $cachedir = $conf->api->dir_temp;
|
||||
Defaults::$cacheDirectory = $cachedir;
|
||||
@@ -57,6 +57,13 @@ class DolibarrApi
|
||||
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
|
||||
$this->r = new Restler($production_mode, $refreshCache);
|
||||
|
||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
|
||||
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
|
||||
|
||||
$urlwithouturlrootautodetect=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim(DOL_MAIN_URL_ROOT));
|
||||
$urlwithrootautodetect=$urlwithouturlroot.DOL_URL_ROOT; // This is to use local domain autodetected by dolibarr from url
|
||||
|
||||
$this->r->setBaseUrls($urlwithouturlroot, $urlwithouturlrootautodetect);
|
||||
$this->r->setAPIVersion(1);
|
||||
}
|
||||
|
||||
@@ -129,6 +136,9 @@ class DolibarrApi
|
||||
unset($object->table_element_line);
|
||||
unset($object->picto);
|
||||
|
||||
unset($object->skip_update_total);
|
||||
unset($object->context);
|
||||
|
||||
// Remove the $oldcopy property because it is not supported by the JSON
|
||||
// encoder. The following error is generated when trying to serialize
|
||||
// it: "Error encoding/decoding JSON: Type is not supported"
|
||||
|
||||
@@ -1540,17 +1540,31 @@ class Categorie extends CommonObject
|
||||
dol_mkdir($dir);
|
||||
}
|
||||
|
||||
if (file_exists($dir))
|
||||
{
|
||||
$originImage = $dir . $file['name'];
|
||||
if (file_exists($dir)) {
|
||||
if (is_array($file['name']) && count($file['name']) > 0) {
|
||||
$nbfile = count($file['name']);
|
||||
for ($i = 0; $i <= $nbfile; $i ++) {
|
||||
|
||||
// Cree fichier en taille origine
|
||||
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
||||
$originImage = $dir . $file['name'][$i];
|
||||
|
||||
if (file_exists($originImage))
|
||||
{
|
||||
// Create thumbs
|
||||
$this->addThumbs($originImage);
|
||||
// Cree fichier en taille origine
|
||||
dol_move_uploaded_file($file['tmp_name'][$i], $originImage, 1, 0, 0);
|
||||
|
||||
if (file_exists($originImage)) {
|
||||
// Create thumbs
|
||||
$this->addThumbs($originImage);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$originImage = $dir . $file['name'];
|
||||
|
||||
// Cree fichier en taille origine
|
||||
dol_move_uploaded_file($file['tmp_name'], $originImage, 1, 0, 0);
|
||||
|
||||
if (file_exists($originImage)) {
|
||||
// Create thumbs
|
||||
$this->addThumbs($originImage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,6 +577,11 @@ if ($action == 'mupdate')
|
||||
|
||||
}
|
||||
|
||||
// Actions to delete doc
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -665,7 +670,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Title
|
||||
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Title").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
|
||||
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired titlefieldcreate"':'').'>'.$langs->trans("Label").'</td><td><input type="text" id="label" name="label" class="soixantepercent" value="'.GETPOST('label').'"></td></tr>';
|
||||
|
||||
// Full day
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td><input type="checkbox" id="fullday" name="fullday" '.(GETPOST('fullday')?' checked':'').'></td></tr>';
|
||||
@@ -709,7 +714,7 @@ if ($action == 'create')
|
||||
// Location
|
||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth100" value="'.(GETPOST('location')?GETPOST('location'):$object->location).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Assigned to
|
||||
@@ -965,7 +970,7 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
// Title
|
||||
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" size="50" value="'.$object->label.'"></td></tr>';
|
||||
print '<tr><td'.(empty($conf->global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").'</td><td colspan="3"><input type="text" name="label" class="minwidth100" value="'.$object->label.'"></td></tr>';
|
||||
|
||||
// Full day event
|
||||
print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3"><input type="checkbox" id="fullday" name="fullday" '.($object->fulldayevent?' checked':'').'></td></tr>';
|
||||
@@ -1049,7 +1054,7 @@ if ($id > 0)
|
||||
// Location
|
||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" size="50" value="'.$object->location.'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="3"><input type="text" name="location" class="minwidth100" value="'.$object->location.'"></td></tr>';
|
||||
}
|
||||
|
||||
// Assigned to
|
||||
@@ -1212,7 +1217,6 @@ if ($id > 0)
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep,'%Y').'&month='.dol_print_date($object->datep,'%m').'&day='.dol_print_date($object->datep,'%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback.=$out;
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Thirdparty
|
||||
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
@@ -1477,7 +1481,7 @@ if ($id > 0)
|
||||
*/
|
||||
|
||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?socid=".$object->id;
|
||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
|
||||
$genallowed=$user->rights->agenda->myactions->create;
|
||||
$delallowed=$user->rights->agenda->myactions->delete;
|
||||
|
||||
@@ -860,9 +860,10 @@ class ActionComm extends CommonObject
|
||||
* @param string $filter Other filter
|
||||
* @param string $sortfield Sort on this field
|
||||
* @param string $sortorder ASC or DESC
|
||||
* @param string $limit Limit number of answers
|
||||
* @return array or string Error string if KO, array with actions if OK
|
||||
*/
|
||||
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='', $sortorder='')
|
||||
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='datep', $sortorder='DESC', $limit=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
@@ -879,6 +880,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
if (! empty($filter)) $sql.= $filter;
|
||||
if ($sortorder && $sortfield) $sql.=$db->order($sortfield, $sortorder);
|
||||
if ($limit) $sql.=$db->plimit($limit);
|
||||
|
||||
dol_syslog(get_class()."::getActions", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@@ -330,25 +330,27 @@ if ($id > 0)
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Compte bancaire par défaut
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('PaymentBankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount')
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1);
|
||||
// Compte bancaire par défaut
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('PaymentBankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->societe->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&socid='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editbankaccount')
|
||||
{
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'fk_account',1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none');
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->formSelectAccount($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->fk_account,'none');
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
// Relative discounts (Discounts-Drawbacks-Rebates)
|
||||
print '<tr><td class="nowrap">';
|
||||
|
||||
@@ -61,7 +61,7 @@ $object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation
|
||||
|
||||
$object->substitutionarrayfortest=array(
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__EMAIL__' => 'TESTEMail',
|
||||
//'__EMAIL__' => 'TESTEMail', // Done into "send" action
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname',
|
||||
'__MAILTOEMAIL__' => 'TESTMailtoEmail',
|
||||
@@ -409,6 +409,8 @@ if (empty($reshook))
|
||||
$msgishtml=-1; // Inconnu par defaut
|
||||
if (preg_match('/[\s\t]*<html>/i',$object->body)) $msgishtml=1;
|
||||
|
||||
$object->substitutionarrayfortest['__EMAIL__'] = $object->sendto; // other are set at begin of page
|
||||
|
||||
// Pratique les substitutions sur le sujet et message
|
||||
$tmpsujet=make_substitutions($object->sujet,$object->substitutionarrayfortest);
|
||||
$tmpbody=make_substitutions($object->body,$object->substitutionarrayfortest);
|
||||
|
||||
@@ -640,16 +640,16 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sqlwhere[]=$this->transformToSQL('t.firstname',$arrayquery['contact_firstname']);
|
||||
}
|
||||
if (!empty($arrayquery['contact_country']) && count($arrayquery['contact_country'])) {
|
||||
$sqlwhere[]= " (t.fk_pays IN (".implode(',',$arrayquery['contact_country'])."))";
|
||||
$sqlwhere[]= " (t.fk_pays IN (".$this->db->escape(implode(',',$arrayquery['contact_country']))."))";
|
||||
}
|
||||
if (!empty($arrayquery['contact_status']) && count($arrayquery['contact_status'])>0) {
|
||||
$sqlwhere[]= " (t.statut IN (".implode(',',$arrayquery['contact_status'])."))";
|
||||
$sqlwhere[]= " (t.statut IN (".$this->db->escape(implode(',',$arrayquery['contact_status']))."))";
|
||||
}
|
||||
if (!empty($arrayquery['contact_civility']) && count($arrayquery['contact_civility'])>0) {
|
||||
$sqlwhere[]= " (t.civility IN ('".implode("','",$arrayquery['contact_civility'])."'))";
|
||||
$sqlwhere[]= " (t.civility IN ('".$this->db->escape(implode("','",$arrayquery['contact_civility']))."'))";
|
||||
}
|
||||
if ($arrayquery['contact_no_email']!='') {
|
||||
$sqlwhere[]= " (t.no_email='".$arrayquery['contact_no_email']."')";
|
||||
$sqlwhere[]= " (t.no_email='".$this->db->escape($arrayquery['contact_no_email'])."')";
|
||||
}
|
||||
if ($arrayquery['contact_update_st_dt']!='') {
|
||||
$sqlwhere[]= " (t.tms >= '".$this->db->idate($arrayquery['contact_update_st_dt'])."' AND t.tms <= '".$this->db->idate($arrayquery['contact_update_end_dt'])."')";
|
||||
@@ -658,7 +658,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
$sqlwhere[]= " (t.datec >= '".$this->db->idate($arrayquery['contact_create_st_dt'])."' AND t.datec <= '".$this->db->idate($arrayquery['contact_create_end_dt'])."')";
|
||||
}
|
||||
if (!empty($arrayquery['contact_categ']) && count($arrayquery['contact_categ'])>0) {
|
||||
$sqlwhere[]= " (contactcateg.fk_categorie IN (".implode(",",$arrayquery['contact_categ'])."))";
|
||||
$sqlwhere[]= " (contactcateg.fk_categorie IN (".$this->db->escape(implode(",",$arrayquery['contact_categ']))."))";
|
||||
}
|
||||
|
||||
//Standard Extrafield feature
|
||||
|
||||
@@ -239,21 +239,25 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
function postLine($id, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
function postLine($id, $request_data = NULL)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
$result = $this->propal->fetch($id);
|
||||
if (! $result) {
|
||||
throw new RestException(404, 'Commercial Proposal not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->propal->addline(
|
||||
if (! DolibarrApi::_checkAccessToResource('propal',$this->propal->id))
|
||||
{
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$updateRes = $this->propal->addline(
|
||||
$request_data->desc,
|
||||
$request_data->subprice,
|
||||
$request_data->qty,
|
||||
@@ -278,7 +282,7 @@ class Proposals extends DolibarrApi
|
||||
$request_data->fk_unit,
|
||||
$this->element,
|
||||
$request_data->id,
|
||||
$request_data->pu_ht_devise,
|
||||
$request_data->multicurrency_subprice,
|
||||
$request_data->fk_remise_except
|
||||
);
|
||||
|
||||
@@ -300,42 +304,52 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
function putLine($id, $lineid, $request_data = NULL) {
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
function putLine($id, $lineid, $request_data = NULL)
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$result = $this->propal->fetch($id);
|
||||
if( ! $result ) {
|
||||
throw new RestException(404, 'Proposal not found');
|
||||
}
|
||||
$result = $this->propal->fetch($id);
|
||||
if($result <= 0) {
|
||||
throw new RestException(404, 'Proposal not found');
|
||||
}
|
||||
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
$request_data = (object) $request_data;
|
||||
$updateRes = $this->propal->updateline(
|
||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$propalline = new PropaleLigne($this->db);
|
||||
$result = $propalline->fetch($lineid);
|
||||
if ($result <= 0) {
|
||||
throw new RestException(404, 'Proposal line not found');
|
||||
}
|
||||
|
||||
$updateRes = $this->propal->updateline(
|
||||
$lineid,
|
||||
$request_data->desc,
|
||||
$request_data->subprice,
|
||||
$request_data->qty,
|
||||
$request_data->remise_percent,
|
||||
$request_data->tva_tx,
|
||||
$request_data->localtax1_tx,
|
||||
$request_data->localtax2_tx,
|
||||
'HT',
|
||||
$request_data->info_bits,
|
||||
$request_data->date_start,
|
||||
$request_data->date_end,
|
||||
$request_data->product_type,
|
||||
$request_data->fk_parent_line,
|
||||
0,
|
||||
$request_data->fk_fournprice,
|
||||
$request_data->pa_ht,
|
||||
$request_data->label,
|
||||
$request_data->special_code,
|
||||
$request_data->array_options,
|
||||
$request_data->fk_unit
|
||||
isset($request_data->subprice)?$request_data->subprice:$propalline->subprice,
|
||||
isset($request_data->qty)?$request_data->qty:$propalline->qty,
|
||||
isset($request_data->remise_percent)?$request_data->remise_percent:$propalline->remise_percent,
|
||||
isset($request_data->tva_tx)?$request_data->tva_tx:$propalline->tva_tx,
|
||||
isset($request_data->localtax1_tx)?$request_data->localtax1_tx:$propalline->localtax1_tx,
|
||||
isset($request_data->localtax2_tx)?$request_data->localtax2_tx:$propalline->localtax2_tx,
|
||||
isset($request_data->desc)?$request_data->desc:$propalline->desc,
|
||||
'HT',
|
||||
isset($request_data->info_bits)?$request_data->info_bits:$propalline->info_bits,
|
||||
isset($request_data->special_code)?$request_data->special_code:$propalline->special_code,
|
||||
isset($request_data->fk_parent_line)?$request_data->fk_parent_line:$propalline->fk_parent_line,
|
||||
0,
|
||||
isset($request_data->fk_fournprice)?$request_data->fk_fournprice:$propalline->fk_fournprice,
|
||||
isset($request_data->pa_ht)?$request_data->pa_ht:$propalline->pa_ht,
|
||||
isset($request_data->label)?$request_data->label:$propalline->label,
|
||||
isset($request_data->product_type)?$request_data->product_type:$propalline->product_type,
|
||||
isset($request_data->date_start)?$request_data->date_start:$propalline->date_start,
|
||||
isset($request_data->date_end)?$request_data->date_end:$propalline->date_end,
|
||||
isset($request_data->array_options)?$request_data->array_options:$propalline->array_options,
|
||||
isset($request_data->fk_unit)?$request_data->fk_unit:$propalline->fk_unit,
|
||||
isset($request_data->multicurrency_subprice)?$request_data->multicurrency_subprice:$propalline->subprice
|
||||
);
|
||||
|
||||
if ($updateRes > 0) {
|
||||
@@ -508,4 +522,23 @@ class Proposals extends DolibarrApi
|
||||
}
|
||||
return $propal;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
*
|
||||
* @param object $object Object to clean
|
||||
* @return array Array of cleaned object properties
|
||||
*/
|
||||
function _cleanObjectDatas($object) {
|
||||
|
||||
$object = parent::_cleanObjectDatas($object);
|
||||
|
||||
unset($object->name);
|
||||
unset($object->lastname);
|
||||
unset($object->firstname);
|
||||
unset($object->civility_id);
|
||||
unset($object->address);
|
||||
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -639,6 +639,7 @@ class Propal extends CommonObject
|
||||
$pa_ht=price2num($pa_ht);
|
||||
if (empty($qty) && empty($special_code)) $special_code=3; // Set option tag
|
||||
if (! empty($qty) && $special_code == 3) $special_code=0; // Remove option tag
|
||||
if (empty($type)) $type=0;
|
||||
|
||||
if ($this->statut == self::STATUS_DRAFT)
|
||||
{
|
||||
@@ -1404,7 +1405,7 @@ class Propal extends CommonObject
|
||||
{
|
||||
$this->lines=array();
|
||||
|
||||
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
|
||||
$sql = 'SELECT d.rowid, d.fk_propal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.vat_src_code, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.localtax1_type, d.localtax2_type, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,';
|
||||
$sql.= ' d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,';
|
||||
$sql.= ' d.fk_unit,';
|
||||
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,';
|
||||
@@ -1443,6 +1444,8 @@ class Propal extends CommonObject
|
||||
$line->tva_tx = $objp->tva_tx;
|
||||
$line->localtax1_tx = $objp->localtax1_tx;
|
||||
$line->localtax2_tx = $objp->localtax2_tx;
|
||||
$line->localtax1_type = $objp->localtax1_type;
|
||||
$line->localtax2_type = $objp->localtax2_type;
|
||||
$line->subprice = $objp->subprice;
|
||||
$line->fk_remise_except = $objp->fk_remise_except;
|
||||
$line->remise_percent = $objp->remise_percent;
|
||||
@@ -3366,8 +3369,8 @@ class Propal extends CommonObject
|
||||
$this->lines = array();
|
||||
|
||||
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
|
||||
$sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
|
||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,';
|
||||
$sql.= ' pt.qty, pt.vat_src_code, pt.tva_tx, pt.localtax1_tx, pt.localtax2_tx, pt.localtax1_type, pt.localtax2_type, pt.remise_percent, pt.subprice, pt.info_bits,';
|
||||
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.total_localtax1, pt.total_localtax2, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code,';
|
||||
$sql.= ' pt.date_start, pt.date_end, pt.product_type, pt.rang, pt.fk_parent_line,';
|
||||
$sql.= ' pt.fk_unit,';
|
||||
$sql.= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.description as product_desc, p.tobatch as product_tobatch,';
|
||||
@@ -3411,11 +3414,17 @@ class Propal extends CommonObject
|
||||
|
||||
$this->lines[$i]->vat_src_code = $obj->vat_src_code;
|
||||
$this->lines[$i]->tva_tx = $obj->tva_tx;
|
||||
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
|
||||
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
|
||||
$this->lines[$i]->localtax1_type = $obj->localtax1_type;
|
||||
$this->lines[$i]->localtax2_type = $obj->localtax2_type;
|
||||
$this->lines[$i]->info_bits = $obj->info_bits;
|
||||
$this->lines[$i]->total_ht = $obj->total_ht;
|
||||
$this->lines[$i]->total_tva = $obj->total_tva;
|
||||
$this->lines[$i]->total_ttc = $obj->total_ttc;
|
||||
$this->lines[$i]->fk_fournprice = $obj->fk_fournprice;
|
||||
$this->lines[$i]->total_localtax1 = $obj->total_localtax1;
|
||||
$this->lines[$i]->total_localtax2 = $obj->total_localtax2;
|
||||
$this->lines[$i]->fk_fournprice = $obj->fk_fournprice;
|
||||
$marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->lines[$i]->fk_fournprice, $obj->pa_ht);
|
||||
$this->lines[$i]->pa_ht = $marginInfos[0];
|
||||
$this->lines[$i]->marge_tx = $marginInfos[1];
|
||||
@@ -3645,59 +3654,66 @@ class PropaleLigne extends CommonObjectLine
|
||||
{
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$this->id = $objp->rowid;
|
||||
$this->rowid = $objp->rowid; // deprecated
|
||||
$this->fk_propal = $objp->fk_propal;
|
||||
$this->fk_parent_line = $objp->fk_parent_line;
|
||||
$this->label = $objp->custom_label;
|
||||
$this->desc = $objp->description;
|
||||
$this->qty = $objp->qty;
|
||||
$this->price = $objp->price; // deprecated
|
||||
$this->subprice = $objp->subprice;
|
||||
$this->vat_src_code = $objp->vat_src_code;
|
||||
$this->tva_tx = $objp->tva_tx;
|
||||
$this->remise = $objp->remise; // deprecated
|
||||
$this->remise_percent = $objp->remise_percent;
|
||||
$this->fk_remise_except = $objp->fk_remise_except;
|
||||
$this->fk_product = $objp->fk_product;
|
||||
$this->info_bits = $objp->info_bits;
|
||||
if ($objp)
|
||||
{
|
||||
$this->id = $objp->rowid;
|
||||
$this->rowid = $objp->rowid; // deprecated
|
||||
$this->fk_propal = $objp->fk_propal;
|
||||
$this->fk_parent_line = $objp->fk_parent_line;
|
||||
$this->label = $objp->custom_label;
|
||||
$this->desc = $objp->description;
|
||||
$this->qty = $objp->qty;
|
||||
$this->price = $objp->price; // deprecated
|
||||
$this->subprice = $objp->subprice;
|
||||
$this->vat_src_code = $objp->vat_src_code;
|
||||
$this->tva_tx = $objp->tva_tx;
|
||||
$this->remise = $objp->remise; // deprecated
|
||||
$this->remise_percent = $objp->remise_percent;
|
||||
$this->fk_remise_except = $objp->fk_remise_except;
|
||||
$this->fk_product = $objp->fk_product;
|
||||
$this->info_bits = $objp->info_bits;
|
||||
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_ttc = $objp->total_ttc;
|
||||
$this->total_ht = $objp->total_ht;
|
||||
$this->total_tva = $objp->total_tva;
|
||||
$this->total_ttc = $objp->total_ttc;
|
||||
|
||||
$this->fk_fournprice = $objp->fk_fournprice;
|
||||
$this->fk_fournprice = $objp->fk_fournprice;
|
||||
|
||||
$marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht);
|
||||
$this->pa_ht = $marginInfos[0];
|
||||
$this->marge_tx = $marginInfos[1];
|
||||
$this->marque_tx = $marginInfos[2];
|
||||
$marginInfos = getMarginInfos($objp->subprice, $objp->remise_percent, $objp->tva_tx, $objp->localtax1_tx, $objp->localtax2_tx, $this->fk_fournprice, $objp->pa_ht);
|
||||
$this->pa_ht = $marginInfos[0];
|
||||
$this->marge_tx = $marginInfos[1];
|
||||
$this->marque_tx = $marginInfos[2];
|
||||
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->product_type = $objp->product_type;
|
||||
$this->rang = $objp->rang;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->product_type = $objp->product_type;
|
||||
$this->rang = $objp->rang;
|
||||
|
||||
$this->ref = $objp->product_ref; // deprecated
|
||||
$this->product_ref = $objp->product_ref;
|
||||
$this->libelle = $objp->product_label; // deprecated
|
||||
$this->product_label = $objp->product_label;
|
||||
$this->product_desc = $objp->product_desc;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
$this->ref = $objp->product_ref; // deprecated
|
||||
$this->product_ref = $objp->product_ref;
|
||||
$this->libelle = $objp->product_label; // deprecated
|
||||
$this->product_label = $objp->product_label;
|
||||
$this->product_desc = $objp->product_desc;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
|
||||
// Multicurrency
|
||||
$this->fk_multicurrency = $objp->fk_multicurrency;
|
||||
$this->multicurrency_code = $objp->multicurrency_code;
|
||||
$this->multicurrency_subprice = $objp->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
// Multicurrency
|
||||
$this->fk_multicurrency = $objp->fk_multicurrency;
|
||||
$this->multicurrency_code = $objp->multicurrency_code;
|
||||
$this->multicurrency_subprice = $objp->multicurrency_subprice;
|
||||
$this->multicurrency_total_ht = $objp->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
$this->db->free($result);
|
||||
$this->db->free($result);
|
||||
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -45,7 +45,6 @@ $ref = GETPOST('ref','alpha');
|
||||
$socid='';
|
||||
if (! empty($user->societe_id))
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result = restrictedArea($user, 'propal', $id);
|
||||
|
||||
@@ -320,8 +320,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ dol_mkdir($dir);
|
||||
|
||||
|
||||
$stats = new PropaleStats($db, $socid, ($userid>0?$userid:0), $mode);
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')';
|
||||
|
||||
// Build graphic number of object
|
||||
$data = $stats->getNbByMonthWithPrevYear($endyear,$startyear);
|
||||
@@ -299,7 +299,7 @@ foreach ($data as $val)
|
||||
while (! empty($year) && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
|
||||
@@ -125,7 +125,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||
if ($res > 0 && $newid1 > 0 && $newid2 > 0)
|
||||
{
|
||||
$db->commit();
|
||||
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); // To avoid pb whith back
|
||||
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id.($backtopage?'&backtopage='.urlencode($backtopage):'')); // To avoid pb whith back
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@@ -275,13 +275,13 @@ if ($socid > 0)
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>';
|
||||
@@ -293,7 +293,7 @@ if ($socid > 0)
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="fieldrequired" >'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" class="quatrevingtpercent" name="desc" value="'.GETPOST('desc').'"></td></tr>';
|
||||
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
@@ -362,7 +362,7 @@ if ($socid > 0)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
|
||||
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
|
||||
@@ -408,14 +408,14 @@ if ($socid > 0)
|
||||
if ($user->rights->societe->creer || $user->rights->facture->creer)
|
||||
{
|
||||
print '<td class="nowrap">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.'">'.img_split($langs->trans("SplitDiscount")).'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=split&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_split($langs->trans("SplitDiscount")).'</a>';
|
||||
print ' ';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=remove&remid='.$obj->rowid.($backtopage?'&backtopage='.urlencode($backtopage):'').'">'.img_delete($langs->trans("RemoveDiscount")).'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
|
||||
{
|
||||
$showconfirminfo['rowid']=$obj->rowid;
|
||||
@@ -427,7 +427,7 @@ if ($socid > 0)
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
print "</table>";
|
||||
|
||||
@@ -441,7 +441,7 @@ if ($socid > 0)
|
||||
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
|
||||
);
|
||||
$langs->load("dict");
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage?'&backtopage='.urlencode($backtopage):''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -590,7 +590,7 @@ if ($socid > 0)
|
||||
{
|
||||
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
else
|
||||
|
||||
@@ -398,6 +398,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Now we create same links to contact than the ones found on origin object
|
||||
/* Useless, already into the create
|
||||
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
|
||||
{
|
||||
$originforcontact = $object->origin;
|
||||
@@ -420,7 +421,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
else dol_print_error($resqlcontact);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Hooks
|
||||
$parameters = array('objFrom' => $srcobject);
|
||||
@@ -1477,7 +1478,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td>';
|
||||
print $form->select_company('', 'socid', 's.client = 1 OR s.client = 3', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
print $form->select_company('', 'socid', '(s.client = 1 OR s.client = 3)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
|
||||
// reload page to retrieve customer informations
|
||||
if (!empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE))
|
||||
{
|
||||
@@ -2496,7 +2497,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
if (! empty($conf->expedition->enabled)) {
|
||||
$numshipping = $object->nb_expedition();
|
||||
|
||||
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfProductsLines() > 0) {
|
||||
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
|
||||
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) {
|
||||
if ($user->rights->expedition->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/expedition/shipment.php?id=' . $object->id . '">' . $langs->trans('CreateShipment') . '</a></div>';
|
||||
|
||||
@@ -920,7 +920,8 @@ class Commande extends CommonOrder
|
||||
foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
|
||||
{
|
||||
$originforcontact = 'commande';
|
||||
$originidforcontact = $value->id;
|
||||
if (is_object($value)) $originidforcontact = $value->id;
|
||||
else $originidforcontact = $value;
|
||||
break; // We take first one
|
||||
}
|
||||
}
|
||||
@@ -2233,7 +2234,7 @@ class Commande extends CommonOrder
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
|
||||
$sql.= " SET date_commande = ".($date ? $this->db->idate($date) : 'null');
|
||||
$sql.= " SET date_commande = ".($date ? "'".$this->db->idate($date)."'" : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
@@ -44,7 +44,6 @@ $ref = GETPOST('ref');
|
||||
// Security check
|
||||
if ($user->societe_id)
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'commande',$id,'');
|
||||
|
||||
@@ -208,7 +208,7 @@ if (empty($reshook))
|
||||
// TODO Move this into mass action include
|
||||
if ($massaction == 'confirm_createbills') {
|
||||
|
||||
$orders = GETPOST('toselect');
|
||||
$orders = GETPOST('toselect','array');
|
||||
$createbills_onebythird = GETPOST('createbills_onebythird', 'int');
|
||||
$validate_invoices = GETPOST('valdate_invoices', 'int');
|
||||
|
||||
@@ -219,13 +219,13 @@ if (empty($reshook))
|
||||
|
||||
$db->begin();
|
||||
|
||||
foreach($orders as $id_order) {
|
||||
|
||||
foreach($orders as $id_order)
|
||||
{
|
||||
$cmd = new Commande($db);
|
||||
if($cmd->fetch($id_order) <= 0) continue;
|
||||
if ($cmd->fetch($id_order) <= 0) continue;
|
||||
|
||||
$object = new Facture($db);
|
||||
if(!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
||||
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $object = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
||||
else {
|
||||
|
||||
$object->socid = $cmd->socid;
|
||||
@@ -247,12 +247,10 @@ if (empty($reshook))
|
||||
$res = $object->create($user);
|
||||
|
||||
if($res > 0) $nb_bills_created++;
|
||||
|
||||
}
|
||||
|
||||
if($object->id > 0) {
|
||||
|
||||
$db->begin();
|
||||
if ($object->id > 0)
|
||||
{
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_element (";
|
||||
$sql.= "fk_source";
|
||||
$sql.= ", sourcetype";
|
||||
@@ -265,115 +263,113 @@ if (empty($reshook))
|
||||
$sql.= ", '".$object->element."'";
|
||||
$sql.= ")";
|
||||
|
||||
if ($db->query($sql))
|
||||
if (! $db->query($sql))
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$error++;
|
||||
}
|
||||
|
||||
$lines = $cmd->lines;
|
||||
if (empty($lines) && method_exists($cmd, 'fetch_lines'))
|
||||
if (! $error)
|
||||
{
|
||||
$cmd->fetch_lines();
|
||||
$lines = $cmd->lines;
|
||||
$lines = $cmd->lines;
|
||||
if (empty($lines) && method_exists($cmd, 'fetch_lines'))
|
||||
{
|
||||
$cmd->fetch_lines();
|
||||
$lines = $cmd->lines;
|
||||
}
|
||||
|
||||
$fk_parent_line=0;
|
||||
$num=count($lines);
|
||||
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||
if ($lines[$i]->subprice < 0)
|
||||
{
|
||||
// Negative line, we create a discount line
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$discount->fk_soc=$object->socid;
|
||||
$discount->amount_ht=abs($lines[$i]->total_ht);
|
||||
$discount->amount_tva=abs($lines[$i]->total_tva);
|
||||
$discount->amount_ttc=abs($lines[$i]->total_ttc);
|
||||
$discount->tva_tx=$lines[$i]->tva_tx;
|
||||
$discount->fk_user=$user->id;
|
||||
$discount->description=$desc;
|
||||
$discountid=$discount->create($user);
|
||||
if ($discountid > 0)
|
||||
{
|
||||
$result=$object->insert_discount($discountid);
|
||||
//$result=$discount->link_to_invoice($lineid,$id);
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Positive line
|
||||
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
|
||||
// Date start
|
||||
$date_start=false;
|
||||
if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
|
||||
if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
|
||||
if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
|
||||
//Date end
|
||||
$date_end=false;
|
||||
if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
|
||||
if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
|
||||
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
|
||||
{
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
$result = $object->addline(
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
$lines[$i]->tva_tx,
|
||||
$lines[$i]->localtax1_tx,
|
||||
$lines[$i]->localtax2_tx,
|
||||
$lines[$i]->fk_product,
|
||||
$lines[$i]->remise_percent,
|
||||
$date_start,
|
||||
$date_end,
|
||||
0,
|
||||
$lines[$i]->info_bits,
|
||||
$lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$product_type,
|
||||
$ii,
|
||||
$lines[$i]->special_code,
|
||||
$object->origin,
|
||||
$lines[$i]->rowid,
|
||||
$fk_parent_line,
|
||||
$lines[$i]->fk_fournprice,
|
||||
$lines[$i]->pa_ht,
|
||||
$lines[$i]->label
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
$lineid=$result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$lineid=0;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0 && $lines[$i]->product_type == 9)
|
||||
{
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$fk_parent_line=0;
|
||||
$num=count($lines);
|
||||
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||
if ($lines[$i]->subprice < 0)
|
||||
{
|
||||
// Negative line, we create a discount line
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$discount->fk_soc=$object->socid;
|
||||
$discount->amount_ht=abs($lines[$i]->total_ht);
|
||||
$discount->amount_tva=abs($lines[$i]->total_tva);
|
||||
$discount->amount_ttc=abs($lines[$i]->total_ttc);
|
||||
$discount->tva_tx=$lines[$i]->tva_tx;
|
||||
$discount->fk_user=$user->id;
|
||||
$discount->description=$desc;
|
||||
$discountid=$discount->create($user);
|
||||
if ($discountid > 0)
|
||||
{
|
||||
$result=$object->insert_discount($discountid);
|
||||
//$result=$discount->link_to_invoice($lineid,$id);
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Positive line
|
||||
$product_type=($lines[$i]->product_type?$lines[$i]->product_type:0);
|
||||
// Date start
|
||||
$date_start=false;
|
||||
if ($lines[$i]->date_debut_prevue) $date_start=$lines[$i]->date_debut_prevue;
|
||||
if ($lines[$i]->date_debut_reel) $date_start=$lines[$i]->date_debut_reel;
|
||||
if ($lines[$i]->date_start) $date_start=$lines[$i]->date_start;
|
||||
//Date end
|
||||
$date_end=false;
|
||||
if ($lines[$i]->date_fin_prevue) $date_end=$lines[$i]->date_fin_prevue;
|
||||
if ($lines[$i]->date_fin_reel) $date_end=$lines[$i]->date_fin_reel;
|
||||
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9)
|
||||
{
|
||||
$fk_parent_line = 0;
|
||||
}
|
||||
$result = $object->addline(
|
||||
$desc,
|
||||
$lines[$i]->subprice,
|
||||
$lines[$i]->qty,
|
||||
$lines[$i]->tva_tx,
|
||||
$lines[$i]->localtax1_tx,
|
||||
$lines[$i]->localtax2_tx,
|
||||
$lines[$i]->fk_product,
|
||||
$lines[$i]->remise_percent,
|
||||
$date_start,
|
||||
$date_end,
|
||||
0,
|
||||
$lines[$i]->info_bits,
|
||||
$lines[$i]->fk_remise_except,
|
||||
'HT',
|
||||
0,
|
||||
$product_type,
|
||||
$ii,
|
||||
$lines[$i]->special_code,
|
||||
$object->origin,
|
||||
$lines[$i]->rowid,
|
||||
$fk_parent_line,
|
||||
$lines[$i]->fk_fournprice,
|
||||
$lines[$i]->pa_ht,
|
||||
$lines[$i]->label
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
$lineid=$result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$lineid=0;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
// Defined the new fk_parent_line
|
||||
if ($result > 0 && $lines[$i]->product_type == 9)
|
||||
{
|
||||
$fk_parent_line = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module.
|
||||
@@ -386,27 +382,29 @@ if (empty($reshook))
|
||||
$TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
|
||||
$toselect = array();
|
||||
|
||||
if(!empty($validate_invoices)) {
|
||||
|
||||
if (! $error && $validate_invoices)
|
||||
{
|
||||
$massaction = $action = 'builddoc';
|
||||
foreach($TAllFact as &$object)
|
||||
{
|
||||
$result = $object->validate($user);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
foreach($TAllFact as &$object) {
|
||||
$object->validate($user);
|
||||
$toselect[] = $object->id; // For builddoc action
|
||||
$id = $object->id; // For builddoc action
|
||||
|
||||
// Fac builddoc
|
||||
$donotredirect = 1;
|
||||
$upload_dir = $conf->facture->dir_output;
|
||||
$permissioncreate=$user->rights->facture->creer;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
}
|
||||
|
||||
$objectclass='Facture';
|
||||
$objectlabel='Invoice';
|
||||
$permtoread = $user->rights->facture->lire;
|
||||
$permtodelete = $user->rights->facture->supprimer;
|
||||
$uploaddir = $conf->facture->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
$massaction = $action = 'confirm_createbills';
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -546,8 +544,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ dol_mkdir($dir);
|
||||
$stats = new CommandeStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -508,8 +508,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2005-2017 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
|
||||
@@ -62,9 +62,7 @@ $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account', '', '',
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == -1) {
|
||||
$page = 0;
|
||||
}
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
$offset = $conf->liste_limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@@ -122,21 +120,21 @@ if ($id > 0 || !empty($ref)) {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td class="titlefield">' . $langs->trans("NbOfAttachedFiles") . '</td><td colspan="3">' . count($filearray) . '</td></tr>';
|
||||
print '<tr><td>' . $langs->trans("TotalSizeOfAttachedFiles") . '</td><td colspan="3">' . $totalsize . ' ' . $langs->trans("bytes") . '</td></tr>';
|
||||
print "</table>\n";
|
||||
|
||||
print '</div>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
$modulepart = 'bank';
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$permtoedit = $user->rights->banque->modifier;
|
||||
|
||||
@@ -165,8 +165,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
@@ -492,21 +493,36 @@ foreach ($accounts as $key=>$type)
|
||||
// Account number
|
||||
if (! empty($arrayfields['b.account_number']['checked']))
|
||||
{
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$acc->account_number);
|
||||
|
||||
print '<td>'.$accountingaccount->getNomUrl(0,1,1,'',1).'</td>';
|
||||
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch('',$acc->account_number);
|
||||
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print $acc->account_number;
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Accountancy journal
|
||||
if (! empty($arrayfields['b.fk_accountancy_journal']['checked']))
|
||||
{
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($acc->fk_accountancy_journal);
|
||||
|
||||
print '<td>'.$accountingjournal->getNomUrl(0,1,1,'',1).'</td>';
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($acc->fk_accountancy_journal);
|
||||
print $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print '';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ if ($action == 'add_confirm')
|
||||
|
||||
if (! $label)
|
||||
{
|
||||
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors');
|
||||
}
|
||||
if (! $amount)
|
||||
|
||||
@@ -378,7 +378,9 @@ if (empty($reshook))
|
||||
|
||||
else if ($action == "setabsolutediscount" && $user->rights->facture->creer)
|
||||
{
|
||||
// POST[remise_id] ou POST[remise_id_for_payment]
|
||||
// POST[remise_id] or POST[remise_id_for_payment]
|
||||
|
||||
// We use the credit to reduce amount of invoice
|
||||
if (! empty($_POST["remise_id"])) {
|
||||
$ret = $object->fetch($id);
|
||||
if ($ret > 0) {
|
||||
@@ -390,14 +392,28 @@ if (empty($reshook))
|
||||
dol_print_error($db, $object->error);
|
||||
}
|
||||
}
|
||||
if (! empty($_POST["remise_id_for_payment"])) {
|
||||
// We use the credit to reduce remain to pay
|
||||
if (! empty($_POST["remise_id_for_payment"]))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$discount->fetch($_POST["remise_id_for_payment"]);
|
||||
|
||||
$result = $discount->link_to_invoice(0, $id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
//var_dump($object->getRemainToPay(0));
|
||||
//var_dump($discount->amount_ttc);exit;
|
||||
if ($discount->amount_ttc > $object->getRemainToPay(0))
|
||||
{
|
||||
// TODO Split the discount in 2 automatically
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorDiscountLargerThanRemainToPaySplitItBefore"), null, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result = $discount->link_to_invoice(0, $id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -648,12 +664,13 @@ if (empty($reshook))
|
||||
if ($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_SITUATION)
|
||||
{
|
||||
// If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT
|
||||
|
||||
$sql = 'SELECT SUM(pf.amount) as total_paiements
|
||||
FROM llx_c_paiement as c, llx_paiement_facture as pf, llx_paiement as p
|
||||
WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid ORDER BY p.datep, p.tms';
|
||||
WHERE pf.fk_facture = '.$object->id.' AND p.fk_paiement = c.id AND pf.fk_paiement = p.rowid';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
|
||||
$res = $db->fetch_object($resql);
|
||||
$total_paiements = $res->total_paiements;
|
||||
|
||||
@@ -840,13 +857,18 @@ if (empty($reshook))
|
||||
$line->fk_facture = $object->id;
|
||||
$line->fk_parent_line = $fk_parent_line;
|
||||
|
||||
$line->subprice =-$line->subprice; // invert price for object
|
||||
$line->subprice = -$line->subprice; // invert price for object
|
||||
$line->pa_ht = $line->pa_ht; // we choosed to have buy/cost price always positive, so no revert of sign here
|
||||
$line->total_ht=-$line->total_ht;
|
||||
$line->total_tva=-$line->total_tva;
|
||||
$line->total_ttc=-$line->total_ttc;
|
||||
$line->total_localtax1=-$line->total_localtax1;
|
||||
$line->total_localtax2=-$line->total_localtax2;
|
||||
$line->total_ht = -$line->total_ht;
|
||||
$line->total_tva = -$line->total_tva;
|
||||
$line->total_ttc = -$line->total_ttc;
|
||||
$line->total_localtax1 = -$line->total_localtax1;
|
||||
$line->total_localtax2 = -$line->total_localtax2;
|
||||
|
||||
$line->multicurrency_subprice = -$line->multicurrency_subprice;
|
||||
$line->multicurrency_total_ht = -$line->multicurrency_total_ht;
|
||||
$line->multicurrency_total_tva = -$line->multicurrency_total_tva;
|
||||
$line->multicurrency_total_ttc = -$line->multicurrency_total_ttc;
|
||||
|
||||
$result = $line->insert(0, 1); // When creating credit note with same lines than source, we must ignore error if discount alreayd linked
|
||||
|
||||
@@ -1248,6 +1270,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Now we create same links to contact than the ones found on origin object
|
||||
/* Useless, already into the create
|
||||
if (! empty($conf->global->MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN))
|
||||
{
|
||||
$originforcontact = $object->origin;
|
||||
@@ -1270,7 +1293,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
else dol_print_error($resqlcontact);
|
||||
}
|
||||
}*/
|
||||
|
||||
// Hooks
|
||||
$parameters = array('objFrom' => $srcobject);
|
||||
@@ -1333,6 +1356,7 @@ if (empty($reshook))
|
||||
{
|
||||
$line->origin = $object->origin;
|
||||
$line->origin_id = $line->id;
|
||||
$line->fetch_optionals($line->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1354,7 +1378,21 @@ if (empty($reshook))
|
||||
|
||||
$object->situation_counter = $object->situation_counter + 1;
|
||||
$id = $object->createFromCurrent($user);
|
||||
if ($id <= 0) $mesg = $object->error;
|
||||
if ($id <= 0)
|
||||
{
|
||||
$mesg = $object->error;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nextSituationInvoice = new Facture($db);
|
||||
$nextSituationInvoice->fetch($id);
|
||||
// create extrafields with data from create form
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($nextSituationInvoice->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $nextSituationInvoice);
|
||||
if ($ret > 0) {
|
||||
$nextSituationInvoice->insertExtraFields();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3154,12 +3192,21 @@ else if ($id > 0 || ! empty($ref))
|
||||
$facthatreplace->fetch($objectidnext);
|
||||
print ' (' . $langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)) . ')';
|
||||
}
|
||||
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
||||
$discount = new DiscountAbsolute($db);
|
||||
$result = $discount->fetch(0, $object->id);
|
||||
if ($result > 0){
|
||||
print '. '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(), $discount->getNomUrl(1, 'discount')).'<br>';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Relative and absolute discounts
|
||||
$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
|
||||
$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
|
||||
$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
|
||||
$viewabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("ViewAvailableGlobalDiscounts") . '</a>';
|
||||
|
||||
print '<!-- Discounts --><tr><td>' . $langs->trans('Discounts');
|
||||
print '</td><td>';
|
||||
@@ -3169,7 +3216,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print $langs->trans("CompanyHasNoRelativeDiscount");
|
||||
// print ' ('.$addrelativediscount.')';
|
||||
|
||||
// Is there commercial discount or down payment available ?
|
||||
// Is there is commercial discount or down payment available ?
|
||||
if ($absolute_discount > 0) {
|
||||
print '. ';
|
||||
if ($object->statut > 0 || $object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
|
||||
@@ -3194,7 +3241,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
} else {
|
||||
if ($absolute_creditnote > 0) // If not, link will be added later
|
||||
{
|
||||
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
|
||||
if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
|
||||
print ' (' . $addabsolutediscount . ')<br>';
|
||||
else
|
||||
print '. ';
|
||||
@@ -3205,7 +3252,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ($absolute_creditnote > 0)
|
||||
{
|
||||
// If validated, we show link "add credit note to payment"
|
||||
if ($object->statut != 1 || $object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
if ($object->statut != Facture::STATUS_VALIDATED || $object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
if ($object->statut == 0 && $object->type != Facture::TYPE_DEPOSIT) {
|
||||
$text = $langs->trans("CompanyHasCreditNote", price($absolute_creditnote), $langs->transnoentities("Currency" . $conf->currency));
|
||||
print $form->textwithpicto($text, $langs->trans("CreditNoteDepositUse"));
|
||||
@@ -3216,13 +3263,13 @@ else if ($id > 0 || ! empty($ref))
|
||||
// There is credit notes discounts available
|
||||
if (! $absolute_discount) print '<br>';
|
||||
// $form->form_remise_dispo($_SERVER["PHP_SELF"].'?facid='.$object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, $resteapayer);
|
||||
$more=' ('.$addcreditnote.')';
|
||||
$more=' ('.$addcreditnote. (($addcreditnote && $viewabsolutediscount) ? ' - ' : '') . $viewabsolutediscount . ')';
|
||||
$form->form_remise_dispo($_SERVER["PHP_SELF"] . '?facid=' . $object->id, 0, 'remise_id_for_payment', $soc->id, $absolute_creditnote, $filtercreditnote, 0, $more); // We allow credit note even if amount is higher
|
||||
}
|
||||
}
|
||||
if (! $absolute_discount && ! $absolute_creditnote) {
|
||||
print $langs->trans("CompanyHasNoAbsoluteDiscount");
|
||||
if ($object->statut == 0 && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
|
||||
if ($object->statut == Facture::STATUS_DRAFT && $object->type != Facture::TYPE_CREDIT_NOTE && $object->type != Facture::TYPE_DEPOSIT)
|
||||
print ' (' . $addabsolutediscount . ')<br>';
|
||||
else
|
||||
print '. ';
|
||||
@@ -4103,11 +4150,11 @@ else if ($id > 0 || ! empty($ref))
|
||||
if ($objectidnext) {
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
} else {
|
||||
if ($resteapayer == 0) {
|
||||
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
} else {
|
||||
//if ($resteapayer == 0) {
|
||||
// print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
|
||||
//} else {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&action=create&accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
|
||||
}
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Classe de gestion des factures recurrentes/Modeles
|
||||
* Class to manage invoice templates
|
||||
*/
|
||||
class FactureRec extends CommonInvoice
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class FactureRec extends CommonInvoice
|
||||
public $table_element_line='facturedet_rec';
|
||||
public $fk_element='fk_facture';
|
||||
public $picto='bill';
|
||||
|
||||
|
||||
var $entity;
|
||||
var $number;
|
||||
var $date;
|
||||
@@ -58,7 +58,10 @@ class FactureRec extends CommonInvoice
|
||||
var $date_when;
|
||||
var $nb_gen_done;
|
||||
var $nb_gen_max;
|
||||
|
||||
|
||||
var $frequency;
|
||||
var $unit_frequency;
|
||||
|
||||
var $rang;
|
||||
var $special_code;
|
||||
|
||||
@@ -91,20 +94,20 @@ class FactureRec extends CommonInvoice
|
||||
// Clean parameters
|
||||
$this->titre=trim($this->titre);
|
||||
$this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice;
|
||||
|
||||
|
||||
// No frequency defined then no next date to execution
|
||||
if (empty($this->frequency))
|
||||
if (empty($this->frequency))
|
||||
{
|
||||
$this->frequency=0;
|
||||
$this->date_when=NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->frequency=abs($this->frequency);
|
||||
$this->nb_gen_done=0;
|
||||
$this->nb_gen_max=empty($this->nb_gen_max)?0:$this->nb_gen_max;
|
||||
$this->auto_validate=empty($this->auto_validate)?0:$this->auto_validate;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Charge facture modele
|
||||
@@ -197,7 +200,7 @@ class FactureRec extends CommonInvoice
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add object linked
|
||||
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||
{
|
||||
@@ -210,7 +213,7 @@ class FactureRec extends CommonInvoice
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
@@ -268,7 +271,7 @@ class FactureRec extends CommonInvoice
|
||||
if ($ref_ext) $sql.= " AND f.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||
if ($ref_int) $sql.= " AND f.ref_int='".$this->db->escape($ref_int)."'";
|
||||
*/
|
||||
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
@@ -361,8 +364,8 @@ class FactureRec extends CommonInvoice
|
||||
{
|
||||
return $this->fetch_lines();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Recupere les lignes de factures predefinies dans this->lines
|
||||
*
|
||||
@@ -386,7 +389,7 @@ class FactureRec extends CommonInvoice
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
|
||||
$sql.= ' WHERE l.fk_facture = '.$this->id;
|
||||
$sql.= ' ORDER BY l.rang';
|
||||
|
||||
|
||||
dol_syslog('FactureRec::fetch_lines', LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
@@ -431,7 +434,7 @@ class FactureRec extends CommonInvoice
|
||||
$line->special_code = $objp->special_code;
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
$line->fk_contract_line = $objp->fk_contract_line;
|
||||
|
||||
|
||||
// Ne plus utiliser
|
||||
$line->price = $objp->price;
|
||||
$line->remise = $objp->remise;
|
||||
@@ -463,12 +466,12 @@ class FactureRec extends CommonInvoice
|
||||
function delete($user, $notrigger=0, $idwarehouse=-1)
|
||||
{
|
||||
$rowid=$this->id;
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::delete rowid=".$rowid, LOG_DEBUG);
|
||||
|
||||
|
||||
$error=0;
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE fk_facture = ".$rowid;
|
||||
dol_syslog($sql);
|
||||
if ($this->db->query($sql))
|
||||
@@ -481,7 +484,7 @@ class FactureRec extends CommonInvoice
|
||||
$res = $this->deleteObjectLinked();
|
||||
if ($res < 0) $error=-3;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
$error=-1;
|
||||
@@ -492,7 +495,7 @@ class FactureRec extends CommonInvoice
|
||||
$this->error=$this->db->lasterror();
|
||||
$error=-2;
|
||||
}
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
@@ -531,7 +534,7 @@ class FactureRec extends CommonInvoice
|
||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null)
|
||||
{
|
||||
global $mysoc;
|
||||
|
||||
|
||||
$facid=$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::addline facid=$facid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,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,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
|
||||
@@ -557,11 +560,14 @@ class FactureRec extends CommonInvoice
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
$qty=price2num($qty);
|
||||
if (! $info_bits) $info_bits=0;
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$txtva=price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
$pu_ht = price2num($pu_ht);
|
||||
$pu_ttc = price2num($pu_ttc);
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
@@ -584,7 +590,7 @@ class FactureRec extends CommonInvoice
|
||||
$total_ttc = $tabprice[2];
|
||||
$total_localtax1=$tabprice[9];
|
||||
$total_localtax2=$tabprice[10];
|
||||
|
||||
|
||||
$product_type=$type;
|
||||
if ($fk_product)
|
||||
{
|
||||
@@ -685,12 +691,12 @@ class FactureRec extends CommonInvoice
|
||||
function updateline($rowid, $desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $price_base_type='HT', $info_bits=0, $fk_remise_except='', $pu_ttc=0, $type=0, $rang=-1, $special_code=0, $label='', $fk_unit=null)
|
||||
{
|
||||
global $mysoc;
|
||||
|
||||
|
||||
$facid=$this->id;
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::updateline facid=".$facid." rowid=$rowid,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva,txlocaltax1=$txlocaltax1,txlocaltax2=$txlocaltax2,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,type=$type,fk_unit=$fk_unit", LOG_DEBUG);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
@@ -715,7 +721,7 @@ class FactureRec extends CommonInvoice
|
||||
$txtva=price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
|
||||
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
@@ -724,7 +730,7 @@ class FactureRec extends CommonInvoice
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
|
||||
|
||||
// Calcul du total TTC et de la TVA pour la ligne a partir de
|
||||
// qty, pu, remise_percent et txtva
|
||||
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
|
||||
@@ -736,7 +742,7 @@ class FactureRec extends CommonInvoice
|
||||
$total_ttc = $tabprice[2];
|
||||
$total_localtax1=$tabprice[9];
|
||||
$total_localtax2=$tabprice[10];
|
||||
|
||||
|
||||
$product_type=$type;
|
||||
if ($fk_product)
|
||||
{
|
||||
@@ -744,7 +750,7 @@ class FactureRec extends CommonInvoice
|
||||
$result=$product->fetch($fk_product);
|
||||
$product_type=$product->type;
|
||||
}
|
||||
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet_rec SET ";
|
||||
$sql.= "fk_facture = '".$facid."'";
|
||||
$sql.= ", label=".(! empty($label)?"'".$this->db->escape($label)."'":"null");
|
||||
@@ -784,12 +790,12 @@ class FactureRec extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the next date of
|
||||
*
|
||||
* Return the next date of
|
||||
*
|
||||
* @return timestamp false if KO, timestamp if OK
|
||||
*/
|
||||
function getNextDate()
|
||||
@@ -797,27 +803,27 @@ class FactureRec extends CommonInvoice
|
||||
if (empty($this->date_when)) return false;
|
||||
return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create all recurrents invoices (for all entities if multicompany is used).
|
||||
* A result may also be provided into this->output.
|
||||
*
|
||||
* WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found.
|
||||
*
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*
|
||||
* WARNING: This method change context $conf->entity to be in correct context for each recurring invoice found.
|
||||
*
|
||||
* @return int 0 if OK, < 0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
function createRecurringInvoices()
|
||||
{
|
||||
global $conf, $langs, $db, $user;
|
||||
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
|
||||
$nb_create=0;
|
||||
|
||||
|
||||
$now = dol_now();
|
||||
$tmparray=dol_getdate($now);
|
||||
$today = dol_mktime(23,59,59,$tmparray['mon'],$tmparray['mday'],$tmparray['year']); // Today is last second of current day
|
||||
|
||||
|
||||
dol_syslog("createRecurringInvoices");
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_rec';
|
||||
$sql.= ' WHERE frequency > 0'; // A recurring invoice is an invoice with a frequency
|
||||
@@ -825,30 +831,30 @@ class FactureRec extends CommonInvoice
|
||||
$sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)';
|
||||
$sql.= $db->order('entity', 'ASC');
|
||||
//print $sql;exit;
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
if ($num) $this->output.=$langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n";
|
||||
else $this->output.=$langs->trans("NoQualifiedRecurringInvoiceTemplateFound");
|
||||
|
||||
|
||||
$saventity = $conf->entity;
|
||||
|
||||
|
||||
while ($i < $num) // Loop on each template invoice
|
||||
{
|
||||
$line = $db->fetch_object($resql);
|
||||
|
||||
$db->begin();
|
||||
|
||||
|
||||
$facturerec = new FactureRec($db);
|
||||
$facturerec->fetch($line->rowid);
|
||||
|
||||
|
||||
// Set entity context
|
||||
$conf->entity = $facturerec->entity;
|
||||
|
||||
|
||||
dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity);
|
||||
|
||||
$error=0;
|
||||
@@ -856,12 +862,12 @@ class FactureRec extends CommonInvoice
|
||||
$facture = new Facture($db);
|
||||
$facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice
|
||||
$facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice
|
||||
|
||||
|
||||
$facture->type = self::TYPE_STANDARD;
|
||||
$facture->brouillon = 1;
|
||||
$facture->date = $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later.
|
||||
$facture->socid = $facturerec->socid;
|
||||
|
||||
|
||||
$invoiceidgenerated = $facture->create($user);
|
||||
if ($invoiceidgenerated <= 0)
|
||||
{
|
||||
@@ -894,16 +900,16 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$conf->entity = $saventity; // Restore entity context
|
||||
}
|
||||
else dol_print_error($db);
|
||||
|
||||
|
||||
$this->output=trim($this->output);
|
||||
|
||||
|
||||
return $error?$error:0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
@@ -920,13 +926,13 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
$result='';
|
||||
$label=$langs->trans("ShowInvoice").': '.$this->ref;
|
||||
|
||||
|
||||
$url = DOL_URL_ROOT.'/compta/facture/fiche-rec.php?facid='.$this->id;
|
||||
|
||||
|
||||
if ($short) return $url;
|
||||
|
||||
|
||||
$picto='bill';
|
||||
|
||||
|
||||
$link = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend='</a>';
|
||||
|
||||
@@ -958,7 +964,7 @@ class FactureRec extends CommonInvoice
|
||||
// Load array of products prodids
|
||||
$num_prods = 0;
|
||||
$prodids = array();
|
||||
|
||||
|
||||
$sql = "SELECT rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||
$sql.= " WHERE entity IN (".getEntity('product').")";
|
||||
@@ -1071,7 +1077,7 @@ class FactureRec extends CommonInvoice
|
||||
$this->lines[$xnbp]=$line;
|
||||
$xnbp++;
|
||||
}
|
||||
|
||||
|
||||
$this->usenewprice = 1;
|
||||
}
|
||||
|
||||
@@ -1091,7 +1097,7 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update frequency and unit
|
||||
*
|
||||
@@ -1115,12 +1121,12 @@ class FactureRec extends CommonInvoice
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= ' SET frequency = '.($frequency?$this->db->escape($frequency):'null');
|
||||
if (!empty($unit))
|
||||
if (!empty($unit))
|
||||
{
|
||||
$sql.= ', unit_frequency = \''.$this->db->escape($unit).'\'';
|
||||
}
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
|
||||
dol_syslog(get_class($this)."::setFrequencyAndUnit", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
@@ -1134,7 +1140,7 @@ class FactureRec extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the next date of execution
|
||||
*
|
||||
@@ -1167,7 +1173,7 @@ class FactureRec extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the maximum period
|
||||
*
|
||||
@@ -1181,9 +1187,9 @@ class FactureRec extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::setMaxPeriod was called on objet with property table_element not defined",LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (empty($nb)) $nb=0;
|
||||
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= ' SET nb_gen_max = '.$nb;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
@@ -1200,7 +1206,7 @@ class FactureRec extends CommonInvoice
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the auto validate invoice
|
||||
*
|
||||
@@ -1214,7 +1220,7 @@ class FactureRec extends CommonInvoice
|
||||
dol_syslog(get_class($this)."::setAutoValidate was called on objet with property table_element not defined",LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= ' SET auto_validate = '.$validate;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
@@ -1241,7 +1247,7 @@ class FactureRec extends CommonInvoice
|
||||
*/
|
||||
class FactureLigneRec extends CommonInvoiceLine
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Delete line in database
|
||||
*
|
||||
@@ -1250,11 +1256,11 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
function delete()
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
|
||||
$error=0;
|
||||
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
// Call trigger
|
||||
/*$result=$this->call_trigger('LINEBILLREC_DELETE',$user);
|
||||
if ($result < 0)
|
||||
@@ -1263,8 +1269,8 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
return -1;
|
||||
}*/
|
||||
// End call triggers
|
||||
|
||||
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet_rec WHERE rowid = ".($this->rowid > 0 ? $this->rowid : $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if ($this->db->query($sql) )
|
||||
@@ -1279,5 +1285,5 @@ class FactureLigneRec extends CommonInvoiceLine
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -430,7 +430,6 @@ class Facture extends CommonInvoice
|
||||
$sql.= ", ".(double) $this->multicurrency_tx;
|
||||
$sql.=")";
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -440,7 +439,6 @@ class Facture extends CommonInvoice
|
||||
$this->ref='(PROV'.$this->id.')';
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."facture SET facnumber='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (! $resql) $error++;
|
||||
|
||||
@@ -489,7 +487,8 @@ class Facture extends CommonInvoice
|
||||
foreach ($exp->linkedObjectsIds['commande'] as $key => $value)
|
||||
{
|
||||
$originforcontact = 'commande';
|
||||
$originidforcontact = $value->id;
|
||||
if (is_object($value)) $originidforcontact = $value->id;
|
||||
else $originidforcontact = $value;
|
||||
break; // We take first one
|
||||
}
|
||||
}
|
||||
@@ -748,12 +747,12 @@ class Facture extends CommonInvoice
|
||||
|
||||
// Charge facture source
|
||||
$facture=new Facture($this->db);
|
||||
|
||||
|
||||
$this->fetch_optionals();
|
||||
if(!empty($this->array_options)){
|
||||
$facture->array_options = $this->array_options;
|
||||
}
|
||||
|
||||
|
||||
foreach($this->lines as &$line){
|
||||
$line->fetch_optionals();//fetch extrafields
|
||||
}
|
||||
@@ -783,7 +782,7 @@ class Facture extends CommonInvoice
|
||||
$facture->situation_final = $this->situation_final;
|
||||
|
||||
// Loop on each line of new invoice
|
||||
foreach($facture->lines as $i => $line)
|
||||
foreach($facture->lines as $i => $tmpline)
|
||||
{
|
||||
$facture->lines[$i]->fk_prev_id = $this->lines[$i]->rowid;
|
||||
if ($invertdetail)
|
||||
@@ -1569,7 +1568,7 @@ class Facture extends CommonInvoice
|
||||
$facligne->desc=$remise->description; // Description ligne
|
||||
$facligne->vat_src_code=$remise->vat_src_code;
|
||||
$facligne->tva_tx=$remise->tva_tx;
|
||||
$facligne->subprice=-$remise->amount_ht;
|
||||
$facligne->subprice = -$remise->amount_ht;
|
||||
$facligne->fk_product=0; // Id produit predefini
|
||||
$facligne->qty=1;
|
||||
$facligne->remise_percent=0;
|
||||
@@ -1592,6 +1591,11 @@ class Facture extends CommonInvoice
|
||||
$facligne->total_tva = -$remise->amount_tva;
|
||||
$facligne->total_ttc = -$remise->amount_ttc;
|
||||
|
||||
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
|
||||
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
|
||||
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
|
||||
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
|
||||
|
||||
$lineid=$facligne->insert();
|
||||
if ($lineid > 0)
|
||||
{
|
||||
@@ -2047,6 +2051,10 @@ class Facture extends CommonInvoice
|
||||
$error=0;
|
||||
dol_syslog(get_class($this).'::validate user='.$user->id.', force_number='.$force_number.', idwarehouse='.$idwarehouse);
|
||||
|
||||
// Force to have object complete for checks
|
||||
$this->fetch_thirdparty();
|
||||
$this->fetch_lines();
|
||||
|
||||
// Check parameters
|
||||
if (! $this->brouillon)
|
||||
{
|
||||
@@ -2064,9 +2072,6 @@ class Facture extends CommonInvoice
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$this->fetch_thirdparty();
|
||||
$this->fetch_lines();
|
||||
|
||||
// Check parameters
|
||||
if ($this->type == self::TYPE_REPLACEMENT) // si facture de remplacement
|
||||
{
|
||||
@@ -3829,6 +3834,9 @@ class Facture extends CommonInvoice
|
||||
$line->total_ht=-100;
|
||||
$line->total_ttc=-119.6;
|
||||
$line->total_tva=-19.6;
|
||||
$line->multicurrency_total_ht=-200;
|
||||
$line->multicurrency_total_ttc=-239.2;
|
||||
$line->multicurrency_total_tva=-39.2;
|
||||
}
|
||||
else if ($xnbp == 2) // UP is negative (free line)
|
||||
{
|
||||
@@ -3837,6 +3845,9 @@ class Facture extends CommonInvoice
|
||||
$line->total_ttc=-119.6;
|
||||
$line->total_tva=-19.6;
|
||||
$line->remise_percent=0;
|
||||
$line->multicurrency_total_ht=-200;
|
||||
$line->multicurrency_total_ttc=-239.2;
|
||||
$line->multicurrency_total_tva=-39.2;
|
||||
}
|
||||
else if ($xnbp == 3) // Discount is 50% (product line)
|
||||
{
|
||||
@@ -3845,6 +3856,9 @@ class Facture extends CommonInvoice
|
||||
$line->total_ht=50;
|
||||
$line->total_ttc=59.8;
|
||||
$line->total_tva=9.8;
|
||||
$line->multicurrency_total_ht=100;
|
||||
$line->multicurrency_total_ttc=119.6;
|
||||
$line->multicurrency_total_tva=19.6;
|
||||
$line->remise_percent=50;
|
||||
}
|
||||
else // (product line)
|
||||
@@ -3854,15 +3868,22 @@ class Facture extends CommonInvoice
|
||||
$line->total_ht=100;
|
||||
$line->total_ttc=119.6;
|
||||
$line->total_tva=19.6;
|
||||
$line->remise_percent=00;
|
||||
$line->multicurrency_total_ht=200;
|
||||
$line->multicurrency_total_ttc=239.2;
|
||||
$line->multicurrency_total_tva=39.2;
|
||||
$line->remise_percent=0;
|
||||
}
|
||||
|
||||
$this->lines[$xnbp]=$line;
|
||||
$xnbp++;
|
||||
|
||||
|
||||
$this->total_ht += $line->total_ht;
|
||||
$this->total_tva += $line->total_tva;
|
||||
$this->total_ttc += $line->total_ttc;
|
||||
$this->multicurrency_total_ht += $line->multicurrency_total_ht;
|
||||
$this->multicurrency_total_tva += $line->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc += $line->multicurrency_total_ttc;
|
||||
}
|
||||
$this->revenuestamp = 0;
|
||||
|
||||
@@ -3878,6 +3899,9 @@ class Facture extends CommonInvoice
|
||||
$line->total_ht=0;
|
||||
$line->total_ttc=0; // 90 * 1.196
|
||||
$line->total_tva=0;
|
||||
$line->multicurrency_total_ht=0;
|
||||
$line->multicurrency_total_ttc=0;
|
||||
$line->multicurrency_total_tva=0;
|
||||
$prodid = mt_rand(1, $num_prods);
|
||||
$line->fk_product=$prodids[$prodid];
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ $confirm=GETPOST('confirm', 'alpha');
|
||||
// Security check
|
||||
if ($user->societe_id)
|
||||
{
|
||||
$action='';
|
||||
$socid = $user->societe_id;
|
||||
}
|
||||
$result=restrictedArea($user,'facture',$id,'');
|
||||
@@ -72,9 +71,11 @@ if ($object->fetch($id))
|
||||
$upload_dir = $conf->facture->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||
|
||||
|
||||
@@ -100,7 +101,7 @@ if ($id > 0 || ! empty($ref))
|
||||
dol_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||
|
||||
$totalpaye = $object->getSommePaiement();
|
||||
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
$totalsize=0;
|
||||
@@ -109,11 +110,11 @@ if ($id > 0 || ! empty($ref))
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Invoice content
|
||||
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
@@ -154,14 +155,14 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
|
||||
|
||||
$object->totalpaye = $totalpaye; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref, '', 0);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
|
||||
@@ -1082,7 +1082,7 @@ if ($action == 'create')
|
||||
$disableedit=1;
|
||||
$disablemove=1;
|
||||
$disableremove=1;
|
||||
$ret = $object->printObjectLines('', $mysoc, $soc, $lineid, 0); // No date selector for template invoice
|
||||
$ret = $object->printObjectLines('', $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
@@ -1493,7 +1493,7 @@ else
|
||||
{
|
||||
//$disableedit=1;
|
||||
//$disablemove=1;
|
||||
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 0); // No date selector for template invoice
|
||||
$ret = $object->printObjectLines($action, $mysoc, $object->thirdparty, $lineid, 0); // No date selector for template invoice
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
@@ -1504,7 +1504,7 @@ else
|
||||
$var = true;
|
||||
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(0, $mysoc, $soc); // No date selector for template invoice
|
||||
$object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
@@ -39,6 +39,8 @@ $ref=GETPOST("ref",'alpha');
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer') . " - " . $langs->trans('Info');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@@ -95,8 +95,10 @@ $month_lim = GETPOST('month_lim','int');
|
||||
$year_lim = GETPOST('year_lim','int');
|
||||
|
||||
$option = GETPOST('option');
|
||||
if ($option == 'late') $filter = 'paye:0';
|
||||
$filtre = GETPOST('filtre');
|
||||
if ($option == 'late') {
|
||||
$search_status = '1';
|
||||
}
|
||||
$filtre = GETPOST('filtre','alpha');
|
||||
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@@ -386,7 +388,7 @@ if ($search_user > 0)
|
||||
$sql.= ' WHERE f.fk_soc = s.rowid';
|
||||
$sql.= ' AND f.entity IN ('.getEntity('facture').')';
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$search_product_category;
|
||||
if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$db->escape($search_product_category);
|
||||
if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
|
||||
if ($userid)
|
||||
{
|
||||
@@ -399,7 +401,7 @@ if ($filtre)
|
||||
foreach ($aFilter as $filter)
|
||||
{
|
||||
$filt = explode(':', $filter);
|
||||
$sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]);
|
||||
$sql .= ' AND ' . $db->escape(trim($filt[0])) . ' = ' . $db->escape(trim($filt[1]));
|
||||
}
|
||||
}
|
||||
if ($search_ref) $sql .= natural_search('f.facnumber', $search_ref);
|
||||
@@ -433,7 +435,7 @@ if ($search_status != '' && $search_status >= 0)
|
||||
if ($search_status == '2') $sql.=" AND f.fk_statut = 2"; // payed Not that some corrupted data may contains f.fk_statut = 1 AND f.paye = 1 (it means payed too but should not happend. If yes, reopen and reclassify billed)
|
||||
if ($search_status == '3') $sql.=" AND f.fk_statut = 3"; // abandonned
|
||||
}
|
||||
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode;
|
||||
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode);
|
||||
if ($month > 0)
|
||||
{
|
||||
if ($year > 0 && empty($day))
|
||||
@@ -461,7 +463,6 @@ else if ($year_lim > 0)
|
||||
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($year_lim,12,false))."'";
|
||||
}
|
||||
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
|
||||
if ($filter == 'paye:0') $sql.= " AND f.fk_statut = 1";
|
||||
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
|
||||
if ($search_user > 0)
|
||||
{
|
||||
@@ -474,8 +475,9 @@ foreach ($search_array_options as $key => $val)
|
||||
$tmpkey=preg_replace('/search_options_/','',$key);
|
||||
$typ=$extrafields->attribute_type[$tmpkey];
|
||||
$mode=0;
|
||||
if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
|
||||
if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
|
||||
if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
|
||||
if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
|
||||
if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
|
||||
{
|
||||
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
|
||||
}
|
||||
|
||||
@@ -84,11 +84,11 @@ dol_mkdir($dir);
|
||||
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$object_status.')';
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
|
||||
// Build graphic number of object
|
||||
@@ -299,7 +299,7 @@ foreach ($data as $val)
|
||||
while ($year && $oldyear > $year+1)
|
||||
{ // If we have empty year
|
||||
$oldyear--;
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$oldyear.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$oldyear.'</a></td>';
|
||||
print '<td align="right">0</td>';
|
||||
@@ -310,7 +310,7 @@ foreach ($data as $val)
|
||||
print '<td align="right"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven" height="24">';
|
||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid>0?'&socid='.$socid:'').($userid>0?'&userid='.$userid:'').'">'.$year.'</a></td>';
|
||||
print '<td align="right">'.$val['nb'].'</td>';
|
||||
|
||||
@@ -585,11 +585,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyAmountTTC').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyalreadypayedlabel.'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$multicurrencyremaindertopay.'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
print '<td align="right">'.$langs->trans('AmountTTC').'</td>';
|
||||
print '<td align="right">'.$alreadypayedlabel.'</td>';
|
||||
print '<td align="right">'.$remaindertopay.'</td>';
|
||||
print '<td align="right">'.$langs->trans('PaymentAmount').'</td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right">'.$langs->trans('MulticurrencyPaymentAmount').'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -659,6 +659,29 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '<td align="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
$nameRemain = 'multicurrency_remain_'.$objp->facid;
|
||||
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
if ($action != 'add_paiement')
|
||||
{
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
|
||||
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
|
||||
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Price
|
||||
@@ -695,33 +718,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Multicurrency Price
|
||||
if (! empty($conf->multicurrency->enabled))
|
||||
{
|
||||
print '<td align="right">';
|
||||
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
$nameRemain = 'multicurrency_remain_'.$objp->facid;
|
||||
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency)
|
||||
{
|
||||
if ($action != 'add_paiement')
|
||||
{
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
|
||||
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
|
||||
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
// Warning
|
||||
print '<td align="center" width="16">';
|
||||
//print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."<br>";
|
||||
@@ -754,6 +750,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td></td>';
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print '<td align="right"><b>'.price($sign * $total_ttc).'</b></td>';
|
||||
print '<td align="right"><b>'.price($sign * $totalrecu);
|
||||
if ($totalrecucreditnote) print '+'.price($totalrecucreditnote);
|
||||
@@ -761,7 +758,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
print '</b></td>';
|
||||
print '<td align="right"><b>'.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits,'MT')).'</b></td>';
|
||||
print '<td align="right" id="result" style="font-weight: bold;"></td>'; // Autofilled
|
||||
if (!empty($conf->multicurrency->enabled)) print '<td align="right" id="multicurrency_result" style="font-weight: bold;"></td>';
|
||||
print '<td align="center"> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ class RemiseCheque extends CommonObject
|
||||
if ($user->rights->banque->cheque)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql.= " SET date_bordereau = ".($date ? $this->db->idate($date) : 'null');
|
||||
$sql.= " SET date_bordereau = ".($date ? "'".$this->db->idate($date)."'" : 'null');
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog("RemiseCheque::set_date", LOG_DEBUG);
|
||||
|
||||
@@ -488,12 +488,12 @@ class Paiement extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Add a record into bank for payment with links between this bank record and invoices of payment.
|
||||
* Add a record into bank for payment + links between this bank record and sources of payment.
|
||||
* All payment properties (this->amount, this->amounts, ...) must have been set first like after a call to create().
|
||||
*
|
||||
* @param User $user Object of user making payment
|
||||
* @param string $mode 'payment', 'payment_supplier'
|
||||
* @param string $label Label to use in bank record
|
||||
* @param string $label Label to use in bank record. Note: If label is '(WithdrawalPayment)', a third entry 'widthdraw' is added into bank_url.
|
||||
* @param int $accountid Id of bank account to do link with
|
||||
* @param string $emetteur_nom Name of transmitter
|
||||
* @param string $emetteur_banque Name of bank
|
||||
@@ -577,10 +577,11 @@ class Paiement extends CommonObject
|
||||
}
|
||||
|
||||
// Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
|
||||
if (! $error && $label != '(WithdrawalPayment)')
|
||||
//if (! $error && $label != '(WithdrawalPayment)')
|
||||
if (! $error)
|
||||
{
|
||||
$linkaddedforthirdparty=array();
|
||||
foreach ($this->amounts as $key => $value) // We should have always same third party but we loop in case of.
|
||||
foreach ($this->amounts as $key => $value) // We should have invoices always for same third party but we loop in case of.
|
||||
{
|
||||
if ($mode == 'payment')
|
||||
{
|
||||
|
||||
@@ -51,6 +51,9 @@ if (! $sortfield) $sortfield="p.datec";
|
||||
// Get supervariables
|
||||
$statut = GETPOST('statut','int');
|
||||
$search_ref = GETPOST('search_ref','alpha');
|
||||
$search_amount = GETPOST('search_amount','alpha');
|
||||
|
||||
$bon=new BonPrelevement($db,"");
|
||||
|
||||
|
||||
/*
|
||||
@@ -60,6 +63,7 @@ $search_ref = GETPOST('search_ref','alpha');
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_ref="";
|
||||
$search_amount="";
|
||||
}
|
||||
|
||||
|
||||
@@ -69,13 +73,12 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
|
||||
llxHeader('',$langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
$bon=new BonPrelevement($db,"");
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.amount, p.statut";
|
||||
$sql.= ", p.datec";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($search_ref) $sql.=natural_search("p.ref", $search_ref);
|
||||
if ($search_amount) $sql.=natural_search("p.amount", $search_amount, 1);
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
@@ -97,6 +100,8 @@ if ($result)
|
||||
|
||||
$urladd= "&statut=".$statut;
|
||||
|
||||
$selectedfields='';
|
||||
|
||||
// Lines of title fields
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@@ -116,7 +121,9 @@ if ($result)
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. $db->escape($search_ref).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. dol_escape_htmltag($search_ref).'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'. dol_escape_htmltag($search_amount).'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
@@ -125,9 +132,11 @@ if ($result)
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("WithdrawalsReceipts",$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"');
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"');
|
||||
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"","","",'align="center"');
|
||||
print_liste_field_titre("WithdrawalsReceipts",$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Date",$_SERVER["PHP_SELF"],"p.datec","","",'class="liste_titre" align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"p.amount","","",'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"","","",'align="right"',$sortfield,$sortorder);
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
|
||||
print "</tr>\n";
|
||||
|
||||
while ($i < min($num,$limit))
|
||||
@@ -136,15 +145,18 @@ if ($result)
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
|
||||
print $bon->LibStatut($obj->statut,2);
|
||||
print " ";
|
||||
|
||||
print '<a href="card.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
|
||||
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->datec),'day')."</td>\n";
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
|
||||
print '<td align="right">';
|
||||
print $bon->LibStatut($obj->statut, 3);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right"></td>'."\n";
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/prelevement/card.php
|
||||
* \ingroup prelevement
|
||||
* \brief Fiche prelevement
|
||||
* \brief Card of a direct debit
|
||||
*/
|
||||
|
||||
require('../../main.inc.php');
|
||||
@@ -45,20 +45,24 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Get supervariables
|
||||
$action = GETPOST('action','alpha');
|
||||
$id = GETPOST('id','int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$socid = GETPOST('socid','int');
|
||||
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (! $sortfield) $sortfield='pl.fk_soc';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
$object = new BonPrelevement($db,"");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -66,10 +70,9 @@ if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
if ( $action == 'confirm_delete' )
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$bon->fetch($id);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$res=$bon->delete();
|
||||
$res=$object->delete();
|
||||
if ($res > 0)
|
||||
{
|
||||
header("Location: index.php");
|
||||
@@ -77,16 +80,16 @@ if ( $action == 'confirm_delete' )
|
||||
}
|
||||
}
|
||||
|
||||
// Seems to no be used and replaced with $action == 'infocredit
|
||||
if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$bon->fetch($id);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$res=$bon->set_credite();
|
||||
$res=$object->set_credite();
|
||||
if ($res >= 0)
|
||||
{
|
||||
header("Location: card.php?id=".$id);
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,19 +97,18 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$bon->fetch($id);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
|
||||
|
||||
/*
|
||||
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref)
|
||||
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
|
||||
{
|
||||
$dir = $conf->prelevement->dir_output.'/receipts';
|
||||
|
||||
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
|
||||
{
|
||||
$bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
|
||||
$object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
|
||||
}
|
||||
|
||||
header("Location: card.php?id=".$id);
|
||||
@@ -118,7 +120,7 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
|
||||
$mesg='BadFile';
|
||||
}*/
|
||||
|
||||
$error = $bon->set_infotrans($user, $dt, GETPOST('methode','alpha'));
|
||||
$error = $object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
|
||||
|
||||
if ($error)
|
||||
{
|
||||
@@ -127,13 +129,13 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
|
||||
}
|
||||
}
|
||||
|
||||
// Set direct debit order to credited, create payment and close invoices
|
||||
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$bon->fetch($id);
|
||||
$object->fetch($id, $ref);
|
||||
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
|
||||
|
||||
$error = $bon->set_infocredit($user, $dt);
|
||||
$error = $object->set_infocredit($user, $dt);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
@@ -143,61 +145,66 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$bon = new BonPrelevement($db,"");
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('',$langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
|
||||
if ($id > 0)
|
||||
if ($id > 0 || $ref)
|
||||
{
|
||||
$bon->fetch($id);
|
||||
$object->fetch($id, $ref);
|
||||
|
||||
$head = prelevement_prepare_head($bon);
|
||||
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), '', 'payment');
|
||||
$head = prelevement_prepare_head($object);
|
||||
dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
|
||||
|
||||
if (GETPOST('error','alpha')!='')
|
||||
{
|
||||
print '<div class="error">'.$bon->getErrorString(GETPOST('error','alpha')).'</div>';
|
||||
print '<div class="error">'.$object->getErrorString(GETPOST('error','alpha')).'</div>';
|
||||
}
|
||||
|
||||
/*if ($action == 'credite')
|
||||
{
|
||||
print $form->formconfirm("card.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
|
||||
print $form->formconfirm("card.php?id=".$object->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
|
||||
|
||||
}*/
|
||||
|
||||
dol_banner_tab($object, 'ref', '', 1, 'ref', 'ref');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
//print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
/*
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '<td>'.$object->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
if($object->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
$muser->fetch($object->user_trans);
|
||||
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print dol_print_date($object->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print $object->methodes_trans[$object->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
if($object->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print dol_print_date($object->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -205,19 +212,36 @@ if ($id > 0)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$acc = new Account($db);
|
||||
$result=$acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("BankToReceiveWithdraw");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($acc->id > 0)
|
||||
print $acc->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
$relativepath = 'receipts/'.$object->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
|
||||
if (empty($object->date_trans) && $user->rights->prelevement->bons->send && $action=='settransmitted')
|
||||
{
|
||||
print '<form method="post" name="userfile" action="card.php?id='.$bon->id.'" enctype="multipart/form-data">';
|
||||
print '<form method="post" name="userfile" action="card.php?id='.$object->id.'" enctype="multipart/form-data">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="infotrans">';
|
||||
print '<table class="border" width="100%">';
|
||||
@@ -227,7 +251,7 @@ if ($id > 0)
|
||||
print $form->select_date('','','','','',"userfile",1,1);
|
||||
print '</td></tr>';
|
||||
print '<tr '.$bc[false].'><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $form->selectarray("methode",$bon->methodes_trans);
|
||||
print $form->selectarray("methode",$object->methodes_trans);
|
||||
print '</td></tr>';
|
||||
/* print '<tr><td width="20%">'.$langs->trans("File").'</td><td>';
|
||||
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
|
||||
@@ -238,9 +262,9 @@ if ($id > 0)
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
if (! empty($bon->date_trans) && $bon->date_credit == 0 && $user->rights->prelevement->bons->credit && $action=='setcredited')
|
||||
if (! empty($object->date_trans) && $object->date_credit == 0 && $user->rights->prelevement->bons->credit && $action=='setcredited')
|
||||
{
|
||||
print '<form name="infocredit" method="post" action="card.php?id='.$bon->id.'">';
|
||||
print '<form name="infocredit" method="post" action="card.php?id='.$object->id.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="infocredit">';
|
||||
print '<table class="border" width="100%">';
|
||||
@@ -261,17 +285,17 @@ if ($id > 0)
|
||||
{
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if (empty($bon->date_trans) && $user->rights->prelevement->bons->send)
|
||||
if (empty($object->date_trans) && $user->rights->prelevement->bons->send)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"card.php?action=settransmitted&id=".$bon->id."\">".$langs->trans("SetToStatusSent")."</a>";
|
||||
print "<a class=\"butAction\" href=\"card.php?action=settransmitted&id=".$object->id."\">".$langs->trans("SetToStatusSent")."</a>";
|
||||
}
|
||||
|
||||
if (! empty($bon->date_trans) && $bon->date_credit == 0)
|
||||
if (! empty($object->date_trans) && $object->date_credit == 0)
|
||||
{
|
||||
print "<a class=\"butAction\" href=\"card.php?action=setcredited&id=".$bon->id."\">".$langs->trans("ClassCredited")."</a>";
|
||||
print "<a class=\"butAction\" href=\"card.php?action=setcredited&id=".$object->id."\">".$langs->trans("ClassCredited")."</a>";
|
||||
}
|
||||
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=confirm_delete&id=".$bon->id."\">".$langs->trans("Delete")."</a>";
|
||||
print "<a class=\"butActionDelete\" href=\"card.php?action=confirm_delete&id=".$object->id."\">".$langs->trans("Delete")."</a>";
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
@@ -293,7 +317,16 @@ if ($id > 0)
|
||||
$sql.= " AND pl.fk_soc = s.rowid";
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= $db->order($sortfield, $sortorder);
|
||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
@@ -304,8 +337,9 @@ if ($id > 0)
|
||||
|
||||
$urladd = "&id=".$id;
|
||||
|
||||
print_barre_liste("", $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num);
|
||||
print"\n<!-- debut table -->\n";
|
||||
print_barre_liste($langs->trans("Lines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Lines",$_SERVER["PHP_SELF"],"pl.rowid",'',$urladd);
|
||||
@@ -363,12 +397,17 @@ if ($id > 0)
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td align="right">';
|
||||
if ($total != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
|
||||
print price($total);
|
||||
print "</td>\n";
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -38,6 +38,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
*/
|
||||
class BonPrelevement extends CommonObject
|
||||
{
|
||||
public $element='widthdraw';
|
||||
public $table_element='prelevement_bons';
|
||||
public $picto = 'payment';
|
||||
|
||||
var $date_echeance;
|
||||
var $raison_sociale;
|
||||
var $reference_remise;
|
||||
@@ -263,10 +267,11 @@ class BonPrelevement extends CommonObject
|
||||
/**
|
||||
* Get object and lines from database
|
||||
*
|
||||
* @param int $rowid id of object to load
|
||||
* @param int $rowid Id of object to load
|
||||
* @param string $ref Ref of direct debit
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function fetch($rowid)
|
||||
function fetch($rowid, $ref='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@@ -278,8 +283,9 @@ class BonPrelevement extends CommonObject
|
||||
$sql.= ", p.fk_user_credit";
|
||||
$sql.= ", p.statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= " WHERE p.rowid = ".$rowid;
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
if ($rowid > 0) $sql.= " AND p.rowid = ".$rowid;
|
||||
else $sql.= " AND p.ref = '".$this->db->escape($ref)."'";
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
@@ -321,7 +327,7 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Set credite and set status of linked invoices
|
||||
* Set credite and set status of linked invoices. Still used ??
|
||||
*
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
@@ -345,7 +351,7 @@ class BonPrelevement extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error == 0)
|
||||
if (! $error)
|
||||
{
|
||||
$facs = array();
|
||||
$facs = $this->getListInvoices();
|
||||
@@ -361,9 +367,8 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if ($error == 0)
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes";
|
||||
$sql.= " SET statut = 2";
|
||||
$sql.= " WHERE fk_prelevement_bons = ".$this->id;
|
||||
@@ -378,7 +383,7 @@ class BonPrelevement extends CommonObject
|
||||
/*
|
||||
* End of procedure
|
||||
*/
|
||||
if ($error == 0)
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 0;
|
||||
@@ -399,10 +404,10 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Set withdrawal to credited status
|
||||
* Set direct debit order to "credited" status.
|
||||
*
|
||||
* @param User $user id of user
|
||||
* @param int $date date of action
|
||||
* @param User $user Id of user
|
||||
* @param int $date date of action
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function set_infocredit($user, $date)
|
||||
@@ -436,49 +441,60 @@ class BonPrelevement extends CommonObject
|
||||
$bankaccount = $conf->global->PRELEVEMENT_ID_BANKACCOUNT;
|
||||
$facs = array();
|
||||
$amounts = array();
|
||||
$amountsperthirdparty = array();
|
||||
|
||||
$facs = $this->getListInvoices(1);
|
||||
|
||||
// Loop on each invoice. $facs=array(0=>id, 1=>amount requested)
|
||||
$num=count($facs);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$fac = new Facture($this->db);
|
||||
$fac->fetch($facs[$i][0]);
|
||||
$amounts[$fac->id] = $facs[$i][1];
|
||||
$amountsperthirdparty[$fac->socid][$fac->id] = $facs[$i][1];
|
||||
|
||||
$totalpaye = $fac->getSommePaiement();
|
||||
$totalcreditnotes = $fac->getSumCreditNotesUsed();
|
||||
$totaldeposits = $fac->getSumDepositsUsed();
|
||||
$alreadypayed = $totalpaye + $totalcreditnotes + $totaldeposits;
|
||||
|
||||
if ($alreadypayed + $facs[$i][1] >= $fac->total_ttc) {
|
||||
if (price2num($alreadypayed + $facs[$i][1], 'MT') == $fac->total_ttc) {
|
||||
$result = $fac->set_paid($user);
|
||||
}
|
||||
}
|
||||
|
||||
$paiement = new Paiement($this->db);
|
||||
$paiement->datepaye = $date ;
|
||||
$paiement->amounts = $amounts;
|
||||
$paiement->paiementid = 3; //
|
||||
$paiement->num_paiement = $this->ref ;
|
||||
$paiement->id_prelevement = $this->id ;
|
||||
// Make one payment per customer
|
||||
foreach ($amountsperthirdparty as $thirdpartyid => $cursoramounts)
|
||||
{
|
||||
$paiement = new Paiement($this->db);
|
||||
$paiement->datepaye = $date;
|
||||
$paiement->amounts = $cursoramounts; // Array with detail of dispatching of payments for each invoice
|
||||
$paiement->paiementid = 3; //
|
||||
$paiement->num_paiement = $this->ref; // Set ref of direct debit note
|
||||
$paiement->id_prelevement = $this->id;
|
||||
|
||||
$paiement_id = $paiement->create($user);
|
||||
if ($paiement_id < 0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::set_credite AddPayment Error");
|
||||
$error++;
|
||||
$paiement_id = $paiement->create($user);
|
||||
if ($paiement_id < 0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::set_infocredit AddPayment Error");
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$paiement->addPaymentToBank($user,'payment','(WithdrawalPayment)',$bankaccount,'','');
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::set_infocredit AddPaymentToBank Error");
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
//var_dump($paiement->amounts);
|
||||
//var_dump($thirdpartyid);
|
||||
//var_dump($cursoramounts);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result=$paiement->addPaymentToBank($user,'payment','(WithdrawalPayment)',$bankaccount,'','');
|
||||
if ($result < 0)
|
||||
{
|
||||
dol_syslog(get_class($this)."::set_credite AddPaymentToBank Error");
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
// Update withdrawal line
|
||||
|
||||
// Update withdrawal line
|
||||
// TODO: Translate to ligneprelevement.class.php
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes";
|
||||
$sql.= " SET statut = 2";
|
||||
@@ -486,7 +502,7 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
if (! $this->db->query($sql))
|
||||
{
|
||||
dol_syslog(get_class($this)."::set_credite Update lines Error");
|
||||
dol_syslog(get_class($this)."::set_infocredit Update lines Error");
|
||||
$error++;
|
||||
}
|
||||
|
||||
@@ -937,6 +953,7 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
|
||||
$this->id = $prev_id;
|
||||
$this->ref = $ref;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -951,14 +968,14 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create withdrawal receipt
|
||||
*/
|
||||
if (!$error)
|
||||
{
|
||||
if (count($factures_prev) > 0)
|
||||
/*
|
||||
* Create withdrawal receipt in database
|
||||
*/
|
||||
if (count($factures_prev) > 0)
|
||||
{
|
||||
foreach ($factures_prev as $fac)
|
||||
foreach ($factures_prev as $fac) // Add a link in database for each invoice
|
||||
{
|
||||
// Fetch invoice
|
||||
$fact = new Facture($this->db);
|
||||
@@ -998,7 +1015,6 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1006,11 +1022,12 @@ class BonPrelevement extends CommonObject
|
||||
if (!$error)
|
||||
{
|
||||
/*
|
||||
* Withdraw receipt
|
||||
* Create direct debit order in a XML file
|
||||
*/
|
||||
|
||||
dol_syslog(__METHOD__."::Init withdraw receipt for ".count($factures_prev)." invoices", LOG_DEBUG);
|
||||
|
||||
|
||||
if (count($factures_prev) > 0)
|
||||
{
|
||||
$this->date_echeance = $datetimeprev;
|
||||
@@ -1034,11 +1051,12 @@ class BonPrelevement extends CommonObject
|
||||
|
||||
$this->factures = $factures_prev_id;
|
||||
|
||||
// Generation of SEPA file
|
||||
// Generation of SEPA file $this->filename
|
||||
$this->generate();
|
||||
}
|
||||
dol_syslog(__METHOD__."::End withdraw receipt, file ".$this->filename, LOG_DEBUG);
|
||||
}
|
||||
//var_dump($factures_prev);exit;
|
||||
|
||||
/*
|
||||
* Update total
|
||||
@@ -1289,8 +1307,9 @@ class BonPrelevement extends CommonObject
|
||||
$sql.= " AND soc.rowid = f.fk_soc";
|
||||
$sql.= " AND rib.fk_soc = f.fk_soc";
|
||||
$sql.= " AND rib.default_rib = 1";
|
||||
//print $sql;
|
||||
|
||||
//echo $sql;
|
||||
// Define $fileDebiteurSection. One section DrctDbtTxInf per invoice.
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -1302,27 +1321,26 @@ class BonPrelevement extends CommonObject
|
||||
$this->total = $this->total + $obj->somme;
|
||||
$i++;
|
||||
}
|
||||
$nbtotalDrctDbtTxInf = $i;
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs($this->file, 'ERREUR DEBITEUR '.$sql.$CrLf);
|
||||
fputs($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers
|
||||
$result = -2;
|
||||
}
|
||||
|
||||
/*
|
||||
* section Emetteur(sepa Emetteur bloc lines)
|
||||
*/
|
||||
// Define $fileEmetteurSection. Start of bloc PmtInf. Will contains all DrctDbtTxInf
|
||||
if ($result != -2)
|
||||
{
|
||||
$fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $i, $this->total, $CrLf);
|
||||
$fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf);
|
||||
}
|
||||
else
|
||||
{
|
||||
fputs($this->file, 'ERREUR EMETTEUR'.$CrLf);
|
||||
fputs($this->file, 'ERROR CREDITOR'.$CrLf); // CREDITOR = My company
|
||||
}
|
||||
|
||||
/**
|
||||
* SECTION CREATION FICHIER SEPA
|
||||
* SECTION CREATION SEPA FILE
|
||||
*/
|
||||
// SEPA File Header
|
||||
fputs($this->file, '<'.'?xml version="1.0" encoding="UTF-8" standalone="yes"?'.'>'.$CrLf);
|
||||
@@ -1819,11 +1837,11 @@ class BonPrelevement extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Return status label for a status
|
||||
* Return status label for a status
|
||||
*
|
||||
* @param int $statut id statut
|
||||
* @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto
|
||||
* @return string Label
|
||||
* @param int $statut id statut
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
{
|
||||
@@ -1846,8 +1864,25 @@ class BonPrelevement extends CommonObject
|
||||
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3');
|
||||
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
|
||||
}
|
||||
|
||||
if ($mode == 3)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
|
||||
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3');
|
||||
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 4)
|
||||
{
|
||||
if ($statut==0) return img_picto($langs->trans($this->labelstatut[$statut]),'statut1').' '.$langs->trans($this->labelstatut[$statut]);
|
||||
if ($statut==1) return img_picto($langs->trans($this->labelstatut[$statut]),'statut3').' '.$langs->trans($this->labelstatut[$statut]);
|
||||
if ($statut==2) return img_picto($langs->trans($this->labelstatut[$statut]),'statut6').' '.$langs->trans($this->labelstatut[$statut]);
|
||||
}
|
||||
if ($mode == 5)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
|
||||
if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut3');
|
||||
if ($statut==2) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut6');
|
||||
}
|
||||
if ($mode == 6)
|
||||
{
|
||||
if ($statut==0) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut1');
|
||||
if ($statut==1) return $langs->trans($this->labelstatut[$statut]).' '.img_picto($langs->trans($this->labelstatut[$statut]),'statut3');
|
||||
|
||||
@@ -67,7 +67,7 @@ if ($action == 'create')
|
||||
{
|
||||
setEventMessages($bprev->error, $bprev->errors, 'errors');
|
||||
}
|
||||
if ($result == 0)
|
||||
elseif ($result == 0)
|
||||
{
|
||||
$mesg='';
|
||||
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed");
|
||||
@@ -78,6 +78,10 @@ if ($action == 'create')
|
||||
$mesg.=$val."<br>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@@ -55,6 +56,9 @@ $pagenext = $page + 1;
|
||||
if (! $sortfield) $sortfield='p.ref';
|
||||
if (! $sortorder) $sortorder='DESC';
|
||||
|
||||
$object = new BonPrelevement($db,"");
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -65,39 +69,41 @@ $thirdpartytmp = new Societe($db);
|
||||
|
||||
llxHeader('',$langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
if ($prev_id)
|
||||
if ($prev_id > 0 || $ref)
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
|
||||
if ($bon->fetch($prev_id) == 0)
|
||||
if ($object->fetch($prev_id, $ref) == 0)
|
||||
{
|
||||
$head = prelevement_prepare_head($bon);
|
||||
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), '', 'payment');
|
||||
$head = prelevement_prepare_head($object);
|
||||
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
|
||||
|
||||
dol_banner_tab($object, 'ref', '', 1, 'ref', 'ref');
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
//print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
// Status
|
||||
print '<tr><td>'.$langs->trans('Status').'</td><td>'.$bon->getLibStatut(1).'</td></tr>';
|
||||
//print '<tr><td>'.$langs->trans('Status').'</td><td>'.$object->getLibStatut(1).'</td></tr>';
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
if($object->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
$muser->fetch($object->user_trans);
|
||||
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print dol_print_date($object->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print $object->methodes_trans[$object->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
if($object->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print dol_print_date($object->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -105,12 +111,29 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$acc = new Account($db);
|
||||
$result=$acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("BankToReceiveWithdraw");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($acc->id > 0)
|
||||
print $acc->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
$relativepath = 'receipts/'.$object->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
}
|
||||
@@ -122,9 +145,9 @@ if ($prev_id)
|
||||
|
||||
|
||||
// List of invoices
|
||||
$sql = "SELECT pf.rowid";
|
||||
$sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
|
||||
$sql.= ", s.rowid as socid, s.nom as name, pl.statut";
|
||||
$sql = "SELECT pf.rowid,";
|
||||
$sql.= " f.rowid as facid, f.facnumber as ref, f.total_ttc,";
|
||||
$sql.= " s.rowid as socid, s.nom as name, pl.statut, pl.amount as amount_requested";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
|
||||
@@ -137,7 +160,6 @@ $sql.= " AND pf.fk_facture = f.rowid";
|
||||
$sql.= " AND f.entity = ".$conf->entity;
|
||||
if ($prev_id) $sql.= " AND p.rowid=".$prev_id;
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
@@ -172,21 +194,22 @@ if ($result)
|
||||
|
||||
$massactionbutton='';
|
||||
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
print_barre_liste($langs->trans("Invoices"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="liste" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Bill",$_SERVER["PHP_SELF"],"p.ref",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("ThirdParty",$_SERVER["PHP_SELF"],"s.nom",'',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre("Amount",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("AmountInvoice",$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("AmountRequested",$_SERVER["PHP_SELF"],"pl.amount_requested","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre("StatusDebitCredit",$_SERVER["PHP_SELF"],"","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre('');
|
||||
print "</tr>\n";
|
||||
|
||||
$var=false;
|
||||
|
||||
$total = 0;
|
||||
$totalinvoices = 0;
|
||||
$totalamount_requested = 0;
|
||||
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
@@ -208,9 +231,12 @@ if ($result)
|
||||
print $thirdpartytmp->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
|
||||
// Amount
|
||||
// Amount of invoice
|
||||
print '<td align="right">'.price($obj->total_ttc)."</td>\n";
|
||||
|
||||
// Amount requested
|
||||
print '<td align="right">'.price($obj->amount_requested)."</td>\n";
|
||||
|
||||
// Status of requests
|
||||
print '<td align="center">';
|
||||
|
||||
@@ -233,7 +259,8 @@ if ($result)
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$total += $obj->total_ttc;
|
||||
$totalinvoices += $obj->total_ttc;
|
||||
$totalamount_requested += $obj->amount_requested;
|
||||
|
||||
$i++;
|
||||
}
|
||||
@@ -243,13 +270,21 @@ if ($result)
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans("Total").'</td>';
|
||||
print '<td> </td>';
|
||||
print '<td align="right">'.price($total)."</td>\n";
|
||||
print '<td align="right">';
|
||||
//if ($totalinvoices != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices"); // It is normal to have total that differs. For an amount of invoice of 100, request to pay may be 50 only.
|
||||
if ($totalamount_requested != $object->amount) print img_warning("AmountOfFileDiffersFromSumOfInvoices");
|
||||
print "</td>\n";
|
||||
print '<td align="right">';
|
||||
print price($totalamount_requested);
|
||||
print "</td>\n";
|
||||
print '<td> </td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
$db->free($result);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -41,49 +41,69 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
|
||||
// Get supervariables
|
||||
$prev_id = GETPOST('id','int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
$object = new BonPrelevement($db,"");
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader('',$langs->trans("WithdrawalsReceipts"));
|
||||
|
||||
if ($prev_id)
|
||||
if ($prev_id > 0 || $ref)
|
||||
{
|
||||
$bon = new BonPrelevement($db,"");
|
||||
|
||||
if ($bon->fetch($prev_id) == 0)
|
||||
if ($object->fetch($prev_id, $ref) == 0)
|
||||
{
|
||||
$head = prelevement_prepare_head($bon);
|
||||
dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), '', 'payment');
|
||||
$head = prelevement_prepare_head($object);
|
||||
dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
dol_banner_tab($object, 'ref', '', 1, 'ref', 'ref');
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">'."\n";
|
||||
|
||||
//print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->getNomUrl(1).'</td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td>'.dol_print_date($object->datec,'day').'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
|
||||
// Status
|
||||
/*
|
||||
print '<tr><td>'.$langs->trans('Status').'</td>';
|
||||
print '<td>'.$bon->getLibStatut(1).'</td>';
|
||||
print '<td>'.$object->getLibStatut(1).'</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
if($bon->date_trans <> 0)
|
||||
if($object->date_trans <> 0)
|
||||
{
|
||||
$muser = new User($db);
|
||||
$muser->fetch($bon->user_trans);
|
||||
$muser->fetch($object->user_trans);
|
||||
|
||||
print '<tr><td>'.$langs->trans("TransData").'</td><td>';
|
||||
print dol_print_date($bon->date_trans,'day');
|
||||
print dol_print_date($object->date_trans,'day');
|
||||
print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TransMetod").'</td><td>';
|
||||
print $bon->methodes_trans[$bon->method_trans];
|
||||
print $object->methodes_trans[$object->method_trans];
|
||||
print '</td></tr>';
|
||||
}
|
||||
if($bon->date_credit <> 0)
|
||||
if($object->date_credit <> 0)
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('CreditDate').'</td><td>';
|
||||
print dol_print_date($bon->date_credit,'day');
|
||||
print dol_print_date($object->date_credit,'day');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -91,12 +111,29 @@ if ($prev_id)
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="border" width="100%"><tr><td class="titlefield">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$acc = new Account($db);
|
||||
$result=$acc->fetch($conf->global->PRELEVEMENT_ID_BANKACCOUNT);
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("BankToReceiveWithdraw");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($acc->id > 0)
|
||||
print $acc->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("WithdrawalFile").'</td><td>';
|
||||
$relativepath = 'receipts/'.$bon->ref.'.xml';
|
||||
$relativepath = 'receipts/'.$object->ref.'.xml';
|
||||
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&modulepart=prelevement&file='.urlencode($relativepath).'">'.$relativepath.'</a>';
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
}
|
||||
@@ -109,7 +146,7 @@ if ($prev_id)
|
||||
$rej = new RejetPrelevement($db, $user);
|
||||
|
||||
/*
|
||||
* Liste des factures
|
||||
* List errors
|
||||
*/
|
||||
$sql = "SELECT pl.rowid, pl.amount, pl.statut";
|
||||
$sql.= " , s.rowid as socid, s.nom as name";
|
||||
@@ -127,12 +164,25 @@ $sql.= " AND pr.fk_prelevement_lignes = pl.rowid";
|
||||
if ($socid) $sql.= " AND s.rowid = ".$socid;
|
||||
$sql.= " ORDER BY pl.amount DESC";
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($limit+1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
print_barre_liste($langs->trans("Rejects"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
|
||||
|
||||
print"\n<!-- debut table -->\n";
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Line").'</td><td>'.$langs->trans("ThirdParty").'</td><td align="right">'.$langs->trans("Amount").'</td>';
|
||||
@@ -146,32 +196,32 @@ if ($resql)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid.'">';
|
||||
print img_picto('', 'statut'.$obj->statut).' ';
|
||||
print substr('000000'.$obj->rowid, -6);
|
||||
print '</a></td>';
|
||||
print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
|
||||
|
||||
|
||||
print '<td align="right">'.price($obj->amount)."</td>\n";
|
||||
print '<td>'.$rej->motifs[$obj->motif].'</td>';
|
||||
|
||||
|
||||
print '<td align="center">'.yn($obj->afacturer).'</td>';
|
||||
print '<td align="center">'.$obj->fk_facture.'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$total += $obj->amount;
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
print '<tr><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
print '<tr class="liste_total"><td> </td>';
|
||||
@@ -181,6 +231,8 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</table>\n";
|
||||
print '</div>';
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user