forked from Wavyzz/dolibarr
Compare commits
1079 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7041c3246e | ||
|
|
40229c9d96 | ||
|
|
f4ca6916cd | ||
|
|
3a99ef7319 | ||
|
|
3ae2d71ea6 | ||
|
|
91ae365588 | ||
|
|
6206519456 | ||
|
|
2e6cb2afaa | ||
|
|
dc9f8a349f | ||
|
|
80ef97e215 | ||
|
|
759427f6ac | ||
|
|
81bf7d07e3 | ||
|
|
72dd3705ed | ||
|
|
6a5af0511d | ||
|
|
e0c3cf8360 | ||
|
|
45d618cd7a | ||
|
|
ae7ba162f2 | ||
|
|
1a16dc1166 | ||
|
|
50b1a54dca | ||
|
|
d9a1c2b235 | ||
|
|
a7530b7eff | ||
|
|
0532598ecf | ||
|
|
410a3801da | ||
|
|
5259547b96 | ||
|
|
31897f54ac | ||
|
|
50a4d54d8a | ||
|
|
07caf22647 | ||
|
|
b62323939e | ||
|
|
70017da95a | ||
|
|
fb01f550f4 | ||
|
|
21b79d314a | ||
|
|
6e425d1895 | ||
|
|
3231e54abd | ||
|
|
bf7fcce1b2 | ||
|
|
11d737f23a | ||
|
|
c9445ee700 | ||
|
|
0855d84ccf | ||
|
|
91af1f8702 | ||
|
|
c0defe3965 | ||
|
|
1669d497b4 | ||
|
|
93365addd1 | ||
|
|
d4a7c0abc6 | ||
|
|
1b5cabad71 | ||
|
|
6cd24ab210 | ||
|
|
9a24007c0a | ||
|
|
524b186959 | ||
|
|
ffca289bff | ||
|
|
125796b0f5 | ||
|
|
c1f0826005 | ||
|
|
153e563c9f | ||
|
|
cd1322de79 | ||
|
|
ea87b2ddb6 | ||
|
|
eaf9a2402a | ||
|
|
4489db2a70 | ||
|
|
0b6c7d2d63 | ||
|
|
17a61b3232 | ||
|
|
26fbd6e2ec | ||
|
|
cb1489e2fa | ||
|
|
2f51221660 | ||
|
|
f671b8bce7 | ||
|
|
143cbba09b | ||
|
|
5dfc1c0897 | ||
|
|
5588fe5b81 | ||
|
|
957fae1081 | ||
|
|
11343e986c | ||
|
|
83d7750274 | ||
|
|
e5f54bd14c | ||
|
|
3ede626932 | ||
|
|
37cc5b7d35 | ||
|
|
f37c1b9287 | ||
|
|
75b94d373f | ||
|
|
1075ef8cf2 | ||
|
|
f7f20df323 | ||
|
|
d10b94e72b | ||
|
|
a1fe1bb58c | ||
|
|
032aa869e4 | ||
|
|
4c85068a85 | ||
|
|
b11403103b | ||
|
|
8664594fc8 | ||
|
|
775aa5ff91 | ||
|
|
89087c6847 | ||
|
|
57091f08b0 | ||
|
|
468af5380f | ||
|
|
46b39dd6a9 | ||
|
|
ae35c982af | ||
|
|
55718cc7da | ||
|
|
efeb7b0c22 | ||
|
|
21e2d36421 | ||
|
|
68945c7d51 | ||
|
|
681d626284 | ||
|
|
4bb45ad1c1 | ||
|
|
b33c366b02 | ||
|
|
abf529770d | ||
|
|
482a37a2c9 | ||
|
|
2da60fb885 | ||
|
|
84bff41543 | ||
|
|
6c2cad3d48 | ||
|
|
8711e51bce | ||
|
|
8375b47e74 | ||
|
|
a8bd8a2101 | ||
|
|
5ec8adb7f5 | ||
|
|
4f84a1614c | ||
|
|
3fb6978bc8 | ||
|
|
eab1e13343 | ||
|
|
885797b748 | ||
|
|
feaca165ad | ||
|
|
a524bbc5c6 | ||
|
|
36b44b1348 | ||
|
|
17647de4cc | ||
|
|
15cc21b89f | ||
|
|
ab781c32c7 | ||
|
|
49f72b6a9a | ||
|
|
5596b2e9bf | ||
|
|
520387c03d | ||
|
|
4022d5f529 | ||
|
|
233bd4374a | ||
|
|
d926657534 | ||
|
|
9a9fd15077 | ||
|
|
d2f1d0cc33 | ||
|
|
e96f84a3d6 | ||
|
|
0349f9bfaa | ||
|
|
2ae3d75df4 | ||
|
|
e3fb228a4d | ||
|
|
96b8da0d62 | ||
|
|
0ff2905180 | ||
|
|
22bb62d900 | ||
|
|
3db8218cba | ||
|
|
98f5bb2ed3 | ||
|
|
1bbf6737ec | ||
|
|
54b9681257 | ||
|
|
dada8c8ff5 | ||
|
|
acaf5cabef | ||
|
|
76dd9e42d2 | ||
|
|
526bd1d02e | ||
|
|
3037e4a157 | ||
|
|
aea5abd9a1 | ||
|
|
8f8aaf1e8c | ||
|
|
a2eefab696 | ||
|
|
bc9218dee3 | ||
|
|
b96ac794e9 | ||
|
|
786c114026 | ||
|
|
c9d240cb73 | ||
|
|
855aaaffd8 | ||
|
|
92259810c1 | ||
|
|
74dec41496 | ||
|
|
cefaeb583f | ||
|
|
85d46a5270 | ||
|
|
4ebf4780c2 | ||
|
|
1237a6d3e9 | ||
|
|
49e03b009f | ||
|
|
86e2ffe323 | ||
|
|
238894a7e4 | ||
|
|
a48e9fdba4 | ||
|
|
c1fa48889e | ||
|
|
6fdd0191f4 | ||
|
|
2f300ae63f | ||
|
|
f41d504ba1 | ||
|
|
2ad91213b2 | ||
|
|
ca2eba866c | ||
|
|
435b416f93 | ||
|
|
0ea7bf3b0b | ||
|
|
4e19a83f1b | ||
|
|
af6c482f26 | ||
|
|
f2a73eecf2 | ||
|
|
4c32aed2f4 | ||
|
|
c38b0c4dbe | ||
|
|
58d82eb477 | ||
|
|
ad7b8371da | ||
|
|
b017213131 | ||
|
|
c0b22e86c2 | ||
|
|
70f1a9d13d | ||
|
|
f456cc5e77 | ||
|
|
45d05da6ed | ||
|
|
c8b4265c12 | ||
|
|
2c2052d113 | ||
|
|
4ac086ab70 | ||
|
|
173d28cf5a | ||
|
|
d2ee00d4bb | ||
|
|
359318392f | ||
|
|
aa4c5ae839 | ||
|
|
53a8f1cd3b | ||
|
|
04b0216277 | ||
|
|
2dc4edb68c | ||
|
|
2142ccee8a | ||
|
|
43fbcf7081 | ||
|
|
1c129a78ae | ||
|
|
679a13e48c | ||
|
|
3318baa664 | ||
|
|
3d58e93a3c | ||
|
|
4997b5968f | ||
|
|
76b021d061 | ||
|
|
92ef0d75cf | ||
|
|
ccda5719cf | ||
|
|
8abebb091c | ||
|
|
24955088de | ||
|
|
e5d7a862b4 | ||
|
|
bd3f0da19c | ||
|
|
0ac995b37c | ||
|
|
51515a487e | ||
|
|
ec7ef265b7 | ||
|
|
9d0e0c2798 | ||
|
|
8e6a567b09 | ||
|
|
4624f1b1b8 | ||
|
|
29e4fce450 | ||
|
|
95cc9faf7e | ||
|
|
428efa9227 | ||
|
|
64739098ae | ||
|
|
da0c863f45 | ||
|
|
730a2a90ff | ||
|
|
4a19cba257 | ||
|
|
cdfeeafab9 | ||
|
|
72f78ecf3b | ||
|
|
4538d13add | ||
|
|
bd2c7092a4 | ||
|
|
62d677118d | ||
|
|
d773c74f09 | ||
|
|
bb3225809b | ||
|
|
75845a990f | ||
|
|
e366ab551c | ||
|
|
dee2a373c1 | ||
|
|
dbf7ae4c25 | ||
|
|
452dfafd32 | ||
|
|
bff2f33022 | ||
|
|
dbab955cbd | ||
|
|
f00271fee6 | ||
|
|
a08a0b4c1d | ||
|
|
cc17aff405 | ||
|
|
f7bed44441 | ||
|
|
2d6f5ca8ab | ||
|
|
14dea53700 | ||
|
|
caa937660d | ||
|
|
bfc7265cbc | ||
|
|
09ba059c21 | ||
|
|
4c2b27560d | ||
|
|
484b4371c1 | ||
|
|
5e46a359e0 | ||
|
|
0c4e5a6487 | ||
|
|
ae1c4e065b | ||
|
|
231395dab8 | ||
|
|
41e20a9d4f | ||
|
|
81ae4c52c5 | ||
|
|
104364ed02 | ||
|
|
8d9b92698d | ||
|
|
869159c09f | ||
|
|
96f46ec261 | ||
|
|
57e7df8acf | ||
|
|
9490929216 | ||
|
|
412940b5ca | ||
|
|
99892c13b0 | ||
|
|
3477cf6bd3 | ||
|
|
c6755b3cf1 | ||
|
|
80cfe86508 | ||
|
|
5ea1cf0775 | ||
|
|
9539bea68a | ||
|
|
39b696af02 | ||
|
|
b6df02e795 | ||
|
|
e75170137e | ||
|
|
f9b8622545 | ||
|
|
dd0f6b3829 | ||
|
|
30548d977f | ||
|
|
508fb5c9cb | ||
|
|
eca1a2cd64 | ||
|
|
b24f5fda68 | ||
|
|
b726939d32 | ||
|
|
9d1a02b0d7 | ||
|
|
9dbf41d6b2 | ||
|
|
4545c0f13a | ||
|
|
6f12cdf236 | ||
|
|
5dbc9ddae0 | ||
|
|
9a666b265f | ||
|
|
a78db45178 | ||
|
|
3e78807cbc | ||
|
|
d59097f65c | ||
|
|
94d3f038eb | ||
|
|
7785f3e3e2 | ||
|
|
15e1d3b456 | ||
|
|
624d17c96a | ||
|
|
1c51716997 | ||
|
|
84e1f92acd | ||
|
|
1cf786acff | ||
|
|
46139399ed | ||
|
|
a4017fa823 | ||
|
|
6f553db93d | ||
|
|
57c9104f1c | ||
|
|
5ab6c41dfa | ||
|
|
b868397902 | ||
|
|
623bd6ef7a | ||
|
|
077b9f1996 | ||
|
|
0e843c56d0 | ||
|
|
1ac55b0800 | ||
|
|
aaa61254ac | ||
|
|
191900d258 | ||
|
|
45ea1647d0 | ||
|
|
c1c3eb61f8 | ||
|
|
be9f63274f | ||
|
|
cb59c97ef7 | ||
|
|
55771bdb3d | ||
|
|
1d33b6ccbb | ||
|
|
d997309bcb | ||
|
|
688311c761 | ||
|
|
698222c769 | ||
|
|
476527e71e | ||
|
|
6becdc8af4 | ||
|
|
7e3bfd332e | ||
|
|
7df86cb630 | ||
|
|
346028c8d5 | ||
|
|
0d384eea00 | ||
|
|
f51b4288da | ||
|
|
6dd905048c | ||
|
|
adc4422323 | ||
|
|
05dc40b6b9 | ||
|
|
41a38b3a0a | ||
|
|
7c9d85d091 | ||
|
|
2a7b3c7d7d | ||
|
|
cf55b54cf5 | ||
|
|
1aa2b7a164 | ||
|
|
0d9367b09d | ||
|
|
a1f5ede736 | ||
|
|
47448b77f0 | ||
|
|
2c2f86736a | ||
|
|
1ee0d42408 | ||
|
|
6ca163c68b | ||
|
|
9a6c3ac3df | ||
|
|
68802c659e | ||
|
|
9d8b084115 | ||
|
|
8e3df45cbf | ||
|
|
f85389ac29 | ||
|
|
41743056bf | ||
|
|
087a4400b0 | ||
|
|
3d578cab28 | ||
|
|
fbb1b344d1 | ||
|
|
2c496d2ac0 | ||
|
|
e8424ebec3 | ||
|
|
74442911a7 | ||
|
|
709d173669 | ||
|
|
96967100ba | ||
|
|
7908550937 | ||
|
|
61fbfaf356 | ||
|
|
f3dd875fc7 | ||
|
|
4694af0488 | ||
|
|
3e358c90b3 | ||
|
|
15cc45b8ae | ||
|
|
66b2a82be6 | ||
|
|
1202bb3173 | ||
|
|
a39336c80d | ||
|
|
d8d47763aa | ||
|
|
3d8479291d | ||
|
|
bab501a1aa | ||
|
|
8645a7f524 | ||
|
|
cad95c7dc2 | ||
|
|
fc3da0f5be | ||
|
|
cf64053fa5 | ||
|
|
dc93cccbe1 | ||
|
|
63beb50465 | ||
|
|
730f5d1ad4 | ||
|
|
94ee18a20a | ||
|
|
8d39edf430 | ||
|
|
0646d4ab7a | ||
|
|
b76c45e8d0 | ||
|
|
f8b0e535fa | ||
|
|
2b088a73c1 | ||
|
|
74e75a7e2b | ||
|
|
bacd5110fb | ||
|
|
4b8be6ed64 | ||
|
|
850b939ffd | ||
|
|
fc3fcc5455 | ||
|
|
0f06e39d23 | ||
|
|
09ce84ca93 | ||
|
|
9b215e117a | ||
|
|
ed13f7b729 | ||
|
|
2978522006 | ||
|
|
707af49025 | ||
|
|
4b7f373802 | ||
|
|
fb8c3f01a4 | ||
|
|
4b6ae9d424 | ||
|
|
b8429c607e | ||
|
|
6851232314 | ||
|
|
f2318716ec | ||
|
|
31d032d5d3 | ||
|
|
2e6a41228f | ||
|
|
96144e18f1 | ||
|
|
7e2eca661b | ||
|
|
051853fc00 | ||
|
|
1aadcc50f1 | ||
|
|
af4405c669 | ||
|
|
d8b5cd4bdf | ||
|
|
efb88292dd | ||
|
|
003c463ee4 | ||
|
|
20d24f2feb | ||
|
|
2d05b7c790 | ||
|
|
9b844df315 | ||
|
|
6275355cd5 | ||
|
|
9558020ea3 | ||
|
|
cca3b4870a | ||
|
|
a61677dcc6 | ||
|
|
6ce0d3e279 | ||
|
|
6eb9013430 | ||
|
|
0f3a063c91 | ||
|
|
72b44a9a32 | ||
|
|
e069da69ba | ||
|
|
dbe5d285e8 | ||
|
|
8e08ea5c14 | ||
|
|
063e589a1b | ||
|
|
45115a9590 | ||
|
|
ea35e45f76 | ||
|
|
37daface19 | ||
|
|
539e2c55cd | ||
|
|
735d04bd2a | ||
|
|
dcb43214d6 | ||
|
|
7a3ab13196 | ||
|
|
603656c7de | ||
|
|
4413b2e886 | ||
|
|
6ad106d14a | ||
|
|
2e57a8be51 | ||
|
|
56923caeec | ||
|
|
22c34bd656 | ||
|
|
d1eed14488 | ||
|
|
4a61c1b6ed | ||
|
|
3da9650003 | ||
|
|
42d4cf9992 | ||
|
|
ff8f235b7e | ||
|
|
930312b425 | ||
|
|
9ed34e2b35 | ||
|
|
eaa7fe5d14 | ||
|
|
d2f0c87d8f | ||
|
|
550df138a6 | ||
|
|
531cfe791d | ||
|
|
e2727f6d91 | ||
|
|
5ce26bae1b | ||
|
|
f142238817 | ||
|
|
8e333c3feb | ||
|
|
d80baaea69 | ||
|
|
779d33cf02 | ||
|
|
b67ed87103 | ||
|
|
6d57c1b5f9 | ||
|
|
5061a9b0c2 | ||
|
|
347384734d | ||
|
|
602986ced8 | ||
|
|
7247b14bd9 | ||
|
|
135a94dfed | ||
|
|
8312d57d16 | ||
|
|
8fea6338e1 | ||
|
|
42c97cf7d5 | ||
|
|
07425e4e19 | ||
|
|
4b785b22f6 | ||
|
|
8ec2bac36a | ||
|
|
0668f90e14 | ||
|
|
5e2f3a53c9 | ||
|
|
cb9ada2119 | ||
|
|
a49a083629 | ||
|
|
e30bee50a2 | ||
|
|
13806124b2 | ||
|
|
474228cbd6 | ||
|
|
b41e0a40e7 | ||
|
|
642a86ba25 | ||
|
|
6236f727c9 | ||
|
|
c422904b99 | ||
|
|
18281d9d43 | ||
|
|
e4bc9f8f87 | ||
|
|
748dd12e4d | ||
|
|
3d09b05338 | ||
|
|
bbf3b3baac | ||
|
|
c320dcd161 | ||
|
|
589511f38c | ||
|
|
3ea69cb1f1 | ||
|
|
508cb459eb | ||
|
|
61322b9ce2 | ||
|
|
0ba5fda3da | ||
|
|
3b4ee295f3 | ||
|
|
8964ec7ea1 | ||
|
|
7d4553179d | ||
|
|
03a67cee99 | ||
|
|
305ab85f5d | ||
|
|
60610ca49d | ||
|
|
6104d16b08 | ||
|
|
1c04c2b5f4 | ||
|
|
163f67d600 | ||
|
|
2b5bf0e2dd | ||
|
|
cddb6e0c47 | ||
|
|
38059ed60d | ||
|
|
335327827d | ||
|
|
0270da7d8c | ||
|
|
6ab12b5911 | ||
|
|
ace14434e9 | ||
|
|
d1df592c7e | ||
|
|
859d6c4401 | ||
|
|
6d8f3aedc3 | ||
|
|
7a182c7880 | ||
|
|
e8a02a971d | ||
|
|
7585461486 | ||
|
|
5dcb3d2a1f | ||
|
|
d8ab614efb | ||
|
|
28902e18ee | ||
|
|
21f4d474b4 | ||
|
|
0373cad2cd | ||
|
|
c13cc5d697 | ||
|
|
2f61d29b06 | ||
|
|
9d6c95e8a9 | ||
|
|
d8537a3c76 | ||
|
|
b5c136bc32 | ||
|
|
653b99cb33 | ||
|
|
ecb6ea9151 | ||
|
|
fe4d8e36be | ||
|
|
322ce410d7 | ||
|
|
1d4c756783 | ||
|
|
084516b885 | ||
|
|
e8cac0df35 | ||
|
|
25ee999d27 | ||
|
|
20dbbaf5cc | ||
|
|
fb6aa01207 | ||
|
|
8191df4857 | ||
|
|
8535844737 | ||
|
|
1931fd33eb | ||
|
|
bd8856b988 | ||
|
|
7a3f088fcb | ||
|
|
77bc1c4313 | ||
|
|
fcb9b693cf | ||
|
|
1e50e0576b | ||
|
|
4bedeabc5b | ||
|
|
ecdfa5219b | ||
|
|
2d09008610 | ||
|
|
f85ab8d0a6 | ||
|
|
129034ba76 | ||
|
|
dc2f1e9812 | ||
|
|
30b1db34cd | ||
|
|
f2bbb54b8f | ||
|
|
f3228dc4f8 | ||
|
|
1b377c0c48 | ||
|
|
3ca45e0e40 | ||
|
|
85dd0ec2dd | ||
|
|
c6cf748ba7 | ||
|
|
500bb7bc96 | ||
|
|
f404cae546 | ||
|
|
66ea8bbe87 | ||
|
|
7f79bb1ffb | ||
|
|
5eb897e049 | ||
|
|
9447e66da1 | ||
|
|
7f0ede0c39 | ||
|
|
c492b3328b | ||
|
|
edc59b9290 | ||
|
|
24c499aa44 | ||
|
|
8eac45a762 | ||
|
|
3d85407619 | ||
|
|
ca1e3b4d55 | ||
|
|
94bb1ac511 | ||
|
|
5ec602cafa | ||
|
|
a12c0d9b53 | ||
|
|
8893d8d59f | ||
|
|
ee06f36f4c | ||
|
|
5d1d77a966 | ||
|
|
9bced281db | ||
|
|
d827601857 | ||
|
|
aad0b700d4 | ||
|
|
f889c9994b | ||
|
|
0d6709c9f7 | ||
|
|
8a89da25c6 | ||
|
|
400b48bd9b | ||
|
|
9012f6ecc5 | ||
|
|
1b8649be6f | ||
|
|
d6bd325f70 | ||
|
|
9a31a61c9d | ||
|
|
f919e6ddb0 | ||
|
|
76ac3bd457 | ||
|
|
be788e6167 | ||
|
|
e84e7f02c8 | ||
|
|
01baddb096 | ||
|
|
d1aabf9566 | ||
|
|
78778e4c58 | ||
|
|
588de2cc86 | ||
|
|
27dcf18637 | ||
|
|
e92a63ba73 | ||
|
|
98548337ae | ||
|
|
8bb1545ed0 | ||
|
|
670eed1e68 | ||
|
|
7c4dad2728 | ||
|
|
c55f83b0b7 | ||
|
|
70826c3191 | ||
|
|
05a679a10c | ||
|
|
abb6b41f91 | ||
|
|
9d780a1722 | ||
|
|
4f7be36249 | ||
|
|
d32fd9fda5 | ||
|
|
7e33af6677 | ||
|
|
52aa860008 | ||
|
|
f0305a7beb | ||
|
|
4c591daab1 | ||
|
|
56a70ab4e5 | ||
|
|
693cf72fca | ||
|
|
2900947019 | ||
|
|
e1e0001fda | ||
|
|
8b373fb7a3 | ||
|
|
98a3af620b | ||
|
|
02eaaaa53e | ||
|
|
d130e79384 | ||
|
|
63454c4e88 | ||
|
|
488ac8c8f0 | ||
|
|
c01113e28b | ||
|
|
d6b909a280 | ||
|
|
8ab53012b7 | ||
|
|
263e8ed4af | ||
|
|
29c0448a2e | ||
|
|
d1133916e0 | ||
|
|
1140735554 | ||
|
|
5b83026fcd | ||
|
|
4b402aa6d1 | ||
|
|
be8e48b265 | ||
|
|
07719eaf1e | ||
|
|
ca726e6c94 | ||
|
|
6c4a2728ca | ||
|
|
19134e82cb | ||
|
|
693570c48b | ||
|
|
c9ef298839 | ||
|
|
ea5b0f53d0 | ||
|
|
866729cd21 | ||
|
|
a183c7d131 | ||
|
|
46fd3bcaf8 | ||
|
|
064417dcf1 | ||
|
|
2fbc305683 | ||
|
|
b9078c6d58 | ||
|
|
ecdecfcbce | ||
|
|
2b526f7469 | ||
|
|
68804cf8a5 | ||
|
|
4dca94480e | ||
|
|
cb2a5baa45 | ||
|
|
2c8b7a4a3d | ||
|
|
afe61579e8 | ||
|
|
b0ef8680ff | ||
|
|
a231932972 | ||
|
|
38396e490a | ||
|
|
8ce035fc36 | ||
|
|
0127682996 | ||
|
|
ca6d15a3eb | ||
|
|
9bb1572e63 | ||
|
|
06bffeeca5 | ||
|
|
a8e6c3832e | ||
|
|
8911d72be8 | ||
|
|
7f1776c3a1 | ||
|
|
1e819ca7c1 | ||
|
|
ca47d1b8b1 | ||
|
|
8fbf5b1f33 | ||
|
|
0266db7aa8 | ||
|
|
d02fccd7e4 | ||
|
|
824757bca6 | ||
|
|
27d82d0e8e | ||
|
|
85b8c9f219 | ||
|
|
c83e67123d | ||
|
|
04f80f0925 | ||
|
|
553e984465 | ||
|
|
244c7f8dc3 | ||
|
|
6e3822345c | ||
|
|
b68b8fe412 | ||
|
|
46d3bec104 | ||
|
|
2fe4763570 | ||
|
|
fcd687642c | ||
|
|
4ec80b5136 | ||
|
|
a30091fd74 | ||
|
|
abb343d37e | ||
|
|
1b054f1b36 | ||
|
|
d800fe9256 | ||
|
|
d347cf3a85 | ||
|
|
f450e04856 | ||
|
|
7c81124e66 | ||
|
|
ed0393dfa8 | ||
|
|
35421d135a | ||
|
|
8a9b9f1736 | ||
|
|
16c35035c1 | ||
|
|
f44162715e | ||
|
|
30a2004d53 | ||
|
|
9972521456 | ||
|
|
7a14a1716d | ||
|
|
fccea99e23 | ||
|
|
036f70860e | ||
|
|
f0dc2df526 | ||
|
|
f8316abfc0 | ||
|
|
919c4fc5bc | ||
|
|
4060dd5377 | ||
|
|
52364f0fd9 | ||
|
|
2ba6f96765 | ||
|
|
6c3e1f6d26 | ||
|
|
e39e57c5b9 | ||
|
|
ddd267f4c3 | ||
|
|
acaaf53085 | ||
|
|
c8aa884462 | ||
|
|
b7d91c30d9 | ||
|
|
7bb5e7c31f | ||
|
|
bf46a35a31 | ||
|
|
cf28e4e442 | ||
|
|
beb906b5f1 | ||
|
|
749a1e6242 | ||
|
|
83e2951107 | ||
|
|
28c86a613d | ||
|
|
c4029f5e5f | ||
|
|
f322c73dd7 | ||
|
|
402bbbe839 | ||
|
|
33cd0e84d2 | ||
|
|
57ad200ae5 | ||
|
|
91745491ff | ||
|
|
5a1a5548df | ||
|
|
47abbd3eb2 | ||
|
|
36ae81c749 | ||
|
|
de4ead2558 | ||
|
|
6fde6e4250 | ||
|
|
5e650bcc1f | ||
|
|
aea7299970 | ||
|
|
ffde353441 | ||
|
|
bdae4e1c4d | ||
|
|
b462e7b217 | ||
|
|
33031450a3 | ||
|
|
d56c237d4e | ||
|
|
7cd8b36cea | ||
|
|
330824748b | ||
|
|
575038d3a3 | ||
|
|
605a7896cf | ||
|
|
08fa0deb24 | ||
|
|
72dd182b1f | ||
|
|
70366e9d91 | ||
|
|
35f9371343 | ||
|
|
dfe239bf8d | ||
|
|
06477b40a0 | ||
|
|
2684767b19 | ||
|
|
e29fb85cec | ||
|
|
aa6996e2d0 | ||
|
|
9afc53ca06 | ||
|
|
47d98ab69d | ||
|
|
4d6d3afbea | ||
|
|
af813f8214 | ||
|
|
c66823d72f | ||
|
|
aedc6fadf4 | ||
|
|
fabc11191d | ||
|
|
f9a66a34d0 | ||
|
|
995f54ca52 | ||
|
|
787658ac98 | ||
|
|
70a98743e8 | ||
|
|
1f1a614b47 | ||
|
|
e19453450d | ||
|
|
532e05c42e | ||
|
|
c15505bc13 | ||
|
|
76e6968a21 | ||
|
|
72381d3697 | ||
|
|
7b17b453bf | ||
|
|
23e4cd57f3 | ||
|
|
0f8ac57c85 | ||
|
|
e2748953c3 | ||
|
|
87f744896d | ||
|
|
b78932b9f7 | ||
|
|
d8edb1f6b8 | ||
|
|
83642ffa4d | ||
|
|
bd60fe6ffd | ||
|
|
bb606df5e0 | ||
|
|
067b29c9f8 | ||
|
|
9f27dd41e5 | ||
|
|
d4b02c0552 | ||
|
|
2d2b9a030c | ||
|
|
60a5444c14 | ||
|
|
afd9b4ea1a | ||
|
|
fd46ae13d6 | ||
|
|
a2aa491c51 | ||
|
|
1ab6cd4b59 | ||
|
|
8c843fdccd | ||
|
|
062d8a4bdb | ||
|
|
2fdc1a9883 | ||
|
|
817920f282 | ||
|
|
79420593f4 | ||
|
|
4b32c8e100 | ||
|
|
e6f179b6cb | ||
|
|
88ff7241f5 | ||
|
|
e1e1599a6d | ||
|
|
ced4038443 | ||
|
|
92686100b2 | ||
|
|
ee225a2b8b | ||
|
|
8fc4e2066f | ||
|
|
40f89d138f | ||
|
|
d75828567c | ||
|
|
b1289632e0 | ||
|
|
b73a2a24ef | ||
|
|
2539f0047f | ||
|
|
df0ec95b22 | ||
|
|
c3f07dd2e0 | ||
|
|
01c32525df | ||
|
|
84605bc59b | ||
|
|
dc498173c8 | ||
|
|
430f833222 | ||
|
|
b1c9d5e4d3 | ||
|
|
b4b82ce3d6 | ||
|
|
5af4b82503 | ||
|
|
bd8cf3d81e | ||
|
|
387d9d685a | ||
|
|
dd0cbabc91 | ||
|
|
9bea9edfd7 | ||
|
|
a2a53a32f1 | ||
|
|
073914572c | ||
|
|
f365a987c4 | ||
|
|
603c70ffc7 | ||
|
|
f3647c45e6 | ||
|
|
4d959bbea7 | ||
|
|
6a1610cdef | ||
|
|
67e7736eb2 | ||
|
|
923b561aff | ||
|
|
91038af84d | ||
|
|
c930218dd2 | ||
|
|
c26fe00362 | ||
|
|
021f9552dd | ||
|
|
0c7b7ed7f4 | ||
|
|
7be9b6d94e | ||
|
|
d776fc423e | ||
|
|
d4b6429ccd | ||
|
|
320ca3db67 | ||
|
|
476aab9bae | ||
|
|
a7d26409c7 | ||
|
|
fef40439be | ||
|
|
3e49935eac | ||
|
|
e165dce908 | ||
|
|
36b75031f5 | ||
|
|
5045bbc3bd | ||
|
|
835ca4e4a5 | ||
|
|
a97dafc1f2 | ||
|
|
4e84ed0e80 | ||
|
|
82651cd920 | ||
|
|
cba4676032 | ||
|
|
68c99d01a7 | ||
|
|
0e83863d45 | ||
|
|
f5966e6303 | ||
|
|
b20dc5678c | ||
|
|
8592b03b49 | ||
|
|
571bc86836 | ||
|
|
17e4af50ec | ||
|
|
ac86eac508 | ||
|
|
9fe5f242a7 | ||
|
|
13759ea146 | ||
|
|
3060647212 | ||
|
|
8690d65479 | ||
|
|
75b9140446 | ||
|
|
577192554d | ||
|
|
9e397206d3 | ||
|
|
1dd276b046 | ||
|
|
301f7349e0 | ||
|
|
bfaf25ca2a | ||
|
|
75c968b4ae | ||
|
|
7a94f4fc00 | ||
|
|
762abf7060 | ||
|
|
58d1ac427e | ||
|
|
d36dda37e6 | ||
|
|
c048f51562 | ||
|
|
e95921eb93 | ||
|
|
7f4f27ebfe | ||
|
|
292dab192b | ||
|
|
2acd69033c | ||
|
|
b8c88a2144 | ||
|
|
1b18781299 | ||
|
|
ef7ed97866 | ||
|
|
8ee7a48583 | ||
|
|
583ea05567 | ||
|
|
587766b39b | ||
|
|
b578913d2b | ||
|
|
e83149a344 | ||
|
|
d66b2322c2 | ||
|
|
d6a9da57e1 | ||
|
|
75b1cac33f | ||
|
|
14627abb27 | ||
|
|
c07ab81e6a | ||
|
|
06fe172669 | ||
|
|
8deb2eaa0c | ||
|
|
575c63f87d | ||
|
|
6e7fd15e1e | ||
|
|
291d477f65 | ||
|
|
7b86776f6b | ||
|
|
96c1814793 | ||
|
|
4c8664b297 | ||
|
|
fee46ac845 | ||
|
|
2d88b69cf6 | ||
|
|
bc5b794b1a | ||
|
|
ee8b5030a0 | ||
|
|
e3b1cb9fdb | ||
|
|
77341470e1 | ||
|
|
46363a7705 | ||
|
|
ff3f1e933a | ||
|
|
e72dc26532 | ||
|
|
2b8ccc0c81 | ||
|
|
af93fc7484 | ||
|
|
1bac3a0ccf | ||
|
|
92a3faeaf7 | ||
|
|
a9f7bdead6 | ||
|
|
e39e54503e | ||
|
|
515acbfee2 | ||
|
|
022f842cb0 | ||
|
|
791c373db5 | ||
|
|
d15c52db3b | ||
|
|
df64961c6b | ||
|
|
fc7c0ce521 | ||
|
|
b1380a6902 | ||
|
|
26d585ffbe | ||
|
|
57e359cd40 | ||
|
|
ceccd5a510 | ||
|
|
40bed96a01 | ||
|
|
dbb75e35a1 | ||
|
|
2dbb82fc76 | ||
|
|
12690666e2 | ||
|
|
969be3a2a7 | ||
|
|
39e9029e41 | ||
|
|
9ddc1770e8 | ||
|
|
1569770855 | ||
|
|
77dd516023 | ||
|
|
7b46bedce6 | ||
|
|
7a422c9d24 | ||
|
|
d6d58b1f68 | ||
|
|
1a7b38f22a | ||
|
|
a0bc26a923 | ||
|
|
37dcb33661 | ||
|
|
eb80c5c338 | ||
|
|
4ba057528f | ||
|
|
b421c29ea7 | ||
|
|
df395847d3 | ||
|
|
c55ebecff7 | ||
|
|
9fc08c45cf | ||
|
|
4597cd44e5 | ||
|
|
e0dfab4c71 | ||
|
|
75104999d3 | ||
|
|
55e3d97842 | ||
|
|
779d7e9689 | ||
|
|
824b572bd0 | ||
|
|
9b190d2cbc | ||
|
|
d62118dca8 | ||
|
|
dc7c27b162 | ||
|
|
02617bd799 | ||
|
|
2b67da3f34 | ||
|
|
d6bd0ed73e | ||
|
|
a6996169d6 | ||
|
|
1d43c6bc3a | ||
|
|
cdbb79a26c | ||
|
|
85180b117c | ||
|
|
c56b02c1c4 | ||
|
|
79b248fc67 | ||
|
|
014da6c22c | ||
|
|
58e82008ac | ||
|
|
99d214abd5 | ||
|
|
4580ed0b09 | ||
|
|
85bed00474 | ||
|
|
2d8eb034e3 | ||
|
|
1e36aba35f | ||
|
|
3fc3cc4688 | ||
|
|
f3ce7cb5a5 | ||
|
|
f3f18bf8cb | ||
|
|
055a0b2859 | ||
|
|
79b15b81f2 | ||
|
|
cc4fbfc3ef | ||
|
|
9c4f582f5c | ||
|
|
d06785e91a | ||
|
|
74a9c680df | ||
|
|
4151ca49eb | ||
|
|
a0bcf999c5 | ||
|
|
a6d4185d6b | ||
|
|
55e7989552 | ||
|
|
2c8064967b | ||
|
|
272944983c | ||
|
|
34b75828d3 | ||
|
|
ecfbe0a568 | ||
|
|
56b0a5f1ed | ||
|
|
16ed582124 | ||
|
|
5655856ca5 | ||
|
|
7838b75ec9 | ||
|
|
b68523b9c1 | ||
|
|
08453a5337 | ||
|
|
c5e30b61c0 | ||
|
|
3dca02d25b | ||
|
|
b7eeaa952c | ||
|
|
72f359fdc7 | ||
|
|
163bc55e4a | ||
|
|
fece67b629 | ||
|
|
23096354e0 | ||
|
|
58ba1c3496 | ||
|
|
e3a00c5dcd | ||
|
|
a57e82a300 | ||
|
|
0bf42085db | ||
|
|
88e76b6127 | ||
|
|
71e8d4c728 | ||
|
|
1ad8a3e190 | ||
|
|
b341cb9245 | ||
|
|
a3968b86df | ||
|
|
3662ebe3a3 | ||
|
|
eb242d58f2 | ||
|
|
77d7c97750 | ||
|
|
fd93a22dca | ||
|
|
48ae4de47b | ||
|
|
9cbba2dc7d | ||
|
|
50478b1bd4 | ||
|
|
729d03862f | ||
|
|
c42f39cc34 | ||
|
|
5bd2c01411 | ||
|
|
902bdf540e | ||
|
|
53da80a79f | ||
|
|
c94689e9a9 | ||
|
|
aad6a0871f | ||
|
|
7bea9f5ffb | ||
|
|
345c24990e | ||
|
|
40c79cb7cd | ||
|
|
2f2dff8155 | ||
|
|
7f3f0f3643 | ||
|
|
849b7154a7 | ||
|
|
d011204624 | ||
|
|
ccc415204e | ||
|
|
43ac51b44c | ||
|
|
8699866062 | ||
|
|
20fa294ff1 | ||
|
|
15aa99fc8e | ||
|
|
d8f77f040f | ||
|
|
9d8a4e463b | ||
|
|
bcfb5fc42e | ||
|
|
e2df3fd4ad | ||
|
|
7c5ceff569 | ||
|
|
0ef17fe581 | ||
|
|
ff05997f0a | ||
|
|
a5f4a74ecc | ||
|
|
9025fd5891 | ||
|
|
844333688b | ||
|
|
da4e902645 | ||
|
|
b25a0ca672 | ||
|
|
ed31eec5ee | ||
|
|
dfea391c88 | ||
|
|
e3339f5f95 | ||
|
|
0bd4bc39dd | ||
|
|
3650dc3ec9 | ||
|
|
f1cb13634b | ||
|
|
19431a94ba | ||
|
|
1882043f19 | ||
|
|
51901108ad | ||
|
|
49b568f73f | ||
|
|
f7d5172a74 | ||
|
|
ead2a764c7 | ||
|
|
57be6a752e | ||
|
|
2015268b7e | ||
|
|
e4afd4af00 | ||
|
|
aec0d4022b | ||
|
|
154e44e761 | ||
|
|
203c925c5b | ||
|
|
8c2eac4c93 | ||
|
|
9042d341f0 | ||
|
|
e7d2bcc34c | ||
|
|
f2ec94e9fd | ||
|
|
76703972ed | ||
|
|
37afd79ec0 | ||
|
|
9697bdf3b0 | ||
|
|
38c8d9d008 | ||
|
|
15b3fa73f4 | ||
|
|
6b3ccddb65 | ||
|
|
c59b0f95e6 | ||
|
|
847189805a | ||
|
|
252335318f | ||
|
|
4a7bec2c04 | ||
|
|
739c2822af | ||
|
|
cdc1e1fc76 | ||
|
|
db6f80e2ff | ||
|
|
94c05fbd84 | ||
|
|
6ce37e588d | ||
|
|
392f31abbd | ||
|
|
e285b42a18 | ||
|
|
3d50c454c1 | ||
|
|
47655f0725 | ||
|
|
d050c0654b | ||
|
|
6641a05744 | ||
|
|
1249e597d4 | ||
|
|
ec9eeb5201 | ||
|
|
6c4ecc025e | ||
|
|
0ee7befa19 | ||
|
|
09dfcc6016 | ||
|
|
59220c05e4 | ||
|
|
2cdae2ec98 | ||
|
|
72449ddef4 | ||
|
|
4d72573484 | ||
|
|
cbf12b779d | ||
|
|
7406d3c7ee | ||
|
|
bcbbcc1c66 | ||
|
|
e66847d5c3 | ||
|
|
dd8ef47a25 | ||
|
|
2f2b0630e2 | ||
|
|
26e3593c98 | ||
|
|
e61bcd03ed | ||
|
|
3295498e9e | ||
|
|
c88f5c560c | ||
|
|
04466651d6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,6 +12,7 @@ dolibarr_install.log
|
||||
upgrade.log
|
||||
doxygen_warnings.log
|
||||
/.project
|
||||
/.vscode
|
||||
.DS_Store
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
389
ChangeLog
389
ChangeLog
@@ -2,6 +2,272 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
|
||||
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
|
||||
FIX: #10381
|
||||
FIX: #10460 compatibility with MariaDB 10.4
|
||||
FIX: #11025
|
||||
FIX: Accountancy - Add transaction with multicompany use all the time 1st entity
|
||||
FIX: Accountancy - Format EBP import
|
||||
FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work
|
||||
FIX: actioncomm: sort events by date after external calendars and hook
|
||||
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
|
||||
FIX: add fk_unit on addline action
|
||||
FIX: avoid php warning
|
||||
FIX: bad sql request
|
||||
FIX: better method
|
||||
FIX: better test
|
||||
FIX: better test on fetch
|
||||
FIX: broken external authentication module feature and avoid warning
|
||||
FIX: Can not create contract with numbering module without autogen rule
|
||||
FIX: can't add lines on invoices
|
||||
FIX: Can't generate invoice pdf
|
||||
FIX: Can't insert if there is extrafields mandatory on another entity.
|
||||
FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar
|
||||
FIX: Check for old picture name if the new one was not found
|
||||
FIX: Civility not saved when creating a member.
|
||||
FIX: $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
|
||||
FIX: could not create several superadmin in transversal mode
|
||||
FIX: credit note can have negative value
|
||||
FIX: Default value on sales representative on third party creation
|
||||
FIX: Don't show journal:getNomUrl without data
|
||||
FIX: Erreur dans le Total
|
||||
FIX: error messages not displayed
|
||||
FIX: expedition: reset status on rollback + replace hardcoded status with const
|
||||
FIX: Fix PHP warning "count(): Parameter must be an array..."
|
||||
FIX: fk_default_warehouse missing in group by
|
||||
FIX: function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it
|
||||
FIX: holidays get natural_search if search params are set only
|
||||
FIX: if empty error message, we just see "error" displayed
|
||||
FIX: if(!method_exists(dol_loginfunction))
|
||||
FIX: If we build one invoice for several orders, we must put the ref of order on the line to not lose information.
|
||||
FIX: in fact expensereport must be in $check array
|
||||
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
|
||||
FIX: line edit template: keep fk_parent_line
|
||||
FIX: Loan impossible to account
|
||||
FIX: Mark credit note as available for credit note in other currency
|
||||
FIX: missing access security checking with multicompany
|
||||
FIX: missing entity filter and wrong var name
|
||||
FIX: missing entity filter in function "build_filterField()" (export)
|
||||
FIX: Missing field in import/export of users
|
||||
FIX: missing hook completeTabsHead in margins module
|
||||
FIX: missing $ismultientitymanaged for previous/next ref
|
||||
FIX: Missing province in export of invoice
|
||||
FIX: multicompany compatibility
|
||||
FIX: must fetch member in current entity
|
||||
FIX: need an order by in case we found other invoice with same number but not same date
|
||||
FIX: need to round with 2 decimals to avoid movements not correctly balanced
|
||||
FIX: no need to test anything to display documents tabs on expense report
|
||||
FIX: positive values creating diff on addline rounding
|
||||
FIX: problem with multicompany transverse mode
|
||||
FIX: Product accountancey sell intra code must be visible if main feature level 1
|
||||
FIX: project_title for display of getNomUrl()
|
||||
FIX: quick search for supplier orders
|
||||
FIX: Remane of project
|
||||
FIX: same thing here
|
||||
FIX: Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER
|
||||
FIX: several hooks in shipping/delivery cards
|
||||
FIX: shipping default warehouse if only one warehouse
|
||||
FIX: SQL injection on rowid of dict.php
|
||||
FIX: 'statut' is ignored when updating a user with the REST API.
|
||||
FIX: supplier invoice payment total dont care about deposit or credit
|
||||
FIX: supplier invoice product stats total ht is line total not invoice total
|
||||
FIX: The minimum amount filter does not work in the VAT report per customer
|
||||
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
|
||||
FIX: Update/delete currency on same languages
|
||||
FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9
|
||||
FIX: useless join
|
||||
FIX: we need to keep originline special_code
|
||||
FIX: we want to be able to reopen fourn credit note
|
||||
FIX: when 2 extra fields are mandatory in 2 different entities
|
||||
FIX: when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
||||
FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line)
|
||||
FIX: wrong redirect link on holiday refuse
|
||||
FIX: wrong test enabled
|
||||
FIX: Wrong variable name
|
||||
FIX: XSS
|
||||
|
||||
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
|
||||
FIX: #10030 better german chart
|
||||
FIX: #10036
|
||||
FIX: #10080 Supplier translations are in english
|
||||
FIX: #10183 using backport of fix done in 9.0
|
||||
FIX: #10218 Bad redirection after deleting a user or group
|
||||
FIX: #3234
|
||||
FIX: #6580
|
||||
FIX: #8741
|
||||
FIX: #9629 #9625
|
||||
FIX: #9971
|
||||
FIX: avoid Class 'AdherentType' not found
|
||||
FIX: Can relaunch install on v8
|
||||
FIX: Can't create a thirdparty from member if customer code is mandatory.
|
||||
FIX: Can't delete a line of minimal stock per warehouse
|
||||
FIX: check if "entity" is already defined in "$param"
|
||||
FIX: contact/address tab issue when changing company
|
||||
FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account
|
||||
FIX: CVE-2018-19799
|
||||
FIX: CVE-2018-19992
|
||||
FIX: CVE-2018-19993
|
||||
FIX: CVE-2018-19994
|
||||
FIX: CVE-2018-19995 and CVE-2018-19998
|
||||
FIX: Error reported when creation of thirdparty from member fails
|
||||
FIX: export only prices of the current entity !
|
||||
FIX: Extrafields on shipment module
|
||||
FIX: filter on product category doesn't work
|
||||
FIX: form actions: select_type_actions could be too small + bad $db init
|
||||
FIX: form actions: select_type_actions could be too small + bad init
|
||||
FIX: fourn payment modes musn't be available on customer docs
|
||||
FIX: Function updatePrice with wrong parameters
|
||||
FIX: hidden extrafield
|
||||
FIX: if qty is 0
|
||||
FIX: If we change customer/supplier rule we can't edit old thirdparty.
|
||||
FIX: lang not loaded
|
||||
FIX: Lines are not inserted correctly if VAT have code
|
||||
FIX: marge sign
|
||||
FIX: Method setValid not found
|
||||
FIX: Migration do not create not used table
|
||||
FIX: missing action "edit" for the hook
|
||||
FIX: missing field "visible"
|
||||
FIX: Missing last month on vat report per month
|
||||
FIX: mode is only customer in stats fichinter
|
||||
FIX: OppStatusShort doesn't exists
|
||||
FIX: Remote ip detection was wrong with proxy (example: cloudflare)
|
||||
FIX: Removed not use table
|
||||
FIX: Replenishment with option STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE
|
||||
FIX: responsive
|
||||
FIX: Same on customer card
|
||||
FIX: same on lines
|
||||
FIX: screen size fall
|
||||
FIX: Select first mail model by default
|
||||
FIX: slow SQL query on creating a new supplier invoice
|
||||
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
|
||||
FIX: supplier order list keep socid
|
||||
FIX: Same on customer card
|
||||
FIX: same on lines
|
||||
FIX: screen size fall
|
||||
FIX: Select first mail model by default
|
||||
FIX: slow SQL query on creating a new supplier invoice
|
||||
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
|
||||
FIX: supplier order list keep socid
|
||||
FIX: Vendor translations are in english
|
||||
FIX: Warning: count()
|
||||
FIX: We want to be able to send PDF of paid invoices
|
||||
|
||||
***** ChangeLog for 8.0.3 compared to 8.0.2 *****
|
||||
FIX: #9161
|
||||
FIX: #9432
|
||||
FIX: #9432 Assign yourself as a commercial when you don't have permission to see all thirds
|
||||
FIX: #9510
|
||||
FIX: #9567
|
||||
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
|
||||
FIX: Amount when using mutlicurrency on PDF
|
||||
FIX: Backup of database without mysqladmin available from cron.
|
||||
FIX: Bad label on delete button
|
||||
FIX: bad link in notification
|
||||
FIX: Bad position of hook formattachOptions call
|
||||
FIX: Can't create shipping if have shipping line's extrafields
|
||||
FIX: check !empty exclude select element
|
||||
FIX: content lost when editing a label with "
|
||||
FIX: correct migration of old postgresql unique key
|
||||
FIX: credit note progression
|
||||
FIX: default accounting accounts on loan creation #9643
|
||||
FIX: Delete of draft invoice
|
||||
FIX: deletion on draft is allowed if we are allwoed to create
|
||||
FIX: Do not show check box if not applicable
|
||||
FIX: exclude element of the select
|
||||
FIX: extrafields of taks not visible in creation
|
||||
FIX: filter on employee
|
||||
FIX: invoice stats: situation invoices were not counted
|
||||
FIX: keep external module element when adding resource
|
||||
FIX: langs fr
|
||||
FIX: Link template invoice to contract
|
||||
FIX: Look and feel v8. Missing button "Create category"
|
||||
FIX: Menu to show/edit Users categories was missing
|
||||
FIX: missing name alias field in societe import/export #9091
|
||||
FIX: missing symbol for indian rupies
|
||||
FIX: Missing transaction around action
|
||||
FIX: modify parenting before task deletion
|
||||
FIX: nb of session in title
|
||||
FIX: need to filter on current entity on replenish
|
||||
FIX: number mailing for a contact with multicompany
|
||||
FIX: Option for prof id mandatory not working with custom type of company
|
||||
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
|
||||
FIX: Pagination stats
|
||||
FIX: pdf typhon: order reference duplicate
|
||||
FIX: position 0 for emails templates
|
||||
FIX: previous situation invoice selection
|
||||
FIX: Product marge tabs on product card
|
||||
FIX: Product margin tab and credit note
|
||||
FIX: propal pdf: missing parenthesis for customs code
|
||||
FIX: properties on proposal must not be modified if error
|
||||
FIX: qty not visible for a lot when making shipment on a dedicated stock
|
||||
FIX: Quick hack to solve pb of bad definition of public holidays
|
||||
FIX: remain to pay for credit note was wrong on invoice list
|
||||
FIX: replenish wasn't caring about supplier price min quantity #9561
|
||||
FIX: Required extrafield value numeric should accept '0'
|
||||
FIX: ressource list with extrafields
|
||||
FIX: restore last seach criteria
|
||||
FIX: Selection of addmaindocfile is lost on error
|
||||
FIX: Sending of reminder for expired subscriptions
|
||||
FIX: shared link ko on proposals
|
||||
FIX: showOptionals: column mismatches
|
||||
FIX: situation invoice total with credit note
|
||||
FIX: situation invoice prev percent
|
||||
FIX: special code on create supplier invoice from supplier order
|
||||
FIX: Symbol of currency in substitution variables
|
||||
FIX: The max size for upload file was not corectly shown
|
||||
FIX: the member e-mail on resign and validation.
|
||||
FIX: thirdparty property of object not loaded when only one record
|
||||
FIX: title
|
||||
FIX: Title problem on admin RSS module
|
||||
FIX: Tooltip on invoice widget
|
||||
FIX: Total of timespent
|
||||
FIX: trackid into email sent from member module.
|
||||
FIX: translation in select unit form
|
||||
FIX: use discount with multicurrency
|
||||
FIX: Variable name
|
||||
FIX: When we delete a product, llx_product_association rows are not deleted
|
||||
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
|
||||
FIX: wrong function name
|
||||
FIX: wrong occurence number of contract on contact card, we must only count externals
|
||||
FIX: wrong value for module part and return access denied
|
||||
FIX: Wrong variable name
|
||||
FIX: XSS vulnerability reported by Mary Princy E
|
||||
|
||||
***** ChangeLog for 8.0.2 compared to 8.0.1 *****
|
||||
FIX: #8452
|
||||
FIX: #9043
|
||||
FIX: #9316 Error when listing invoices
|
||||
FIX: #9317
|
||||
FIX: #9353 Bug: html error - div inside span on graphs
|
||||
FIX: #9355
|
||||
FIX: #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES
|
||||
FIX: #9394
|
||||
FIX: #9396
|
||||
FIX: #9403
|
||||
FIX: #9412
|
||||
FIX: #9497
|
||||
FIX: Add paypal error message in alert email when online payment fails.
|
||||
FIX: better compatibility with multicompany
|
||||
FIX: capital must be empty and not 0 if undefined
|
||||
FIX: character making error on bill list
|
||||
FIX: Entering negative price on order.
|
||||
FIX: Expedition not showing extrafields on creation.
|
||||
FIX: Homepage links were using wrong topmenus
|
||||
FIX: inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES
|
||||
FIX: invert mime type and name.
|
||||
FIX: invoice popup hide localtax2 and 3 if not defined.
|
||||
FIX: Lose filter on payment type or category after a sort on invoice list.
|
||||
FIX: Maxi debug to allow to load chart of account with multicompany.
|
||||
FIX: Missing translation in predefined email to membership renewal.
|
||||
FIX: Mixing tickets of different thirdparties.
|
||||
FIX: "Other ..." link so the "Back to" link works.
|
||||
FIX: PDF address: handle when contact thirdparty is different from thirdparty of document
|
||||
FIX: Problems with permissions of module to record payment of salaries
|
||||
FIX: remove debug
|
||||
FIX: Several fixes on the management of minimal amount for orders
|
||||
FIX: wrong var name
|
||||
|
||||
***** ChangeLog for 8.0.1 compared to 8.0.0 *****
|
||||
FIX: #9258
|
||||
FIX: #9328
|
||||
@@ -51,7 +317,7 @@ NEW: Add a tab to specify accountant/auditor of the company
|
||||
NEW: Add Date delivery and Availability on Propals List
|
||||
NEW: Add date in goods reception supplier order table
|
||||
NEW: Add delivery_time_days of suppliers in export profile
|
||||
NEW: Add Docments'tab to expedition module
|
||||
NEW: Add Documents'tab to expedition module
|
||||
NEW: Use dol_print_phone in thirdparty list page to format phone
|
||||
NEW: Add entry for the GDPR contact
|
||||
NEW: Add extrafield type "html"
|
||||
@@ -221,8 +487,103 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* Remove method Categorie:get_nb_categories() that was not used.
|
||||
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
|
||||
are now replaced with hook getNomUrl.
|
||||
* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__
|
||||
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
|
||||
|
||||
|
||||
***** ChangeLog for 7.0.5 compared to 7.0.4 *****
|
||||
FIX: #3234
|
||||
FIX: #6580
|
||||
FIX: #8741
|
||||
FIX: #9934
|
||||
FIX: avoid Class 'AdherentType' not found
|
||||
FIX: Can't create a thirdparty from member if customer code is mandatory.
|
||||
FIX: Can't generate invoice pdf
|
||||
FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account
|
||||
FIX: Error generating ODT when option to use contact on doc on
|
||||
FIX: Error reported when creation of thirdparty from member fails
|
||||
FIX: filter on product category doesn't work
|
||||
FIX: form actions: select_type_actions could be too small + bad init
|
||||
FIX: fourn payment modes musn't be available on customer docs
|
||||
FIX: Function updatePrice with wrong parameters
|
||||
FIX: If we change customer/supplier rule we can't edit old thirdparty.
|
||||
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
|
||||
FIX: Lines are not inserted correctly if VAT have code
|
||||
FIX: OppStatusShort doesn't exists
|
||||
FIX: pdf typhon: order reference duplicate
|
||||
FIX: propal pdf: missing parenthesis for customs code
|
||||
FIX: Same on customer card
|
||||
FIX: same on lines
|
||||
FIX: Select first mail model by default
|
||||
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
|
||||
FIX: task time screen: last fix was overkill
|
||||
FIX: task time screen: prevent users with access to all project from assigning to tasks they're not allowed to do
|
||||
FIX: use discount with multicurrency
|
||||
FIX: Variable name
|
||||
FIX: We want to be able to send PDF of paid invoices
|
||||
FIX: When delete a product, llx_product_association rows are not deleted
|
||||
FIX: wrong occurence number of contract on contact card, we must only count externals
|
||||
|
||||
***** ChangeLog for 7.0.4 compared to 7.0.3 *****
|
||||
FIX: #8984 button create expense report
|
||||
FIX: #9032
|
||||
FIX: #9161
|
||||
FIX: #9328
|
||||
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
|
||||
FIX: Add calls to fetchComments function
|
||||
FIX: better compatibility with multicompany
|
||||
FIX: case when we valid form with keyboard
|
||||
FIX: character making error on bill list
|
||||
FIX: check !empty exclude select element
|
||||
FIX: combo into popup become crazy with IE10
|
||||
FIX: combo of stock in popup are crazy in IE
|
||||
FIX: Deletion of files in migration
|
||||
FIX: exclude element of the select
|
||||
FIX: extrafieldkey
|
||||
FIX: Fetch function will fetch comments
|
||||
FIX: Fetch task will now fetch comments
|
||||
FIX: filter supplier invoice list by societe name.
|
||||
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||
FIX: Force stripe api version to avoid trouble if we update stripe api
|
||||
FIX: getEntity project and not projet
|
||||
FIX: Get templates in a forced language
|
||||
FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281)
|
||||
FIX: Injection
|
||||
FIX: invoice stats: situation invoices were not counted
|
||||
FIX: keep context filter on contact list on change column displayed
|
||||
FIX: Keep same project when creating shipping from order
|
||||
FIX: langs fr
|
||||
FIX: Lose filter on payment type or category after a sort on invoice list
|
||||
FIX: Missing behavior
|
||||
FIX: missing hook to edit sql
|
||||
FIX: multicompany compatibility !
|
||||
FIX: need to filter on current entity on replenish
|
||||
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
|
||||
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
|
||||
FIX: Pagination on related item pages
|
||||
FIX: Pagination on withdraw request list
|
||||
FIX: PDF address: handle when contact thirdparty different from document thirdparty
|
||||
FIX: PHP warning, undefined index notnull
|
||||
FIX: Product marge tabs on product card
|
||||
FIX: Product margin tab and credit note
|
||||
FIX: propal: correctly preset project when creating with origin/originid
|
||||
FIX: remain to pay for credit note was wrong on invoice list
|
||||
FIX: remove debug
|
||||
FIX: Remove fetchComments from project and task fetch function
|
||||
FIX: remove rowid for multicompany compatibility
|
||||
FIX: Search on Ref project on order list
|
||||
FIX: search on ref project on propal list
|
||||
FIX: showOptionals: column mismatches
|
||||
FIX: SQL Injections reported by mu shcor (ADLab of Venustech)
|
||||
FIX: stock replenish with multientity
|
||||
FIX: table llx_chargessociales doesn't exists
|
||||
FIX: we must see number of all shared projects
|
||||
FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing
|
||||
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
|
||||
FIX: wrong function name
|
||||
FIX: Wrong position of firstname lastname
|
||||
FIX: wrong value for module part and return access denied
|
||||
FIX: Wrong variable and trigger name
|
||||
|
||||
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
|
||||
FIX: 7.0 task contact card without withproject parameters
|
||||
@@ -706,6 +1067,32 @@ Following changes may create regressions for some external modules, but were nec
|
||||
multicompany module to a version that support Dolibarr v7, everything should work as expected.
|
||||
|
||||
|
||||
***** ChangeLog for 6.0.8 compared to 6.0.7 *****
|
||||
FIX: #8762
|
||||
FIX: #9032
|
||||
FIX: case when we valid form with keyboard
|
||||
FIX: clause must not be there
|
||||
FIX: dol_delete_file must work in a context without db handler loaded
|
||||
FIX: entity test must be on product_fourn_price table and not product table
|
||||
FIX: Fetch shipping will now fetch project id
|
||||
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||
FIX: getEntity project and not projet
|
||||
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
|
||||
FIX: Keep supplier proposal price for supplier order
|
||||
FIX: langs fr
|
||||
FIX: missing filters during reordering
|
||||
FIX: need to filter on aa.entity for same accounting accounts available in several entities
|
||||
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
|
||||
FIX: PDF address: handle when contact thirdparty different from document thirdparty
|
||||
FIX: propal: correctly preset project when creating with origin/originid
|
||||
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
|
||||
FIX: remain to pay for credit note was wrong on invoice list
|
||||
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
|
||||
FIX: showOptionals: column mismatches
|
||||
FIX: sometimes amounts are identical but php find them different.
|
||||
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
|
||||
FIX: we must see number of all shared projects
|
||||
FIX: wrong var name
|
||||
|
||||
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
|
||||
FIX: #8023
|
||||
|
||||
@@ -523,10 +523,17 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
|
||||
|
||||
# Security to avoid to package data files
|
||||
print "Remove documents dir\n";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
||||
|
||||
print "Remove subdir of custom dir\n";
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
|
||||
|
||||
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
|
||||
@@ -592,13 +599,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||
|
||||
|
||||
print "Remove subdir of custom dir\n";
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
|
||||
BIN
dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf
Normal file
BIN
dev/resources/iso-normes/Accountancy-format_Ebp_txt.pdf
Normal file
Binary file not shown.
@@ -26,19 +26,19 @@
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
|
||||
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH">
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCatch">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH">
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedForeach">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF">
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE">
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElse">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSEIF">
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
@@ -63,9 +63,9 @@ if (! $sortorder) $sortorder = "ASC";
|
||||
$arrayfields=array(
|
||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
|
||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||
);
|
||||
|
||||
@@ -121,14 +121,35 @@ if (empty($reshook))
|
||||
if ($country_code)
|
||||
{
|
||||
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
||||
$result = run_sql($sqlfile, 1, 0, 1);
|
||||
|
||||
$offsetforchartofaccount = 0;
|
||||
// Get the comment line '-- ADD CCCNNNNN to rowid...' to find CCCNNNNN (CCC is country num, NNNNN is id of accounting account)
|
||||
// and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
|
||||
// This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used.
|
||||
$tmp = file_get_contents($sqlfile);
|
||||
if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg))
|
||||
{
|
||||
$offsetforchartofaccount += $reg[1];
|
||||
}
|
||||
$offsetforchartofaccount+=($conf->entity * 100000000);
|
||||
|
||||
$result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', $offsetforchartofaccount);
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
setEventMessages($langs->trans("ChartLoaded"), null);
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,23 @@ $page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder", 'alpha');
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
||||
|
||||
// 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 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
//if (! $sortfield) $sortfield="p.date_fin";
|
||||
//if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
if ($search_accountancy_code_start == - 1) {
|
||||
@@ -53,14 +68,6 @@ if ($search_accountancy_code_end == - 1) {
|
||||
$search_accountancy_code_end = '';
|
||||
}
|
||||
|
||||
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
|
||||
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
if (empty($page) || $page < 0) { $page = 0; }
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
@@ -96,26 +103,29 @@ if ($sortorder == "")
|
||||
if ($sortfield == "")
|
||||
$sortfield = "t.numero_compte";
|
||||
|
||||
$options = '';
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
|
||||
$filter = array ();
|
||||
if (! empty($search_date_start)) {
|
||||
$filter['t.doc_date>='] = $search_date_start;
|
||||
$options .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
$param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int');
|
||||
}
|
||||
if (! empty($search_date_end)) {
|
||||
$filter['t.doc_date<='] = $search_date_end;
|
||||
$options .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
$param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int');
|
||||
}
|
||||
if (! empty($search_accountancy_code_start)) {
|
||||
$filter['t.numero_compte>='] = $search_accountancy_code_start;
|
||||
$options .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
||||
$param .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
|
||||
}
|
||||
if (! empty($search_accountancy_code_end)) {
|
||||
$filter['t.numero_compte<='] = $search_accountancy_code_end;
|
||||
$options .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
|
||||
$param .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
@@ -134,14 +144,14 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
* View
|
||||
*/
|
||||
|
||||
if ($action == 'export_csv') {
|
||||
|
||||
if ($action == 'export_csv')
|
||||
{
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
|
||||
$filename = 'balance';
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
$result = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
|
||||
$result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@@ -187,7 +197,8 @@ else {
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0);
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@@ -225,12 +236,12 @@ else {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
$total_debit = 0;
|
||||
|
||||
@@ -651,8 +651,8 @@ if ($action == 'create')
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
$total_debit = price2num($total_debit);
|
||||
$total_credit = price2num($total_credit);
|
||||
$total_debit = price2num($total_debit, 'MT');
|
||||
$total_credit = price2num($total_credit, 'MT');
|
||||
|
||||
if ($total_debit != $total_credit)
|
||||
{
|
||||
|
||||
@@ -621,7 +621,6 @@ if ($num > 0)
|
||||
$object->id = $line->id;
|
||||
$object->piece_num = $line->piece_num;
|
||||
print $object->getNomUrl(1,'',0,'',1);
|
||||
//print '<a href="./card.php?piece_num=' . $line->piece_num . '&save_lastsearch_values=1">' . $line->piece_num . '</a>';
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -688,7 +689,7 @@ class AccountancyCategory // extends CommonObject
|
||||
* Return list of personalized groups that are active
|
||||
*
|
||||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @return array Array of groups
|
||||
* @return array|int Array of groups or -1 if error
|
||||
*/
|
||||
public function getCats($categorytype=-1)
|
||||
{
|
||||
@@ -743,9 +744,9 @@ class AccountancyCategory // extends CommonObject
|
||||
* Get all accounting account of a group.
|
||||
* You must choose between first parameter (personalized group) or the second (free criteria filter)
|
||||
*
|
||||
* @param int $cat_id Id if personalized accounting group/category
|
||||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||
* @return array Array of accounting accounts
|
||||
* @param int $cat_id Id if personalized accounting group/category
|
||||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||
* @return array|int Array of accounting accounts or -1 if error
|
||||
*/
|
||||
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
||||
{
|
||||
|
||||
@@ -517,14 +517,19 @@ class AccountancyExport
|
||||
print $line->id . $separator;
|
||||
print $date . $separator;
|
||||
print $line->code_journal . $separator;
|
||||
print length_accountg($line->numero_compte) . $separator;
|
||||
print substr(length_accountg($line->numero_compte),0,2) . $separator;
|
||||
|
||||
if (empty($line->subledger_account)) {
|
||||
print $line->numero_compte . $separator;
|
||||
} else {
|
||||
print $line->subledger_account . $separator;
|
||||
}
|
||||
//print substr(length_accountg($line->numero_compte),0,2) . $separator;
|
||||
print '"'.dol_trunc($line->label_operation,40,'right','UTF-8',1).'"' . $separator;
|
||||
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$separator;
|
||||
print price2num($line->montant).$separator;
|
||||
print $line->sens.$separator;
|
||||
print $date . $separator;
|
||||
print 'EUR';
|
||||
//print 'EUR';
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ class BookKeeping extends CommonObject
|
||||
|
||||
// First check if line not yet already in bookkeeping.
|
||||
// Note that we must include doc_type - fk_doc - numero_compte - label to be sure to have unicity of line (we may have several lines
|
||||
// with same doc_type, fk_odc, numero_compte for 1 invoice line when using localtaxes with same account)
|
||||
// with same doc_type, fk_doc, numero_compte for 1 invoice line when using localtaxes with same account)
|
||||
// WARNING: This is not reliable, label may have been modified. This is just a small protection.
|
||||
// The page to make journalization make the test on couple doc_type - fk_doc only.
|
||||
$sql = "SELECT count(*) as nb";
|
||||
@@ -986,16 +986,21 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($resql)
|
||||
{
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
while ( $obj = $this->db->fetch_object($resql) ) {
|
||||
$i = 0;
|
||||
while (($obj = $this->db->fetch_object($resql)) && ($i < min($limit, $num)))
|
||||
{
|
||||
$line = new BookKeepingLine();
|
||||
|
||||
$line->numero_compte = $obj->numero_compte;
|
||||
$line->debit = $obj->debit;
|
||||
$line->credit = $obj->credit;
|
||||
$this->lines[] = $line;
|
||||
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@@ -1612,11 +1617,11 @@ class BookKeeping extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'(doc_date, doc_type,';
|
||||
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
|
||||
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
|
||||
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
||||
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
|
||||
$sql .= 'SELECT doc_date, doc_type,';
|
||||
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
|
||||
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
|
||||
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
|
||||
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.$next_piecenum.'';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;
|
||||
|
||||
@@ -146,9 +146,12 @@ if ($conf->accounting->enabled)
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -369,6 +370,18 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
|
||||
//$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
|
||||
$sqlmid = 'SELECT pl.amount_capital, pl.amount_insurance, pl.amount_interest, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest';
|
||||
$sqlmid.= ' FROM '.MAIN_DB_PREFIX.'payment_loan as pl, '.MAIN_DB_PREFIX.'loan as l';
|
||||
$sqlmid.= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = '.$obj->rowid;
|
||||
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$tabtp[$obj->rowid][$objmid->accountancy_account_capital] -= $objmid->amount_capital;
|
||||
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
|
||||
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
|
||||
}
|
||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
|
||||
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
||||
@@ -858,7 +871,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
|
||||
// Test that setup is complete
|
||||
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
|
||||
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0';
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
|
||||
@@ -60,11 +60,15 @@ $now = dol_now();
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
$hookmanager->initHooks(array('sellsjournal'));
|
||||
$parameters=array();
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
// Get informations of journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch($id_journal);
|
||||
|
||||
@@ -428,7 +428,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
$typeid=GETPOST("typeid",'int');
|
||||
$civility_id=GETPOST("civility_id",'int');
|
||||
$civility_id=GETPOST("civility_id",'alpha');
|
||||
$lastname=GETPOST("lastname",'alpha');
|
||||
$firstname=GETPOST("firstname",'alpha');
|
||||
$societe=GETPOST("societe",'alpha');
|
||||
@@ -634,17 +634,27 @@ if (empty($reshook))
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
||||
if (empty($labeltouse) || (int) $labeltouse === -1) {
|
||||
//fallback on the old configuration.
|
||||
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||
$error++;
|
||||
}else{
|
||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
|
||||
|
||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
||||
|
||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, 2);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -705,18 +715,28 @@ if (empty($reshook))
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
|
||||
if (empty($labeltouse) || (int) $labeltouse === -1) {
|
||||
//fallback on the old configuration.
|
||||
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
|
||||
$error++;
|
||||
}else{
|
||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
|
||||
|
||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
|
||||
|
||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1);
|
||||
}
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -931,14 +951,14 @@ else
|
||||
|
||||
// Address
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alphanohtml')?GETPOST('address','alphanohtml'):$object->address).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
||||
print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
print $formcompany->select_ziptown((GETPOST('zipcode','alphanohtml')?GETPOST('zipcode','alphanohtml'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
||||
print ' ';
|
||||
print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print $formcompany->select_ziptown((GETPOST('town','alphanohtml')?GETPOST('town','alphanohtml'):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
|
||||
print '</td></tr>';
|
||||
|
||||
// Country
|
||||
|
||||
@@ -79,7 +79,6 @@ class Adherent extends CommonObject
|
||||
|
||||
var $datec;
|
||||
var $datem;
|
||||
var $datefin;
|
||||
var $datevalid;
|
||||
var $birth;
|
||||
|
||||
@@ -95,6 +94,8 @@ class Adherent extends CommonObject
|
||||
|
||||
var $fk_soc;
|
||||
|
||||
var $datefin; // From member table
|
||||
|
||||
// Fields loaded by fetch_subscriptions()
|
||||
var $first_subscription_date;
|
||||
var $first_subscription_amount;
|
||||
@@ -125,7 +126,7 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Function sending an email has the adherent with the text supplied in parameter.
|
||||
* Function sending an email to the current member with the text supplied in parameter.
|
||||
*
|
||||
* @param string $text Content of message (not html entities encoded)
|
||||
* @param string $subject Subject of message
|
||||
@@ -137,9 +138,10 @@ class Adherent extends CommonObject
|
||||
* @param int $deliveryreceipt Ask a delivery receipt
|
||||
* @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
|
||||
* @param string $errors_to erros to
|
||||
* @param string $moreinheader Add more html headers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
|
||||
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='', $moreinheader='')
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@@ -160,9 +162,11 @@ class Adherent extends CommonObject
|
||||
$from=$conf->email_from;
|
||||
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
|
||||
|
||||
$trackid = 'mem'.$this->id;
|
||||
|
||||
// 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);
|
||||
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml, '', '', $trackid, $moreinheader);
|
||||
if ($mailfile->sendfile())
|
||||
{
|
||||
return 1;
|
||||
@@ -215,7 +219,9 @@ class Adherent extends CommonObject
|
||||
|
||||
// Substitutions
|
||||
$substitutionarray=array(
|
||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||
'__ID__'=>$this->id,
|
||||
'__MEMBER_ID__'=>$this->id,
|
||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||
@@ -572,7 +578,7 @@ class Adherent extends CommonObject
|
||||
$lthirdparty=new Societe($this->db);
|
||||
$result=$lthirdparty->fetch($this->fk_soc);
|
||||
|
||||
if ($result >= 0)
|
||||
if ($result > 0)
|
||||
{
|
||||
$lthirdparty->address=$this->address;
|
||||
$lthirdparty->zip=$this->zip;
|
||||
@@ -582,18 +588,19 @@ class Adherent extends CommonObject
|
||||
$lthirdparty->phone=$this->phone;
|
||||
$lthirdparty->state_id=$this->state_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
$lthirdparty->country_id=$this->country_id;
|
||||
//$lthirdparty->phone_mobile=$this->phone_mobile;
|
||||
|
||||
$result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates
|
||||
$result=$lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$lthirdparty->error;
|
||||
$this->errors=$lthirdparty->errors;
|
||||
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
elseif ($result < 0)
|
||||
{
|
||||
$this->error=$lthirdparty->error;
|
||||
$error++;
|
||||
@@ -682,7 +689,6 @@ class Adherent extends CommonObject
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1185,11 +1191,9 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Fonction qui recupere pour un adherent les parametres
|
||||
* first_subscription_date
|
||||
* first_subscription_amount
|
||||
* last_subscription_date
|
||||
* last_subscription_amount
|
||||
* Function to get member subscriptions data
|
||||
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
|
||||
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
|
||||
*
|
||||
* @return int <0 si KO, >0 si OK
|
||||
*/
|
||||
@@ -1219,10 +1223,14 @@ class Adherent extends CommonObject
|
||||
{
|
||||
if ($i==0)
|
||||
{
|
||||
$this->first_subscription_date=$obj->dateh;
|
||||
$this->first_subscription_date=$this->db->jdate($obj->datec);
|
||||
$this->first_subscription_date_start=$this->db->jdate($obj->dateh);
|
||||
$this->first_subscription_date_end=$this->db->jdate($obj->datef);
|
||||
$this->first_subscription_amount=$obj->subscription;
|
||||
}
|
||||
$this->last_subscription_date=$obj->dateh;
|
||||
$this->last_subscription_date=$this->db->jdate($obj->datec);
|
||||
$this->last_subscription_date_start=$this->db->jdate($obj->datef);
|
||||
$this->last_subscription_date_end=$this->db->jdate($obj->datef);
|
||||
$this->last_subscription_amount=$obj->subscription;
|
||||
|
||||
$subscription=new Subscription($this->db);
|
||||
@@ -1307,9 +1315,9 @@ class Adherent extends CommonObject
|
||||
{
|
||||
// Change properties of object (used by triggers)
|
||||
$this->last_subscription_date=dol_now();
|
||||
$this->last_subscription_amount=$amount;
|
||||
$this->last_subscription_date_start=$date;
|
||||
$this->last_subscription_date_end=$datefin;
|
||||
$this->last_subscription_amount=$amount;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -2238,8 +2246,13 @@ class Adherent extends CommonObject
|
||||
$this->need_subscription=0;
|
||||
|
||||
$this->first_subscription_date=time();
|
||||
$this->first_subscription_date_start=$this->first_subscription_date;
|
||||
$this->first_subscription_date_end=dol_time_plus_duree($this->first_subscription_date_start, 1, 'y');
|
||||
$this->first_subscription_amount=10;
|
||||
$this->last_subscription_date=time();
|
||||
|
||||
$this->last_subscription_date=$this->first_subscription_date;
|
||||
$this->last_subscription_date_start=$this->first_subscription_date;
|
||||
$this->last_subscription_date_end=dol_time_plus_duree($this->last_subscription_date_start, 1, 'y');
|
||||
$this->last_subscription_amount=10;
|
||||
}
|
||||
|
||||
@@ -2539,10 +2552,10 @@ class Adherent extends CommonObject
|
||||
* Send reminders by emails before subscription end
|
||||
* CAN BE A CRON TASK
|
||||
*
|
||||
* @param int $daysbeforeend Nb of days before end of subscription (negative number = after subscription)
|
||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||
* @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
|
||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function sendReminderForExpiredSubscription($daysbeforeend=10)
|
||||
public function sendReminderForExpiredSubscription($daysbeforeendlist='10')
|
||||
{
|
||||
global $conf, $langs, $mysoc, $user;
|
||||
|
||||
@@ -2560,92 +2573,110 @@ class Adherent extends CommonObject
|
||||
}*/
|
||||
|
||||
$now = dol_now();
|
||||
$nbok = 0;
|
||||
$nbko = 0;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$tmp=dol_getdate($now);
|
||||
$datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']), -1 * $daysbeforeend, 'd');
|
||||
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent';
|
||||
$sql.= " WHERE datefin = '".$this->db->idate($datetosearchfor)."'";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
$arraydaysbeforeend=explode(';',$daysbeforeendlist);
|
||||
foreach($arraydaysbeforeend as $daysbeforeend) // Loop on each delay
|
||||
{
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
dol_syslog(__METHOD__.' - Process delta = '.$daysbeforeend, LOG_DEBUG);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$adherent = new Adherent($this->db);
|
||||
$formmail = new FormMail($this->db);
|
||||
|
||||
$i=0;
|
||||
$nbok = 0;
|
||||
$nbko = 0;
|
||||
while ($i < $num_rows)
|
||||
if (! is_numeric($daysbeforeend))
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$blockingerrormsg="Value for delta is not a positive or negative numeric";
|
||||
$nbko++;
|
||||
break;
|
||||
}
|
||||
|
||||
$adherent->fetch($obj->rowid);
|
||||
$tmp=dol_getdate($now);
|
||||
$datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']), $daysbeforeend, 'd');
|
||||
|
||||
if (empty($adherent->email))
|
||||
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent';
|
||||
$sql.= " WHERE datefin = '".$this->db->idate($datetosearchfor)."'";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$adherent = new Adherent($this->db);
|
||||
$formmail = new FormMail($this->db);
|
||||
|
||||
$i=0;
|
||||
while ($i < $num_rows)
|
||||
{
|
||||
$nbko++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$adherent->fetch_thirdparty();
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
// Send reminder email
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
$adherent->fetch($obj->rowid, '', '', '', true, true);
|
||||
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
|
||||
|
||||
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
||||
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
|
||||
if (empty($adherent->email))
|
||||
{
|
||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent);
|
||||
//if (is_array($adherent->thirdparty)) $substitutionarraycomp = ...
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $adherent);
|
||||
|
||||
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
|
||||
$msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
|
||||
$from = $conf->global->ADHERENT_MAIL_FROM;
|
||||
$to = $adherent->email;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1);
|
||||
$result = $cmail->sendfile();
|
||||
if (! $result)
|
||||
{
|
||||
$error++;
|
||||
$this->error = $cmail->error;
|
||||
$this->errors += $cmail->errors;
|
||||
$nbko++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nbok++;
|
||||
}
|
||||
$nbko++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding";
|
||||
$nbko++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$adherent->fetch_thirdparty();
|
||||
|
||||
$i++;
|
||||
// Send reminder email
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
|
||||
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
|
||||
|
||||
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
|
||||
|
||||
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
|
||||
{
|
||||
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent);
|
||||
//if (is_array($adherent->thirdparty)) $substitutionarraycomp = ...
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $adherent);
|
||||
|
||||
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
|
||||
$msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
|
||||
$from = $conf->global->ADHERENT_MAIL_FROM;
|
||||
$to = $adherent->email;
|
||||
|
||||
$trackid = 'mem'.$adherent->id;
|
||||
$moreinheader='X-Dolibarr-Info: sendReminderForExpiredSubscription'."\r\n";
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
$cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1, '', '', $trackid, $moreinheader);
|
||||
$result = $cmail->sendfile();
|
||||
if (! $result)
|
||||
{
|
||||
$error++;
|
||||
$this->error = $cmail->error;
|
||||
$this->errors += $cmail->errors;
|
||||
$nbko++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$nbok++;
|
||||
|
||||
// TODO Add event email sent for member
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding";
|
||||
$nbko++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = $this->db->lasterror();
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = $this->db->lasterror();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($blockingerrormsg)
|
||||
|
||||
@@ -120,7 +120,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
||||
{
|
||||
// Creation of thirdparty
|
||||
$company = new Societe($db);
|
||||
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'));
|
||||
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'), GETPOST('customercode', 'alpha'));
|
||||
|
||||
if ($result < 0)
|
||||
{
|
||||
@@ -347,7 +347,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
if (! $error)
|
||||
{
|
||||
// Send confirmation Email
|
||||
if ($object->email && $sendalsoemail)
|
||||
if ($object->email && $sendalsoemail) // $object is 'Adherent'
|
||||
{
|
||||
$subject = '';
|
||||
$msg= '';
|
||||
@@ -359,7 +359,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content fro mtemplae
|
||||
// Get email content from templae
|
||||
$arraydefaultmessage=null;
|
||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
|
||||
|
||||
@@ -392,7 +392,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
||||
$listofmimes=array(dol_mimetype($file));
|
||||
}
|
||||
|
||||
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1);
|
||||
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n";
|
||||
|
||||
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1, '', $moreinheader);
|
||||
if ($result < 0)
|
||||
{
|
||||
$errmsg=$object->error;
|
||||
@@ -852,6 +854,23 @@ if ($rowid > 0)
|
||||
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
|
||||
array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
|
||||
);
|
||||
// If customer code was forced to "required", we ask it at creation to avoid error later
|
||||
if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED))
|
||||
{
|
||||
$tmpcompany = new Societe($db);
|
||||
$tmpcompany->name=$companyname;
|
||||
$tmpcompany->get_codeclient($tmpcompany, 0);
|
||||
$customercode = $tmpcompany->code_client;
|
||||
$formquestion[]=array(
|
||||
'label' => $langs->trans("CustomerCode"),
|
||||
'type' => 'text',
|
||||
'name' => 'customercode',
|
||||
'value' => $customercode,
|
||||
'morecss' => 'minwidth300',
|
||||
'moreattr' => 'maxlength="128"',
|
||||
);
|
||||
}
|
||||
// @TODO Add other extrafields mandatory for thirdparty creation
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ $search_account=GETPOST('search_account','int');
|
||||
$search_amount=GETPOST('search_amount','alpha');
|
||||
$optioncss = GETPOST('optioncss','alpha');
|
||||
|
||||
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
|
||||
$date_select=GETPOST("date_select",'alpha');
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
@@ -126,7 +126,8 @@ $sql.= " WHERE d.rowid = c.fk_adherent";
|
||||
$sql.= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if (isset($date_select) && $date_select != '')
|
||||
{
|
||||
$sql.= " AND c.dateadh LIKE '".$date_select."%'";
|
||||
$sql.= " AND c.dateadh >= '".$date_select."-01-01 00:00:00'";
|
||||
$sql.= " AND c.dateadh < '".($date_select+1)."-01-01 00:00:00'";
|
||||
}
|
||||
if ($search_ref)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ $backtopage = GETPOST('backtopage','alpha');
|
||||
$search_lastname = GETPOST('search_lastname','alpha');
|
||||
$search_login = GETPOST('search_login','alpha');
|
||||
$search_email = GETPOST('search_email','alpha');
|
||||
$type = GETPOST('type','alpha');
|
||||
$type = GETPOST('type','intcomma');
|
||||
$status = GETPOST('status','alpha');
|
||||
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
@@ -59,8 +59,8 @@ if (! $sortfield) { $sortfield="d.lastname"; }
|
||||
$label=GETPOST("label","alpha");
|
||||
$subscription=GETPOST("subscription","int");
|
||||
$vote=GETPOST("vote","int");
|
||||
$comment=GETPOST("comment");
|
||||
$mail_valid=GETPOST("mail_valid");
|
||||
$comment=GETPOST("comment",'alphanohtml');
|
||||
$mail_valid=GETPOST("mail_valid",'none');
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
|
||||
|
||||
@@ -191,7 +191,7 @@ print '</tr>'."\n";
|
||||
|
||||
|
||||
// AGENDA REMINDER EMAIL
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL == 2)
|
||||
{
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n";
|
||||
@@ -208,7 +208,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
}
|
||||
|
||||
// AGENDA REMINDER BROWSER
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL == 2)
|
||||
{
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";
|
||||
|
||||
@@ -71,18 +71,8 @@ else if ($action == 'update')
|
||||
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
|
||||
$coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
|
||||
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
|
||||
}
|
||||
else if ($action == 'updateengine')
|
||||
{
|
||||
// TODO Update engines.
|
||||
|
||||
}
|
||||
|
||||
if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
|
||||
{
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
|
||||
if ($res > 0)
|
||||
{
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
@@ -91,6 +81,42 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
else if ($action == 'updateengine')
|
||||
{
|
||||
$sql = "SELECT rowid, coder";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sql.= " WHERE entity = ".$conf->entity;
|
||||
$sql.= " ORDER BY code";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
if (GETPOST('coder'.$obj->rowid, 'alpha'))
|
||||
{
|
||||
$coder = GETPOST('coder'.$obj->rowid,'alpha');
|
||||
$code_id = $obj->rowid;
|
||||
|
||||
$sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
|
||||
$sqlp.= " SET coder = '" . $coder."'";
|
||||
$sqlp.= " WHERE rowid = ". $code_id;
|
||||
$sqlp.= " AND entity = ".$conf->entity;
|
||||
|
||||
$upsql=$db->query($sqlp);
|
||||
if (! $upsql) dol_print_error($db);
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -162,9 +188,12 @@ foreach($dirbarcode as $reldir)
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
|
||||
|
||||
//print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||
//print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
//print "<input type=\"hidden\" name=\"action\" value=\"updateengine\">";
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updateengine">';
|
||||
}
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -259,10 +288,9 @@ print "</table>\n";
|
||||
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
// TODO Implement code behind action updateengine
|
||||
//print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"></div>';
|
||||
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"></div>';
|
||||
print '</form>';
|
||||
}
|
||||
//print '</form>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
|
||||
@@ -327,20 +327,20 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// 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: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
|
||||
|
||||
// Addresse
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS: GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml')) . '</textarea></td></tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP: GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha')) . '"></td></tr>'."\n";
|
||||
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha')) . '"></td></tr>'."\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN: GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml')) . '"></td></tr>'."\n";
|
||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml')) . '"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
|
||||
@@ -362,29 +362,29 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
|
||||
|
||||
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 '<input name="tel" id="phone" value="'. dol_escape_htmltag($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 '<input name="fax" id="fax" value="'. dol_escape_htmltag($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 '<input name="mail" id="email" class="minwidth200" value="'. dol_escape_htmltag($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 '<input name="web" id="web" class="minwidth300" value="'. dol_escape_htmltag($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 '<input name="barcode" id="barcode" class="minwidth150" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD) . '"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -423,19 +423,19 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
// 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>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MANAGERS) . '"></td></tr>';
|
||||
|
||||
// GDPR contact
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . $conf->global->MAIN_INFO_GDPR . '"></td></tr>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_GDPR) . '"></td></tr>';
|
||||
|
||||
// Capital
|
||||
|
||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||
print '<input name="capital" id="capital" class="minwidth100" value="' . $conf->global->MAIN_INFO_CAPITAL . '"></td></tr>';
|
||||
print '<input name="capital" id="capital" class="minwidth100" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_CAPITAL) . '"></td></tr>';
|
||||
|
||||
// Juridical Status
|
||||
|
||||
@@ -454,7 +454,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="siren" id="profid1" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
|
||||
print '<input name="siren" id="profid1" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -470,7 +470,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="siret" id="profid2" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
|
||||
print '<input name="siret" id="profid2" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -486,7 +486,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="ape" id="profid3" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
|
||||
print '<input name="ape" id="profid3" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -502,7 +502,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="rcs" id="profid4" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
|
||||
print '<input name="rcs" id="profid4" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -518,7 +518,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
|
||||
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -534,7 +534,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
||||
print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</label></td><td>';
|
||||
if (! empty($mysoc->country_code))
|
||||
{
|
||||
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
|
||||
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -546,7 +546,7 @@ 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 '<input name="tva" id="intra_vat" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Object of the company
|
||||
|
||||
@@ -376,6 +376,11 @@ if ($result)
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||
{
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
// Actions
|
||||
print '<td align="center">';
|
||||
if ($action != 'edit' || GETPOST('rowid') != $obj->rowid)
|
||||
|
||||
@@ -618,7 +618,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
||||
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
|
||||
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory
|
||||
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
||||
)
|
||||
)
|
||||
@@ -794,7 +794,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||
$i++;
|
||||
}
|
||||
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
|
||||
$sql.= " WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
|
||||
if (in_array('entity', $listfieldmodify)) $sql.= " AND entity = '".getEntity($tabname[$id])."'";
|
||||
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
@@ -818,7 +818,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
$sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
$sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
|
||||
dol_syslog("delete", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -842,7 +842,7 @@ if ($action == $acts[0])
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
}
|
||||
elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
@@ -862,7 +862,7 @@ if ($action == $acts[1])
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
}
|
||||
elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
@@ -882,7 +882,7 @@ if ($action == 'activate_favorite')
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
}
|
||||
elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
@@ -902,7 +902,7 @@ if ($action == 'disable_favorite')
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
}
|
||||
elseif ($code) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
|
||||
@@ -967,7 +967,7 @@ if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.$rowid.'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
|
||||
}
|
||||
//var_dump($elementList);
|
||||
|
||||
@@ -1367,8 +1367,8 @@ if ($id)
|
||||
|
||||
print '<td colspan="3" align="center">';
|
||||
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="hidden" name="page" value="'.dol_escape_htmltag($page).'">';
|
||||
print '<input type="hidden" name="rowid" value="'.dol_escape_htmltag($rowid).'">';
|
||||
if (! is_null($withentity))
|
||||
print '<input type="hidden" name="entity" value="'.$withentity.'">';
|
||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
@@ -1622,14 +1622,14 @@ if ($id)
|
||||
if ($id == 4)
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
|
||||
if ($iserasable) print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
|
||||
else print $langs->trans("AlwaysActive");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
if ($canbedisabled) print '<a class="reposition" href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
else
|
||||
{
|
||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
|
||||
|
||||
@@ -242,10 +242,10 @@ if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
preg_match('/^([0-9]+)/i',$obj->note,$reg);
|
||||
preg_match('/^([0-9]+)/i',$obj->note,$reg);
|
||||
$idrss = $reg[1];
|
||||
$keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss;
|
||||
$keyrsstitle="EXTERNAL_RSS_URLRSS_".$idrss;
|
||||
$keyrsstitle="EXTERNAL_RSS_TITLE_".$idrss;
|
||||
$keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss;
|
||||
//print "x".$idrss;
|
||||
|
||||
$rssparser=new RssParser($db);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php';
|
||||
|
||||
// Security check
|
||||
@@ -150,6 +151,25 @@ if ($geoip)
|
||||
if ($result) print $result;
|
||||
else print $langs->trans("Error");
|
||||
*/
|
||||
//var_dump($_SERVER);
|
||||
$ip = getUserRemoteIP();
|
||||
//$ip='91.161.249.43';
|
||||
$isip=is_ip($ip);
|
||||
if ($isip == 1)
|
||||
{
|
||||
print '<br>'.$ip.' -> ';
|
||||
$result=dol_print_ip($ip,1);
|
||||
if ($result) print $result;
|
||||
else print $langs->trans("Error");
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br>'.$ip.' -> ';
|
||||
$result=dol_print_ip($ip,1);
|
||||
if ($result) print $result;
|
||||
else print $langs->trans("NotAPublicIp");
|
||||
}
|
||||
|
||||
$geoip->close();
|
||||
}
|
||||
|
||||
|
||||
@@ -319,10 +319,11 @@ if (empty($reshook))
|
||||
if ($i) $sql.=",";
|
||||
$sql.= $field."=";
|
||||
|
||||
// print $keycode.' - '.$_POST[$keycode].'<br>';
|
||||
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
|
||||
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
|
||||
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
|
||||
//print $keycode.' - '.$_POST[$keycode].'<br>';
|
||||
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
|
||||
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
|
||||
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
|
||||
elseif ($keycode == 'position') $sql.=((int) $_POST[$keycode]);
|
||||
else $sql.="'".$db->escape($_POST[$keycode])."'";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ $langs->loadLangs(array("errors","admin","modulebuilder"));
|
||||
$mode=GETPOST('mode', 'alpha');
|
||||
if (empty($mode)) $mode='common';
|
||||
$action=GETPOST('action','alpha');
|
||||
//var_dump($_POST);exit;
|
||||
$value=GETPOST('value', 'alpha');
|
||||
$page_y=GETPOST('page_y','int');
|
||||
$search_keyword=GETPOST('search_keyword','alpha');
|
||||
@@ -140,6 +141,12 @@ if ($action=='install')
|
||||
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (empty($_FILES['fileinstall']['tmp_name']))
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -150,14 +157,14 @@ if ($action=='install')
|
||||
dol_mkdir($conf->admin->dir_temp.'/'.$original_file);
|
||||
}
|
||||
|
||||
$tmpdir=preg_replace('/\.zip$/','',$original_file).'.dir';
|
||||
$tmpdir=preg_replace('/\.zip$/i','',$original_file).'.dir';
|
||||
if ($tmpdir)
|
||||
{
|
||||
@dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$tmpdir);
|
||||
dol_mkdir($conf->admin->dir_temp.'/'.$tmpdir);
|
||||
}
|
||||
|
||||
$result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']);
|
||||
$result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'], $newfile, 1, 0, $_FILES['fileinstall']['error']);
|
||||
if ($result > 0)
|
||||
{
|
||||
$result=dol_uncompress($newfile,$conf->admin->dir_temp.'/'.$tmpdir);
|
||||
@@ -205,6 +212,7 @@ if ($action=='install')
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@@ -833,6 +841,8 @@ if ($mode == 'common')
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Show warning about external users
|
||||
print info_admin(showModulesExludedForExternal($modules))."\n";
|
||||
|
||||
@@ -999,10 +1009,46 @@ if ($mode == 'deploy')
|
||||
print '<br>';
|
||||
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
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 $langs->trans("YouCanSubmitFile");
|
||||
|
||||
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
|
||||
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
|
||||
if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1;
|
||||
if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024;
|
||||
if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024;
|
||||
if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024;
|
||||
// Now $max and $maxphp are in Kb
|
||||
$maxmin = $max;
|
||||
if ($maxphp > 0) $maxmin=min($max,$maxphp);
|
||||
|
||||
if ($maxmin > 0)
|
||||
{
|
||||
// MAX_FILE_SIZE doit précéder le champ input de type file
|
||||
print '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
|
||||
}
|
||||
|
||||
print '<input class="flat minwidth400" type="file" name="fileinstall"> ';
|
||||
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
|
||||
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($user->admin)
|
||||
{
|
||||
$langs->load('other');
|
||||
print ' ';
|
||||
print info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("UploadDisabled").')';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -106,9 +106,7 @@ elseif ($action == 'update_currency')
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
$submit = GETPOST('submit', 'alpha');
|
||||
|
||||
if ($submit == $langs->trans('Modify'))
|
||||
if (GETPOST('updatecurrency', 'alpha'))
|
||||
{
|
||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||
$rate = price2num(GETPOST('rate', 'alpha'));
|
||||
@@ -127,7 +125,7 @@ elseif ($action == 'update_currency')
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($submit == $langs->trans('Delete'))
|
||||
elseif (GETPOST('deletecurrency', 'alpha'))
|
||||
{
|
||||
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
|
||||
$currency = new MultiCurrency($db);
|
||||
@@ -334,8 +332,8 @@ foreach ($TCurrency as &$currency)
|
||||
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
|
||||
print '1 '.$conf->currency.' = ';
|
||||
print '<input type="text" name="rate" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13" /> '.$currency->code.' ';
|
||||
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Modify").'"> ';
|
||||
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Delete").'">';
|
||||
print '<input type="submit" name="updatecurrency" class="button" value="'.$langs->trans("Modify").'"> ';
|
||||
print '<input type="submit" name="deletecurrency" class="button" value="'.$langs->trans("Delete").'">';
|
||||
print '</form>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -56,9 +56,12 @@ $specimenthirdparty->initAsSpecimen();
|
||||
if ($action == 'updateMask')
|
||||
{
|
||||
$maskconstinvoice=GETPOST('maskconstinvoice','alpha');
|
||||
$maskvalue=GETPOST('maskinvoice','alpha');
|
||||
$maskconstcredit=GETPOST('maskconstcredit','alpha');
|
||||
$maskinvoice=GETPOST('maskinvoice','alpha');
|
||||
$maskcredit=GETPOST('maskcredit','alpha');
|
||||
|
||||
if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskvalue,'chaine',0,'',$conf->entity);
|
||||
if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity);
|
||||
if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
|
||||
@@ -157,7 +157,8 @@ $i=0;
|
||||
foreach($_SESSION as $key => $val)
|
||||
{
|
||||
if ($i > 0) print ', ';
|
||||
print $key.' => '.dol_escape_htmltag($val);
|
||||
if (is_array($val)) print $key.' => array(...)';
|
||||
else print $key.' => '.dol_escape_htmltag($val);
|
||||
$i++;
|
||||
}
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
@@ -337,7 +337,12 @@ if (! $error && $xml)
|
||||
$i++;
|
||||
$out.='<tr class="oddeven">';
|
||||
$out.='<td>'.$i.'</td>' . "\n";
|
||||
$out.='<td>'.$file['filename'].'</td>' . "\n";
|
||||
$out.='<td>'.$file['filename'];
|
||||
if (! preg_match('/^win/i',PHP_OS)) {
|
||||
$htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.'/'.$file['filename']);
|
||||
$out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm');
|
||||
}
|
||||
$out.='</td>' . "\n";
|
||||
$out.='<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
|
||||
$out.='<td align="center">'.$file['md5'].'</td>' . "\n";
|
||||
$size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);
|
||||
|
||||
@@ -129,7 +129,7 @@ if ($what == 'mysql')
|
||||
{
|
||||
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
|
||||
$ok=0;
|
||||
dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that on of this command is inside ".$cmddump);
|
||||
dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump);
|
||||
foreach($arrayofallowedcommand as $allowedcommand)
|
||||
{
|
||||
if (preg_match('/'.preg_quote($allowedcommand,'/').'/', $cmddump))
|
||||
@@ -235,176 +235,3 @@ $time_end = time();
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
|
||||
// MYSQL NO BINARIES (only php)
|
||||
/** Backup the db OR just a table without mysqldump binary (does not require any exec permission)
|
||||
* Author: David Walsh (http://davidwalsh.name/backup-mysql-database-php)
|
||||
* Updated and enhanced by Stephen Larroque (lrq3000) and by the many commentators from the blog
|
||||
* Note about foreign keys constraints: for Dolibarr, since there are a lot of constraints and when imported the tables will be inserted in the dumped order, not in constraints order, then we ABSOLUTELY need to use SET FOREIGN_KEY_CHECKS=0; when importing the sql dump.
|
||||
* Note2: db2SQL by Howard Yeend can be an alternative, by using SHOW FIELDS FROM and SHOW KEYS FROM we could generate a more precise dump (eg: by getting the type of the field and then precisely outputting the right formatting - in quotes, numeric or null - instead of trying to guess like we are doing now).
|
||||
*
|
||||
* @param string $outputfile Output file name
|
||||
* @param string $tables Table name or '*' for all
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function backup_tables($outputfile, $tables='*')
|
||||
{
|
||||
global $db, $langs;
|
||||
global $errormsg;
|
||||
|
||||
// Set to UTF-8
|
||||
if (is_a($db, 'DoliDBMysqli')) {
|
||||
/** @var DoliDBMysqli $db */
|
||||
$db->db->set_charset('utf8');
|
||||
} else {
|
||||
/** @var DoliDB $db */
|
||||
$db->query('SET NAMES utf8');
|
||||
$db->query('SET CHARACTER SET utf8');
|
||||
}
|
||||
|
||||
//get all of the tables
|
||||
if ($tables == '*')
|
||||
{
|
||||
$tables = array();
|
||||
$result = $db->query('SHOW FULL TABLES WHERE Table_type = \'BASE TABLE\'');
|
||||
while($row = $db->fetch_row($result))
|
||||
{
|
||||
$tables[] = $row[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$tables = is_array($tables) ? $tables : explode(',',$tables);
|
||||
}
|
||||
|
||||
//cycle through
|
||||
$handle = fopen($outputfile, 'w+');
|
||||
if (fwrite($handle, '') === false)
|
||||
{
|
||||
$langs->load("errors");
|
||||
dol_syslog("Failed to open file ".$outputfile,LOG_ERR);
|
||||
$errormsg=$langs->trans("ErrorFailedToWriteInDir");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Print headers and global mysql config vars
|
||||
$sqlhead = '';
|
||||
$sqlhead .= "-- ".$db::LABEL." dump via php with Dolibarr ".DOL_VERSION."
|
||||
--
|
||||
-- Host: ".$db->db->host_info." Database: ".$db->database_name."
|
||||
-- ------------------------------------------------------
|
||||
-- Server version ".$db->db->server_info."
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
";
|
||||
|
||||
if (GETPOST("nobin_disable_fk")) $sqlhead .= "SET FOREIGN_KEY_CHECKS=0;\n";
|
||||
//$sqlhead .= "SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";\n";
|
||||
if (GETPOST("nobin_use_transaction")) $sqlhead .= "SET AUTOCOMMIT=0;\nSTART TRANSACTION;\n";
|
||||
|
||||
fwrite($handle, $sqlhead);
|
||||
|
||||
$ignore = '';
|
||||
if (GETPOST("nobin_sql_ignore")) $ignore = 'IGNORE ';
|
||||
$delayed = '';
|
||||
if (GETPOST("nobin_delayed")) $delayed = 'DELAYED ';
|
||||
|
||||
// Process each table and print their definition + their datas
|
||||
foreach($tables as $table)
|
||||
{
|
||||
// Saving the table structure
|
||||
fwrite($handle, "\n--\n-- Table structure for table `".$table."`\n--\n");
|
||||
|
||||
if (GETPOST("nobin_drop")) fwrite($handle,"DROP TABLE IF EXISTS `".$table."`;\n"); // Dropping table if exists prior to re create it
|
||||
fwrite($handle,"/*!40101 SET @saved_cs_client = @@character_set_client */;\n");
|
||||
fwrite($handle,"/*!40101 SET character_set_client = utf8 */;\n");
|
||||
$resqldrop=$db->query('SHOW CREATE TABLE '.$table);
|
||||
$row2 = $db->fetch_row($resqldrop);
|
||||
if (empty($row2[1]))
|
||||
{
|
||||
fwrite($handle, "\n-- WARNING: Show create table ".$table." return empy string when it should not.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite($handle,$row2[1].";\n");
|
||||
//fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n");
|
||||
|
||||
// Dumping the data (locking the table and disabling the keys check while doing the process)
|
||||
fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n");
|
||||
if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back)
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n");
|
||||
else fwrite($handle, "/*!40000 ALTER TABLE `".$table."` DISABLE KEYS */;\n");
|
||||
|
||||
$sql='SELECT * FROM '.$table;
|
||||
$result = $db->query($sql);
|
||||
while($row = $db->fetch_row($result))
|
||||
{
|
||||
// For each row of data we print a line of INSERT
|
||||
fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES (');
|
||||
$columns = count($row);
|
||||
for($j=0; $j<$columns; $j++) {
|
||||
// Processing each columns of the row to ensure that we correctly save the value (eg: add quotes for string - in fact we add quotes for everything, it's easier)
|
||||
if ($row[$j] == null && !is_string($row[$j])) {
|
||||
// IMPORTANT: if the field is NULL we set it NULL
|
||||
$row[$j] = 'NULL';
|
||||
} elseif(is_string($row[$j]) && $row[$j] == '') {
|
||||
// if it's an empty string, we set it as an empty string
|
||||
$row[$j] = "''";
|
||||
} elseif(is_numeric($row[$j]) && !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
|
||||
// if it's a number, we return it as-is
|
||||
// $row[$j] = $row[$j];
|
||||
} else { // else for all other cases we escape the value and put quotes around
|
||||
$row[$j] = addslashes($row[$j]);
|
||||
$row[$j] = preg_replace("#\n#", "\\n", $row[$j]);
|
||||
$row[$j] = "'".$row[$j]."'";
|
||||
}
|
||||
}
|
||||
fwrite($handle,implode(',', $row).");\n");
|
||||
}
|
||||
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` ENABLE KEYS;\n"); // Enabling back the keys/index checking
|
||||
if (!GETPOST("nobin_nolocks")) fwrite($handle, "UNLOCK TABLES;\n"); // Unlocking the table
|
||||
fwrite($handle,"\n\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Backup Procedure structure*/
|
||||
/*
|
||||
$result = $db->query('SHOW PROCEDURE STATUS');
|
||||
if ($db->num_rows($result) > 0)
|
||||
{
|
||||
while ($row = $db->fetch_row($result)) { $procedures[] = $row[1]; }
|
||||
foreach($procedures as $proc)
|
||||
{
|
||||
fwrite($handle,"DELIMITER $$\n\n");
|
||||
fwrite($handle,"DROP PROCEDURE IF EXISTS '$name'.'$proc'$$\n");
|
||||
$resqlcreateproc=$db->query("SHOW CREATE PROCEDURE '$proc'");
|
||||
$row2 = $db->fetch_row($resqlcreateproc);
|
||||
fwrite($handle,"\n".$row2[2]."$$\n\n");
|
||||
fwrite($handle,"DELIMITER ;\n\n");
|
||||
}
|
||||
}
|
||||
*/
|
||||
/* Backup Procedure structure*/
|
||||
|
||||
// Write the footer (restore the previous database settings)
|
||||
$sqlfooter="\n\n";
|
||||
if (GETPOST("nobin_use_transaction")) $sqlfooter .= "COMMIT;\n";
|
||||
if (GETPOST("nobin_disable_fk")) $sqlfooter .= "SET FOREIGN_KEY_CHECKS=1;\n";
|
||||
$sqlfooter.="\n\n-- Dump completed on ".date('Y-m-d G-i-s');
|
||||
fwrite($handle, $sqlfooter);
|
||||
|
||||
fclose($handle);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ $usefilter=0;
|
||||
$listofsessions=listOfSessions();
|
||||
$num=count($listofsessions);
|
||||
|
||||
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,'setup');
|
||||
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'', $num, ($num?$num:''),'setup'); // Do not show numer (0) if no session found (it means we can't know)
|
||||
|
||||
$savehandler=ini_get("session.save_handler");
|
||||
$savepath=ini_get("session.save_path");
|
||||
|
||||
@@ -251,7 +251,7 @@ class DolibarrApi
|
||||
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
|
||||
$tmp=$sqlfilters;
|
||||
$ok=0;
|
||||
$i=0; $nb=count($tmp);
|
||||
$i=0; $nb=strlen($tmp);
|
||||
$counter=0;
|
||||
while ($i < $nb)
|
||||
{
|
||||
|
||||
@@ -317,7 +317,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
@@ -211,8 +211,7 @@ class Facturation
|
||||
$total_localtax1 = 0;
|
||||
$total_localtax2 = 0;
|
||||
|
||||
$tab=array();
|
||||
$tab = $_SESSION['poscart'];
|
||||
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
|
||||
|
||||
$tab_size=count($tab);
|
||||
for($i=0;$i < $tab_size;$i++)
|
||||
|
||||
@@ -41,6 +41,8 @@ if ( $_SESSION['uid'] > 0 )
|
||||
$usertxt=GETPOST('user','',1);
|
||||
$err=GETPOST("err");
|
||||
|
||||
// Instantiate hooks of thirdparty module only if not already define
|
||||
$hookmanager->initHooks(array('cashdeskloginpage'));
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -51,6 +53,15 @@ $formproduct=new FormProduct($db);
|
||||
|
||||
$arrayofcss=array('/cashdesk/css/style.css');
|
||||
top_htmlhead('','',0,0,'',$arrayofcss);
|
||||
|
||||
// Execute hook getLoginPageOptions (for table)
|
||||
$parameters=array('entity' => GETPOST('entity','int'));
|
||||
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
|
||||
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
|
||||
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
|
||||
} else {
|
||||
$morelogincontent = $hookmanager->resPrint;
|
||||
}
|
||||
?>
|
||||
|
||||
<body>
|
||||
@@ -92,6 +103,24 @@ else
|
||||
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
if (! empty($morelogincontent)) {
|
||||
if (is_array($morelogincontent)) {
|
||||
foreach ($morelogincontent as $format => $option)
|
||||
{
|
||||
if ($format == 'table') {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $option;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
echo '<!-- Option by hook -->';
|
||||
echo $morelogincontent;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
|
||||
|
||||
@@ -46,8 +46,7 @@ $societe = new Societe($db);
|
||||
$societe->fetch($thirdpartyid);
|
||||
/** end add Ditto */
|
||||
|
||||
$tab=array();
|
||||
$tab = $_SESSION['poscart'];
|
||||
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
|
||||
|
||||
$tab_size=count($tab);
|
||||
if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';
|
||||
|
||||
@@ -1043,7 +1043,7 @@ class Categorie extends CommonObject
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// Init $this->cats array
|
||||
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
|
||||
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
|
||||
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
|
||||
@@ -1063,6 +1063,7 @@ class Categorie extends CommonObject
|
||||
$this->cats[$obj->rowid]['label'] = ! empty($obj->label_trans) ? $obj->label_trans : $obj->label;
|
||||
$this->cats[$obj->rowid]['description'] = ! empty($obj->description_trans) ? $obj->description_trans : $obj->description;
|
||||
$this->cats[$obj->rowid]['color'] = $obj->color;
|
||||
$this->cats[$obj->rowid]['visible'] = $obj->visible;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ $langs->load("categories");
|
||||
$id=GETPOST('id','int');
|
||||
$ref=GETPOST('ref');
|
||||
$type=GETPOST('type');
|
||||
$action=GETPOST('action','aZ09');
|
||||
$action=(GETPOST('action','aZ09')?GETPOST('action','aZ09'):'edit');
|
||||
$confirm=GETPOST('confirm');
|
||||
$cancel=GETPOST('cancel','alpha');
|
||||
|
||||
|
||||
@@ -65,8 +65,11 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
|
||||
|
||||
llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss);
|
||||
|
||||
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'"><span class="valignmiddle">'.$langs->trans("NewCategory").'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
$newcardbutton.= '</a>';
|
||||
|
||||
print load_fiche_titre($title);
|
||||
print load_fiche_titre($title, $newcardbutton);
|
||||
|
||||
//print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
|
||||
@@ -69,7 +69,24 @@ if ($id > 0)
|
||||
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($object->id) {
|
||||
$object->add_photo($upload_dir, $_FILES['userfile']);
|
||||
|
||||
$file = $_FILES['userfile'];
|
||||
if (is_array($file['name']) && count($file['name']) > 0)
|
||||
{
|
||||
foreach ($file['name'] as $i => $name)
|
||||
{
|
||||
if(empty($file['tmp_name'][$i]) || intval($conf->global->MAIN_UPLOAD_DOC) * 1000 <= filesize($file['tmp_name'][$i]) )
|
||||
{
|
||||
setEventMessage($file['name'][$i] .' : '. $langs->trans(empty($file['tmp_name'][$i])? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles' ) );
|
||||
unset($file['name'][$i],$file['type'][$i],$file['tmp_name'][$i],$file['error'][$i],$file['size'][$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($file['tmp_name'])){
|
||||
$object->add_photo($upload_dir, $file);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1615,7 +1615,7 @@ if ($id > 0)
|
||||
$delallowed=$user->rights->agenda->myactions->create;
|
||||
|
||||
|
||||
print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
print $formfile->showdocuments('actions',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
@@ -1020,8 +1020,7 @@ class ActionComm extends CommonObject
|
||||
$this->nb=array();
|
||||
$sql = "SELECT count(a.id) as nb";
|
||||
}
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.= ")";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql.= " WHERE 1 = 1";
|
||||
|
||||
@@ -306,6 +306,7 @@ if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||
if ($filter) $param.="&filter=".$filter;
|
||||
if ($usergroup) $param.="&usergroup=".$usergroup;
|
||||
if ($filtert) $param.="&filtert=".$filtert;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($showbirthday) $param.="&showbirthday=1";
|
||||
@@ -1005,6 +1006,11 @@ if (! empty($hookmanager->resArray['eventarray'])) {
|
||||
}
|
||||
}
|
||||
|
||||
// Sort events
|
||||
foreach($eventarray as $keyDate => &$dateeventarray)
|
||||
{
|
||||
usort($dateeventarray, 'sort_events_by_date');
|
||||
}
|
||||
|
||||
|
||||
$maxnbofchar=0;
|
||||
@@ -1276,7 +1282,7 @@ $db->close();
|
||||
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0)
|
||||
{
|
||||
global $user, $conf, $langs;
|
||||
global $action, $filter, $filtert, $status, $actioncode; // Filters used into search form
|
||||
global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form
|
||||
global $theme_datacolor;
|
||||
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
|
||||
|
||||
@@ -1635,6 +1641,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
|
||||
print ($status?'&status='.$status:'').($filter?'&filter='.$filter:'');
|
||||
print ($filtert?'&filtert='.$filtert:'');
|
||||
print ($usergroup?'&usergroup='.$usergroup:'');
|
||||
print ($actioncode!=''?'&actioncode='.$actioncode:'');
|
||||
print '">'.img_picto("all","1downarrow_selected.png").' ...';
|
||||
print ' +'.(count($eventarray[$daykey])-$maxprint);
|
||||
@@ -1698,3 +1705,22 @@ function dol_color_minus($color, $minus, $minusunit = 16)
|
||||
}
|
||||
return $newcolor;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sort events by date
|
||||
*
|
||||
* @param object $a Event A
|
||||
* @param object $b Event B
|
||||
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
|
||||
*/
|
||||
function sort_events_by_date($a, $b)
|
||||
{
|
||||
if($a->datep != $b->datep)
|
||||
{
|
||||
return $a->datep - $b->datep;
|
||||
}
|
||||
|
||||
// If both events have the same start time, longest first
|
||||
return $b->datef - $a->datef;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
{
|
||||
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,8 +239,15 @@ $sql.= " a.fk_contact, a.note, a.percent as percent,";
|
||||
$sql.= " a.fk_element, a.elementtype,";
|
||||
$sql.= " c.code as type_code, c.libelle as type_label,";
|
||||
$sql.= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
|
||||
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||
|
||||
// Add fields from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
@@ -312,9 +319,15 @@ if ($filtert > 0 || $usergroup > 0)
|
||||
if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect-3600)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'))";
|
||||
if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
|
||||
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
|
||||
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
|
||||
$sql.= $db->order($sortfield,$sortorder);
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
|
||||
@@ -181,7 +181,7 @@ if (empty($reshook))
|
||||
if ($action == 'setorder_min_amount')
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->order_min_amount=GETPOST('order_min_amount');
|
||||
$object->order_min_amount=price2num(GETPOST('order_min_amount','alpha'));
|
||||
$result=$object->update($object->id, $user);
|
||||
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@@ -346,7 +346,7 @@ if ($object->id > 0)
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode')
|
||||
{
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id', 'CRDT');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -377,38 +377,43 @@ if ($object->id > 0)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Relative discounts (Discounts-Drawbacks-Rebates)
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerRelativeDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
||||
print '</tr>';
|
||||
$isCustomer = ($object->client == 1 || $object->client == 3);
|
||||
|
||||
// Absolute discounts (Discounts-Drawbacks-Rebates)
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
// Relative discounts (Discounts-Drawbacks-Rebates)
|
||||
if ($isCustomer)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerRelativeDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Absolute discounts (Discounts-Drawbacks-Rebates)
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding">';
|
||||
print '<tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerAbsoluteDiscountShort");
|
||||
print '<td><td align="right">';
|
||||
if ($user->rights->societe->creer && !$user->societe_id > 0)
|
||||
{
|
||||
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$amount_discount=$object->getAvailableDiscounts();
|
||||
if ($amount_discount < 0) dol_print_error($db,$object->error);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
|
||||
//else print $langs->trans("DiscountNone");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
$amount_discount=$object->getAvailableDiscounts();
|
||||
if ($amount_discount < 0) dol_print_error($db,$object->error);
|
||||
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
|
||||
//else print $langs->trans("DiscountNone");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Max outstanding bill
|
||||
if ($object->client)
|
||||
@@ -423,15 +428,21 @@ if ($object->id > 0)
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr class="nowrap">';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : ''));
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
if ($object->client)
|
||||
{
|
||||
if (! empty($conf->commande->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT))
|
||||
{
|
||||
print '<!-- Minimim amount for orders -->'."\n";
|
||||
print '<tr class="nowrap">';
|
||||
print '<td>';
|
||||
print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : ''));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -660,6 +671,8 @@ if ($object->id > 0)
|
||||
*/
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
{
|
||||
$langs->load("propal");
|
||||
|
||||
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
|
||||
$sql.= ", p.tva as total_tva";
|
||||
$sql.= ", p.total as total_ttc";
|
||||
@@ -668,7 +681,7 @@ if ($object->id > 0)
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql.= " AND s.rowid = ".$object->id;
|
||||
$sql.= " AND p.entity = ".$conf->entity;
|
||||
$sql.= " AND p.entity IN (".getEntity('propal').")";
|
||||
$sql.= " ORDER BY p.datep DESC";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@@ -609,12 +609,23 @@ if (empty($reshook))
|
||||
// Classify billed
|
||||
else if ($action == 'classifybilled' && $usercanclose)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result=$object->cloture($user, 4, '');
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
// Close proposal
|
||||
@@ -627,12 +638,23 @@ if (empty($reshook))
|
||||
// prevent browser refresh from closing proposal several times
|
||||
if ($object->statut == Propal::STATUS_VALIDATED)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note_private','none'));
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -643,12 +665,23 @@ if (empty($reshook))
|
||||
// prevent browser refresh from reopening proposal several times
|
||||
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED)
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$result=$object->reopen($user, 1);
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,7 +751,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@@ -931,6 +964,7 @@ if (empty($reshook))
|
||||
// Add custom code and origin country into description
|
||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||
{
|
||||
$tmptxt = '(';
|
||||
// Define output language
|
||||
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||
$outputlangs = $langs;
|
||||
@@ -1085,7 +1119,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@@ -1848,7 +1882,7 @@ if ($action == 'create')
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1,'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherProposals").'</a>)';
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
@@ -2064,7 +2098,7 @@ if ($action == 'create')
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if (! empty($object->brouillon) && $action == 'editmode' && $usercancreate) {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -403,38 +405,40 @@ class Propal extends CommonObject
|
||||
global $mysoc, $conf, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ht_devise=price2num($pu_ht_devise);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
if ($this->statut == self::STATUS_DRAFT)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ht_devise=price2num($pu_ht_devise);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1'
|
||||
}
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$product_type=$type;
|
||||
@@ -1007,6 +1011,7 @@ class Propal extends CommonObject
|
||||
// Add linked object (deprecated, use ->linkedObjectsIds instead)
|
||||
if (! $error && $this->origin && $this->origin_id)
|
||||
{
|
||||
dol_syslog('Deprecated use of linked object, use ->linkedObjectsIds instead', LOG_WARNING);
|
||||
$ret = $this->add_object_linked();
|
||||
if (! $ret) dol_print_error($this->db);
|
||||
}
|
||||
@@ -1079,13 +1084,6 @@ class Propal extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Add linked object
|
||||
if (! $error && $this->origin && $this->origin_id)
|
||||
{
|
||||
$ret = $this->add_object_linked();
|
||||
if (! $ret) dol_print_error($this->db);
|
||||
}
|
||||
|
||||
// Set delivery address
|
||||
if (! $error && $this->fk_delivery_address)
|
||||
{
|
||||
@@ -2425,16 +2423,16 @@ class Propal extends CommonObject
|
||||
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
|
||||
{
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
//$ret=$object->fetch($id); // Reload to get new records
|
||||
$this->generateDocument($modelpdf, $outputlangs);
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
if (! empty($conf->global->MAIN_MULTILANGS))
|
||||
{
|
||||
$outputlangs = new Translate("",$conf);
|
||||
$newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
//$ret=$object->fetch($id); // Reload to get new records
|
||||
$this->generateDocument($modelpdf, $outputlangs);
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -2442,7 +2440,7 @@ class Propal extends CommonObject
|
||||
$this->oldcopy= clone $this;
|
||||
$this->statut = $statut;
|
||||
$this->date_cloture = $now;
|
||||
$this->note_private = $note;
|
||||
$this->note_private = $newprivatenote;
|
||||
}
|
||||
|
||||
if (! $notrigger && empty($error))
|
||||
@@ -2453,13 +2451,17 @@ class Propal extends CommonObject
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
if ( ! $error )
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->statut = $this->oldcopy->statut;
|
||||
$this->date_cloture = $this->oldcopy->date_cloture;
|
||||
$this->note_private = $this->oldcopy->note_private;
|
||||
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@@ -3110,7 +3112,7 @@ class Propal extends CommonObject
|
||||
$this->labelstatut[3]=$langs->trans("PropalStatusNotSigned");
|
||||
$this->labelstatut[4]=$langs->trans("PropalStatusBilled");
|
||||
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort");
|
||||
$this->labelstatut_short[1]=$langs->trans("Opened");
|
||||
$this->labelstatut_short[1]=$langs->trans("PropalStatusValidatedShort");
|
||||
$this->labelstatut_short[2]=$langs->trans("PropalStatusSignedShort");
|
||||
$this->labelstatut_short[3]=$langs->trans("PropalStatusNotSignedShort");
|
||||
$this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort");
|
||||
@@ -4188,7 +4190,7 @@ class PropaleLigne extends CommonObjectLine
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_total()
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies','propal','compta','bills','orders','products','deliveries'));
|
||||
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
|
||||
|
||||
$socid=GETPOST('socid','int');
|
||||
|
||||
@@ -490,7 +490,7 @@ if ($resql)
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
@@ -990,7 +990,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
// Show total line
|
||||
if (isset($totalarray['totalhtfield'])
|
||||
if (isset($totalarray['totalhtfield'])
|
||||
|| isset($totalarray['totalvatfield'])
|
||||
|| isset($totalarray['totalttcfield'])
|
||||
|| isset($totalarray['totalamfield'])
|
||||
|
||||
@@ -106,7 +106,7 @@ if ($socid > 0)
|
||||
|
||||
$head = societe_prepare_head($object);
|
||||
|
||||
$isCustomer = $object->client == 1 || $object->client == 3;
|
||||
$isCustomer = ($object->client == 1 || $object->client == 3);
|
||||
$isSupplier = $object->fournisseur == 1;
|
||||
|
||||
print '<form method="POST" action="remise.php?id='.$object->id.'">';
|
||||
@@ -122,7 +122,7 @@ if ($socid > 0)
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
if(! $isCustomer && ! $isSupplier) {
|
||||
if (! $isCustomer && ! $isSupplier) {
|
||||
print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>';
|
||||
|
||||
dol_fiche_end();
|
||||
@@ -136,13 +136,13 @@ if ($socid > 0)
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if($isCustomer) {
|
||||
if ($isCustomer) {
|
||||
// Customer discount
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>";
|
||||
}
|
||||
|
||||
if($isSupplier) {
|
||||
if ($isSupplier) {
|
||||
// Supplier discount
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans("SupplierRelativeDiscount").'</td><td>'.price2num($object->remise_supplier_percent)."%</td></tr>";
|
||||
@@ -155,21 +155,28 @@ if ($socid > 0)
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
if($isCustomer && ! $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="0" />';
|
||||
}
|
||||
|
||||
if(! $isCustomer && $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="1" />';
|
||||
}
|
||||
/*if (! ($isCustomer && $isSupplier))
|
||||
{
|
||||
if ($isCustomer && ! $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="0" />';
|
||||
}
|
||||
if (! $isCustomer && $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="1" />';
|
||||
}
|
||||
}*/
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if($isCustomer && $isSupplier) {
|
||||
if ($isCustomer || $isSupplier)
|
||||
{
|
||||
// Discount type
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>';
|
||||
print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td><td>';
|
||||
if ($isCustomer) {
|
||||
print '<input type="radio" name="discount_type" id="discount_type_0" checked value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
|
||||
}
|
||||
if ($isSupplier) {
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1"'.($isCustomer?'':' checked').' value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -127,6 +128,8 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||
|
||||
$db->begin();
|
||||
$discount->fk_facture_source=0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
|
||||
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
|
||||
$discount->fk_invoice_supplier_source=0;
|
||||
$res=$discount->delete($user);
|
||||
$newid1=$newdiscount1->create($user);
|
||||
$newid2=$newdiscount2->create($user);
|
||||
@@ -254,7 +257,7 @@ if ($socid > 0)
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
if(! $isCustomer && ! $isSupplier) {
|
||||
print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>';
|
||||
|
||||
@@ -266,8 +269,8 @@ if ($socid > 0)
|
||||
$db->close();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if($isCustomer) { // Calcul avoirs client en cours
|
||||
@@ -293,7 +296,7 @@ if ($socid > 0)
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
|
||||
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
|
||||
|
||||
if (! empty($user->fk_soc)) // No need to show this for external users
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
|
||||
@@ -322,10 +325,10 @@ if ($socid > 0)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>';
|
||||
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
|
||||
|
||||
if (! empty($user->fk_soc)) // No need to show this for external users
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("SupplierAbsoluteDiscountMy").'</td>';
|
||||
@@ -344,11 +347,11 @@ if ($socid > 0)
|
||||
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
if($isCustomer && ! $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="0" />';
|
||||
}
|
||||
|
||||
|
||||
if(! $isCustomer && $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="1" />';
|
||||
}
|
||||
@@ -356,8 +359,8 @@ if ($socid > 0)
|
||||
print '<table class="border" width="100%">';
|
||||
if($isCustomer && $isSupplier) {
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>';
|
||||
print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
print '<td><input type="radio" name="discount_type" id="discount_type_0" checked="checked" value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1" value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>';
|
||||
@@ -401,7 +404,7 @@ if ($socid > 0)
|
||||
/*
|
||||
* Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture)
|
||||
*/
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("DiscountStillRemaining"));
|
||||
|
||||
if($isCustomer) {
|
||||
@@ -424,10 +427,11 @@ if ($socid > 0)
|
||||
$sql.= " AND rc.discount_type = 0"; // Eliminate supplier discounts
|
||||
$sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)";
|
||||
$sql.= " ORDER BY rc.datec DESC";
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
@@ -439,9 +443,9 @@ if ($socid > 0)
|
||||
print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$showconfirminfo=array();
|
||||
|
||||
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num > 0)
|
||||
@@ -449,7 +453,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))
|
||||
@@ -502,7 +506,7 @@ if ($socid > 0)
|
||||
}
|
||||
else print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
|
||||
{
|
||||
$showconfirminfo['rowid']=$obj->rowid;
|
||||
@@ -517,7 +521,8 @@ if ($socid > 0)
|
||||
}
|
||||
$db->free($resql);
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (count($showconfirminfo))
|
||||
{
|
||||
$amount1=price2num($showconfirminfo['amount_ttc']/2,'MT');
|
||||
@@ -561,10 +566,11 @@ if ($socid > 0)
|
||||
$sql.= " AND rc.discount_type = 1"; // Eliminate customer discounts
|
||||
$sql.= " AND (rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_line IS NULL)";
|
||||
$sql.= " ORDER BY rc.datec DESC";
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table width="100%" class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
@@ -576,9 +582,9 @@ if ($socid > 0)
|
||||
print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$showconfirminfo=array();
|
||||
|
||||
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num > 0)
|
||||
@@ -586,7 +592,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))
|
||||
@@ -639,7 +645,7 @@ if ($socid > 0)
|
||||
}
|
||||
else print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
|
||||
{
|
||||
$showconfirminfo['rowid']=$obj->rowid;
|
||||
@@ -654,7 +660,8 @@ if ($socid > 0)
|
||||
}
|
||||
$db->free($resql);
|
||||
print "</table>";
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (count($showconfirminfo))
|
||||
{
|
||||
$amount1=price2num($showconfirminfo['amount_ttc']/2,'MT');
|
||||
@@ -673,19 +680,19 @@ if ($socid > 0)
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if($isCustomer) {
|
||||
if ($isCustomer) {
|
||||
print '</div>'; // class="ficheaddleft"
|
||||
print '</div>'; // class="fichehalfright"
|
||||
print '</div>'; // class="fichecenter"
|
||||
}
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
print '<div class="clearboth"></div><br>';
|
||||
|
||||
/*
|
||||
* List discount consumed (=liees a une ligne de facture ou facture)
|
||||
*/
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("DiscountAlreadyCounted"));
|
||||
|
||||
if($isCustomer) {
|
||||
@@ -730,12 +737,13 @@ if ($socid > 0)
|
||||
$sql2.= " AND rc.fk_user = u.rowid";
|
||||
$sql2.= " AND rc.discount_type = 0"; // Eliminate supplier discounts
|
||||
$sql2.= " ORDER BY dc DESC";
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
$resql2=null;
|
||||
if ($resql) $resql2=$db->query($sql2);
|
||||
if ($resql2)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
@@ -747,7 +755,7 @@ if ($socid > 0)
|
||||
print '<td width="100" align="center">'.$langs->trans("Author").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$tab_sqlobj=array();
|
||||
$tab_sqlobjOrder=array();
|
||||
$num = $db->num_rows($resql);
|
||||
@@ -761,7 +769,7 @@ if ($socid > 0)
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
|
||||
$num = $db->num_rows($resql2);
|
||||
for ($i = 0;$i < $num;$i++)
|
||||
{
|
||||
@@ -771,7 +779,7 @@ if ($socid > 0)
|
||||
}
|
||||
$db->free($resql2);
|
||||
array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj);
|
||||
|
||||
|
||||
$num = count($tab_sqlobj);
|
||||
if ($num > 0)
|
||||
{
|
||||
@@ -830,8 +838,9 @@ if ($socid > 0)
|
||||
{
|
||||
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -882,12 +891,13 @@ if ($socid > 0)
|
||||
$sql2.= " AND rc.fk_user = u.rowid";
|
||||
$sql2.= " AND rc.discount_type = 1"; // Eliminate customer discounts
|
||||
$sql2.= " ORDER BY dc DESC";
|
||||
|
||||
|
||||
$resql=$db->query($sql);
|
||||
$resql2=null;
|
||||
if ($resql) $resql2=$db->query($sql2);
|
||||
if ($resql2)
|
||||
{
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
|
||||
@@ -899,7 +909,7 @@ if ($socid > 0)
|
||||
print '<td width="100" align="center">'.$langs->trans("Author").'</td>';
|
||||
print '<td width="50"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$tab_sqlobj=array();
|
||||
$tab_sqlobjOrder=array();
|
||||
$num = $db->num_rows($resql);
|
||||
@@ -913,7 +923,7 @@ if ($socid > 0)
|
||||
}
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
|
||||
$num = $db->num_rows($resql2);
|
||||
for ($i = 0;$i < $num;$i++)
|
||||
{
|
||||
@@ -923,7 +933,7 @@ if ($socid > 0)
|
||||
}
|
||||
$db->free($resql2);
|
||||
array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj);
|
||||
|
||||
|
||||
$num = count($tab_sqlobj);
|
||||
if ($num > 0)
|
||||
{
|
||||
@@ -982,8 +992,9 @@ if ($socid > 0)
|
||||
{
|
||||
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -662,7 +662,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@@ -679,7 +679,7 @@ if (empty($reshook))
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && (! ($price_ht_devise >= 0) || $price_ht_devise == '')) // Unit price can be 0 but not ''
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for order.
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
@@ -1023,7 +1023,7 @@ if (empty($reshook))
|
||||
// Extrafields Lines
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield POST Data
|
||||
if (is_array($extralabelsline)) {
|
||||
foreach ($extralabelsline as $key => $value) {
|
||||
@@ -1987,7 +1987,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherOrders").'</a>)';
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
@@ -2190,7 +2190,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($action == 'editmode') {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
|
||||
}
|
||||
@@ -2387,7 +2387,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
|
||||
// Total HT
|
||||
$alert = '';
|
||||
if($object->total_ht < $object->thirdparty->order_min_amount) {
|
||||
if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) {
|
||||
$alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
|
||||
}
|
||||
print '<tr><td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -85,6 +85,9 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
public $billed; // billed or not
|
||||
|
||||
/**
|
||||
* @var int Draft Status of the order
|
||||
*/
|
||||
public $brouillon;
|
||||
public $cond_reglement_code;
|
||||
|
||||
@@ -233,7 +236,7 @@ class Commande extends CommonOrder
|
||||
$mybool|=@include_once $dir.$file;
|
||||
}
|
||||
|
||||
if (! $mybool)
|
||||
if ($mybool === false)
|
||||
{
|
||||
dol_print_error('',"Failed to include file ".$file);
|
||||
return '';
|
||||
@@ -407,6 +410,7 @@ class Commande extends CommonOrder
|
||||
{
|
||||
$this->ref = $num;
|
||||
$this->statut = self::STATUS_VALIDATED;
|
||||
$this->brouillon = 0;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
@@ -1263,44 +1267,46 @@ class Commande extends CommonOrder
|
||||
$logtext.= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise";
|
||||
dol_syslog(get_class($this).$logtext, LOG_DEBUG);
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
if ($this->statut == self::STATUS_DRAFT)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0;
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ht_devise=price2num($pu_ht_devise);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
$txtva = price2num($txtva);
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
$label=trim($label);
|
||||
$desc=trim($desc);
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ht_devise=price2num($pu_ht_devise);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1'
|
||||
}
|
||||
$txlocaltax1 = price2num($txlocaltax1);
|
||||
$txlocaltax2 = price2num($txlocaltax2);
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
$label=trim($label);
|
||||
$desc=trim($desc);
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
if ($this->statut == self::STATUS_DRAFT)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$product_type=$type;
|
||||
@@ -1877,6 +1883,9 @@ class Commande extends CommonOrder
|
||||
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
$line->fetch_optionals();
|
||||
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
$i++;
|
||||
@@ -4253,9 +4262,10 @@ class OrderLine extends CommonOrderLine
|
||||
}
|
||||
|
||||
/**
|
||||
* Update totals of order into database
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_total()
|
||||
{
|
||||
|
||||
@@ -467,6 +467,8 @@ if ($resql)
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
|
||||
print '<input type="hidden" name="socid" value="'.$socid.'">';
|
||||
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit);
|
||||
|
||||
@@ -529,7 +531,7 @@ if ($resql)
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
@@ -638,11 +638,12 @@ else
|
||||
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
|
||||
print '<td>';
|
||||
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($object->fk_accountancy_journal);
|
||||
|
||||
print $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||
if ($object->fk_accountancy_journal > 0) {
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch($object->fk_accountancy_journal);
|
||||
|
||||
print $accountingjournal->getNomUrl(0, 1, 1, '', 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ class Account extends CommonObject
|
||||
/**
|
||||
* @var int Use id instead of rowid
|
||||
* @deprecated
|
||||
* @see id
|
||||
* @see $id
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
@@ -1159,8 +1159,7 @@ class Account extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $solde;
|
||||
|
||||
return price2num($solde, 'MU');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1430,7 +1429,7 @@ class Account extends CommonObject
|
||||
{
|
||||
$country_code=$this->getCountryCode();
|
||||
|
||||
if (in_array($country_code,array('CH','FR','ES','GA','IT','NC'))) return 1; // France, Spain, Gabon, ...
|
||||
if (in_array($country_code,array('FR','ES','GA','IT','NC'))) return 1; // France, Spain, Gabon, ... - Not valid for CH
|
||||
if (in_array($country_code,array('AU','BE','CA','DE','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, England...
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
if ($sall)
|
||||
{
|
||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
$moreforfilter='';
|
||||
|
||||
@@ -455,7 +455,7 @@ while($j<$numlt)
|
||||
|
||||
|
||||
// Payment Salary
|
||||
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|
||||
{
|
||||
if (! $mode || $mode != 'sconly')
|
||||
{
|
||||
|
||||
@@ -92,11 +92,6 @@ $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') :
|
||||
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
|
||||
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
|
||||
|
||||
// Security check
|
||||
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
|
||||
if ($user->societe_id) $socid = $user->societe_id;
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
|
||||
|
||||
// Nombre de ligne pour choix de produit/service predefinis
|
||||
$NBLINES = 4;
|
||||
|
||||
@@ -117,6 +112,12 @@ $permissionnote = $user->rights->facture->creer; // Used by the include of actio
|
||||
$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
|
||||
$permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php
|
||||
|
||||
// Security check
|
||||
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
|
||||
if ($user->societe_id) $socid = $user->societe_id;
|
||||
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, null, $isdraft);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -177,7 +178,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// Delete invoice
|
||||
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) {
|
||||
else if ($action == 'confirm_delete' && $confirm == 'yes') {
|
||||
$result = $object->fetch($id);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
@@ -190,7 +191,10 @@ if (empty($reshook))
|
||||
$qualified_for_stock_change = $object->hasProductsOrServices(1);
|
||||
}
|
||||
|
||||
if ($object->is_erasable())
|
||||
$isErasable=$object->is_erasable();
|
||||
|
||||
if (($user->rights->facture->supprimer && $isErasable > 0)
|
||||
|| ($user->rights->facture->creer && $isErasable == 1))
|
||||
{
|
||||
$result = $object->delete($user, 0, $idwarehouse);
|
||||
if ($result > 0) {
|
||||
@@ -513,7 +517,7 @@ if (empty($reshook))
|
||||
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
|
||||
{
|
||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
@@ -573,7 +577,7 @@ if (empty($reshook))
|
||||
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
|
||||
{
|
||||
if (! $idwarehouse || $idwarehouse == - 1) {
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
@@ -684,6 +688,7 @@ if (empty($reshook))
|
||||
$db->begin();
|
||||
|
||||
$amount_ht = $amount_tva = $amount_ttc = array();
|
||||
$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
|
||||
|
||||
// Loop on each vat rate
|
||||
$i = 0;
|
||||
@@ -694,7 +699,10 @@ if (empty($reshook))
|
||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||
$amount_ttc[$line->tva_tx] += $line->total_ttc;
|
||||
$i ++;
|
||||
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
|
||||
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
|
||||
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,20 +726,31 @@ if (empty($reshook))
|
||||
{
|
||||
// If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT
|
||||
|
||||
// Total payments
|
||||
$sql = 'SELECT SUM(pf.amount) as total_paiements';
|
||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p';
|
||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
|
||||
$sql.= ' WHERE pf.fk_facture = '.$object->id;
|
||||
$sql.= ' AND pf.fk_paiement = p.rowid';
|
||||
$sql.= ' AND p.entity IN (' . getEntity('facture').')';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) dol_print_error($db);
|
||||
|
||||
$res = $db->fetch_object($resql);
|
||||
$total_paiements = $res->total_paiements;
|
||||
|
||||
$discount->amount_ht = $discount->amount_ttc = $total_paiements - $object->total_ttc;
|
||||
// Total credit note and deposit
|
||||
$total_creditnote_and_deposit = 0;
|
||||
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
|
||||
$sql .= " re.description, re.fk_facture_source";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
|
||||
$sql .= " WHERE fk_facture = " . $object->id;
|
||||
$resql = $db->query($sql);
|
||||
if (!empty($resql)) {
|
||||
while ($obj = $db->fetch_object($resql)) $total_creditnote_and_deposit += $obj->amount_ttc;
|
||||
} else dol_print_error($db);
|
||||
|
||||
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
|
||||
$discount->amount_tva = 0;
|
||||
$discount->tva_tx = 0;
|
||||
|
||||
@@ -749,6 +768,9 @@ if (empty($reshook))
|
||||
$discount->amount_ht = abs($amount_ht[$tva_tx]);
|
||||
$discount->amount_tva = abs($amount_tva[$tva_tx]);
|
||||
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
|
||||
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
||||
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
||||
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
||||
$discount->tva_tx = abs($tva_tx);
|
||||
|
||||
$result = $discount->create($user);
|
||||
@@ -832,7 +854,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
if (! ($_POST['fac_replacement'] > 0)) {
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
|
||||
}
|
||||
|
||||
@@ -878,14 +900,14 @@ if (empty($reshook))
|
||||
$sourceinvoice = GETPOST('fac_avoir');
|
||||
if (! ($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE))
|
||||
{
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors');
|
||||
}
|
||||
|
||||
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
if (empty($dateinvoice))
|
||||
{
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
|
||||
}
|
||||
|
||||
@@ -953,6 +975,8 @@ if (empty($reshook))
|
||||
|
||||
if($facture_source->type == Facture::TYPE_SITUATION)
|
||||
{
|
||||
$source_fk_prev_id = $line->fk_prev_id; // temporary storing situation invoice fk_prev_id
|
||||
$line->fk_prev_id = $line->id; // Credit note line need to be linked to the situation invoice it is create from
|
||||
|
||||
if(!empty($facture_source->tab_previous_situation_invoice))
|
||||
{
|
||||
@@ -976,7 +1000,7 @@ if (empty($reshook))
|
||||
$maxPrevSituationPercent = 0;
|
||||
foreach($facture_source->tab_previous_situation_invoice[$lineIndex]->lines as $prevLine)
|
||||
{
|
||||
if($prevLine->id == $line->fk_prev_id)
|
||||
if($prevLine->id == $source_fk_prev_id)
|
||||
{
|
||||
$maxPrevSituationPercent = max($maxPrevSituationPercent,$prevLine->situation_percent);
|
||||
|
||||
@@ -1109,7 +1133,7 @@ if (empty($reshook))
|
||||
{
|
||||
if (GETPOST('socid', 'int') < 1)
|
||||
{
|
||||
$error ++;
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors');
|
||||
}
|
||||
|
||||
@@ -1266,28 +1290,29 @@ if (empty($reshook))
|
||||
$qualified=1;
|
||||
if (empty($lines[$i]->qty)) $qualified=0; // We discard qty=0, it is an option
|
||||
if (! empty($lines[$i]->special_code)) $qualified=0; // We discard special_code (frais port, ecotaxe, option, ...)
|
||||
if ($qualified) $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
|
||||
if ($qualified){
|
||||
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
|
||||
$tva_tx = $lines[$i]->tva_tx;
|
||||
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($totalamount != 0) {
|
||||
if ($numlines > 0) $numlines = $numlines-1;
|
||||
$tva_tx = $lines[$numlines]->tva_tx;
|
||||
if (! empty($lines[$numlines]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$numlines]->vat_src_code.')';
|
||||
$amountdeposit[$tva_tx] = ($totalamount * $valuedeposit) / 100;
|
||||
} else {
|
||||
if($totalamount == 0) {
|
||||
$amountdeposit[0] = 0;
|
||||
}
|
||||
} else {
|
||||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$amount_ttc_diff = $amountdeposit[0];
|
||||
}
|
||||
|
||||
foreach ($amountdeposit as $tva => $amount)
|
||||
{
|
||||
if (empty($amount)) continue;
|
||||
|
||||
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
|
||||
$descline = $langs->trans('Deposit');
|
||||
//$descline.= ' - '.$langs->trans($arraylist[$typeamount]);
|
||||
@@ -1296,6 +1321,7 @@ if (empty($reshook))
|
||||
} elseif ($typeamount=='variable') {
|
||||
$descline.= ' ('. $valuedeposit.'%)';
|
||||
}
|
||||
|
||||
$descline.= ' - '.$srcobject->ref;
|
||||
$result = $object->addline(
|
||||
$descline,
|
||||
@@ -1352,6 +1378,8 @@ if (empty($reshook))
|
||||
{
|
||||
// Don't add lines with qty 0 when coming from a shipment including all order lines
|
||||
if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue;
|
||||
// Don't add closed lines when coming from a contract
|
||||
if($srcobject->element == 'contrat' && $lines[$i]->statut == 5) continue;
|
||||
|
||||
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
|
||||
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
|
||||
@@ -1373,7 +1401,7 @@ if (empty($reshook))
|
||||
$result = $object->insert_discount($discountid); // This include link_to_invoice
|
||||
} else {
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -1429,7 +1457,7 @@ if (empty($reshook))
|
||||
$lineid = $result;
|
||||
} else {
|
||||
$lineid = 0;
|
||||
$error ++;
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1441,7 +1469,7 @@ if (empty($reshook))
|
||||
}
|
||||
} else {
|
||||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1509,14 +1537,16 @@ if (empty($reshook))
|
||||
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
|
||||
if (empty($datefacture)) {
|
||||
$error++;
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("Date")) . '</div>';
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("Date"));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
|
||||
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
|
||||
|
||||
if (!($_POST['situations'] > 0)) {
|
||||
$error++;
|
||||
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation")) . '</div>';
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation"));
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@@ -1533,7 +1563,9 @@ if (empty($reshook))
|
||||
{
|
||||
$line->origin = $object->origin;
|
||||
$line->origin_id = $line->id;
|
||||
$line->fk_prev_id = $line->id;
|
||||
$line->fetch_optionals($line->id);
|
||||
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
|
||||
|
||||
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||
if ($line->fk_remise_except)
|
||||
@@ -1654,7 +1686,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@@ -1665,37 +1697,46 @@ if (empty($reshook))
|
||||
|
||||
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
|
||||
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if (!$prod_entry_mode)
|
||||
{
|
||||
if (GETPOST('type') < 0 && ! GETPOST('search_idprod'))
|
||||
{
|
||||
setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
|
||||
if (($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error ++;
|
||||
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($qty == '') {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if ($qty < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
|
||||
@@ -1707,7 +1748,7 @@ if (empty($reshook))
|
||||
$idprod = $res->fk_product_child;
|
||||
} else {
|
||||
setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2052,7 +2093,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@@ -2113,7 +2154,7 @@ if (empty($reshook))
|
||||
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
|
||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
|
||||
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$type = GETPOST('type');
|
||||
@@ -2122,14 +2163,29 @@ if (empty($reshook))
|
||||
// Check parameters
|
||||
if (GETPOST('type') < 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($qty < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
|
||||
$error ++;
|
||||
$error++;
|
||||
}
|
||||
if ((empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
|
||||
{
|
||||
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Update line
|
||||
if (! $error) {
|
||||
@@ -2216,11 +2272,13 @@ if (empty($reshook))
|
||||
if (!$object->fetch($id) > 0) dol_print_error($db);
|
||||
if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
|
||||
{
|
||||
$all_progress = GETPOST('all_progress', 'int');
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
$percent = $line->get_prev_progress($object->id);
|
||||
if (GETPOST('all_progress') < $percent) {
|
||||
$mesg = '<div class="warning">' . $langs->trans("CantBeLessThanMinPercent") . '</div>';
|
||||
if (floatval($all_progress) < floatval($percent)) {
|
||||
$mesg = $langs->trans("Line") . ' ' . $i . ' '. $line->ref .' : ' . $langs->trans("CantBeLessThanMinPercent");
|
||||
setEventMessages($mesg, null, 'warnings');
|
||||
$result = -1;
|
||||
} else
|
||||
$object->update_percent($line, $_POST['all_progress']);
|
||||
@@ -3223,8 +3281,7 @@ if ($action == 'create')
|
||||
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1);
|
||||
// We check if Origin document (id and type is known) has already at least one invoice attached to it
|
||||
$objectsrc->fetchObjectLinked($originid,$origin,'','facture');
|
||||
$cntinvoice=count($objectsrc->linkedObjects['facture']);
|
||||
if ($cntinvoice>=1)
|
||||
if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1)
|
||||
{
|
||||
setEventMessages('WarningBillExist', null, 'warnings');
|
||||
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
|
||||
@@ -3619,7 +3676,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1,'customer');
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherBills").'</a>)';
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
@@ -4501,7 +4558,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
|
||||
|
||||
// Form to add new line
|
||||
if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline' && ($object->is_first() || !$object->situation_cycle_ref))
|
||||
if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline')
|
||||
{
|
||||
if ($action != 'editline' && $action != 'selectlines')
|
||||
{
|
||||
@@ -4778,9 +4835,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->facture->supprimer)
|
||||
$isErasable = $object->is_erasable();
|
||||
if ($user->rights->facture->supprimer || ($user->rights->facture->creer && $isErasable == 1)) // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
|
||||
{
|
||||
$isErasable = $object->is_erasable();
|
||||
//var_dump($isErasable);
|
||||
if ($isErasable == -4) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>';
|
||||
|
||||
@@ -206,7 +206,7 @@ class Facture extends CommonInvoice
|
||||
* If paid partially, $this->close_code can be:
|
||||
* - CLOSECODE_DISCOUNTVAT
|
||||
* - CLOSECODE_BADDEBT
|
||||
* If paid completelly, this->close_code will be null
|
||||
* If paid completely, this->close_code will be null
|
||||
*/
|
||||
const STATUS_CLOSED = 2;
|
||||
|
||||
@@ -1177,6 +1177,10 @@ class Facture extends CommonInvoice
|
||||
|
||||
if ($user->rights->facture->lire) {
|
||||
$label = '<u>' . $langs->trans("ShowInvoice") . '</u>';
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceReplace") . '</u>';
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceAvoir") . '</u>';
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceDeposit") . '</u>';
|
||||
if ($this->type == self::TYPE_SITUATION) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceSituation") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
@@ -1185,16 +1189,12 @@ class Facture extends CommonInvoice
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_localtax1))
|
||||
$label.= '<br><b>' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_localtax2))
|
||||
if (! empty($this->total_localtax1) && $this->total_localtax1 != 0) // We keep test != 0 because $this->total_localtax1 can be '0.00000000'
|
||||
$label.= '<br><b>eee' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_localtax2) && $this->total_localtax2 != 0)
|
||||
$label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
|
||||
if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref;
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
}
|
||||
|
||||
@@ -1379,7 +1379,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error='Bill with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found';
|
||||
$this->error='Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found';
|
||||
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
|
||||
return 0;
|
||||
}
|
||||
@@ -1485,7 +1485,7 @@ class Facture extends CommonInvoice
|
||||
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
// TODO Fetch optional like done in fetch line of facture_rec ?
|
||||
$line->fetch_optionals();
|
||||
|
||||
$this->lines[$i] = $line;
|
||||
|
||||
@@ -1605,7 +1605,7 @@ class Facture extends CommonInvoice
|
||||
$sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").",";
|
||||
$sql.= " situation_cycle_ref=".(empty($this->situation_cycle_ref)?"null":$this->db->escape($this->situation_cycle_ref)).",";
|
||||
$sql.= " situation_counter=".(empty($this->situation_counter)?"null":$this->db->escape($this->situation_counter)).",";
|
||||
$sql.= " situation_final=".(empty($this->situation_counter)?"0":$this->db->escape($this->situation_counter));
|
||||
$sql.= " situation_final=".(empty($this->situation_final)?"0":$this->db->escape($this->situation_final));
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
$this->db->begin();
|
||||
@@ -1709,9 +1709,9 @@ class Facture extends CommonInvoice
|
||||
$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;
|
||||
$facligne->multicurrency_total_ht = -$remise->multicurrency_amount_ht;
|
||||
$facligne->multicurrency_total_tva = -$remise->multicurrency_amount_tva;
|
||||
$facligne->multicurrency_total_ttc = -$remise->multicurrency_amount_ttc;
|
||||
|
||||
$lineid=$facligne->insert();
|
||||
if ($lineid > 0)
|
||||
@@ -2370,7 +2370,7 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
// Set new ref and define current statut
|
||||
// Set new ref and define current status
|
||||
if (! $error)
|
||||
{
|
||||
$this->ref = $num;
|
||||
@@ -2590,55 +2590,47 @@ class Facture extends CommonInvoice
|
||||
global $mysoc, $conf, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::addline id=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,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';
|
||||
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($ventil)) $ventil=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($fk_prev_id)) $fk_prev_id = 'null';
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code='';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ht_devise=price2num($pu_ht_devise);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
$txtva=price2num($txtva);
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
if (! empty($this->brouillon))
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||
|
||||
// Clean parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
if (empty($qty)) $qty=0;
|
||||
if (empty($info_bits)) $info_bits=0;
|
||||
if (empty($rang)) $rang=0;
|
||||
if (empty($ventil)) $ventil=0;
|
||||
if (empty($txtva)) $txtva=0;
|
||||
if (empty($txlocaltax1)) $txlocaltax1=0;
|
||||
if (empty($txlocaltax2)) $txlocaltax2=0;
|
||||
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
|
||||
if (empty($fk_prev_id)) $fk_prev_id = 'null';
|
||||
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
|
||||
|
||||
$remise_percent=price2num($remise_percent);
|
||||
$qty=price2num($qty);
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ht_devise=price2num($pu_ht_devise);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
|
||||
if ($price_base_type=='HT')
|
||||
{
|
||||
$pu=$pu_ht;
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu=$pu_ttc;
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($type < 0) return -1;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$product_type=$type;
|
||||
@@ -2656,6 +2648,16 @@ class Facture extends CommonInvoice
|
||||
}
|
||||
}
|
||||
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code='';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
// 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
|
||||
@@ -3742,7 +3744,7 @@ class Facture extends CommonInvoice
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->facture->client->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("CustomerBillsUnpaid");
|
||||
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills';
|
||||
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=billing&leftmenu=customers_bills';
|
||||
$response->img=img_object('',"bill");
|
||||
|
||||
$generic_facture = new Facture($this->db);
|
||||
@@ -4784,8 +4786,8 @@ class FactureLigne extends CommonInvoiceLine
|
||||
}
|
||||
|
||||
/**
|
||||
* Mise a jour en base des champs total_xxx de ligne de facture
|
||||
* TODO What is goal of this method ?
|
||||
* Update DB line fields total_xxx
|
||||
* Used by migration
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
@@ -4828,14 +4830,15 @@ class FactureLigne extends CommonInvoiceLine
|
||||
* Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line.
|
||||
*
|
||||
* @param int $invoiceid Invoice id
|
||||
* @param bool $include_credit_note Include credit note or not
|
||||
* @return int >= 0
|
||||
*/
|
||||
function get_prev_progress($invoiceid)
|
||||
function get_prev_progress($invoiceid, $include_credit_note=true)
|
||||
{
|
||||
if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") {
|
||||
return 0;
|
||||
} else {
|
||||
// If invoice is a not a situation invoice, this->fk_prev_id is used for something else
|
||||
// If invoice is not a situation invoice, this->fk_prev_id is used for something else
|
||||
$tmpinvoice=new Facture($this->db);
|
||||
$tmpinvoice->fetch($invoiceid);
|
||||
if ($tmpinvoice->type != Facture::TYPE_SITUATION) return 0;
|
||||
@@ -4844,7 +4847,26 @@ class FactureLigne extends CommonInvoiceLine
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql && $resql->num_rows > 0) {
|
||||
$res = $this->db->fetch_array($resql);
|
||||
return floatval($res['situation_percent']);
|
||||
|
||||
$returnPercent = floatval($res['situation_percent']);
|
||||
|
||||
if($include_credit_note) {
|
||||
|
||||
$sql = 'SELECT fd.situation_percent FROM ' . MAIN_DB_PREFIX . 'facturedet fd';
|
||||
$sql.= ' JOIN ' . MAIN_DB_PREFIX . 'facture f ON (f.rowid = fd.fk_facture) ';
|
||||
$sql.= ' WHERE fd.fk_prev_id =' . $this->fk_prev_id;
|
||||
$sql.= ' AND f.situation_cycle_ref = '.$tmpinvoice->situation_cycle_ref; // Prevent cycle outed
|
||||
$sql.= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
if($res) {
|
||||
while($obj = $this->db->fetch_object($res)) {
|
||||
$returnPercent = $returnPercent + floatval($obj->situation_percent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $returnPercent;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
||||
|
||||
@@ -84,8 +84,8 @@ class FactureStats extends Stats
|
||||
$this->where.=" AND f.fk_soc = ".$this->socid;
|
||||
}
|
||||
if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid;
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2)";
|
||||
else $this->where.= " AND f.type IN (0,1,2,3)";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2,5)";
|
||||
else $this->where.= " AND f.type IN (0,1,2,3,5)";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ class PaymentTerm // extends CommonObject
|
||||
global $langs;
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
$sql.= " t.entity";
|
||||
$sql.= " t.entity,";
|
||||
|
||||
$sql.= " t.code,";
|
||||
$sql.= " t.sortorder,";
|
||||
|
||||
@@ -453,7 +453,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline))
|
||||
{
|
||||
@@ -776,7 +776,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
|
||||
|
||||
$objectline = new FactureLigneRec($db);
|
||||
if ($objectline->fetch(GETPOST('lineid')))
|
||||
|
||||
@@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('bills', 'companies', 'products'));
|
||||
$langs->loadLangs(array('bills', 'companies', 'products', 'categories'));
|
||||
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
$projectid=(GETPOST('projectid')?GETPOST('projectid','int'):0);
|
||||
@@ -464,7 +464,7 @@ if ($search_month > 0)
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $serch_year))."'";
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.datef, '%m') = '".$search_month."'";
|
||||
}
|
||||
@@ -509,8 +509,9 @@ if (! $sall)
|
||||
$sql.= ' typent.code,';
|
||||
$sql.= ' state.code_departement, state.nom,';
|
||||
$sql.= ' country.code,';
|
||||
$sql.= " p.rowid, p.ref";
|
||||
|
||||
$sql.= " p.rowid, p.ref, p.title";
|
||||
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
|
||||
// Add fields from extrafields
|
||||
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
|
||||
{
|
||||
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
|
||||
@@ -574,14 +575,14 @@ if ($resql)
|
||||
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
|
||||
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
|
||||
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
|
||||
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
|
||||
if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
|
||||
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
||||
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
|
||||
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
|
||||
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
|
||||
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
||||
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
|
||||
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
|
||||
if ($show_files) $param.='&show_files='.urlencode($show_files);
|
||||
if ($option) $param.="&search_option=".urlencode($option);
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
@@ -908,6 +909,7 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
|
||||
$projectstatic=new Project($db);
|
||||
$discount = new DiscountAbsolute($db);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
@@ -922,6 +924,9 @@ if ($resql)
|
||||
$facturestatic->ref=$obj->ref;
|
||||
$facturestatic->type=$obj->type;
|
||||
$facturestatic->statut=$obj->fk_statut;
|
||||
$facturestatic->total_ttc=$obj->total_ttc;
|
||||
$facturestatic->paye=$obj->paye;
|
||||
$facturestatic->fk_soc=$obj->fk_soc;
|
||||
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
|
||||
$facturestatic->note_public=$obj->note_public;
|
||||
$facturestatic->note_private=$obj->note_private;
|
||||
@@ -941,7 +946,12 @@ if ($resql)
|
||||
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
|
||||
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
||||
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
||||
$remaintopay = $obj->total_ttc - $totalpay;
|
||||
$remaintopay = $facturestatic->total_ttc - $totalpay;
|
||||
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) {
|
||||
$remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
|
||||
$remaintopay = -$remaincreditnote;
|
||||
$totalpay = $facturestatic->total_ttc - $remaintopay;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||
|
||||
@@ -120,7 +120,7 @@ function pt($db, $sql, $date)
|
||||
if ($obj->mode == 'claimed' && ! empty($previousmode))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">'.$obj->dm."</td>\n";
|
||||
print '<td class="nowrap">'.$previousmonth."</td>\n";
|
||||
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n";
|
||||
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n";
|
||||
print "</tr>\n";
|
||||
@@ -270,7 +270,7 @@ $mend = $tmp['mon'];
|
||||
|
||||
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
||||
$i=0; $mcursor=0;
|
||||
while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
|
||||
while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
|
||||
{
|
||||
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
|
||||
if ($m == 13) $y++;
|
||||
@@ -535,7 +535,7 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu
|
||||
if ($i > 2)
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
|
||||
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll,'MT')).'</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye,'MT')).'</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtotal,'MT')).'</td>';
|
||||
|
||||
@@ -250,11 +250,14 @@ if (empty($reshook))
|
||||
$paiement->amounts = $amounts; // Array with all payments dispatching with invoice id
|
||||
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
|
||||
$paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement','code','id',1);
|
||||
$paiement->num_paiement = GETPOST('num_paiement');
|
||||
$paiement->note = GETPOST('comment');
|
||||
$paiement->num_paiement = GETPOST('num_paiement', 'alpha');
|
||||
$paiement->note = GETPOST('comment', 'alpha');
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Create payment and update this->multicurrency_amounts if this->amounts filled or
|
||||
// this->amounts if this->multicurrency_amounts filled.
|
||||
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0)); // This include closing invoices and regenerating documents
|
||||
if ($paiement_id < 0)
|
||||
{
|
||||
@@ -279,7 +282,7 @@ if (empty($reshook))
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
// If payment dispatching on more than one invoice, we keep on summary page, otherwise jump on invoice card
|
||||
// If payment dispatching on more than one invoice, we stay on summary page, otherwise jump on invoice card
|
||||
$invoiceid=0;
|
||||
foreach ($paiement->amounts as $key => $amount)
|
||||
{
|
||||
@@ -649,12 +652,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Multicurrency Price
|
||||
// Multicurrency remain to pay
|
||||
print '<td align="right">';
|
||||
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td class="right nowraponall">';
|
||||
|
||||
// Add remind multicurrency amount
|
||||
$namef = 'multicurrency_amount_'.$objp->facid;
|
||||
@@ -666,12 +669,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
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="text" class="maxwidth75 multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
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="text" class="maxwidth75" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
|
||||
}
|
||||
}
|
||||
@@ -692,7 +695,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
//$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
|
||||
|
||||
// Amount
|
||||
print '<td align="right">';
|
||||
print '<td class="right nowraponall">';
|
||||
|
||||
// Add remind amount
|
||||
$namef = 'amount_'.$objp->facid;
|
||||
@@ -702,12 +705,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
{
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
|
||||
print '<input type="text" class="maxwidth75 amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
|
||||
print '<input type="hidden" class="remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
|
||||
print '<input type="text" class="maxwidth75" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
|
||||
print '<input type="hidden" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
@@ -91,7 +91,7 @@ $max=10;
|
||||
|
||||
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
|
||||
$sql.= " bc.statut, bc.nbcheque,";
|
||||
$sql.= " ba.ref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
|
||||
$sql.= " ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
|
||||
$sql.= " aj.code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
|
||||
@@ -120,7 +120,7 @@ if ($resql)
|
||||
$checkdepositstatic->statut=$objp->statut;
|
||||
|
||||
$accountstatic->id=$objp->bid;
|
||||
$accountstatic->ref=$objp->ref;
|
||||
$accountstatic->ref=$objp->bref;
|
||||
$accountstatic->label=$objp->label;
|
||||
$accountstatic->number=$objp->number;
|
||||
$accountstatic->currency_code=$objp->currency_code;
|
||||
|
||||
@@ -292,6 +292,7 @@ class Paiement extends CommonObject
|
||||
if ($invoice->type == Facture::TYPE_DEPOSIT)
|
||||
{
|
||||
$amount_ht = $amount_tva = $amount_ttc = array();
|
||||
$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
|
||||
|
||||
// Insert one discount by VAT rate category
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
@@ -310,6 +311,9 @@ class Paiement extends CommonObject
|
||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||
$amount_ttc[$line->tva_tx] += $line->total_ttc;
|
||||
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
|
||||
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
|
||||
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
@@ -318,6 +322,9 @@ class Paiement extends CommonObject
|
||||
$discount->amount_ht = abs($amount_ht[$tva_tx]);
|
||||
$discount->amount_tva = abs($amount_tva[$tva_tx]);
|
||||
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
|
||||
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
|
||||
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
|
||||
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
|
||||
$discount->tva_tx = abs($tva_tx);
|
||||
|
||||
$result = $discount->create($user);
|
||||
@@ -995,7 +1002,7 @@ class Paiement extends CommonObject
|
||||
/**
|
||||
* get the right way of payment
|
||||
*
|
||||
* @return string 'dolibarr' if standard comportment or paid in dolibarr currency, 'customer' if payment received from multicurrency inputs
|
||||
* @return string 'dolibarr' if standard comportment or paid in main currency, 'customer' if payment received from multicurrency inputs
|
||||
*/
|
||||
function getWay()
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ $action=GETPOST('action','aZ09');
|
||||
// Security check
|
||||
$socid = GETPOST("socid","int");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'salaries', '', '', 'payment');
|
||||
$result = restrictedArea($user, 'salaries', '', '', '');
|
||||
|
||||
$object = new PaymentSalary($db);
|
||||
|
||||
|
||||
@@ -44,8 +44,9 @@ $action = GETPOST('action','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid","int");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'salaries', $id, '');
|
||||
$result = restrictedArea($user, 'salaries', '', '', '');
|
||||
|
||||
|
||||
// Get parameters
|
||||
|
||||
@@ -148,7 +148,7 @@ if ($result)
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
$newcardbutton='';
|
||||
if ($user->rights->salaries->payment->write)
|
||||
if (! empty($user->rights->salaries->write))
|
||||
{
|
||||
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/salaries/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewSalaryPayment').'</span>';
|
||||
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
|
||||
|
||||
@@ -41,18 +41,6 @@ $socid = GETPOST("socid","int");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'salaries', '', '', '');
|
||||
|
||||
// Other security check
|
||||
$childids = $user->getAllChildIds();
|
||||
$childids[]=$user->id;
|
||||
if ($userid > 0)
|
||||
{
|
||||
if (empty($user->rights->salaries->payment->readall) && ! in_array($userid, $childids))
|
||||
{
|
||||
accessforbidden();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
$nowyear=strftime("%Y", dol_now());
|
||||
$year = GETPOST('year')>0?GETPOST('year'):$nowyear;
|
||||
//$startyear=$year-2;
|
||||
@@ -77,11 +65,6 @@ print load_fiche_titre($title, $mesg);
|
||||
dol_mkdir($dir);
|
||||
|
||||
$useridtofilter=$userid; // Filter from parameters
|
||||
if (empty($useridtofilter))
|
||||
{
|
||||
$useridtofilter=$childids;
|
||||
if (! empty($user->rights->salaries->payment->readall)) $useridtofilter=0;
|
||||
}
|
||||
|
||||
$stats = new SalariesStats($db, $socid, $useridtofilter);
|
||||
|
||||
|
||||
@@ -288,10 +288,12 @@ class ChargeSociales extends CommonObject
|
||||
* Met a jour une charge sociale
|
||||
*
|
||||
* @param User $user Utilisateur qui modifie
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 si erreur, >0 si ok
|
||||
*/
|
||||
function update($user)
|
||||
function update($user,$notrigger=0)
|
||||
{
|
||||
$error=0;
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
|
||||
@@ -305,17 +307,40 @@ class ChargeSociales extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
if (! $resql) {
|
||||
$error++; $this->errors[]="Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('SOCIALCHARGES_MODIFY',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1*$error;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -397,7 +397,7 @@ while($j<$numlt)
|
||||
|
||||
|
||||
// Payment Salary
|
||||
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
||||
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|
||||
{
|
||||
if (! $mode || $mode != 'sconly')
|
||||
{
|
||||
|
||||
@@ -372,161 +372,156 @@ if (! is_array($x_coll) || ! is_array($x_paye))
|
||||
$subtot_coll_total_ht = 0;
|
||||
$subtot_coll_vat = 0;
|
||||
|
||||
if (is_array($x_both[$thirdparty_id]['coll']['detail']))
|
||||
{
|
||||
if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['coll']['totalht'] > $min)) {
|
||||
|
||||
// VAT Rate
|
||||
print "<tr>";
|
||||
print '<td class="tax_rate">';
|
||||
if (is_numeric($thirdparty_id))
|
||||
{
|
||||
$company_static->fetch($thirdparty_id);
|
||||
print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpid = preg_replace('/userid_/','',$thirdparty_id);
|
||||
$user_static->fetch($tmpid);
|
||||
print $langs->trans("User").': '.$user_static->getNomUrl(1);
|
||||
}
|
||||
print '</td><td colspan="'.($span+1).'"></td>';
|
||||
print '</tr>'."\n";
|
||||
if (is_array($x_both[$thirdparty_id]['coll']['detail'])) {
|
||||
|
||||
foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) {
|
||||
// Define type
|
||||
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
|
||||
$type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']);
|
||||
// Try to enhance type detection using date_start and date_end for free lines where type
|
||||
// was not saved.
|
||||
if (!empty($fields['ddate_start'])) {
|
||||
$type=1;
|
||||
}
|
||||
if (!empty($fields['ddate_end'])) {
|
||||
$type=1;
|
||||
// VAT Rate
|
||||
print "<tr>";
|
||||
print '<td class="tax_rate">';
|
||||
if (is_numeric($thirdparty_id)) {
|
||||
$company_static->fetch($thirdparty_id);
|
||||
print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1);
|
||||
} else {
|
||||
$tmpid = preg_replace('/userid_/', '', $thirdparty_id);
|
||||
$user_static->fetch($tmpid);
|
||||
print $langs->trans("User") . ': ' . $user_static->getNomUrl(1);
|
||||
}
|
||||
print '</td><td colspan="' . ($span + 1) . '"></td>';
|
||||
print '</tr>' . "\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
print '<td class="nowrap" align="left">'.$fields['link'].'</td>';
|
||||
|
||||
// Invoice date
|
||||
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
|
||||
|
||||
// Payment date
|
||||
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
|
||||
else print '<td></td>';
|
||||
|
||||
// Rate
|
||||
print '<td align="right">' . $fields['drate'] . '</td>';
|
||||
|
||||
// Description
|
||||
print '<td align="left">';
|
||||
if ($fields['pid'])
|
||||
{
|
||||
$product_static->id=$fields['pid'];
|
||||
$product_static->ref=$fields['pref'];
|
||||
$product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered
|
||||
print $product_static->getNomUrl(1);
|
||||
if (dol_string_nohtmltag($fields['descr'])) {
|
||||
print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
|
||||
foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) {
|
||||
// Define type
|
||||
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
|
||||
$type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
|
||||
// Try to enhance type detection using date_start and date_end for free lines where type
|
||||
// was not saved.
|
||||
if (!empty($fields['ddate_start'])) {
|
||||
$type = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($type) {
|
||||
$text = img_object($langs->trans('Service'),'service');
|
||||
if (!empty($fields['ddate_end'])) {
|
||||
$type = 1;
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
print '<td class="nowrap" align="left">' . $fields['link'] . '</td>';
|
||||
|
||||
// Invoice date
|
||||
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
|
||||
|
||||
// Payment date
|
||||
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
|
||||
print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
|
||||
} else {
|
||||
$text = img_object($langs->trans('Product'),'product');
|
||||
print '<td></td>';
|
||||
}
|
||||
if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) {
|
||||
if ($reg[1]=='DEPOSIT') {
|
||||
$fields['descr']=$langs->transnoentitiesnoconv('Deposit');
|
||||
} elseif ($reg[1]=='CREDIT_NOTE') {
|
||||
$fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
|
||||
|
||||
// Rate
|
||||
print '<td align="right">' . $fields['drate'] . '</td>';
|
||||
|
||||
// Description
|
||||
print '<td align="left">';
|
||||
if ($fields['pid']) {
|
||||
$product_static->id = $fields['pid'];
|
||||
$product_static->ref = $fields['pref'];
|
||||
$product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
|
||||
print $product_static->getNomUrl(1);
|
||||
if (dol_string_nohtmltag($fields['descr'])) {
|
||||
print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
|
||||
}
|
||||
} else {
|
||||
if ($type) {
|
||||
$text = img_object($langs->trans('Service'), 'service');
|
||||
} else {
|
||||
$fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
|
||||
$text = img_object($langs->trans('Product'), 'product');
|
||||
}
|
||||
}
|
||||
print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
|
||||
if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
|
||||
if ($reg[1] == 'DEPOSIT') {
|
||||
$fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
|
||||
} elseif ($reg[1] == 'CREDIT_NOTE') {
|
||||
$fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
|
||||
} else {
|
||||
$fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
|
||||
}
|
||||
}
|
||||
print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
|
||||
|
||||
// Show range
|
||||
print_date_range($fields['ddate_start'],$fields['ddate_end']);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Total HT
|
||||
if ($modetax != 1)
|
||||
{
|
||||
print '<td class="nowrap" align="right">';
|
||||
print price($fields['totalht']);
|
||||
if (price2num($fields['ftotal_ttc']))
|
||||
{
|
||||
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
|
||||
$ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
|
||||
//print ' ('.round($ratiolineinvoice*100,2).'%)';
|
||||
// Show range
|
||||
print_date_range($fields['ddate_start'], $fields['ddate_end']);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Payment
|
||||
$ratiopaymentinvoice=1;
|
||||
if ($modetax != 1)
|
||||
{
|
||||
// Total HT
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right">';
|
||||
print price($fields['totalht']);
|
||||
if (price2num($fields['ftotal_ttc'])) {
|
||||
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
|
||||
$ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
|
||||
//print ' ('.round($ratiolineinvoice*100,2).'%)';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Payment
|
||||
$ratiopaymentinvoice = 1;
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right">';
|
||||
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||
$payment_static->id = $fields['payment_id'];
|
||||
print $payment_static->getNomUrl(2);
|
||||
}
|
||||
if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
|
||||
|| ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) {
|
||||
print $langs->trans("NA");
|
||||
} else {
|
||||
if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
|
||||
$ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
|
||||
}
|
||||
print price(price2num($fields['payment_amount'], 'MT'));
|
||||
if (isset($fields['payment_amount'])) {
|
||||
print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Total collected
|
||||
print '<td class="nowrap" align="right">';
|
||||
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc'])
|
||||
{
|
||||
$payment_static->id=$fields['payment_id'];
|
||||
print $payment_static->getNomUrl(2);
|
||||
}
|
||||
if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
|
||||
|| ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice'))
|
||||
{
|
||||
print $langs->trans("NA");
|
||||
} else {
|
||||
if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
|
||||
$ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
|
||||
}
|
||||
print price(price2num($fields['payment_amount'],'MT'));
|
||||
if (isset($fields['payment_amount'])) {
|
||||
print ' ('.round($ratiopaymentinvoice*100,2).'%)';
|
||||
}
|
||||
}
|
||||
$temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
|
||||
print price(price2num($temp_ht, 'MT'), 1);
|
||||
print '</td>';
|
||||
|
||||
// VAT
|
||||
print '<td class="nowrap" align="right">';
|
||||
$temp_vat = $fields['vat'] * $ratiopaymentinvoice;
|
||||
print price(price2num($temp_vat, 'MT'), 1);
|
||||
//print price($fields['vat']);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$subtot_coll_total_ht += $temp_ht;
|
||||
$subtot_coll_vat += $temp_vat;
|
||||
$x_coll_sum += $temp_vat;
|
||||
}
|
||||
|
||||
// Total collected
|
||||
print '<td class="nowrap" align="right">';
|
||||
$temp_ht=$fields['totalht']*$ratiopaymentinvoice;
|
||||
print price(price2num($temp_ht,'MT'),1);
|
||||
print '</td>';
|
||||
|
||||
// VAT
|
||||
print '<td class="nowrap" align="right">';
|
||||
$temp_vat=$fields['vat']*$ratiopaymentinvoice;
|
||||
print price(price2num($temp_vat,'MT'),1);
|
||||
//print price($fields['vat']);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$subtot_coll_total_ht += $temp_ht;
|
||||
$subtot_coll_vat += $temp_vat;
|
||||
$x_coll_sum += $temp_vat;
|
||||
}
|
||||
// Total customers for this vat rate
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="4"></td>';
|
||||
print '<td align="right">' . $langs->trans("Total") . ':</td>';
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
}
|
||||
print '<td align="right">' . price(price2num($subtot_coll_total_ht, 'MT')) . '</td>';
|
||||
print '<td class="nowrap" align="right">' . price(price2num($subtot_coll_vat, 'MT')) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// Total customers for this vat rate
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="4"></td>';
|
||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
}
|
||||
print '<td align="right">'.price(price2num($subtot_coll_total_ht,'MT')).'</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtot_coll_vat,'MT')).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (count($x_coll) == 0) // Show a total ine if nothing shown
|
||||
@@ -567,161 +562,153 @@ if (! is_array($x_coll) || ! is_array($x_paye))
|
||||
$subtot_paye_total_ht = 0;
|
||||
$subtot_paye_vat = 0;
|
||||
|
||||
if (is_array($x_both[$thirdparty_id]['paye']['detail']))
|
||||
{
|
||||
print "<tr>";
|
||||
print '<td class="tax_rate">';
|
||||
if (is_numeric($thirdparty_id))
|
||||
{
|
||||
$company_static->fetch($thirdparty_id);
|
||||
print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpid = preg_replace('/userid_/','',$thirdparty_id);
|
||||
$user_static->fetch($tmpid);
|
||||
print $langs->trans("User").': '.$user_static->getNomUrl(1);
|
||||
}
|
||||
print '<td colspan="'.($span+1).'"></td>';
|
||||
print '</tr>'."\n";
|
||||
if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['paye']['totalht'] > $min)) {
|
||||
|
||||
foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index=>$fields) {
|
||||
// Define type
|
||||
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
|
||||
$type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']);
|
||||
// Try to enhance type detection using date_start and date_end for free lines where type
|
||||
// was not saved.
|
||||
if (!empty($fields['ddate_start'])) {
|
||||
$type=1;
|
||||
}
|
||||
if (!empty($fields['ddate_end'])) {
|
||||
$type=1;
|
||||
if (is_array($x_both[$thirdparty_id]['paye']['detail'])) {
|
||||
print "<tr>";
|
||||
print '<td class="tax_rate">';
|
||||
if (is_numeric($thirdparty_id)) {
|
||||
$company_static->fetch($thirdparty_id);
|
||||
print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1);
|
||||
} else {
|
||||
$tmpid = preg_replace('/userid_/', '', $thirdparty_id);
|
||||
$user_static->fetch($tmpid);
|
||||
print $langs->trans("User") . ': ' . $user_static->getNomUrl(1);
|
||||
}
|
||||
print '<td colspan="' . ($span + 1) . '"></td>';
|
||||
print '</tr>' . "\n";
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
print '<td class="nowrap" align="left">'.$fields['link'].'</td>';
|
||||
|
||||
// Invoice date
|
||||
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
|
||||
|
||||
// Payment date
|
||||
if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
|
||||
else print '<td></td>';
|
||||
|
||||
// Company name
|
||||
print '<td align="left">' . $fields['company_link'] . '</td>';
|
||||
|
||||
// Description
|
||||
print '<td align="left">';
|
||||
if ($fields['pid'])
|
||||
{
|
||||
$product_static->id=$fields['pid'];
|
||||
$product_static->ref=$fields['pref'];
|
||||
$product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered
|
||||
print $product_static->getNomUrl(1);
|
||||
if (dol_string_nohtmltag($fields['descr'])) {
|
||||
print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
|
||||
foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index => $fields) {
|
||||
// Define type
|
||||
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
|
||||
$type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
|
||||
// Try to enhance type detection using date_start and date_end for free lines where type
|
||||
// was not saved.
|
||||
if (!empty($fields['ddate_start'])) {
|
||||
$type = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($type) {
|
||||
$text = img_object($langs->trans('Service'),'service');
|
||||
if (!empty($fields['ddate_end'])) {
|
||||
$type = 1;
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
print '<td class="nowrap" align="left">' . $fields['link'] . '</td>';
|
||||
|
||||
// Invoice date
|
||||
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
|
||||
|
||||
// Payment date
|
||||
if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') {
|
||||
print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
|
||||
} else {
|
||||
$text = img_object($langs->trans('Product'),'product');
|
||||
print '<td></td>';
|
||||
}
|
||||
if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) {
|
||||
if ($reg[1]=='DEPOSIT') {
|
||||
$fields['descr']=$langs->transnoentitiesnoconv('Deposit');
|
||||
} elseif ($reg[1]=='CREDIT_NOTE') {
|
||||
$fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
|
||||
|
||||
// Company name
|
||||
print '<td align="left">' . $fields['company_link'] . '</td>';
|
||||
|
||||
// Description
|
||||
print '<td align="left">';
|
||||
if ($fields['pid']) {
|
||||
$product_static->id = $fields['pid'];
|
||||
$product_static->ref = $fields['pref'];
|
||||
$product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
|
||||
print $product_static->getNomUrl(1);
|
||||
if (dol_string_nohtmltag($fields['descr'])) {
|
||||
print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
|
||||
}
|
||||
} else {
|
||||
if ($type) {
|
||||
$text = img_object($langs->trans('Service'), 'service');
|
||||
} else {
|
||||
$fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
|
||||
$text = img_object($langs->trans('Product'), 'product');
|
||||
}
|
||||
}
|
||||
print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
|
||||
if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
|
||||
if ($reg[1] == 'DEPOSIT') {
|
||||
$fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
|
||||
} elseif ($reg[1] == 'CREDIT_NOTE') {
|
||||
$fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
|
||||
} else {
|
||||
$fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
|
||||
}
|
||||
}
|
||||
print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
|
||||
|
||||
// Show range
|
||||
print_date_range($fields['ddate_start'],$fields['ddate_end']);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Total HT
|
||||
if ($modetax != 1)
|
||||
{
|
||||
print '<td class="nowrap" align="right">';
|
||||
print price($fields['totalht']);
|
||||
if (price2num($fields['ftotal_ttc']))
|
||||
{
|
||||
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
|
||||
$ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
|
||||
//print ' ('.round($ratiolineinvoice*100,2).'%)';
|
||||
// Show range
|
||||
print_date_range($fields['ddate_start'], $fields['ddate_end']);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Payment
|
||||
$ratiopaymentinvoice=1;
|
||||
if ($modetax != 1)
|
||||
{
|
||||
// Total HT
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right">';
|
||||
print price($fields['totalht']);
|
||||
if (price2num($fields['ftotal_ttc'])) {
|
||||
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
|
||||
$ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
|
||||
//print ' ('.round($ratiolineinvoice*100,2).'%)';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Payment
|
||||
$ratiopaymentinvoice = 1;
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right">';
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
|
||||
$paymentfourn_static->id = $fields['payment_id'];
|
||||
print $paymentfourn_static->getNomUrl(2);
|
||||
}
|
||||
|
||||
if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice')
|
||||
|| ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) {
|
||||
print $langs->trans("NA");
|
||||
} else {
|
||||
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
|
||||
$ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
|
||||
}
|
||||
print price(price2num($fields['payment_amount'], 'MT'));
|
||||
if (isset($fields['payment_amount'])) {
|
||||
print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// VAT paid
|
||||
print '<td class="nowrap" align="right">';
|
||||
if ($fields['payment_amount'] && $fields['ftotal_ttc'])
|
||||
{
|
||||
$paymentfourn_static->id=$fields['payment_id'];
|
||||
print $paymentfourn_static->getNomUrl(2);
|
||||
}
|
||||
|
||||
if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice')
|
||||
|| ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice'))
|
||||
{
|
||||
print $langs->trans("NA");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
|
||||
$ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
|
||||
}
|
||||
print price(price2num($fields['payment_amount'],'MT'));
|
||||
if (isset($fields['payment_amount'])) {
|
||||
print ' ('.round($ratiopaymentinvoice*100,2).'%)';
|
||||
}
|
||||
}
|
||||
$temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
|
||||
print price(price2num($temp_ht, 'MT'), 1);
|
||||
print '</td>';
|
||||
|
||||
// VAT
|
||||
print '<td class="nowrap" align="right">';
|
||||
$temp_vat = $fields['vat'] * $ratiopaymentinvoice;
|
||||
print price(price2num($temp_vat, 'MT'), 1);
|
||||
//print price($fields['vat']);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$subtot_paye_total_ht += $temp_ht;
|
||||
$subtot_paye_vat += $temp_vat;
|
||||
$x_paye_sum += $temp_vat;
|
||||
}
|
||||
|
||||
// VAT paid
|
||||
print '<td class="nowrap" align="right">';
|
||||
$temp_ht=$fields['totalht']*$ratiopaymentinvoice;
|
||||
print price(price2num($temp_ht,'MT'),1);
|
||||
print '</td>';
|
||||
|
||||
// VAT
|
||||
print '<td class="nowrap" align="right">';
|
||||
$temp_vat=$fields['vat']*$ratiopaymentinvoice;
|
||||
print price(price2num($temp_vat,'MT'),1);
|
||||
//print price($fields['vat']);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$subtot_paye_total_ht += $temp_ht;
|
||||
$subtot_paye_vat += $temp_vat;
|
||||
$x_paye_sum += $temp_vat;
|
||||
}
|
||||
// Total suppliers for this vat rate
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="4"></td>';
|
||||
print '<td align="right">' . $langs->trans("Total") . ':</td>';
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
}
|
||||
print '<td align="right">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</td>';
|
||||
print '<td class="nowrap" align="right">' . price(price2num($subtot_paye_vat, 'MT')) . '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
// Total suppliers for this vat rate
|
||||
print '<tr class="liste_total">';
|
||||
print '<td colspan="4"></td>';
|
||||
print '<td align="right">'.$langs->trans("Total").':</td>';
|
||||
if ($modetax != 1) {
|
||||
print '<td class="nowrap" align="right"> </td>';
|
||||
print '<td align="right"> </td>';
|
||||
}
|
||||
print '<td align="right">'.price(price2num($subtot_paye_total_ht,'MT')).'</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtot_paye_vat,'MT')).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
if (count($x_paye) == 0) { // Show a total line if nothing shown
|
||||
|
||||
@@ -256,7 +256,8 @@ $mend = $tmp['mon'];
|
||||
//var_dump($m);
|
||||
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
||||
$i=0; $mcursor=0;
|
||||
while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
|
||||
|
||||
while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
|
||||
{
|
||||
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
|
||||
if ($m == 13) $y++;
|
||||
@@ -503,7 +504,7 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu
|
||||
if ($i > 2)
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
|
||||
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll,'MT')).'</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye,'MT')).'</td>';
|
||||
print '<td class="nowrap" align="right">'.price(price2num($subtotal,'MT')).'</td>';
|
||||
@@ -561,12 +562,11 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||
|
||||
print load_fiche_titre($langs->trans("VATBalance"), '', ''); // need to add translation
|
||||
|
||||
$sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm";
|
||||
$sql1 = "SELECT SUM(amount) as mm";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f";
|
||||
$sql1 .= " WHERE f.entity = " . $conf->entity;
|
||||
$sql1 .= " AND f.datev >= '" . $db->idate($date_start) . "'";
|
||||
$sql1 .= " AND f.datev <= '" . $db->idate($date_end) . "'";
|
||||
$sql1 .= " GROUP BY dm ORDER BY dm ASC";
|
||||
|
||||
$result = $db->query($sql1);
|
||||
if ($result) {
|
||||
|
||||
@@ -856,6 +856,7 @@ class Contact extends CommonObject
|
||||
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
$sql.=" WHERE ec.fk_c_type_contact = tc.rowid";
|
||||
$sql.=" AND fk_socpeople = ". $this->id;
|
||||
$sql.=" AND tc.source = 'external'";
|
||||
$sql.=" GROUP BY tc.element";
|
||||
|
||||
dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG);
|
||||
@@ -1050,9 +1051,9 @@ class Contact extends CommonObject
|
||||
function getNbOfEMailings()
|
||||
{
|
||||
$sql = "SELECT count(mc.email) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
|
||||
$sql.= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."mailing as m";
|
||||
$sql.= " WHERE mc.fk_mailing=m.rowid AND mc.email = '".$this->db->escape($this->email)."' ";
|
||||
$sql.= " AND m.entity IN (".getEntity($this->element).") AND mc.statut NOT IN (-1,0)"; // -1 error, 0 not sent, 1 sent with success
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "suppliers"));
|
||||
$langs->loadLangs(array("companies", "suppliers", "categories"));
|
||||
|
||||
$action=GETPOST('action','alpha');
|
||||
$massaction=GETPOST('massaction','alpha');
|
||||
@@ -154,7 +154,7 @@ $arrayfields=array(
|
||||
'p.phone'=>array('label'=>"Phone", 'checked'=>1),
|
||||
'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0),
|
||||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
|
||||
'p.email'=>array('label'=>"EMail", 'checked'=>1),
|
||||
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
|
||||
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
|
||||
@@ -307,12 +307,14 @@ if ($search_societe) $sql.= natural_search('s.nom', $search_socie
|
||||
if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')';
|
||||
if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste);
|
||||
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
|
||||
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
|
||||
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
|
||||
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
|
||||
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
|
||||
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
|
||||
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
|
||||
if (strlen($search_zip)) $sql.= natural_search("p.zip",$search_zip);
|
||||
if (strlen($search_town)) $sql.= natural_search("p.town",$search_town);
|
||||
|
||||
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
|
||||
if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key);
|
||||
if ($type == "o") // filtre sur type
|
||||
@@ -732,7 +734,7 @@ while ($i < min($num,$limit))
|
||||
// Job position
|
||||
if (! empty($arrayfields['p.poste']['checked']))
|
||||
{
|
||||
print '<td>'.dol_trunc($obj->poste,20).'</td>';
|
||||
print '<td class="tdoverflowmax100">'.$obj->poste.'</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Zip
|
||||
|
||||
@@ -456,7 +456,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
// Unset extrafield
|
||||
if (is_array($extralabelsline)) {
|
||||
// Get extra fields
|
||||
@@ -737,7 +737,7 @@ if (empty($reshook))
|
||||
// Extrafields
|
||||
$extrafieldsline = new ExtraFields($db);
|
||||
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
|
||||
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
|
||||
$objectline->array_options=$array_options;
|
||||
|
||||
// TODO verifier price_min si fk_product et multiprix
|
||||
@@ -1421,6 +1421,7 @@ else
|
||||
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -892,6 +892,7 @@ class Contrat extends CommonObject
|
||||
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
|
||||
$sql.= ")";
|
||||
$resql=$this->db->query($sql);
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$error=0;
|
||||
@@ -908,9 +909,8 @@ class Contrat extends CommonObject
|
||||
if ($result > 0)
|
||||
{
|
||||
$modCodeContract = new $module();
|
||||
|
||||
if (!empty($modCodeContract->code_auto)) {
|
||||
// Mise a jour ref
|
||||
if (! empty($modCodeContract->code_auto)) {
|
||||
// Force the ref to a draft value if numbering module is an automatic numbering
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
@@ -919,9 +919,6 @@ class Contrat extends CommonObject
|
||||
$this->ref="(PROV".$this->id.")";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
$this->error='Failed to get PROV number';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1361,7 +1358,9 @@ class Contrat extends CommonObject
|
||||
$pu_ht=price2num($pu_ht);
|
||||
$pu_ttc=price2num($pu_ttc);
|
||||
$pa_ht=price2num($pa_ht);
|
||||
$txtva=price2num($txtva);
|
||||
if (!preg_match('/\((.*)\)/', $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||
}
|
||||
$txlocaltax1=price2num($txlocaltax1);
|
||||
$txlocaltax2=price2num($txlocaltax2);
|
||||
$remise_percent=price2num($remise_percent);
|
||||
@@ -1386,21 +1385,21 @@ class Contrat extends CommonObject
|
||||
// Check parameters
|
||||
if (empty($remise_percent)) $remise_percent=0;
|
||||
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code='';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
// 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
|
||||
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
|
||||
|
||||
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
|
||||
|
||||
// Clean vat code
|
||||
$vat_src_code='';
|
||||
if (preg_match('/\((.*)\)/', $txtva, $reg))
|
||||
{
|
||||
$vat_src_code = $reg[1];
|
||||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
|
||||
$total_ht = $tabprice[0];
|
||||
$total_tva = $tabprice[1];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
@@ -45,14 +45,14 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractlist'; // To manage different context of search
|
||||
|
||||
$search_name=GETPOST('search_name');
|
||||
$search_email=GETPOST('search_email');
|
||||
$search_name=GETPOST('search_name', 'alpha');
|
||||
$search_email=GETPOST('search_email', 'alpha');
|
||||
$search_town=GETPOST('search_town','alpha');
|
||||
$search_zip=GETPOST('search_zip','alpha');
|
||||
$search_state=trim(GETPOST("search_state"));
|
||||
$search_country=GETPOST("search_country",'int');
|
||||
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
|
||||
$search_contract=GETPOST('search_contract');
|
||||
$search_contract=GETPOST('search_contract','alpha');
|
||||
$search_ref_customer=GETPOST('search_ref_customer','alpha');
|
||||
$search_ref_supplier=GETPOST('search_ref_supplier','alpha');
|
||||
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||
@@ -107,7 +107,6 @@ $fieldstosearchall = array(
|
||||
'c.ref_customer'=>'RefCustomer',
|
||||
'c.ref_supplier'=>'RefSupplier',
|
||||
's.nom'=>"ThirdParty",
|
||||
'cd.description'=>'Description',
|
||||
'c.note_public'=>'NotePublic',
|
||||
);
|
||||
if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate";
|
||||
@@ -252,7 +251,7 @@ else if ($year > 0)
|
||||
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
|
||||
}
|
||||
if ($search_name) $sql .= natural_search('s.nom', $search_name);
|
||||
if ($search_email) $sql .= natural_search('s.email', $search_name);
|
||||
if ($search_email) $sql .= natural_search('s.email', $search_email);
|
||||
if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
|
||||
if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
|
||||
if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2019 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
|
||||
@@ -46,9 +47,9 @@ if (! $sortorder) $sortorder="ASC";
|
||||
|
||||
$mode = GETPOST("mode");
|
||||
$filter=GETPOST("filter");
|
||||
$search_name=GETPOST("search_name");
|
||||
$search_contract=GETPOST("search_contract");
|
||||
$search_service=GETPOST("search_service");
|
||||
$search_name=GETPOST("search_name", 'alpha');
|
||||
$search_contract=GETPOST("search_contract", 'alpha');
|
||||
$search_service=GETPOST("search_service", 'alpha');
|
||||
$search_status=GETPOST("search_status","alpha");
|
||||
$statut=GETPOST('statut')?GETPOST('statut'):1;
|
||||
$search_product_category=GETPOST('search_product_category','int');
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -93,7 +94,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
|
||||
// Check mandatory parameters
|
||||
if (empty($user->email))
|
||||
if (GETPOST('fromtype','alpha') === 'user' && empty($user->email))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
|
||||
@@ -215,7 +216,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
||||
continue;
|
||||
}
|
||||
if ($objectclass == 'Facture' && $objectobj->statut != Facture::STATUS_VALIDATED)
|
||||
if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT)
|
||||
{
|
||||
$langs->load("errors");
|
||||
$nbignored++;
|
||||
@@ -333,12 +334,16 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO));
|
||||
if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO));
|
||||
|
||||
// $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty
|
||||
// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
|
||||
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
|
||||
$looparray=array();
|
||||
if (! $oneemailperrecipient)
|
||||
{
|
||||
$looparray = $listofqualifiedobj;
|
||||
foreach ($looparray as $key => $objecttmp)
|
||||
{
|
||||
$looparray[$key]->thirdparty = $thirdparty;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -348,7 +353,7 @@ if (! $error && $massaction == 'confirm_presend')
|
||||
}
|
||||
//var_dump($looparray);exit;
|
||||
|
||||
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record
|
||||
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per record
|
||||
{
|
||||
// Make substitution in email content
|
||||
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
|
||||
@@ -512,6 +517,8 @@ if ($massaction == 'confirm_createbills')
|
||||
$objecttmp = new Facture($db);
|
||||
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
|
||||
else {
|
||||
// Load extrafields of order
|
||||
$cmd->fetch_optionals();
|
||||
|
||||
$objecttmp->socid = $cmd->socid;
|
||||
$objecttmp->type = Facture::TYPE_STANDARD;
|
||||
@@ -529,6 +536,8 @@ if ($massaction == 'confirm_createbills')
|
||||
$objecttmp->origin = 'commande';
|
||||
$objecttmp->origin_id = $id_order;
|
||||
|
||||
$objecttmp->array_options = $cmd->array_options; // Copy extrafields
|
||||
|
||||
$res = $objecttmp->create($user);
|
||||
|
||||
if($res > 0) $nb_bills_created++;
|
||||
@@ -568,6 +577,12 @@ if ($massaction == 'confirm_createbills')
|
||||
for ($i=0;$i<$num;$i++)
|
||||
{
|
||||
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
|
||||
// If we build one invoice for several order, we must put the invoice of order on the line
|
||||
if (! empty($createbills_onebythird))
|
||||
{
|
||||
$desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
|
||||
}
|
||||
|
||||
if ($lines[$i]->subprice < 0)
|
||||
{
|
||||
// Negative line, we create a discount line
|
||||
@@ -678,6 +693,7 @@ if ($massaction == 'confirm_createbills')
|
||||
if (! $error && $validate_invoices)
|
||||
{
|
||||
$massaction = $action = 'builddoc';
|
||||
|
||||
foreach($TAllFact as &$objecttmp)
|
||||
{
|
||||
$result = $objecttmp->validate($user);
|
||||
@@ -689,12 +705,18 @@ if ($massaction == 'confirm_createbills')
|
||||
}
|
||||
|
||||
$id = $objecttmp->id; // For builddoc action
|
||||
$object = $objecttmp;
|
||||
|
||||
// Builddoc
|
||||
$donotredirect = 1;
|
||||
$upload_dir = $conf->facture->dir_output;
|
||||
$permissioncreate=$user->rights->facture->creer;
|
||||
|
||||
// Call action to build doc
|
||||
$savobject = $object;
|
||||
$object = $objecttmp;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
$object = $savobject;
|
||||
}
|
||||
|
||||
$massaction = $action = 'confirm_createbills';
|
||||
@@ -1097,6 +1119,18 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
|
||||
$res = $db->query($sql);
|
||||
|
||||
if (!$res)
|
||||
{
|
||||
setEventMessage('ErrorRecordParentingNotModified', 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);
|
||||
else $result = $objecttmp->delete($user);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* Copyright (C) 2013 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
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
@@ -42,7 +43,7 @@ if (GETPOST('addfile','alpha'))
|
||||
$vardir=$conf->user->dir_output."/".$user->id;
|
||||
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
|
||||
|
||||
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid);
|
||||
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0);
|
||||
$action='presend';
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ if ($type == 'directory')
|
||||
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);
|
||||
|
||||
// Right area. If module is defined here, we are in automatic ecm.
|
||||
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport');
|
||||
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday');
|
||||
|
||||
// TODO change for multicompany sharing
|
||||
// Auto area for suppliers invoices
|
||||
@@ -203,6 +203,8 @@ if ($type == 'directory')
|
||||
else if ($module == 'user') $upload_dir = $conf->user->dir_output;
|
||||
// Auto area for expense report
|
||||
else if ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
|
||||
// Auto area for holiday
|
||||
else if ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
|
||||
|
||||
// Automatic list
|
||||
if (in_array($module, $automodules))
|
||||
|
||||
@@ -53,6 +53,12 @@ $search_boxvalue=GETPOST('q', 'none');
|
||||
$arrayresult=array();
|
||||
|
||||
// Define $searchform
|
||||
|
||||
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||
{
|
||||
$arrayresult['searchintomember']=array('position'=>8, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):''));
|
||||
}
|
||||
|
||||
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
|
||||
{
|
||||
$arrayresult['searchintothirdparty']=array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):''));
|
||||
@@ -63,11 +69,6 @@ if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CON
|
||||
$arrayresult['searchintocontact']=array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):''));
|
||||
}
|
||||
|
||||
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
|
||||
{
|
||||
$arrayresult['searchintomember']=array('position'=>20, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):''));
|
||||
}
|
||||
|
||||
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
|
||||
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
|
||||
{
|
||||
|
||||
@@ -85,8 +85,7 @@ class box_actions extends ModeleBoxes
|
||||
$sql.= ", s.nom as name";
|
||||
$sql.= ", s.rowid as socid";
|
||||
$sql.= ", s.code_client";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
|
||||
$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, ".MAIN_DB_PREFIX."actioncomm AS a";
|
||||
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql.= " WHERE a.fk_action = ta.id";
|
||||
|
||||
@@ -72,9 +72,11 @@ class box_factures extends ModeleBoxes
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$facturestatic=new Facture($db);
|
||||
$facturestatic = new Facture($db);
|
||||
$societestatic = new Societe($db);
|
||||
|
||||
$langs->load("bills");
|
||||
|
||||
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
@@ -88,9 +90,7 @@ class box_factures extends ModeleBoxes
|
||||
$sql.= ", f.total_ttc";
|
||||
$sql.= ", f.datef as df";
|
||||
$sql.= ", f.paye, f.fk_statut, f.datec, f.tms";
|
||||
$sql.= ", s.nom as name";
|
||||
$sql.= ", s.rowid as socid";
|
||||
$sql.= ", s.code_client";
|
||||
$sql.= ", s.rowid as socid, s.nom as name, s.code_client, s.email, s.tva_intra, s.code_compta, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
||||
$sql.= ", f.date_lim_reglement as datelimite";
|
||||
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@@ -117,6 +117,7 @@ class box_factures extends ModeleBoxes
|
||||
$datelimite = $db->jdate($objp->datelimite);
|
||||
$date = $db->jdate($objp->df);
|
||||
$datem = $db->jdate($objp->tms);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->facnumber;
|
||||
$facturestatic->type = $objp->type;
|
||||
@@ -129,7 +130,14 @@ class box_factures extends ModeleBoxes
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
|
||||
$societestatic->tva_intra = $objp->tva_intra;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->idprof1 = $objp->idprof1;
|
||||
$societestatic->idprof2 = $objp->idprof2;
|
||||
$societestatic->idprof3 = $objp->idprof3;
|
||||
$societestatic->idprof4 = $objp->idprof4;
|
||||
$societestatic->idprof5 = $objp->idprof5;
|
||||
$societestatic->idprof6 = $objp->idprof6;
|
||||
|
||||
$late = '';
|
||||
if ($facturestatic->hasDelay()) {
|
||||
|
||||
@@ -82,7 +82,7 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
if ($user->rights->facture->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid,";
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, s.email,";
|
||||
$sql.= " s.code_client,";
|
||||
$sql.= " s.logo,";
|
||||
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
|
||||
@@ -130,9 +130,11 @@ class box_factures_imp extends ModeleBoxes
|
||||
$facturestatic->total_ttc = $objp->total_ttc;
|
||||
$facturestatic->statut = $objp->fk_statut;
|
||||
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
|
||||
|
||||
$societestatic->id = $objp->socid;
|
||||
$societestatic->name = $objp->name;
|
||||
$societestatic->client = 1;
|
||||
$societestatic->email = $objp->email;
|
||||
$societestatic->code_client = $objp->code_client;
|
||||
$societestatic->logo = $objp->logo;
|
||||
|
||||
|
||||
@@ -385,13 +385,17 @@ class CMailFile
|
||||
// TODO if (! empty($moreinheader)) ...
|
||||
|
||||
// Give the message a subject
|
||||
$this->message->setSubject($this->encodetorfc2822($subject));
|
||||
try {
|
||||
$result = $this->message->setSubject($subject);
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
|
||||
// Set the From address with an associative array
|
||||
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
|
||||
if (! empty($from)) {
|
||||
try {
|
||||
$this->message->setFrom($this->getArrayAddress($from));
|
||||
$result = $this->message->setFrom($this->getArrayAddress($from));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
@@ -400,7 +404,7 @@ class CMailFile
|
||||
// Set the To addresses with an associative array
|
||||
if (! empty($to)) {
|
||||
try {
|
||||
$this->message->setTo($this->getArrayAddress($to));
|
||||
$result = $this->message->setTo($this->getArrayAddress($to));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
@@ -408,13 +412,17 @@ class CMailFile
|
||||
|
||||
if (! empty($replyto)) {
|
||||
try {
|
||||
$this->message->SetReplyTo($this->getArrayAddress($replyto));
|
||||
$result = $this->message->SetReplyTo($this->getArrayAddress($replyto));
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
$this->message->setCharSet($conf->file->character_set_client);
|
||||
try {
|
||||
$result = $this->message->setCharSet($conf->file->character_set_client);
|
||||
} catch (Exception $e) {
|
||||
$this->errors[] = $e->getMessage();
|
||||
}
|
||||
|
||||
if (! empty($this->html))
|
||||
{
|
||||
@@ -463,7 +471,7 @@ class CMailFile
|
||||
if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
|
||||
if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
|
||||
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
|
||||
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
|
||||
if (isset($deliveryreceipt) && $deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -223,10 +223,10 @@ abstract class CommonDocGenerator
|
||||
/**
|
||||
* Define array with couple subtitution key => subtitution value
|
||||
*
|
||||
* @param Contact $object contact
|
||||
* @param Contact $object contact
|
||||
* @param Translate $outputlangs object for output
|
||||
* @param array_key $array_key Name of the key for return array
|
||||
* @return array of substitution key->code
|
||||
* @param array $array_key Name of the key for return array
|
||||
* @return array Array of substitution key->code
|
||||
*/
|
||||
function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') {
|
||||
global $conf;
|
||||
@@ -340,6 +340,8 @@ abstract class CommonDocGenerator
|
||||
global $conf;
|
||||
|
||||
$sumpayed=$sumdeposit=$sumcreditnote='';
|
||||
$already_payed_all=0;
|
||||
$remain_to_pay=0;
|
||||
if ($object->element == 'facture')
|
||||
{
|
||||
$invoice_source=new Facture($this->db);
|
||||
@@ -350,6 +352,8 @@ abstract class CommonDocGenerator
|
||||
$sumpayed = $object->getSommePaiement();
|
||||
$sumdeposit = $object->getSumDepositsUsed();
|
||||
$sumcreditnote = $object->getSumCreditNotesUsed();
|
||||
$already_payed_all=$sumpayed + $sumdeposit + $sumcreditnote;
|
||||
$remain_to_pay=$sumpayed - $sumdeposit - $sumcreditnote;
|
||||
}
|
||||
|
||||
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
|
||||
@@ -411,12 +415,12 @@ abstract class CommonDocGenerator
|
||||
$array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs),
|
||||
$array_key.'_already_creditnote'=>price2num($sumcreditnote),
|
||||
|
||||
$array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs),
|
||||
$array_key.'_already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'),
|
||||
$array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
|
||||
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
|
||||
|
||||
// Remain to pay with all know infrmation (except open direct debit requests)
|
||||
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs),
|
||||
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT')
|
||||
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs),
|
||||
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
|
||||
);
|
||||
|
||||
if (method_exists($object, 'getTotalDiscount')) {
|
||||
@@ -552,9 +556,9 @@ abstract class CommonDocGenerator
|
||||
/**
|
||||
* Define array with couple substitution key => substitution value
|
||||
*
|
||||
* @param Expedition $object Main object to use as data source
|
||||
* @param Expedition $object Main object to use as data source
|
||||
* @param Translate $outputlangs Lang object to use for output
|
||||
* @param array_key $array_key Name of the key for return array
|
||||
* @param array $array_key Name of the key for return array
|
||||
* @return array Array of substitution
|
||||
*/
|
||||
function get_substitutionarray_shipment($object,$outputlangs,$array_key='object')
|
||||
@@ -746,7 +750,7 @@ abstract class CommonDocGenerator
|
||||
/**
|
||||
* Rect pdf
|
||||
*
|
||||
* @param PDF $pdf Object PDF
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param float $x Abscissa of first point
|
||||
* @param float $y Ordinate of first point
|
||||
* @param float $l ??
|
||||
|
||||
@@ -328,12 +328,13 @@ abstract class CommonInvoice extends CommonObject
|
||||
/**
|
||||
* Return if an invoice can be deleted
|
||||
* Rule is:
|
||||
* If invoice is draft and has a temporary ref -> yes
|
||||
* If invoice is draft and has a temporary ref -> yes (1)
|
||||
* If hidden option INVOICE_CAN_NEVER_BE_REMOVED is on -> no (0)
|
||||
* If invoice is dispatched in bookkeeping -> no (-1)
|
||||
* If invoice has a definitive ref, is not last and INVOICE_CAN_ALWAYS_BE_REMOVED off -> no (-2)
|
||||
* If invoice not last in a cycle -> no (-3)
|
||||
* If there is payment -> no (-4)
|
||||
* Otherwise -> yes (2)
|
||||
*
|
||||
* @return int <=0 if no, >0 if yes
|
||||
*/
|
||||
@@ -381,7 +382,7 @@ abstract class CommonInvoice extends CommonObject
|
||||
// Test if there is at least one payment. If yes, refuse to delete.
|
||||
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $this->getSommePaiement() > 0) return -4;
|
||||
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1151,8 +1151,8 @@ abstract class CommonObject
|
||||
$sql.= " ".MAIN_DB_PREFIX."c_type_contact as tc";
|
||||
$sql.= " WHERE ec.element_id = ".$id;
|
||||
$sql.= " AND ec.fk_socpeople = c.rowid";
|
||||
if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")";
|
||||
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('socpeople').")";
|
||||
if ($source == 'internal') $sql.= " AND c.entity IN (".getEntity('user').")";
|
||||
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe').")";
|
||||
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
|
||||
$sql.= " AND tc.element = '".$element."'";
|
||||
$sql.= " AND tc.source = '".$source."'";
|
||||
@@ -1778,7 +1778,7 @@ abstract class CommonObject
|
||||
$this->multicurrency_code = $code;
|
||||
|
||||
list($fk_multicurrency, $rate) = MultiCurrency::getIdAndTxFromCode($this->db, $code);
|
||||
if ($rate) $this->setMulticurrencyRate($rate);
|
||||
if ($rate) $this->setMulticurrencyRate($rate,2);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -2848,6 +2848,7 @@ abstract class CommonObject
|
||||
// Special case
|
||||
if ($origin == 'order') $origin='commande';
|
||||
if ($origin == 'invoice') $origin='facture';
|
||||
if ($origin == 'invoice_template') $origin='facturerec';
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@@ -4726,6 +4727,7 @@ abstract class CommonObject
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$this->array_options = array();
|
||||
$numrows=$this->db->num_rows($resql);
|
||||
if ($numrows)
|
||||
{
|
||||
@@ -4846,11 +4848,15 @@ abstract class CommonObject
|
||||
if ($this->array_options[$key] === '') $mandatorypb=true;
|
||||
if ($mandatorypb)
|
||||
{
|
||||
dol_syslog($this->error);
|
||||
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
|
||||
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
|
||||
|
||||
switch ($attributeType)
|
||||
{
|
||||
case 'int':
|
||||
@@ -4864,6 +4870,21 @@ abstract class CommonObject
|
||||
$new_array_options[$key] = null;
|
||||
}
|
||||
break;
|
||||
case 'double':
|
||||
$value = price2num($value);
|
||||
if (!is_numeric($value) && $value!='')
|
||||
{
|
||||
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
|
||||
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
|
||||
return -1;
|
||||
}
|
||||
elseif ($value=='')
|
||||
{
|
||||
$new_array_options[$key] = null;
|
||||
}
|
||||
//dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG);
|
||||
$new_array_options[$key] = $value;
|
||||
break;
|
||||
/*case 'select': // Not required, we chosed value='0' for undefined values
|
||||
if ($value=='-1')
|
||||
{
|
||||
@@ -4911,8 +4932,6 @@ abstract class CommonObject
|
||||
$new_array_options[$key] = price2num($this->array_options[$key]);
|
||||
break;
|
||||
case 'date':
|
||||
$new_array_options[$key] = $this->db->idate($this->array_options[$key]);
|
||||
break;
|
||||
case 'datetime':
|
||||
// If data is a string instead of a timestamp, we convert it
|
||||
if (! is_int($this->array_options[$key])) {
|
||||
@@ -4960,8 +4979,9 @@ abstract class CommonObject
|
||||
$table_element = $this->table_element;
|
||||
if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
|
||||
|
||||
dol_syslog(get_class($this)."::insertExtraFields delete then insert", LOG_DEBUG);
|
||||
|
||||
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id;
|
||||
dol_syslog(get_class($this)."::insertExtraFields delete", LOG_DEBUG);
|
||||
$this->db->query($sql_del);
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$table_element."_extrafields (fk_object";
|
||||
@@ -4972,6 +4992,17 @@ abstract class CommonObject
|
||||
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator
|
||||
$sql.=",".$attributeKey;
|
||||
}
|
||||
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
|
||||
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
|
||||
{
|
||||
foreach($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
|
||||
{
|
||||
if (! isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
|
||||
{
|
||||
$sql.=",".$tmpkey;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql .= ") VALUES (".$this->id;
|
||||
|
||||
foreach($new_array_options as $key => $value)
|
||||
@@ -4990,10 +5021,23 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
|
||||
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
|
||||
{
|
||||
foreach($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
|
||||
{
|
||||
if (! isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
|
||||
{
|
||||
if (in_array($tmpval, array('int', 'double'))) $sql.=", 0";
|
||||
else $sql.=", ''";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql.=")";
|
||||
|
||||
dol_syslog(get_class($this)."::insertExtraFields insert", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (! $resql)
|
||||
{
|
||||
$this->error=$this->db->lasterror();
|
||||
@@ -5033,7 +5077,7 @@ abstract class CommonObject
|
||||
* @return int -1=error, O=did nothing, 1=OK
|
||||
* @see setValueFrom, insertExtraFields
|
||||
*/
|
||||
function updateExtraField($key, $trigger, $userused)
|
||||
function updateExtraField($key, $trigger=null, $userused=null)
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
@@ -5058,6 +5102,9 @@ abstract class CommonObject
|
||||
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$key];
|
||||
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$key];
|
||||
|
||||
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
|
||||
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
|
||||
|
||||
switch ($attributeType)
|
||||
{
|
||||
case 'int':
|
||||
@@ -5071,6 +5118,21 @@ abstract class CommonObject
|
||||
$this->array_options["options_".$key] = null;
|
||||
}
|
||||
break;
|
||||
case 'double':
|
||||
$value = price2num($value);
|
||||
if (!is_numeric($value) && $value!='')
|
||||
{
|
||||
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
|
||||
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
|
||||
return -1;
|
||||
}
|
||||
elseif ($value=='')
|
||||
{
|
||||
$this->array_options["options_".$key] = null;
|
||||
}
|
||||
//dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG);
|
||||
$this->array_options["options_".$key] = $value;
|
||||
break;
|
||||
/*case 'select': // Not required, we chosed value='0' for undefined values
|
||||
if ($value=='-1')
|
||||
{
|
||||
@@ -6114,6 +6176,11 @@ abstract class CommonObject
|
||||
$e = 0;
|
||||
foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label)
|
||||
{
|
||||
if (isset($extrafields->attributes[$this->table_element]['list'][$key])
|
||||
&& empty($extrafields->attributes[$this->table_element]['list'][$key]) && $mode == 'view'){
|
||||
continue;
|
||||
}
|
||||
|
||||
$enabled = 1;
|
||||
if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key]))
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ class Conf
|
||||
|
||||
//! To store if javascript/ajax is enabked
|
||||
public $use_javascript_ajax;
|
||||
//! Used to store current currency
|
||||
//! Used to store current currency (ISO code like 'USD', 'EUR', ...)
|
||||
public $currency;
|
||||
//! Used to store current css (from theme)
|
||||
public $theme; // Contains current theme ("eldy", "auguria", ...)
|
||||
@@ -519,6 +519,9 @@ class Conf
|
||||
// By default, we open card if one found
|
||||
if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1;
|
||||
|
||||
// By default, we show state code in combo list
|
||||
if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1;
|
||||
|
||||
// Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal"
|
||||
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later.
|
||||
if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list
|
||||
|
||||
@@ -33,10 +33,14 @@ class DiscountAbsolute
|
||||
|
||||
public $id; // Id discount
|
||||
public $fk_soc;
|
||||
public $discount_type; // 0 => customer discount, 1 => supplier discount
|
||||
public $amount_ht; //
|
||||
|
||||
public $discount_type; // 0 => customer discount, 1 => supplier discount
|
||||
public $amount_ht; //
|
||||
public $amount_tva; //
|
||||
public $amount_ttc; //
|
||||
public $multicurrency_amount_ht;
|
||||
public $multicurrency_amount_tva;
|
||||
public $multicurrency_amount_ttc;
|
||||
public $tva_tx; // Vat rate
|
||||
public $fk_user; // Id utilisateur qui accorde la remise
|
||||
public $description; // Description libre
|
||||
@@ -108,7 +112,7 @@ class DiscountAbsolute
|
||||
$this->amount_tva = $obj->amount_tva;
|
||||
$this->amount_ttc = $obj->amount_ttc;
|
||||
|
||||
$this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
|
||||
$this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
|
||||
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
|
||||
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
|
||||
|
||||
@@ -156,8 +160,17 @@ class DiscountAbsolute
|
||||
$this->amount_ht=price2num($this->amount_ht);
|
||||
$this->amount_tva=price2num($this->amount_tva);
|
||||
$this->amount_ttc=price2num($this->amount_ttc);
|
||||
|
||||
$this->tva_tx=price2num($this->tva_tx);
|
||||
|
||||
$this->multicurrency_amount_ht=price2num($this->multicurrency_amount_ht);
|
||||
$this->multicurrency_amount_tva=price2num($this->multicurrency_amount_tva);
|
||||
$this->multicurrency_amount_ttc=price2num($this->multicurrency_amount_ttc);
|
||||
|
||||
if (empty($this->multicurrency_amount_ht)) $this->multicurrency_amount_ht=0;
|
||||
if (empty($this->multicurrency_amount_tva)) $this->multicurrency_amount_tva=0;
|
||||
if (empty($this->multicurrency_amount_ttc)) $this->multicurrency_amount_ttc=0;
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->description))
|
||||
{
|
||||
@@ -170,10 +183,12 @@ class DiscountAbsolute
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
|
||||
$sql.= " (entity, datec, fk_soc, discount_type, fk_user, description,";
|
||||
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
|
||||
$sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
|
||||
$sql.= " fk_facture_source, fk_invoice_supplier_source";
|
||||
$sql.= ")";
|
||||
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type)?0:intval($this->discount_type)).", ".$user->id.", '".$this->db->escape($this->description)."',";
|
||||
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
|
||||
$sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
|
||||
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null").",";
|
||||
$sql.= " ".($this->fk_invoice_supplier_source ? "'".$this->db->escape($this->fk_invoice_supplier_source)."'":"null");
|
||||
$sql.= ")";
|
||||
|
||||
@@ -924,7 +924,7 @@ class DolGraph
|
||||
var percent=Math.round(series.percent);
|
||||
var number=series.data[0][1];
|
||||
return \'';
|
||||
$this->stringtoshow.='<div style="font-size:8pt;text-align:center;padding:2px;color:black;">';
|
||||
$this->stringtoshow.='<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
|
||||
if ($urltemp) $this->stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
|
||||
$this->stringtoshow.='\'+';
|
||||
$this->stringtoshow.=($showlegend?'':'label+\' \'+'); // Hide label if already shown in legend
|
||||
@@ -932,7 +932,7 @@ class DolGraph
|
||||
$this->stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':'');
|
||||
$this->stringtoshow.='\'';
|
||||
if ($urltemp) $this->stringtoshow.='</a>';
|
||||
$this->stringtoshow.='</div>\';
|
||||
$this->stringtoshow.='</span>\';
|
||||
},
|
||||
background: {
|
||||
opacity: 0.0,
|
||||
|
||||
@@ -112,6 +112,7 @@ class Events // extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
$this->description=trim($this->description);
|
||||
if (empty($this->user_agent) && !empty($_SERVER['HTTP_USER_AGENT'])) $this->user_agent=$_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
// Check parameters
|
||||
if (empty($this->description)) { $this->error='ErrorBadValueForParameterCreateEventDesc'; return -1; }
|
||||
@@ -128,8 +129,8 @@ class Events // extends CommonObject
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= " '".$this->db->escape($this->type)."',";
|
||||
$sql.= " ".$conf->entity.",";
|
||||
$sql.= " '".$this->db->escape($_SERVER['REMOTE_ADDR'])."',";
|
||||
$sql.= " ".($_SERVER['HTTP_USER_AGENT']?"'".$this->db->escape(dol_trunc($_SERVER['HTTP_USER_AGENT'],250))."'":'NULL').",";
|
||||
$sql.= " '".$this->db->escape(getUserRemoteIP())."',";
|
||||
$sql.= " ".($this->user_agent ? "'".$this->db->escape(dol_trunc($this->user_agent,250))."'" : 'NULL').",";
|
||||
$sql.= " '".$this->db->idate($this->dateevent)."',";
|
||||
$sql.= " ".($user->id?"'".$this->db->escape($user->id)."'":'NULL').",";
|
||||
$sql.= " '".$this->db->escape(dol_trunc($this->description,250))."'";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user