forked from Wavyzz/dolibarr
Compare commits
989 Commits
phpstan-ba
...
hregis-fix
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4192a1f2 | ||
|
|
2355a3b53b | ||
|
|
e1dffb015f | ||
|
|
9b20da1475 | ||
|
|
228a91c923 | ||
|
|
89d4b29120 | ||
|
|
d8656d523b | ||
|
|
2db13a49b9 | ||
|
|
9914e6280b | ||
|
|
b30718ebfa | ||
|
|
df4cd2fc65 | ||
|
|
538baecead | ||
|
|
a00ff66f45 | ||
|
|
1ee0c4f4ba | ||
|
|
2df6fa0237 | ||
|
|
78cb2e0294 | ||
|
|
cc7f297b47 | ||
|
|
73cc0c1701 | ||
|
|
35b0625a76 | ||
|
|
372487c30f | ||
|
|
933c90aa5e | ||
|
|
0076b1d276 | ||
|
|
50430d0a1b | ||
|
|
7b842b5028 | ||
|
|
81790d0667 | ||
|
|
cca679c0a1 | ||
|
|
70f2836dbc | ||
|
|
a3c634affe | ||
|
|
86b2db926f | ||
|
|
cb1b29dd6a | ||
|
|
e25f213da1 | ||
|
|
184c9ab6ad | ||
|
|
dfc5367f7f | ||
|
|
6165c865bf | ||
|
|
9c73d4aa35 | ||
|
|
cd30258bec | ||
|
|
2880feaea5 | ||
|
|
48defa3a87 | ||
|
|
8c983073a3 | ||
|
|
5a30ee1014 | ||
|
|
61ddab5061 | ||
|
|
9d70bcbf24 | ||
|
|
9d15e4e08e | ||
|
|
77930aaa3c | ||
|
|
f8e9d223f9 | ||
|
|
ddb3ba4ece | ||
|
|
abef925331 | ||
|
|
a71194c4d4 | ||
|
|
69a22346eb | ||
|
|
c39e87d703 | ||
|
|
472ad1d22c | ||
|
|
4334797588 | ||
|
|
0831c65913 | ||
|
|
533c32ff12 | ||
|
|
bd8b081a37 | ||
|
|
c42d783abe | ||
|
|
94ebf6e583 | ||
|
|
34145b8e45 | ||
|
|
2ff17df01a | ||
|
|
e41910b146 | ||
|
|
caad2bb2b9 | ||
|
|
cf651c7544 | ||
|
|
ff80a85962 | ||
|
|
8d21dda08b | ||
|
|
9d52e0b333 | ||
|
|
08c281b2e4 | ||
|
|
e9229fd044 | ||
|
|
905173425f | ||
|
|
ddb1fd42fc | ||
|
|
114131d59d | ||
|
|
eaf2b694c0 | ||
|
|
07f8b3c8f1 | ||
|
|
7e8d32d0fc | ||
|
|
b8c8bc4b01 | ||
|
|
2be111c933 | ||
|
|
9491d880cf | ||
|
|
ca0052e82d | ||
|
|
1e75d5a2d3 | ||
|
|
a04e9c3e18 | ||
|
|
7b27b6b9c8 | ||
|
|
59dfe1423e | ||
|
|
6976d4a011 | ||
|
|
9f215b7b1d | ||
|
|
240352b89e | ||
|
|
e5c8ff5bc3 | ||
|
|
33f3fb5dbb | ||
|
|
c2fcf5d697 | ||
|
|
e343b4ab1f | ||
|
|
67ef39ff8d | ||
|
|
0b8f8ee8a0 | ||
|
|
936b3cddfb | ||
|
|
4ee6aebbbf | ||
|
|
cbaf4e3791 | ||
|
|
d4d06084a5 | ||
|
|
b54fd5ab02 | ||
|
|
223ce3fb84 | ||
|
|
3afe861e34 | ||
|
|
1d1cd86c8e | ||
|
|
3c7b2f070d | ||
|
|
f221716a8a | ||
|
|
e67f1b8510 | ||
|
|
9ec5b94808 | ||
|
|
794ec7e880 | ||
|
|
4d2e51681f | ||
|
|
dfbf173b17 | ||
|
|
ff1e31d239 | ||
|
|
88bc1ea328 | ||
|
|
817e7a826c | ||
|
|
a8384403d3 | ||
|
|
cad3574179 | ||
|
|
a420e9a79a | ||
|
|
f70e12fc2b | ||
|
|
7e4df12c3a | ||
|
|
cc63bedc4c | ||
|
|
355092f6d7 | ||
|
|
544b145410 | ||
|
|
4a19407940 | ||
|
|
df57023546 | ||
|
|
bb502e5439 | ||
|
|
f38eee5e49 | ||
|
|
98382cb0bb | ||
|
|
87d69d6a0b | ||
|
|
3a4b11b824 | ||
|
|
b2ab49a7c0 | ||
|
|
c4b9eff72f | ||
|
|
3284835892 | ||
|
|
20af12a806 | ||
|
|
5e69bb3b3d | ||
|
|
025dda60dd | ||
|
|
5c54b86786 | ||
|
|
af4630c456 | ||
|
|
beddd5152a | ||
|
|
ccc5707146 | ||
|
|
dc4a28cd0b | ||
|
|
e55fc378d3 | ||
|
|
7855469d5f | ||
|
|
93a0b1f0e2 | ||
|
|
430fc664fa | ||
|
|
fa10fc0f94 | ||
|
|
88241b30de | ||
|
|
c19f86a4bf | ||
|
|
1d2d7f04f2 | ||
|
|
2f898ff188 | ||
|
|
a1bc0dc27c | ||
|
|
b7213f0797 | ||
|
|
2e2ba8e144 | ||
|
|
50ee4e2d72 | ||
|
|
3107435574 | ||
|
|
382bc4e80e | ||
|
|
c3f8a2b2e6 | ||
|
|
933eeb7474 | ||
|
|
3cc6f830d2 | ||
|
|
2d0beece5c | ||
|
|
2c67389686 | ||
|
|
19c6fb6f9b | ||
|
|
e5f71cd278 | ||
|
|
0fd19787e2 | ||
|
|
19ddd6e13a | ||
|
|
5ff71267eb | ||
|
|
ba3603d5c9 | ||
|
|
31cc6a702a | ||
|
|
2dc94a0244 | ||
|
|
afd44449c1 | ||
|
|
36e90ab14e | ||
|
|
62eafb914a | ||
|
|
2cd881988e | ||
|
|
d221d5eb6d | ||
|
|
26c79375f1 | ||
|
|
afd9a21c16 | ||
|
|
3a8b82ec0e | ||
|
|
39fa4dd720 | ||
|
|
0411367b8a | ||
|
|
2b0c118601 | ||
|
|
8d72cd0269 | ||
|
|
4e67dd3a81 | ||
|
|
59789a8f02 | ||
|
|
4e001e0fba | ||
|
|
9cc747d020 | ||
|
|
f20b847197 | ||
|
|
ed734ffeb9 | ||
|
|
37a0918393 | ||
|
|
4d2aea5ed7 | ||
|
|
6df93d0fb9 | ||
|
|
c5cf6f58a6 | ||
|
|
85ceba6b36 | ||
|
|
361a88a1c5 | ||
|
|
0e3fdfe204 | ||
|
|
fb7a3edc64 | ||
|
|
2aea630ac2 | ||
|
|
15aa0fe0b0 | ||
|
|
b3c7c1e0eb | ||
|
|
c8ed79b905 | ||
|
|
655c8eb2db | ||
|
|
e072b171b7 | ||
|
|
b418e8e1e5 | ||
|
|
04b4d6bee3 | ||
|
|
445366c4f5 | ||
|
|
10cee8f51b | ||
|
|
13bc1e2e16 | ||
|
|
cbe8c660ab | ||
|
|
dbeb192f8b | ||
|
|
2993b4eb69 | ||
|
|
2ad3be3959 | ||
|
|
5bf4022200 | ||
|
|
39f54ca1d0 | ||
|
|
b925dd6c37 | ||
|
|
3b04eacf98 | ||
|
|
e7b390bceb | ||
|
|
a35fac2d9f | ||
|
|
2d06e4af70 | ||
|
|
0c76fc1003 | ||
|
|
a11b045ca5 | ||
|
|
0b4e2f3b90 | ||
|
|
6584ed2d6d | ||
|
|
8859dbdb79 | ||
|
|
f355bff45a | ||
|
|
05d41cfd0f | ||
|
|
c8d42248c2 | ||
|
|
6a98306eca | ||
|
|
776e5b9088 | ||
|
|
c75484d6be | ||
|
|
146980e440 | ||
|
|
0900f69936 | ||
|
|
be009f0418 | ||
|
|
ab4e7d1e92 | ||
|
|
c5a2960cbd | ||
|
|
74cc41c460 | ||
|
|
94d1a25d67 | ||
|
|
62760d6195 | ||
|
|
d8d77a8e51 | ||
|
|
af13e3354b | ||
|
|
e7a1e58ebf | ||
|
|
534d4ed4bc | ||
|
|
50b90d795c | ||
|
|
3209eb4bd8 | ||
|
|
3deaf8731b | ||
|
|
4a6c6ef725 | ||
|
|
aa33c2254d | ||
|
|
21da38b935 | ||
|
|
8ac52ae91a | ||
|
|
36b3ddb883 | ||
|
|
6743c38463 | ||
|
|
49e74b07fe | ||
|
|
3f45882d80 | ||
|
|
6ced6e2622 | ||
|
|
21f27ce45c | ||
|
|
70d4461c1d | ||
|
|
6978cecc0d | ||
|
|
e4e2e06306 | ||
|
|
93a305faa7 | ||
|
|
20fba19fca | ||
|
|
65a983c2d7 | ||
|
|
34d95eeac1 | ||
|
|
813adaa7b1 | ||
|
|
fe07914d89 | ||
|
|
64a09cd635 | ||
|
|
c4712cbca7 | ||
|
|
71b4612a47 | ||
|
|
78a2bfcef8 | ||
|
|
54fd942a9f | ||
|
|
4b08955478 | ||
|
|
7ebb809547 | ||
|
|
6ab539fe54 | ||
|
|
d763a46fd3 | ||
|
|
7f7518b389 | ||
|
|
9a91513fc1 | ||
|
|
f295746f7d | ||
|
|
b6c27f8052 | ||
|
|
436b270b0d | ||
|
|
f13172ee98 | ||
|
|
154e5801a9 | ||
|
|
be588ee1be | ||
|
|
2de1724786 | ||
|
|
6e1f01a942 | ||
|
|
6c5cd1c7b0 | ||
|
|
3963002486 | ||
|
|
20a428e2de | ||
|
|
7655c259f8 | ||
|
|
dd58e49736 | ||
|
|
fe2cf18f52 | ||
|
|
a4fe30aded | ||
|
|
d93ccee00e | ||
|
|
3d0703d5c6 | ||
|
|
808eaa8cfc | ||
|
|
31b4e093cb | ||
|
|
b1c7b1154f | ||
|
|
963deab290 | ||
|
|
f4d725bd09 | ||
|
|
91af13069a | ||
|
|
b39902a4b4 | ||
|
|
2c16fffa38 | ||
|
|
a199a7ded9 | ||
|
|
ff7a684a0a | ||
|
|
a0da0850a3 | ||
|
|
073426d97e | ||
|
|
0a3d2c7ddc | ||
|
|
f4b91c40a1 | ||
|
|
60e2fec850 | ||
|
|
79c672fda8 | ||
|
|
c599c114fe | ||
|
|
17bb284e0c | ||
|
|
9c66964104 | ||
|
|
e86aa52d83 | ||
|
|
2883a7d47a | ||
|
|
d4cb81508d | ||
|
|
e00559b242 | ||
|
|
aa89439179 | ||
|
|
211514c85e | ||
|
|
f2b0873e26 | ||
|
|
a2c1bc77c2 | ||
|
|
df5588b3e1 | ||
|
|
2030b6a338 | ||
|
|
38a62ca163 | ||
|
|
fe9a55259a | ||
|
|
5f23325eb2 | ||
|
|
24952c3916 | ||
|
|
05b14fb762 | ||
|
|
ca4619f769 | ||
|
|
ef0f2ee4ee | ||
|
|
f1a418f042 | ||
|
|
0707b849fd | ||
|
|
dc024fef27 | ||
|
|
e3fc45b6c8 | ||
|
|
f5b56e5ea3 | ||
|
|
6540c1cb1f | ||
|
|
9562b68f7f | ||
|
|
64854482d8 | ||
|
|
1cd82c88cb | ||
|
|
63ec276f5c | ||
|
|
6145bcc449 | ||
|
|
5a61116497 | ||
|
|
6e14377ba4 | ||
|
|
cb7d856aa1 | ||
|
|
88aeae24da | ||
|
|
e660f0f35a | ||
|
|
8cd3abb78d | ||
|
|
bbd01729b6 | ||
|
|
ee84fadd1c | ||
|
|
57e1c22753 | ||
|
|
beb33d2f62 | ||
|
|
96ab49b80d | ||
|
|
e21139558a | ||
|
|
9152e86c5a | ||
|
|
2e838f7f1b | ||
|
|
2686238fe9 | ||
|
|
ee2db13af7 | ||
|
|
31f14faa0f | ||
|
|
9b5d4791cf | ||
|
|
bd510c090d | ||
|
|
9eee6b187f | ||
|
|
187840dbb3 | ||
|
|
af6358a441 | ||
|
|
8e9290abd6 | ||
|
|
cd86879db3 | ||
|
|
305aced04b | ||
|
|
c616e27274 | ||
|
|
f6f9f1214d | ||
|
|
414c6927be | ||
|
|
59e0320984 | ||
|
|
1a8d91eee2 | ||
|
|
0f56916173 | ||
|
|
f319f32452 | ||
|
|
786449d633 | ||
|
|
4f3aca359d | ||
|
|
6a9d50513f | ||
|
|
a42ea407f2 | ||
|
|
bda086bf0e | ||
|
|
2053ccf197 | ||
|
|
3b61b77b79 | ||
|
|
3f2f676e58 | ||
|
|
006c9dcc99 | ||
|
|
77a06a6cfd | ||
|
|
ebdf77bbde | ||
|
|
99d311402d | ||
|
|
440c2d238a | ||
|
|
ae16c8ccba | ||
|
|
4c84650e39 | ||
|
|
68fc03caae | ||
|
|
f32aeac947 | ||
|
|
d0c4d2d8b4 | ||
|
|
4fd6894210 | ||
|
|
7b44d610d4 | ||
|
|
d0123c3795 | ||
|
|
e68cb0fc00 | ||
|
|
870ee50729 | ||
|
|
c49066640e | ||
|
|
db9ac18451 | ||
|
|
ab56e3a2c1 | ||
|
|
cf18a71a75 | ||
|
|
8e005b19c0 | ||
|
|
e47925af7c | ||
|
|
541e5fefdc | ||
|
|
9214ee5d2a | ||
|
|
a1b4d1a06e | ||
|
|
982e0ed64e | ||
|
|
e69f56acbe | ||
|
|
88cf4654b4 | ||
|
|
34a1c824b7 | ||
|
|
2524ab424c | ||
|
|
8cbe1b55af | ||
|
|
7342a58044 | ||
|
|
03ea0cda01 | ||
|
|
e37c7678a4 | ||
|
|
cac1058caf | ||
|
|
972295ea3c | ||
|
|
a487ce4923 | ||
|
|
8ac1fca761 | ||
|
|
8ed78a31b1 | ||
|
|
210328dd33 | ||
|
|
ce7e9f4027 | ||
|
|
9b512f565f | ||
|
|
7b4def5e99 | ||
|
|
f3931b386a | ||
|
|
df5c3a8084 | ||
|
|
aa6bc46141 | ||
|
|
342120f893 | ||
|
|
de2641c842 | ||
|
|
a7a3ad2352 | ||
|
|
bf4140e8f8 | ||
|
|
c625ef121a | ||
|
|
5efdee9094 | ||
|
|
9a9eec75fc | ||
|
|
24f1aa1f63 | ||
|
|
fb7b8f6c28 | ||
|
|
a268f6265f | ||
|
|
52d714865c | ||
|
|
8900b8e7bd | ||
|
|
58942df61e | ||
|
|
cdcbc60ec2 | ||
|
|
b6ce064641 | ||
|
|
48d2dd8956 | ||
|
|
6333f32c9c | ||
|
|
4d69d875f0 | ||
|
|
a31a02dbe5 | ||
|
|
d07de98ad8 | ||
|
|
e67651f5bc | ||
|
|
9b48b2347b | ||
|
|
658770a449 | ||
|
|
4ac3c3f8b6 | ||
|
|
c0cfd77cb9 | ||
|
|
675ec205f4 | ||
|
|
591395f44b | ||
|
|
21a933bd2e | ||
|
|
24335dd8c7 | ||
|
|
729e19cecb | ||
|
|
cd2f4bb7d2 | ||
|
|
9f2c33aa75 | ||
|
|
04bd68c493 | ||
|
|
e98fe358d3 | ||
|
|
5b7d358c4e | ||
|
|
16371177ac | ||
|
|
d4905ca777 | ||
|
|
f807b77c25 | ||
|
|
5259819fc5 | ||
|
|
d22b6abe59 | ||
|
|
1fc5590934 | ||
|
|
f3b8e64ec0 | ||
|
|
eec7c592c0 | ||
|
|
c6c968374a | ||
|
|
b3d8e7078e | ||
|
|
bbec4721a4 | ||
|
|
1e1d8de59a | ||
|
|
ba4878b490 | ||
|
|
fe71668d0d | ||
|
|
de62f22493 | ||
|
|
6e5f044e31 | ||
|
|
c03026a41d | ||
|
|
23fcfd233c | ||
|
|
3464989848 | ||
|
|
69060a6f49 | ||
|
|
8e0566a33b | ||
|
|
80c1fe6ae0 | ||
|
|
0346d901be | ||
|
|
1e84852825 | ||
|
|
628aacd7fe | ||
|
|
f89cc919b8 | ||
|
|
802e4b6491 | ||
|
|
1e8b3e5d01 | ||
|
|
f203eace15 | ||
|
|
c42f2e4c88 | ||
|
|
57670bd45e | ||
|
|
2f38d267b3 | ||
|
|
713eeeacf2 | ||
|
|
ea0fcd193c | ||
|
|
412a224d90 | ||
|
|
f54b5618fb | ||
|
|
73d3067b16 | ||
|
|
ec109fa7ea | ||
|
|
52ea569239 | ||
|
|
93bb6035b8 | ||
|
|
2efff17837 | ||
|
|
7f04762b17 | ||
|
|
c465a5c8da | ||
|
|
2f64e56ef2 | ||
|
|
4bae3f6eec | ||
|
|
7db8a7eadc | ||
|
|
c1831b76a3 | ||
|
|
1f47cfd583 | ||
|
|
592710868f | ||
|
|
e314c075a7 | ||
|
|
d6b2b12419 | ||
|
|
ae711c02f3 | ||
|
|
8f51b05a57 | ||
|
|
27ed249561 | ||
|
|
29eabe9a75 | ||
|
|
6df379c62a | ||
|
|
33e27947ca | ||
|
|
7fa99f6e15 | ||
|
|
c82a709ff3 | ||
|
|
8de37232d8 | ||
|
|
95741170ab | ||
|
|
e3ff9e5c2d | ||
|
|
2c1ab9b40a | ||
|
|
8d50b69bce | ||
|
|
43aa97edcc | ||
|
|
3bc8d435a4 | ||
|
|
2c71ce566f | ||
|
|
165242c0fb | ||
|
|
481f3f1a9e | ||
|
|
be351614e2 | ||
|
|
e274a9c31c | ||
|
|
bc20306426 | ||
|
|
f6004f22ff | ||
|
|
0ddd2b194f | ||
|
|
4c5e17f7e6 | ||
|
|
d37cf4b38a | ||
|
|
74455fd391 | ||
|
|
58abe1291c | ||
|
|
7724e58d6d | ||
|
|
aca82c627f | ||
|
|
7aa9633901 | ||
|
|
c04359f995 | ||
|
|
111dcd174f | ||
|
|
c80858e712 | ||
|
|
4d88608f1f | ||
|
|
acb1bc22c4 | ||
|
|
3be9f0e9cc | ||
|
|
73c559b9d5 | ||
|
|
bbb96e3c14 | ||
|
|
3975453a75 | ||
|
|
0fe5b9c52b | ||
|
|
a0411e6725 | ||
|
|
f35536712f | ||
|
|
d8b63e6fa6 | ||
|
|
bf6e7d80e0 | ||
|
|
8aabe1efb7 | ||
|
|
02f949c4b7 | ||
|
|
ad67faa01d | ||
|
|
cdd4dde166 | ||
|
|
cd3b74f092 | ||
|
|
8b47aadb1c | ||
|
|
4799705cd8 | ||
|
|
d49426ef30 | ||
|
|
3fca1d8cb1 | ||
|
|
f82675c729 | ||
|
|
700b89d578 | ||
|
|
a4b78f8230 | ||
|
|
88db5b4bd7 | ||
|
|
ffa489ee59 | ||
|
|
894e73e9cf | ||
|
|
7d01503c46 | ||
|
|
56bcd57fc6 | ||
|
|
0cb4679757 | ||
|
|
655286f3b3 | ||
|
|
b8f8e2b785 | ||
|
|
1f65548836 | ||
|
|
9ee8006f17 | ||
|
|
294309dbd4 | ||
|
|
ab6aae51dd | ||
|
|
a202d1e60d | ||
|
|
dab2bcbd90 | ||
|
|
6f88b841e0 | ||
|
|
7792a397d3 | ||
|
|
5604df683d | ||
|
|
330d1aa778 | ||
|
|
8e43cea541 | ||
|
|
2835ec5c3d | ||
|
|
a84cff56a7 | ||
|
|
dc6c6b281e | ||
|
|
606de1688e | ||
|
|
9fb7805e4f | ||
|
|
4fe22fad9e | ||
|
|
0d2b4faee2 | ||
|
|
2a155bff70 | ||
|
|
d539010e3f | ||
|
|
0fa7da21f1 | ||
|
|
277ca022f2 | ||
|
|
2076c44618 | ||
|
|
ad00c73028 | ||
|
|
f97028a764 | ||
|
|
2c04ca3979 | ||
|
|
893b6525ab | ||
|
|
f729b421a5 | ||
|
|
d36bfd0f3e | ||
|
|
2b93b8a66a | ||
|
|
e7672cd9e5 | ||
|
|
a66164d0f7 | ||
|
|
3aa920be4a | ||
|
|
4f3b2fe8de | ||
|
|
738b85abcd | ||
|
|
2c65efad96 | ||
|
|
8d91557b17 | ||
|
|
a1f4fb9810 | ||
|
|
b6353d06ae | ||
|
|
01eb4510f7 | ||
|
|
4be6bd93cb | ||
|
|
bbeaadb14a | ||
|
|
c5b4faffe7 | ||
|
|
68a8631cb5 | ||
|
|
02216080f6 | ||
|
|
1e329f2325 | ||
|
|
db4d73ed50 | ||
|
|
8a84fad171 | ||
|
|
9193aa889a | ||
|
|
8f7931eb49 | ||
|
|
9a8820b9c6 | ||
|
|
ed4b7ce58d | ||
|
|
4bc77ebcda | ||
|
|
18c29d0e40 | ||
|
|
66683105f1 | ||
|
|
05e6c8ce11 | ||
|
|
dabda44e8d | ||
|
|
3a8bab63cd | ||
|
|
1b4afcea4b | ||
|
|
ea2543e9e4 | ||
|
|
836696847e | ||
|
|
78aefbaa2e | ||
|
|
0df13aedcb | ||
|
|
3d852682ec | ||
|
|
b28b94821f | ||
|
|
17e78c99a2 | ||
|
|
f0c61790eb | ||
|
|
384d40ca01 | ||
|
|
74d38106b9 | ||
|
|
f711fe9900 | ||
|
|
993f821a3b | ||
|
|
2139fdd9a2 | ||
|
|
6691441468 | ||
|
|
3fb0dddd65 | ||
|
|
b6171202db | ||
|
|
e81cca858e | ||
|
|
9430078409 | ||
|
|
493630eb4f | ||
|
|
8fb42b0061 | ||
|
|
da32ca9228 | ||
|
|
0d1b1703cc | ||
|
|
54a2335d79 | ||
|
|
3c5d6b9649 | ||
|
|
0245482bc6 | ||
|
|
5de1fcca2f | ||
|
|
9447f04876 | ||
|
|
276f792e9a | ||
|
|
c48d4db3a5 | ||
|
|
0fb8688b7c | ||
|
|
93a03691e1 | ||
|
|
d87d6d10a4 | ||
|
|
c902b2eeed | ||
|
|
c4528e39e3 | ||
|
|
b1854b7d4f | ||
|
|
be803918dd | ||
|
|
5da33763d2 | ||
|
|
88607b2eda | ||
|
|
b395cee7c8 | ||
|
|
6e184d4195 | ||
|
|
fefc2ef466 | ||
|
|
c0e395ee11 | ||
|
|
29b3880e6c | ||
|
|
e801a7602c | ||
|
|
54f8ac4153 | ||
|
|
a504be0258 | ||
|
|
90a0d3cc28 | ||
|
|
c4207d7b45 | ||
|
|
fa266e7fd7 | ||
|
|
174a38b48b | ||
|
|
0d8647975d | ||
|
|
70a7554f87 | ||
|
|
2dbf41e058 | ||
|
|
c7a61226fb | ||
|
|
67428766a2 | ||
|
|
4c5a256088 | ||
|
|
bce1f5e7ed | ||
|
|
70e0132baa | ||
|
|
f8988d3874 | ||
|
|
c6dd95e6d2 | ||
|
|
3f72cf2576 | ||
|
|
15bd28fefb | ||
|
|
b87922dbd7 | ||
|
|
412fe1df32 | ||
|
|
5d3c80e0af | ||
|
|
ef44576079 | ||
|
|
9d24127f37 | ||
|
|
5228c9827e | ||
|
|
793f48dbff | ||
|
|
65a57465f9 | ||
|
|
fa166d62a8 | ||
|
|
c45ab5c387 | ||
|
|
f85108b8ac | ||
|
|
e84ea68218 | ||
|
|
14f63d1ca2 | ||
|
|
fc7f9058af | ||
|
|
82010e7a60 | ||
|
|
f0d53c7dc6 | ||
|
|
4fdf50752f | ||
|
|
04eecafa78 | ||
|
|
d13ebdef2f | ||
|
|
12bcdd0e80 | ||
|
|
f8bb32eb97 | ||
|
|
520d44e808 | ||
|
|
c09ae7c3fb | ||
|
|
f8218fe64b | ||
|
|
578cd6ca0f | ||
|
|
9a99139d85 | ||
|
|
d04e40dea3 | ||
|
|
5a53c19ad5 | ||
|
|
37ff735a80 | ||
|
|
5367d63a56 | ||
|
|
7853a33560 | ||
|
|
dbc0905e79 | ||
|
|
f33ed7a702 | ||
|
|
56997cc06c | ||
|
|
80700179be | ||
|
|
cfd17372f4 | ||
|
|
a9b468bbcd | ||
|
|
387a42c9ea | ||
|
|
153dadf6aa | ||
|
|
c50d511d7e | ||
|
|
51c2103c3e | ||
|
|
c1a8172347 | ||
|
|
e8fc2c0f0e | ||
|
|
51629b1949 | ||
|
|
a4822e466a | ||
|
|
86610810ca | ||
|
|
dc5bc7204b | ||
|
|
58110719cc | ||
|
|
55591abedf | ||
|
|
63480f0318 | ||
|
|
2d75809b9f | ||
|
|
d343c75aac | ||
|
|
1e788d14f5 | ||
|
|
f6db1af7a8 | ||
|
|
870ad12100 | ||
|
|
9894886ba9 | ||
|
|
e9d1e719e6 | ||
|
|
94b113273e | ||
|
|
5454512d95 | ||
|
|
862ea4e15c | ||
|
|
2e644b8420 | ||
|
|
aa67ad50bc | ||
|
|
58f516ef18 | ||
|
|
8851025eb2 | ||
|
|
49b8f4a590 | ||
|
|
31989adc1f | ||
|
|
025aefb69c | ||
|
|
d0634c5b93 | ||
|
|
ee08f8a0b6 | ||
|
|
f0bebb4ee8 | ||
|
|
eb80551a51 | ||
|
|
2e4c0715c4 | ||
|
|
f62b83df1d | ||
|
|
81e5b0da1b | ||
|
|
eb91e09a50 | ||
|
|
2d62fc3c59 | ||
|
|
3c597c263d | ||
|
|
e8418543f7 | ||
|
|
0572d947aa | ||
|
|
7faa7e81f2 | ||
|
|
59009d67a5 | ||
|
|
7fc9b253bf | ||
|
|
1ad2d24a4b | ||
|
|
61b70cfbe5 | ||
|
|
a8da70e116 | ||
|
|
96f119ffd9 | ||
|
|
6f83be9cf4 | ||
|
|
cc22f978cd | ||
|
|
8c699b6103 | ||
|
|
9d4af43760 | ||
|
|
1a4a0e14d4 | ||
|
|
c7ab7cd83d | ||
|
|
62e53b2774 | ||
|
|
a021b9fb52 | ||
|
|
d37b717844 | ||
|
|
a74147f146 | ||
|
|
099a7b650c | ||
|
|
6595b1aa66 | ||
|
|
bb073c6fd1 | ||
|
|
68560aa946 | ||
|
|
ef9e74c4d4 | ||
|
|
53537873c4 | ||
|
|
4b4bb7faf6 | ||
|
|
470f1b4aa9 | ||
|
|
9f6f781e01 | ||
|
|
ac164d4ee2 | ||
|
|
41634d08ca | ||
|
|
938e6e0b77 | ||
|
|
b78f30e8af | ||
|
|
cba68f31bb | ||
|
|
394e35d00b | ||
|
|
580d0d4fa8 | ||
|
|
d57bb824d7 | ||
|
|
85fbc62222 | ||
|
|
bc2049c93d | ||
|
|
de1c933a9b | ||
|
|
8a0dde736b | ||
|
|
7e910ae975 | ||
|
|
a510a70350 | ||
|
|
15acc37e62 | ||
|
|
bdfab3c467 | ||
|
|
538fc37242 | ||
|
|
4cac3d3544 | ||
|
|
62a3d7242d | ||
|
|
67c1960483 | ||
|
|
951c3a36cc | ||
|
|
435d10b887 | ||
|
|
2d805806b3 | ||
|
|
ae0d3b4133 | ||
|
|
3e1a6edd84 | ||
|
|
049fe9f201 | ||
|
|
ae39bedf27 | ||
|
|
bbec15ee91 | ||
|
|
b77850521b | ||
|
|
c4abb3f8c3 | ||
|
|
92b158d1fc | ||
|
|
e0c2fe14f9 | ||
|
|
4dec03b9f9 | ||
|
|
9e24aed800 | ||
|
|
c363096d36 | ||
|
|
5824cc3449 | ||
|
|
e3ad771149 | ||
|
|
617d6e677f | ||
|
|
042f4c8822 | ||
|
|
fad11836ff | ||
|
|
0d10df9065 | ||
|
|
99aea6fdea | ||
|
|
ae759ee6af | ||
|
|
b14892043f | ||
|
|
3bcb82428f | ||
|
|
115da282e3 | ||
|
|
efe851ec92 | ||
|
|
4e95109429 | ||
|
|
47ba906291 | ||
|
|
755c616dfd | ||
|
|
7f180687a1 | ||
|
|
1afb65a042 | ||
|
|
ed28193e27 | ||
|
|
13313f56be | ||
|
|
1e0548468e | ||
|
|
6c8fde377c | ||
|
|
5aee279f5a | ||
|
|
77d7d17d4c | ||
|
|
c24ebe2122 | ||
|
|
87e8eddb65 | ||
|
|
049ab546be | ||
|
|
fa650e4d5d | ||
|
|
3403bbe869 | ||
|
|
a162de2455 | ||
|
|
076ab14c47 | ||
|
|
c7f75a9a52 | ||
|
|
e8a347f89e | ||
|
|
140d2aa1cd | ||
|
|
edda95d07f | ||
|
|
de6a6ef039 | ||
|
|
cdcfb93eb5 | ||
|
|
44981cde29 | ||
|
|
72f6422804 | ||
|
|
05d0bba2a0 | ||
|
|
9bc45a5e89 | ||
|
|
eeacbac425 | ||
|
|
100ba8e060 | ||
|
|
58b524d98c | ||
|
|
8c85a8a0e6 | ||
|
|
cb3d3c09c4 | ||
|
|
a5a4dd1add | ||
|
|
5245289ef8 | ||
|
|
d4082e1560 | ||
|
|
21e06d8fb5 | ||
|
|
ca11daa0bb | ||
|
|
091787d65d | ||
|
|
e171a15fba | ||
|
|
8c77b76400 | ||
|
|
d17f13f149 | ||
|
|
c01ca1cc14 | ||
|
|
e78cb01ce6 | ||
|
|
cc1d3c431d | ||
|
|
94ee91a051 | ||
|
|
01fe82e726 | ||
|
|
56c616d65a | ||
|
|
6dd6760d24 | ||
|
|
e9a9c7ac61 | ||
|
|
b99464eb80 | ||
|
|
be3f10e6d2 | ||
|
|
44ef4d5860 | ||
|
|
aa0f3f2d60 | ||
|
|
adf03f7168 | ||
|
|
51492f25f2 | ||
|
|
62a16aadff | ||
|
|
2ed9f1ea98 | ||
|
|
8e3a185af5 | ||
|
|
e36f3f4e9d | ||
|
|
0820139b1d | ||
|
|
f75b6a64eb | ||
|
|
3283967651 | ||
|
|
8146025b08 | ||
|
|
47dc800efb | ||
|
|
07c1391ffd | ||
|
|
7c20dc8333 | ||
|
|
6dd2f31012 | ||
|
|
49b432436b | ||
|
|
0d73eaf179 | ||
|
|
51be9b6a44 | ||
|
|
341ec9d71d | ||
|
|
8dd55d5a33 | ||
|
|
7b4a17e000 | ||
|
|
68459f54ab | ||
|
|
6ef0ec5b9e | ||
|
|
91fec9d807 | ||
|
|
f796dc9f67 | ||
|
|
58a84827d5 | ||
|
|
3ff7e43648 | ||
|
|
cec620563e | ||
|
|
f3bfcfe7c2 | ||
|
|
87c4ed00a3 | ||
|
|
16929b4d89 | ||
|
|
ca000b77f6 | ||
|
|
0d04a879a1 | ||
|
|
152cc48585 | ||
|
|
d67db1e685 | ||
|
|
0c2f6ea9b0 | ||
|
|
07518a6865 | ||
|
|
345a256ef6 | ||
|
|
7626de3ff1 | ||
|
|
41f5804a92 | ||
|
|
f2e80fead5 | ||
|
|
7faab635c4 | ||
|
|
da46bc5517 | ||
|
|
8335e264be | ||
|
|
e348a89ccf | ||
|
|
175c90f658 | ||
|
|
6c738b6503 | ||
|
|
685119cdde | ||
|
|
447d8b7a64 | ||
|
|
1225aee5e0 | ||
|
|
53b5af0efa | ||
|
|
dd4f55ca0a | ||
|
|
f815571248 | ||
|
|
f22838782a | ||
|
|
26a2d47bec | ||
|
|
570c7b2255 | ||
|
|
0aaf06d07b | ||
|
|
6b6ebe7a43 | ||
|
|
8dd9ed56a1 | ||
|
|
2078610328 | ||
|
|
10deeef770 | ||
|
|
89db077280 | ||
|
|
37270fdca0 | ||
|
|
77d4a16778 | ||
|
|
8e3a7714b8 | ||
|
|
0a914f437a | ||
|
|
e486707236 | ||
|
|
39d7ffae8d | ||
|
|
50afc9682b | ||
|
|
38180ab43c | ||
|
|
cecc1831a2 | ||
|
|
adb02003f5 | ||
|
|
0e79c7817f | ||
|
|
26123a6f84 | ||
|
|
3f91f3f1fc | ||
|
|
1cb221efe9 | ||
|
|
2da06f9fb1 | ||
|
|
56fed15f5b | ||
|
|
efc15d7d1f | ||
|
|
7c400a1e12 | ||
|
|
a9bf93afd1 | ||
|
|
dcee71db77 | ||
|
|
ef22546aa6 | ||
|
|
5342cb87ea | ||
|
|
c1aceed820 | ||
|
|
9a67f45847 | ||
|
|
e471e0fb31 | ||
|
|
2d4a30fd58 | ||
|
|
a692c73071 | ||
|
|
f721985162 | ||
|
|
0ef9acd8ae | ||
|
|
419e208a77 | ||
|
|
78ca88f4fc | ||
|
|
67500e1b99 | ||
|
|
d7063122a2 | ||
|
|
404ad0e876 | ||
|
|
3b3c5a53d3 | ||
|
|
aef314264c |
2
.github/workflows/ci-cache-clean-pr.yml
vendored
2
.github/workflows/ci-cache-clean-pr.yml
vendored
@@ -6,6 +6,8 @@ on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
jobs:
|
||||
cleanup:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
1
.github/workflows/ci-on-pull_request.yml
vendored
1
.github/workflows/ci-on-pull_request.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: "CI-PULL-REQUEST"
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
uses: ./.github/workflows/pre-commit.yml
|
||||
|
||||
1
.github/workflows/ci-on-push.yml
vendored
1
.github/workflows/ci-on-push.yml
vendored
@@ -1,6 +1,7 @@
|
||||
name: "CI-PUSH"
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
uses: ./.github/workflows/pre-commit.yml
|
||||
|
||||
45
.github/workflows/ci-pr-devcamp.yaml.disabled
vendored
Normal file
45
.github/workflows/ci-pr-devcamp.yaml.disabled
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# Action to prepare the github action
|
||||
# Go on Dolibarr Organization - Settings - Developer settings - GitHub App (https://github.com/organizations/Dolibarr/settings/apps)
|
||||
# Create an App: Enter a name + In Home page URL use https://github.com/Dolibarr/dolibarr + Disable webhook
|
||||
# Set Permissions (see other app for list of permissions)
|
||||
# Click on generate the private keys
|
||||
# Click on Install application - choose the repository of the bot
|
||||
# Go on Organisation - Secret and variables and create a secret PR_SECRET_KEY and copy the content of received private key. Choose the repository access to "Repository Dolibarr".
|
||||
# Go on Organisation - Secret and variables and create a variable PR_APP_ID and copy the ID of the previously create ID. Choose the repository access to "Repository Dolibarr".
|
||||
#
|
||||
|
||||
name: Set the tag with devcamp label during the session of a devcamp
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
|
||||
jobs:
|
||||
add-label-devcamp:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
#- name: Install GitHub CLI
|
||||
# run: sudo apt-get install gh
|
||||
|
||||
- name: Generate a token
|
||||
id: generate-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ vars.PR_APP_ID }}
|
||||
private-key: ${{ secrets.PR_SECRET_KEY }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Assign label
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
url: ${{ github.event.pull_request.html_url }}
|
||||
run: |
|
||||
echo "env.url=${{env.url}}"
|
||||
gh pr edit "${{env.url}}" --add-label "Event: DevCamp 2025 XXX"
|
||||
7
.github/workflows/phan.yml
vendored
7
.github/workflows/phan.yml
vendored
@@ -1,4 +1,7 @@
|
||||
---
|
||||
# This is a basic workflow to check code with PHPSTAN tool
|
||||
name: Phan
|
||||
|
||||
on:
|
||||
# workflow called by the parent workflow ci.yml
|
||||
workflow_call:
|
||||
@@ -12,15 +15,15 @@ on:
|
||||
concurrency:
|
||||
group: phan-${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
gh_event: ${{ inputs.gh_event || github.event_name }}
|
||||
PHAN_CONFIG: dev/tools/phan/config.php
|
||||
PHAN_BASELINE: dev/tools/phan/baseline.txt
|
||||
PHAN_MIN_PHP: 7.0
|
||||
PHAN_MIN_PHP: 7.2
|
||||
PHAN_QUICK: ${{ github.event.schedule && '' || '--quick' }}
|
||||
GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action
|
||||
|
||||
name: phan
|
||||
jobs:
|
||||
phan:
|
||||
name: Run phan
|
||||
|
||||
6
.github/workflows/phpstan.yml
vendored
6
.github/workflows/phpstan.yml
vendored
@@ -1,6 +1,7 @@
|
||||
---
|
||||
# This is a basic workflow to check code with PHPSTAN tool
|
||||
name: PHPStan
|
||||
|
||||
# Controls when the workflow will run
|
||||
on:
|
||||
# workflow called by the parent workflow ci.yml
|
||||
@@ -13,8 +14,9 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: stan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
group: phpstan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
gh_event: ${{ inputs.gh_event || github.event_name }}
|
||||
CACHE_KEY_PART: ${{ ( inputs.gh_event == 'pull_request' || github.event_name == 'pull_request' ) && format('{0}-{1}', github.base_ref, github.head_ref) || github.ref_name }}
|
||||
@@ -79,7 +81,7 @@ jobs:
|
||||
key: phpstan-cache-${{ matrix.php-version }}-${{ env.CACHE_KEY_PART }}-${{
|
||||
github.run_id }}
|
||||
- name: Provide phpstan log as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: phpstan-srcrt
|
||||
|
||||
4
.github/workflows/pre-commit.yml
vendored
4
.github/workflows/pre-commit.yml
vendored
@@ -1,5 +1,6 @@
|
||||
---
|
||||
name: pre-commit
|
||||
|
||||
on:
|
||||
# workflow called by the parent workflow ci.yml
|
||||
workflow_call:
|
||||
@@ -16,6 +17,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
gh_event: ${{ inputs.gh_event || github.event_name }}
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -164,7 +166,7 @@ jobs:
|
||||
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
# Upload result log files of precommit into the Artifact shared store
|
||||
- name: Provide log as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
if: ${{ ! cancelled() }}
|
||||
with:
|
||||
name: precommit-logs
|
||||
|
||||
6
.github/workflows/windows-ci.yml
vendored
6
.github/workflows/windows-ci.yml
vendored
@@ -1,5 +1,6 @@
|
||||
---
|
||||
name: Win CI
|
||||
|
||||
# yamllint disable-line rule:truthy
|
||||
on:
|
||||
# workflow called by the parent workflow ci.yml
|
||||
@@ -25,6 +26,7 @@ env:
|
||||
PHP_INI_SCAN_DIR: C:\myphpini
|
||||
CKEY: win-ci-2
|
||||
GITHUB_JSON: ${{ toJSON(github) }} # Helps in debugging Github Action
|
||||
|
||||
jobs:
|
||||
win-test:
|
||||
strategy:
|
||||
@@ -57,7 +59,7 @@ jobs:
|
||||
id: cache
|
||||
uses: actions/cache/restore@v4
|
||||
env:
|
||||
HASH: ${{ hashFiles('htdocs/install/**', 'htdocs/filefunc.inc.php') }}
|
||||
HASH: ${{ hashFiles('htdocs/install/**', 'htdocs/filefunc.inc.php', 'htdocs/version.inc.php') }}
|
||||
KEY_ROOT: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}
|
||||
with:
|
||||
# See https://github.com/actions/cache/issues/1275#issuecomment-1925217178
|
||||
@@ -171,7 +173,7 @@ jobs:
|
||||
in: ${{ env.PHPUNIT_LOG }}
|
||||
|
||||
- name: Provide dolibarr and phpunit logs as artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
if: ${{ ! cancelled() }}
|
||||
with:
|
||||
name: win-ci-logs
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -52,6 +52,7 @@ dev/build/node_modules/
|
||||
node_modules/
|
||||
|
||||
vendor/
|
||||
php-vendor
|
||||
tmp/
|
||||
|
||||
#yarn
|
||||
|
||||
@@ -137,6 +137,8 @@ repos:
|
||||
files: \.(php)$
|
||||
args: [--standard=dev/setup/codesniffer/ruleset.xml]
|
||||
- id: php-cs
|
||||
exclude: |
|
||||
(?x)^(htdocs/includes/.*)$
|
||||
files: \.(php)$
|
||||
args:
|
||||
[
|
||||
|
||||
14
.travis.yml
14
.travis.yml
@@ -41,10 +41,10 @@ jobs:
|
||||
include:
|
||||
- stage: PHP min and max
|
||||
if: type = push
|
||||
php: '7.1'
|
||||
php: '7.2'
|
||||
env:
|
||||
- DB=postgresql
|
||||
- TRAVIS_PHP_VERSION=7.1
|
||||
- TRAVIS_PHP_VERSION=7.2
|
||||
- stage: PHP min and max
|
||||
if: type = pull_request OR type = push
|
||||
php: '8.4'
|
||||
@@ -85,6 +85,9 @@ before_install:
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
|
||||
sudo apt install unzip apache2 php7.1 php7.1-cli php7.1-curl php7.1-mysql php7.1-pgsql php7.1-gd php7.1-imap php7.1-intl php7.1-ldap php7.1-xml php7.1-mbstring php7.1-xml php7.1-zip libapache2-mod-php7.1
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
||||
sudo apt install unzip apache2 php7.2 php7.2-cli php7.2-curl php7.2-mysql php7.2-pgsql php7.2-gd php7.2-imap php7.2-intl php7.2-ldap php7.2-xml php7.2-mbstring php7.2-xml php7.2-zip libapache2-mod-php7.2
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
|
||||
sudo apt install unzip apache2 php8.1 php8.1-cli php8.1-curl php8.1-mysql php8.1-pgsql php8.1-gd php8.1-imap php8.1-intl php8.1-ldap php8.1-xml php8.1-mbstring php8.1-xml php8.1-zip libapache2-mod-php8.1
|
||||
fi
|
||||
@@ -109,8 +112,8 @@ before_install:
|
||||
#ps fauxww | grep postgres
|
||||
ls /etc/postgresql/13/main/
|
||||
|
||||
sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/13/main/pg_hba.conf
|
||||
sudo cat /etc/postgresql/13/main/pg_hba.conf
|
||||
sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/14/main/pg_hba.conf
|
||||
sudo cat /etc/postgresql/14/main/pg_hba.conf
|
||||
|
||||
sudo service postgresql restart
|
||||
|
||||
@@ -131,6 +134,9 @@ install:
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php7.1
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.2' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php7.2
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php8.1
|
||||
fi
|
||||
|
||||
@@ -30,6 +30,10 @@ The following changes may create regressions for some external modules, but were
|
||||
* The directory theme/common/octicons has been removed
|
||||
* The library timepicker.js has been removed. Was not used by Dolibarr.
|
||||
* Because of new TRIGGER_PREFIX property triggers SUPPLIER_PRODUCT_BUYPRICE_XXX are renamed to PRODUCT_BUYPRICE_XXX.
|
||||
* Function img_pdf() has been removed. Replace it with img_picto('', 'pdf.png') if you were using it.
|
||||
* The method run_trigger() was deprecated 10+ years ago in favor of runTrigger(). It has been removed. Change your trigger file if you still use it.
|
||||
* Property ->picto of module descriptors must contains the image extension if it is not a font awesome tag. Example: $this->picto="mymoduleimg.png";
|
||||
* Stock movement API GET method output variable names have been harmonized with POST input parameter names
|
||||
|
||||
|
||||
***** ChangeLog for 22.0.2 compared to 22.0.1 *****
|
||||
|
||||
@@ -49,16 +49,20 @@ $includecustom = 0;
|
||||
$includeconstants = array();
|
||||
$buildzip = 0;
|
||||
|
||||
print '***** '.$script_file.' *****'."\n";
|
||||
|
||||
if (empty($argv[1])) {
|
||||
print '***** '.$script_file.' *****'."\n";
|
||||
print "Usage: ".$script_file." release=auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=ES:CONST_XX_IS_ON includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
print "\n";
|
||||
print "Generate the file filelist-x.y.z[-mybuild].xml with signature of files. ";
|
||||
print "This includes the 3 sections:\n";
|
||||
print "The file always includes the 3 sections:\n";
|
||||
print "- dolibarr_htdocs_dir\n";
|
||||
print "- dolibarr_scripts_dir\n";
|
||||
print "- dolibarr_unalterable_files (only files inside the scope of the unalterable module)\n";
|
||||
print "and if a specific setup/parameter need to be included into the signature for check:\n";
|
||||
print "- dolibarr_constants\n";
|
||||
print "\n";
|
||||
print "Usage: ".$script_file." release=auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -75,12 +79,6 @@ while ($i < $argc) {
|
||||
if (!empty($result["includecustom"])) {
|
||||
$includecustom = $result["includecustom"];
|
||||
}
|
||||
if (!empty($result["includeconstant"])) {
|
||||
$includeconstants[$i] = $result["includeconstant"];
|
||||
}
|
||||
if (!empty($result["buildzip"])) {
|
||||
$buildzip = 1;
|
||||
}
|
||||
if (preg_match('/includeconstant=/', strval($argv[$i]))) {
|
||||
$tmp = explode(':', $result['includeconstant'], 3); // $includeconstant has been set with previous parse_str()
|
||||
if (count($tmp) != 3) {
|
||||
@@ -89,6 +87,9 @@ while ($i < $argc) {
|
||||
}
|
||||
$includeconstants[$tmp[0]][$tmp[1]] = $tmp[2];
|
||||
}
|
||||
if (!empty($result["buildzip"])) {
|
||||
$buildzip = 1;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -167,7 +168,7 @@ if (file_exists($fileforgit)) {
|
||||
$fileforgitcontent = file_get_contents($fileforgit);
|
||||
}
|
||||
if (empty($fileforgitcontent)) {
|
||||
print "Failed to get the last commit ID. Are you on the branch for the release (branch name ".$branchname.") ?\n";
|
||||
print "Failed to get the last commit ID (are you on the branch for the release branch name ".$branchname." ?). We will use an empty value for gitcommit.\n";
|
||||
}
|
||||
$gitcommit = trim($fileforgitcontent);
|
||||
|
||||
@@ -273,127 +274,72 @@ $checksumconcat = array();
|
||||
|
||||
fputs($fp, '<dolibarr_unalterable_files version="'.$release.'">'."\n");
|
||||
|
||||
$regextoinclude = '(\.php|\.sql)$';
|
||||
$regextoexclude = ''; // Exclude dirs
|
||||
$files = dol_dir_list(dirname(__FILE__).'/../../htdocs/blockedlog', 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir = '';
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose = 1;
|
||||
}
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
// Add the SQL file
|
||||
$regextoinclude = 'llx_blockedlog.*(\.php|\.sql)$';
|
||||
$regextoexclude = ''; // Exclude dirs
|
||||
$files = dol_dir_list(dirname(__FILE__).'/../../htdocs/install/mysql/tables', 'files', 0, $regextoinclude, $regextoexclude, 'fullname');
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose = 1;
|
||||
}
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
// Add the trigger file
|
||||
$file = dirname(__FILE__).'/../../htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php';
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose = 1;
|
||||
}
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
// Add the interfaces.class.php file
|
||||
$file = dirname(__FILE__).'/../../htdocs/core/class/interfaces.class.php';
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
//$needtoclose = 1; // close will be done in next filethat is in same dir
|
||||
}
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
// Add the commontrigger.class.php file
|
||||
$file = dirname(__FILE__).'/../../htdocs/core/class/commontrigger.class.php';
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose = 1;
|
||||
}
|
||||
// Array of dir/files to include in the section
|
||||
$arrayofunalterablefiles = array(
|
||||
array('dir' => dirname(__FILE__).'/../../htdocs/', 'file' => 'version.inc.php'),
|
||||
array('dir' => dirname(__FILE__).'/../../htdocs/blockedlog', 'file' => 'all', 'regextoinclude' => '(\.php|\.sql)$', 'regextoexclude' => ''),
|
||||
array('dir' => dirname(__FILE__).'/../../htdocs/install/mysql/tables', 'file' => 'all', 'regextoinclude' => 'llx_blockedlog.*(\.php|\.sql)$', 'regextoexclude' => ''),
|
||||
array('dir' => dirname(__FILE__).'/../../htdocs/core/triggers', 'file' => 'interface_50_modBlockedlog_ActionsBlockedLog.class.php'),
|
||||
array('dir' => dirname(__FILE__).'/../../htdocs/core/class', 'file' => 'all', 'regextoinclude' => '(interfaces.class.php|commontrigger.class.php)$', 'regextoexclude' => ''),
|
||||
array('dir' => dirname(__FILE__).'/../../htdocs/takepos', 'file' => 'receipt.php')
|
||||
);
|
||||
|
||||
$needtoclose = 1; // This is the last file
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
foreach ($arrayofunalterablefiles as $entry) {
|
||||
if ($entry['file'] == 'all') {
|
||||
$regextoinclude = $entry['regextoinclude'];
|
||||
$regextoexclude = $entry['regextoexclude'];
|
||||
$files = dol_dir_list($entry['dir'], 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir = '';
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose = 1;
|
||||
}
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
} else {
|
||||
$file = $entry['dir'].'/'.$entry['file'];
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../../htdocs', '', dirname($file));
|
||||
if (!file_exists($file)) {
|
||||
print "Error file ".$file." does not exists.";
|
||||
exit(1);
|
||||
}
|
||||
if ($newdir != $dir) {
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
fputs($fp, ' <dir name="'.$newdir.'">'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose = 1;
|
||||
}
|
||||
if (filetype($file) == "file") {
|
||||
$md5 = md5_file($file);
|
||||
$checksumconcat[] = $md5;
|
||||
fputs($fp, ' <md5file name="'.basename($file).'" size="'.filesize($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
if ($needtoclose) {
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
$needtoclose = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -411,22 +357,26 @@ fputs($fp, '</dolibarr_unalterable_files_checksum>'."\n\n");
|
||||
fputs($fp, '</checksum_list>'."\n");
|
||||
fclose($fp);
|
||||
|
||||
print "\n";
|
||||
|
||||
if (empty($buildzip)) {
|
||||
print "File ".$outputfile." generated\n";
|
||||
print "File ".$outputfile." generated.\n";
|
||||
} else {
|
||||
if ($buildzip == '1' || $buildzip == 'zip') {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".zip generated\n";
|
||||
print "File ".$outputfile.".zip generated.\n";
|
||||
}
|
||||
} elseif ($buildzip == '2' || $buildzip == 'gz') {
|
||||
$result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz');
|
||||
if ($result > 0) {
|
||||
dol_delete_file($outputfile);
|
||||
print "File ".$outputfile.".gz generated\n";
|
||||
print "File ".$outputfile.".gz generated.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n";
|
||||
|
||||
exit(0);
|
||||
|
||||
@@ -163,14 +163,14 @@ $BUILDROOT="$TEMP/buildroot";
|
||||
|
||||
|
||||
# Get version $MAJOR, $MINOR and $BUILD
|
||||
$result = open( IN, "<" . $SOURCE . "/htdocs/filefunc.inc.php" );
|
||||
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/filefunc.inc.php\n"; }
|
||||
$result = open( IN, "<" . $SOURCE . "/htdocs/version.inc.php" );
|
||||
if ( !$result ) { die "Error: Can't open descriptor file " . $SOURCE . "/htdocs/version.inc.php\n"; }
|
||||
while (<IN>) {
|
||||
if ( $_ =~ /define\('DOL_VERSION',\s*'([\d\.a-z\-]+)'\)/ ) { $PROJVERSION = $1; break; }
|
||||
}
|
||||
close IN;
|
||||
($MAJOR,$MINOR,$BUILD)=split(/\./,$PROJVERSION,3);
|
||||
if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/filefunc.inc.php"; }
|
||||
if ($MINOR eq '') { die "Error can't detect version into ".$SOURCE . "/htdocs/version.inc.php"; }
|
||||
|
||||
# Set vars for packaging
|
||||
$FILENAME = "$PROJECT";
|
||||
|
||||
@@ -112,14 +112,14 @@ We suppose the branch x.y has already been created during the beta (see previous
|
||||
|
||||
- Update version/info in ChangeLog, for this:
|
||||
|
||||
To generate a changelog of a **major new version** x.0.0 (from a repo on branch develop), you can do
|
||||
To generate a changelog of a **major new version** x.0.0 (from a repo on branch develop or x.y):
|
||||
|
||||
```
|
||||
cd ~/git/dolibarr
|
||||
git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy
|
||||
```
|
||||
|
||||
To generate a changelog of a **intermediate new version** x.y.0 (from a repo on branch x.y), you can do
|
||||
To generate a changelog of a **intermediate new version** x.y.0 (from a repo on branch x.y);
|
||||
|
||||
```
|
||||
cd ~/git/dolibarr_x.y
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -234,7 +234,7 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||
|
||||
PHP TCPDI:
|
||||
----------
|
||||
Add file fpdf_tpl.php 1.2
|
||||
Add file fpdf_tpl.php 1.2.3
|
||||
|
||||
Add file tcpdi.php
|
||||
|
||||
|
||||
Binary file not shown.
@@ -44,10 +44,10 @@ function save_db_cache() (
|
||||
# DETERMINE VERSION
|
||||
cd "${TRAVIS_BUILD_DIR}/htdocs/install" || exit 1
|
||||
|
||||
# Get the target version from the filefunc.inc.php file
|
||||
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9.]*\\).*/\\1/p" ../filefunc.inc.php) ; echo $target_version
|
||||
# Get the target version from the version.inc.php file
|
||||
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9.]*\\).*/\\1/p" ../version.inc.php) ; echo $target_version
|
||||
# Default in case that failed
|
||||
target_version=${target_version:=20.0.0}
|
||||
target_version=${target_version:=22.0.0}
|
||||
|
||||
# Sequence of versions for upgrade process (to be completed)
|
||||
VERSIONS=("3.5.0" "3.6.0" "3.7.0" "3.8.0" "3.9.0")
|
||||
|
||||
33
dev/tools/api/macos/README
Normal file
33
dev/tools/api/macos/README
Normal file
@@ -0,0 +1,33 @@
|
||||
README (English)
|
||||
--------------------------------
|
||||
|
||||
##############
|
||||
RapidAPI
|
||||
##############
|
||||
|
||||
RapidAPI for Mac is a full-featured HTTP client that let's you test and describe the APIs you build or consume.
|
||||
It has a beautiful native macOS interface to compose requests, inspect server responses, generate client code and export API definitions.
|
||||
|
||||
https://paw.cloud/
|
||||
|
||||
|
||||
|
||||
@@@
|
||||
(@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@%
|
||||
@@@@@@, @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,
|
||||
@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
(@@@@@@( @@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@* @@@@@@@@@@@. /@@@@@@@@@@@@@@@@@(
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@* @@@@@@@@@@@. @@@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ /@@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@# @@@@@@@@@@@ @@@@@@@@@@@@&
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ @@@@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ &@@@@@@@@@@@@@@@@@@@@@@
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@ &@@@@@@@@@@@@@@@@@@@@/
|
||||
@@@@@@@@@@@@@@@@@@@@@@@@@@& .@@@@@@@@@@@ &@@@@@@@@@@@@@@@@@@/
|
||||
(@@@@@@@@@@@@@@@@@@@@@@@ .@@@@@@@@@@@ &@@@@@@@@@@@@@@@(
|
||||
@@@@@ @@@@@ .@@@@@@@@@@@ @@@@@@@@@@@*
|
||||
|
||||
|
||||
@@ -124,14 +124,14 @@ $urlgit = 'https://github.com/Dolibarr/dolibarr/blob/develop/';
|
||||
$output_arrproj = array();
|
||||
$output_arrdep = array();
|
||||
if ($dirscc != 'disabled') {
|
||||
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc . --exclude-dir=htdocs/custom,htdocs/includes,htdocs/public/includes,htdocs/theme/common/fontawesome-5,htdocs/public/theme/common/fontawesome-5';
|
||||
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc . --exclude-dir=htdocs/custom,htdocs/includes,htdocs/public/includes,htdocs/theme/common/fontawesome-5,htdocs/public/theme/common/fontawesome-5 --cocomo-project-type semi-detached';
|
||||
print 'Execute SCC to count lines of code in project: '.$commandcheck."\n";
|
||||
$resexecproj = 0;
|
||||
exec($commandcheck, $output_arrproj, $resexecproj);
|
||||
|
||||
|
||||
// Count lines of code of dependencies
|
||||
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc htdocs/includes htdocs/public/includes htdocs/theme/common/fontawesome-5 htdocs/public/theme/common/fontawesome-5';
|
||||
$commandcheck = ($dirscc ? $dirscc.'/' : '').'scc htdocs/includes htdocs/public/includes htdocs/theme/common/fontawesome-5 htdocs/public/theme/common/fontawesome-5 --cocomo-project-type semi-detached';
|
||||
print 'Execute SCC to count lines of code in dependencies: '.$commandcheck."\n";
|
||||
$resexecdep = 0;
|
||||
exec($commandcheck, $output_arrdep, $resexecdep);
|
||||
@@ -221,13 +221,13 @@ foreach (array('proj', 'dep') as $source) {
|
||||
$arrayofmetrics[$source]['Bytes'] = $reg[1];
|
||||
}
|
||||
|
||||
if (preg_match('/^(.*)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)$/', $line, $reg)) {
|
||||
$arrayoflineofcode[$source][$reg[1]]['Files'] = $reg[2];
|
||||
$arrayoflineofcode[$source][$reg[1]]['Lines'] = $reg[3];
|
||||
$arrayoflineofcode[$source][$reg[1]]['Blanks'] = $reg[4];
|
||||
$arrayoflineofcode[$source][$reg[1]]['Comments'] = $reg[5];
|
||||
$arrayoflineofcode[$source][$reg[1]]['Code'] = $reg[6];
|
||||
$arrayoflineofcode[$source][$reg[1]]['Complexity'] = $reg[7];
|
||||
if (preg_match('/^(.*)\s+([\d,]+)\s+([\d,]+)\s+([\d,]+)\s+([\d,]+)\s+([\d,]+)\s+([\d,]+)$/', $line, $reg)) {
|
||||
$arrayoflineofcode[$source][$reg[1]]['Files'] = str_replace(array(',', ' '), array('', ''), $reg[2]);
|
||||
$arrayoflineofcode[$source][$reg[1]]['Lines'] = str_replace(array(',', ' '), array('', ''), $reg[3]);
|
||||
$arrayoflineofcode[$source][$reg[1]]['Blanks'] = str_replace(array(',', ' '), array('', ''), $reg[4]);
|
||||
$arrayoflineofcode[$source][$reg[1]]['Comments'] = str_replace(array(',', ' '), array('', ''), $reg[5]);
|
||||
$arrayoflineofcode[$source][$reg[1]]['Code'] = str_replace(array(',', ' '), array('', ''), $reg[6]);
|
||||
$arrayoflineofcode[$source][$reg[1]]['Complexity'] = str_replace(array(',', ' '), array('', ''), $reg[7]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,19 +742,19 @@ $html .= '</div>';
|
||||
$html .= '</section>'."\n";
|
||||
|
||||
|
||||
// Project value
|
||||
// Project value (COCOMO Model, use Basic / Semi-detached
|
||||
|
||||
$html .= '<section class="chapter" id="projectvalue">'."\n";
|
||||
$html .= '<h2><span class="fas fa-dollar-sign pictofixedwidth"></span>Project value</h2>'."\n";
|
||||
|
||||
$html .= '<div class="boxallwidth">'."\n";
|
||||
$html .= '<div class="box inline-box back1">';
|
||||
$html .= 'COCOMO value<br><span class="small opacitymedium">(Basic organic model)</span><br>';
|
||||
$html .= 'COCOMO value<br><span class="small opacitymedium">(Basic/Semi-detached model)</span><br>';
|
||||
$html .= '<b>$'.formatNumber((empty($arraycocomo['proj']['currency']) ? 0 : $arraycocomo['proj']['currency']) + (empty($arraycocomo['dep']['currency']) ? 0 : $arraycocomo['dep']['currency']), 2).'</b>';
|
||||
$html .= '</div>';
|
||||
if (array_key_exists('proj', $arraycocomo)) {
|
||||
$html .= '<div class="box inline-box back2">';
|
||||
$html .= 'COCOMO effort<br><span class="small opacitymedium">(Basic organic model)</span><br>';
|
||||
$html .= 'COCOMO effort<br><span class="small opacitymedium">(Basic/Semi-detached model)</span><br>';
|
||||
$html .= '<b>'.formatNumber($arraycocomo['proj']['people'] * $arraycocomo['proj']['effort'] + $arraycocomo['dep']['people'] * $arraycocomo['dep']['effort']);
|
||||
$html .= ' months people</b>';
|
||||
$html .= '</div>';
|
||||
|
||||
@@ -32,8 +32,8 @@ fi
|
||||
|
||||
|
||||
# Determine release to check
|
||||
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "19.0" "20.0")
|
||||
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9]*\\.[0-9]*\\).*/\\1/p" htdocs/filefunc.inc.php)
|
||||
Releases=("3.9" "4.0" "5.0" "6.0" "7.0" "8.0" "9.0" "10.0" "11.0" "12.0" "13.0" "14.0" "15.0" "16.0" "17.0" "18.0" "19.0" "20.0" "21.0" "22.0")
|
||||
target_version=$(sed -n "s/.*define('DOL_VERSION',[[:space:]]*'\\([0-9]*\\.[0-9]*\\).*/\\1/p" htdocs/version.inc.php)
|
||||
|
||||
# Default target version in case getting it from filefunc.inc failed
|
||||
target_version=${target_version:=20.0}
|
||||
|
||||
@@ -11,32 +11,30 @@ return [
|
||||
// # Issue statistics:
|
||||
// PhanUndeclaredProperty : 420+ occurrences
|
||||
// PhanTypeMismatchProperty : 100+ occurrences
|
||||
// PhanTypeMismatchArgument : 70+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 70+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 40+ occurrences
|
||||
// PhanTypeMismatchArgument : 65+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 60+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 20+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 15+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 15+ occurrences
|
||||
// PhanUndeclaredMethod : 9 occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 6 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 6 occurrences
|
||||
// PhanTypeComparisonFromArray : 6 occurrences
|
||||
// PhanTypeMismatchDimFetch : 10+ occurrences
|
||||
// PhanUndeclaredMethod : 7 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 5 occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 5 occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 5 occurrences
|
||||
// PhanPluginDuplicateArrayKey : 4 occurrences
|
||||
// PhanParamTooMany : 3 occurrences
|
||||
// PhanPluginUndeclaredVariableIsset : 3 occurrences
|
||||
// PhanPluginUndeclaredVariableIsset : 2 occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 2 occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 2 occurrences
|
||||
// PhanParamTooMany : 1 occurrence
|
||||
// PhanPossiblyUndeclaredVariable : 1 occurrence
|
||||
// PhanTypeExpectedObjectPropAccessButGotNull : 1 occurrence
|
||||
// PhanTypeMismatchReturn : 1 occurrence
|
||||
|
||||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
|
||||
'file_suppressions' => [
|
||||
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
|
||||
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/action/pertype.php' => ['PhanTypeExpectedObjectPropAccess'],
|
||||
'htdocs/comm/action/peruser.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/comm/mailing/targetemailing.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -54,7 +52,6 @@ return [
|
||||
'htdocs/compta/clients.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
@@ -71,20 +68,19 @@ return [
|
||||
'htdocs/compta/tva/class/paymentvat.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/tva/clients.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/actions_sendmails.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/actions_sendmails.inc.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/ajax/selectobject.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
|
||||
'htdocs/core/class/canvas.class.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/core/class/ccountry.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -106,7 +102,6 @@ return [
|
||||
'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
@@ -124,7 +119,7 @@ return [
|
||||
'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -143,7 +138,6 @@ return [
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
|
||||
'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -155,12 +149,6 @@ return [
|
||||
'htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/don/list.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgument'],
|
||||
@@ -168,9 +156,8 @@ return [
|
||||
'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/fichinter/class/api_interventions.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/fichinter/class/fichinterrec.class.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -200,7 +187,6 @@ return [
|
||||
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'],
|
||||
@@ -217,7 +203,7 @@ return [
|
||||
'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'],
|
||||
'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/movement_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/movement_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/productlot_card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/product/stock/stats/expedition.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -230,10 +216,7 @@ return [
|
||||
'htdocs/projet/tasks.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanUndeclaredProperty'],
|
||||
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/eventorganization/subscriptionok.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
@@ -254,7 +237,7 @@ return [
|
||||
'htdocs/recruitment/recruitmentjobposition_card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/recruitment/recruitmentjobposition_note.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/paiement_salary.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/payment_salary.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],
|
||||
@@ -262,7 +245,6 @@ return [
|
||||
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/takepos/invoice.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
|
||||
|
||||
@@ -175,7 +175,6 @@ Child of
|
||||
ClassNotFound
|
||||
Clear
|
||||
ClickToDial
|
||||
Clients
|
||||
Clone
|
||||
CloneAffectation
|
||||
CloneChanges
|
||||
@@ -261,7 +260,6 @@ Dictionaries
|
||||
DictionaryEmpty
|
||||
DictionaryNameUpdated
|
||||
Directory
|
||||
DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND
|
||||
Document
|
||||
Documentation
|
||||
Dolibarr
|
||||
@@ -326,7 +324,6 @@ ErrorFailedToGetListOfNotificationsToSend
|
||||
ErrorFailedToLoadBankAccount
|
||||
ErrorFailedToLoadDiscount
|
||||
ErrorFailedToSetNewPassword
|
||||
ErrorFaviconMustBeASquaredImage
|
||||
ErrorFileNameInvalid
|
||||
ErrorImportOfChartLimitedToCurrentChart
|
||||
ErrorMAIN_ROUNDING_RULE_TOTCanMAIN_MAX_DECIMALS_TOT
|
||||
@@ -403,7 +400,6 @@ Filename
|
||||
FilteredFrom
|
||||
Flashy
|
||||
ForcedByGlobalSetup
|
||||
Form for public lead registration has not been enabled
|
||||
Free
|
||||
FreeLegalTextOnReceptions
|
||||
FrequencyPer_
|
||||
@@ -626,7 +622,6 @@ Poll
|
||||
Posts
|
||||
PredefinedInterventional
|
||||
PrevRangeToThisRange
|
||||
PreviousFingerprint
|
||||
Print
|
||||
PrintDriver
|
||||
PrintModule
|
||||
@@ -806,7 +801,6 @@ TicketTypeShort
|
||||
TimeOnly
|
||||
Timezone
|
||||
ToGetBack
|
||||
ToPay
|
||||
Token
|
||||
Tooltip
|
||||
TooltipEditAndRevertStockMovement
|
||||
|
||||
1
htdocs/.gitignore
vendored
1
htdocs/.gitignore
vendored
@@ -21,7 +21,6 @@
|
||||
/cabinetmed*
|
||||
/webmail*
|
||||
/conf/conf.php
|
||||
/subtotal*
|
||||
/abricot*
|
||||
/nomenclature*
|
||||
/of/
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -431,7 +431,7 @@ if ($resql) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('Addanaccount'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/accountancy/admin/card.php?action=create', '', $permissiontoadd);
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
@@ -788,11 +788,11 @@ if ($resql) {
|
||||
if (!empty($arrayfields['aa.reconcilable']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (empty($obj->reconcilable)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=1&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&page='.$page.'&mode=1&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=1&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&page='.$page.'&mode=1&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
@@ -806,11 +806,11 @@ if ($resql) {
|
||||
if (!empty($arrayfields['aa.centralized']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (empty($obj->centralized)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=2&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&page='.$page.'&mode=2&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=2&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&page='.$page.'&mode=2&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
@@ -824,11 +824,11 @@ if ($resql) {
|
||||
if (!empty($arrayfields['aa.active']['checked'])) {
|
||||
print '<td class="center">';
|
||||
if (empty($obj->active)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&mode=0&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=enable&page='.$page.'&mode=0&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&mode=0&token='.newToken().'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$obj->rowid.'&action=disable&page='.$page.'&mode=0&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ print load_fiche_titre($titre, $linkback, 'title_accountancy');
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.urlencode((string) ($page)).'&' : '').'sortfield='.urlencode((string) ($sortfield)).'&sortorder='.urlencode((string) ($sortorder)).'&rowid='.urlencode((string) ($rowid)).'&code='.urlencode((string) ($code)).'&id='.urlencode((string) ($id)), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
print $form->formconfirm(dolBuildUrl($_SERVER["PHP_SELF"], ['page'=> $page, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'rowid' => $rowid, 'code' => $code, 'id' => $id]), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -577,19 +577,34 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
|
||||
$url .= '&'.$param.'&';
|
||||
// $url = $_SERVER["PHP_SELF"].'?token='.newToken().($page ? '&page='.$page : '').'&sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : '');
|
||||
// $url .= '&'.$param.'&';
|
||||
|
||||
$query = [];
|
||||
// decode and add param to query
|
||||
parse_str($param, $query);
|
||||
$query = array_merge($query, [
|
||||
'action' => '',
|
||||
'page' => $page,
|
||||
'sortfield' => $sortfield,
|
||||
'sortorder' => $sortorder,
|
||||
'rowid' => (!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')),
|
||||
'code' => $obj->code,
|
||||
]);
|
||||
|
||||
// Active
|
||||
print '<td class="center nowrap">';
|
||||
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
$query['action'] = $acts[$obj->active];
|
||||
print '<a href="'.dolBuildUrl($_SERVER["PHP_SELF"], $query, true).'">'.$actl[$obj->active].'</a>';
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
print '<td class="center"><a class="reposition editfielda" href="'.$url.'action=edit&token='.newToken().'">'.img_edit().'</a></td>';
|
||||
$query['action'] = 'edit';
|
||||
print '<td class="center"><a class="reposition editfielda" href="'.dolBuildUrl($_SERVER["PHP_SELF"], $query, true).'">'.img_edit().'</a></td>';
|
||||
|
||||
// Delete link
|
||||
print '<td class="center"><a href="'.$url.'action=delete&token='.newToken().'">'.img_delete().'</a></td>';
|
||||
$query['action'] = 'delete';
|
||||
print '<td class="center"><a href="'.dolBuildUrl($_SERVER["PHP_SELF"], $query, true).'">'.img_delete().'</a></td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
/* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -909,7 +909,6 @@ if ($resql) {
|
||||
print '<td class="center" class="nowrap">';
|
||||
if ($canbedisabled) {
|
||||
print '<a class="reposition" href="'.$url.'action='.urlencode($acts[$obj->active]).'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
||||
print '<a class="reposition" href="'.$url.'action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
||||
} else {
|
||||
print $langs->trans("AlwaysActive");
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 Vincent de Grandporé <vincent@de-grandpre.quebec>
|
||||
*
|
||||
* 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
|
||||
@@ -102,9 +103,20 @@ $list_account[] = 'ACCOUNTING_VAT_BUY_ACCOUNT';
|
||||
|
||||
$list_account[] = 'ACCOUNTING_VAT_PAY_ACCOUNT';
|
||||
|
||||
$list_account[] = 'ACCOUNTING_LT1_SOLD_ACCOUNT';
|
||||
$list_account[] = 'ACCOUNTING_LT1_BUY_ACCOUNT';
|
||||
$list_account[] = 'ACCOUNTING_LT1_PAY_ACCOUNT';
|
||||
$list_account[] = 'ACCOUNTING_LT2_SOLD_ACCOUNT';
|
||||
$list_account[] = 'ACCOUNTING_LT2_BUY_ACCOUNT';
|
||||
$list_account[] = 'ACCOUNTING_LT2_PAY_ACCOUNT';
|
||||
|
||||
if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
|
||||
$list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT';
|
||||
$list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT';
|
||||
$list_account[] = 'ACCOUNTING_LT1_BUY_REVERSE_CHARGES_CREDIT';
|
||||
$list_account[] = 'ACCOUNTING_LT1_BUY_REVERSE_CHARGES_DEBIT';
|
||||
$list_account[] = 'ACCOUNTING_LT2_BUY_REVERSE_CHARGES_CREDIT';
|
||||
$list_account[] = 'ACCOUNTING_LT2_BUY_REVERSE_CHARGES_DEBIT';
|
||||
}
|
||||
if (isModEnabled('bank')) {
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH';
|
||||
@@ -124,6 +136,11 @@ if (isModEnabled('loan')) {
|
||||
$list_account[] = 'LOAN_ACCOUNTING_ACCOUNT_INSURANCE';
|
||||
}
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE';
|
||||
if (isModEnabled('invoice') || isModEnabled('supplier_invoice')) {
|
||||
$list_account[] = '---Discounts---';
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_DISCOUNT_GRANTED';
|
||||
$list_account[] = 'ACCOUNTING_ACCOUNT_DISCOUNT_RECEIVED';
|
||||
}
|
||||
if (isModEnabled('societe')) {
|
||||
$list_account[] = '---Deposits---';
|
||||
}
|
||||
@@ -280,8 +297,14 @@ foreach ($list_account as $key) {
|
||||
print img_picto('', 'service', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^ACCOUNTING_VAT_PAY_ACCOUNT/', $key)) {
|
||||
print img_picto('', 'payment_vat', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^ACCOUNTING_LT1_PAY_ACCOUNT/', $key)) {
|
||||
print img_picto('', 'payment_vat', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^ACCOUNTING_LT2_PAY_ACCOUNT/', $key)) {
|
||||
print img_picto('', 'payment_vat', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^ACCOUNTING_VAT/', $key)) {
|
||||
print img_picto('', 'vat', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^ACCOUNTING_LT/', $key)) {
|
||||
print img_picto('', 'vat', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^ACCOUNTING_ACCOUNT_CUSTOMER/', $key)) {
|
||||
print img_picto('', 'bill', 'class="pictofixedwidth"');
|
||||
} elseif (preg_match('/^LOAN_ACCOUNTING_ACCOUNT/', $key)) {
|
||||
|
||||
@@ -202,7 +202,7 @@ if ($result) {
|
||||
if (getDolGlobalString('ACCOUNTANCY_FISCALYEAR_DEFAULT') == (int) $fiscalyearstatic->ref) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdefault&token='.newToken().'&value='.urlencode($fiscalyearstatic->ref).'&label='.urlencode($fiscalyearstatic->label).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').'</a>';
|
||||
print '<a class="reposition" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'setdefault', 'value' => $fiscalyearstatic->ref, 'label'=>$fiscalyearstatic->label], true).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-fis
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($title, '', 'object_'.$object->picto);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
@@ -334,7 +334,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
// ------------------------------------------------------------
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/fiscalyear.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
dol_banner_tab($object, 'label', $linkback, 1, 'label', 'label', $morehtmlref);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
@@ -342,6 +342,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Id
|
||||
print "<tr>";
|
||||
print '<td class="titlefield">'.$langs->trans("Id").'</td><td>';
|
||||
print $object->id;
|
||||
print '</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td class="tdtop">';
|
||||
print $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'alpha:32');
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@destailleur.fr>
|
||||
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.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
|
||||
@@ -69,7 +69,6 @@ $formSetup = new FormSetup($db);
|
||||
// Main options
|
||||
$formSetup->newItem('BANK_DISABLE_DIRECT_INPUT')->setAsYesNo();
|
||||
|
||||
|
||||
$formSetup->newItem('ACCOUNTANCY_COMBO_FOR_AUX')->setAsYesNo();
|
||||
|
||||
$item = $formSetup->newItem('ACCOUNTING_MANAGE_ZERO')->setAsYesNo();
|
||||
@@ -177,20 +176,27 @@ if ($action == 'updatemode') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update2') {
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
foreach ($list as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if ($error) {
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update_binding') {
|
||||
$error = 0;
|
||||
|
||||
// option in section binding
|
||||
foreach ($list_binding as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
@@ -203,16 +209,39 @@ if ($action == 'update2') {
|
||||
}
|
||||
}
|
||||
|
||||
// options in section other
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update_advanced') {
|
||||
$error = 0;
|
||||
|
||||
if (GETPOSTISSET('ACCOUNTING_LETTERING_NBLETTERS')) {
|
||||
if (!dolibarr_set_const($db, 'ACCOUNTING_LETTERING_NBLETTERS', GETPOST('ACCOUNTING_LETTERING_NBLETTERS'), 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'update_export') {
|
||||
$error = 0;
|
||||
|
||||
// Export options
|
||||
$modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV');
|
||||
|
||||
// reload
|
||||
$configuration = $accountancyexport->getTypeConfig();
|
||||
$listparam = $configuration['param'];
|
||||
|
||||
if (!empty($modelcsv)) {
|
||||
if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
@@ -243,12 +272,6 @@ if ($action == 'update2') {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// reload
|
||||
$configuration = $accountancyexport->getTypeConfig();
|
||||
$listparam = $configuration['param'];
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
@@ -312,6 +335,34 @@ if ($action == 'setdisablebindingonexpensereports') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdisabletransferonassets') {
|
||||
$setdisabletransferonassets = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS", $setdisabletransferonassets, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setdisabletransferondiscounts') {
|
||||
$setdisabletransferondiscounts = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS", $setdisabletransferondiscounts, 'yesno', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setenablelettering') {
|
||||
$setenablelettering = GETPOSTINT('value');
|
||||
$res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity);
|
||||
@@ -455,20 +506,19 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<br><br><br>';
|
||||
print '<br><br>';
|
||||
}
|
||||
|
||||
|
||||
// Show form for main parameters
|
||||
// Show form main options
|
||||
print $formSetup->generateOutput(true);
|
||||
|
||||
|
||||
print '<br><br><br>';
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update2">';
|
||||
print '<input type="hidden" name="action" value="update_binding">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
// Binding params
|
||||
@@ -546,6 +596,32 @@ if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS").'</td>';
|
||||
if (getDolGlobalString('ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS')) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisabletransferonassets&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisabletransferonassets&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS").'</td>';
|
||||
if (getDolGlobalString('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisabletransferondiscounts&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on', '', 0, 0, 0, '', 'warning');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setdisabletransferondiscounts&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
if (!getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ACCOUNTANCY_ER_DATE_RECORD").'</td>';
|
||||
@@ -577,12 +653,11 @@ print '</tr>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button reposition" value="'.dol_escape_htmltag($langs->trans('Save')).'" name="button"></div>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.dol_escape_htmltag($langs->trans('Save')).'"></div>';
|
||||
print '</form>';
|
||||
|
||||
// Show numbering options
|
||||
print '<br><br><br>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Accountancy Numbering model
|
||||
$dirmodels = array_merge(array('/'), $conf->modules_parts['models']);
|
||||
@@ -694,13 +769,17 @@ foreach ($arrayofmodules as $module) {
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
// Show advanced options
|
||||
print '<br><br><br>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Advanced params
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update_advanced">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -739,7 +818,7 @@ if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING')) {
|
||||
print '<input class="flat right" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter . '" type="number" step="1" min="2" max="3" >' . "\n";
|
||||
print '</tr>';
|
||||
|
||||
// Auto Lettering when transfer in accountancy is realized
|
||||
// Auto matching when transfer in accountancy is realized
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>';
|
||||
@@ -788,12 +867,17 @@ print '</div>';
|
||||
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-edit reposition" name="button" value="'.$langs->trans('Save').'"></div>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<br><br><br>';
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
// Export options
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update_export">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
print "\n".'<script type="text/javascript">'."\n";
|
||||
print 'jQuery(document).ready(function () {'."\n";
|
||||
@@ -839,8 +923,6 @@ print ' });'."\n";
|
||||
print '})'."\n";
|
||||
print '</script>'."\n";
|
||||
|
||||
// Main Options
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans('ExportOptions').'</td>';
|
||||
@@ -902,7 +984,6 @@ if ($num2) {
|
||||
|
||||
print '<div class="center"><input type="submit" class="button reposition" value="'.dol_escape_htmltag($langs->trans('Save')).'" name="button"></div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
|
||||
// End of page
|
||||
|
||||
@@ -28,6 +28,14 @@
|
||||
* \brief To define accounting account on product / service
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
@@ -39,15 +47,6 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "compta", "accountancy", "products"));
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2016-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -336,7 +336,7 @@ if ($resql) {
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2016-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -318,7 +318,7 @@ if ($action != 'export') {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" id="action" value="list">';
|
||||
print '<input type="hidden" name="export_type" id="export_type" value="">';
|
||||
|
||||
@@ -198,6 +198,11 @@ if (empty($reshook)) {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
$subledger_account_str = is_array($subledger_account) ? reset($subledger_account) : (string) $subledger_account;
|
||||
if (!checkGeneralAccountAllowsAuxiliary($db, $accountingaccount_number, $subledger_account_str)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorAccountNotCentralized"). ". " . $langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors');
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) {
|
||||
@@ -446,44 +451,14 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'clonebookkeepingwriting' && $permissiontoadd) {
|
||||
if ($action == 'clonebookkeepingwriting' && $confirm == "yes" && $permissiontoadd) {
|
||||
// Reread the values sent by the validated form
|
||||
$piece_num = GETPOST('piece_num', 'alpha');
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$journal_code = GETPOST('code_journal', 'alpha');
|
||||
|
||||
$form = new Form($db);
|
||||
$input1 = $form->selectDate('', 'clonedate', 0, 0, 0, "create_mvt", 1, 1);
|
||||
$input2 = $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1).'</td>';
|
||||
$inputHidden = '<input type="hidden" name="piece_num_hidden" id="piece_num_hidden" value="'.$piece_num.'">';
|
||||
// Reconstruct the selected date
|
||||
$clonedate = dol_mktime(0, 0, 0, GETPOSTINT('clonedatemonth'), GETPOSTINT('clonedateday'), GETPOSTINT('clonedateyear'));
|
||||
|
||||
$formquestion = array(
|
||||
array(
|
||||
'type' => 'date',
|
||||
'name' => 'clonedate',
|
||||
'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>',
|
||||
'value' => $input1
|
||||
)
|
||||
);
|
||||
|
||||
if (getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL')) {
|
||||
$formquestion[] = array(
|
||||
'type' => 'text',
|
||||
'name' => 'code_journal',
|
||||
'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>',
|
||||
'value' => $input2
|
||||
);
|
||||
}
|
||||
|
||||
print $form->formconfirm(
|
||||
$_SERVER["PHP_SELF"],
|
||||
$langs->trans("ConfirmMassCloneBookkeepingWriting"),
|
||||
$langs->trans("ConfirmMassCloneBookkeepingWritingQuestion", count($toselect)),
|
||||
"clonebookkeepingwriting",
|
||||
$formquestion,
|
||||
'', 0, 300, 1000, 1
|
||||
);
|
||||
}
|
||||
|
||||
if ($action == 'preclonebookkeepingwriting' && $confirm == "yes" && $permissiontoadd) {
|
||||
$result = $object->newClone($piece_num, $journal_code, $clonedate);
|
||||
|
||||
if ($result == -1) {
|
||||
@@ -492,7 +467,7 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . "?piece_num=" . $object->getNextNumMvt() - 1);
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . "?piece_num=" . ($object->getNextNumMvt() - 1));
|
||||
exit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
@@ -520,6 +495,29 @@ if ($action == 'delete') {
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
// Update fields properties in realtime
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n" . '<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
function toggleSubledger() {
|
||||
var isCentral = $("#accountingaccount_number option:selected").data("centralized");
|
||||
console.log("the selected general ledger account is centralised?", isCentral);
|
||||
if (isCentral) {
|
||||
$("#subledger_account, #subledger_label").prop("disabled", false);
|
||||
} else {
|
||||
$("#subledger_account, #subledger_label").prop("disabled", true);
|
||||
}
|
||||
}
|
||||
|
||||
toggleSubledger();
|
||||
|
||||
$("#accountingaccount_number").on("change", toggleSubledger);
|
||||
$("#accountingaccount_number").on("select2:select", toggleSubledger);
|
||||
';
|
||||
print ' });' . "\n";
|
||||
print ' </script>' . "\n";
|
||||
}
|
||||
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($title);
|
||||
|
||||
@@ -606,12 +604,7 @@ if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("UpdateMvts"), $backlink);
|
||||
}*/
|
||||
|
||||
$head = array();
|
||||
$h = 0;
|
||||
$head[$h][0] = DOL_URL_ROOT."/accountancy/bookkeeping/card.php".'?piece_num='.((int) $object->piece_num).($mode ? '&mode='.$mode : '').($type ? '&type='.$type : '').'&backtopage='.urlencode($backtopage);
|
||||
$head[$h][1] = $langs->trans("Transaction");
|
||||
$head[$h][2] = 'transaction';
|
||||
$h++;
|
||||
$head = accounting_transaction_prepare_head($object, $mode, $type, $backtopage);
|
||||
|
||||
print dol_get_fiche_head($head, 'transaction', '', -1);
|
||||
|
||||
@@ -629,6 +622,46 @@ if ($action == 'create') {
|
||||
|
||||
dol_banner_tab($object, 'ref', $backlink, 1, 'piece_num', 'piece_num', $morehtmlref);
|
||||
|
||||
|
||||
if ($action == 'clonebookkeepingwriting' && $confirm != 'yes' && $permissiontoadd) {
|
||||
$piece_num = GETPOST('piece_num', 'alpha');
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
$form = new Form($db);
|
||||
$input1 = $form->selectDate('', 'clonedate', 0, 0, 0, "", 1, 1);
|
||||
$input2 = $formaccounting->select_journal($journal_code, 'code_journal', 0, 0, 1, 1);
|
||||
|
||||
$formquestion = array(
|
||||
array(
|
||||
'type' => 'other',
|
||||
'name' => 'clonedate',
|
||||
'label' => '<span class="fieldrequired">' . $langs->trans("Docdate") . '</span>',
|
||||
'value' => $input1
|
||||
)
|
||||
);
|
||||
|
||||
$formquestion[] = array('type' => 'hidden', 'name' => 'piece_num', 'value' => $piece_num);
|
||||
|
||||
if (getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL')) {
|
||||
$formquestion[] = array(
|
||||
'type' => 'text',
|
||||
'name' => 'code_journal',
|
||||
'label' => '<span class="fieldrequired">' . $langs->trans("Codejournal") . '</span>',
|
||||
'value' => $input2
|
||||
);
|
||||
}
|
||||
|
||||
print $form->formconfirm(
|
||||
$_SERVER["PHP_SELF"],
|
||||
$langs->trans("ConfirmMassCloneBookkeepingWriting"),
|
||||
$langs->trans("ConfirmMassCloneBookkeepingWritingQuestion", 1),
|
||||
"clonebookkeepingwriting",
|
||||
$formquestion,
|
||||
'', 0, 300, 1000, 0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="fichehalfleft">';
|
||||
@@ -1001,7 +1034,7 @@ if ($action == 'create') {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="'.(GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||
}
|
||||
// Add also input for subledger label
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" id="subledger_label" value="'.(GETPOSTISSET("subledger_label") ? GETPOST("subledger_label", "alpha") : $line->subledger_label).'" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.(GETPOSTISSET("label_operation") ? GETPOST("label_operation", "alpha") : $line->label_operation).'"></td>';
|
||||
print '<td class="right"><input type="text" class="right width50" name="debit" value="'.(GETPOSTISSET("debit") ? GETPOST("debit", "alpha") : price($line->debit)).'"></td>';
|
||||
@@ -1028,7 +1061,7 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" id="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . dol_escape_htmltag($label_operation) . '"/></td>';
|
||||
print '<td class="right"><input type="text" class="right width50" name="debit" value=""/></td>';
|
||||
|
||||
@@ -877,7 +877,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$arrayofmassactions = array();
|
||||
$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
if ($optioncss != '') {
|
||||
@@ -1046,7 +1046,7 @@ if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Lettering code
|
||||
// Matching code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.dol_escape_htmltag($search_lettering_code).'"/>';
|
||||
@@ -1399,7 +1399,7 @@ while ($i < min($num, $limit)) {
|
||||
$totalarray['val']['totalcredit'] += $line->credit;
|
||||
}
|
||||
|
||||
// Lettering code
|
||||
// Matching code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||
if (!$i) {
|
||||
|
||||
@@ -853,7 +853,7 @@ if (GETPOSTINT('nomassaction') || in_array($massaction, array('preunletteringaut
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
if ($optioncss != '') {
|
||||
@@ -1055,7 +1055,7 @@ if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Lettering code
|
||||
// Matching code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.dol_escape_htmltag($search_lettering_code).'"/>';
|
||||
@@ -1437,7 +1437,7 @@ while ($i < min($num, $limit)) {
|
||||
$totalarray['val']['totalcredit'] += $line->credit;
|
||||
}
|
||||
|
||||
// Lettering code
|
||||
// Matching code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="center">'.$line->lettering_code.'</td>';
|
||||
if (!$i) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Nicolas Barrouillet <nicolas@pragma-tech.fr>
|
||||
*
|
||||
@@ -463,11 +463,17 @@ if (empty($reshook)) {
|
||||
|
||||
// Actions
|
||||
if ($action === 'exporttopdf' && $permissiontoadd) {
|
||||
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||
if ($type == "sub") {
|
||||
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter, 'AND', 1);
|
||||
} else {
|
||||
$object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter);
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/modules/accountancy/doc/pdf_ledger.modules.php';
|
||||
$pdf = new pdf_ledger($db);
|
||||
$pdf->fromDate = $search_date_start;
|
||||
$pdf->toDate = $search_date_end;
|
||||
$pdf->ledgerType = $type;
|
||||
|
||||
$result = $pdf->write_file($object, $langs);
|
||||
|
||||
if ($result < 0) {
|
||||
@@ -860,7 +866,7 @@ if (GETPOSTINT('nomassaction') || in_array($massaction, array('preunletteringaut
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
if ($optioncss != '') {
|
||||
@@ -895,7 +901,7 @@ if (empty($reshook)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
}
|
||||
}
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'] . '?action=exporttopdf&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ExportToPdf'), '', 'fa fa-file-pdf paddingleft', $_SERVER['PHP_SELF'] . '?action=exporttopdf'.(!empty($type) ? '&type=sub' : '').'&' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
|
||||
@@ -1004,16 +1010,8 @@ if ($type == 'sub') {
|
||||
}
|
||||
|
||||
if (empty($socid)) {
|
||||
$stringforfirstkey = $langs->trans("KeyboardShortcut");
|
||||
if ($conf->browser->name == 'chrome') {
|
||||
$stringforfirstkey .= ' ALT +';
|
||||
} elseif ($conf->browser->name == 'firefox') {
|
||||
$stringforfirstkey .= ' ALT + SHIFT +';
|
||||
} else {
|
||||
$stringforfirstkey .= ' CTL +';
|
||||
}
|
||||
$moreforfilter .= ' <a id="previous_account" accesskey="p" title="' . $stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
|
||||
$moreforfilter .= ' <a id="next_account" accesskey="n" title="' . $stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
|
||||
$moreforfilter .= ' <a id="previous_account" accesskey="p" title="' . $conf->browser->stringforfirstkey . ' p" class="classfortooltip" href="#"><i class="fa fa-chevron-left"></i></a>';
|
||||
$moreforfilter .= ' <a id="next_account" accesskey="n" title="' . $conf->browser->stringforfirstkey . ' n" class="classfortooltip" href="#"><i class="fa fa-chevron-right"></i></a>';
|
||||
$moreforfilter .= <<<SCRIPT
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
@@ -1104,7 +1102,7 @@ if (!empty($arrayfields['t.doc_ref']['checked'])) {
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) {
|
||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="'.dol_escape_htmltag($search_label_operation).'"/></td>';
|
||||
}
|
||||
// Lettering code
|
||||
// Matching code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<input type="text" size="3" class="flat" name="search_lettering_code" value="'.$search_lettering_code.'"/>';
|
||||
@@ -1528,7 +1526,7 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Lettering code
|
||||
// Matching code
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
print '<td class="center">'.dol_escape_htmltag((string) $line->lettering_code).'</td>';
|
||||
if (!$i) {
|
||||
|
||||
@@ -85,6 +85,8 @@ class AccountancyExport
|
||||
public static $EXPORT_TYPE_GESTIMUMV5 = 135;
|
||||
/** @var int */
|
||||
public static $EXPORT_TYPE_ISUITEEXPERT = 200;
|
||||
/** @var int */
|
||||
public static $EXPORT_TYPE_ISTEA = 205;
|
||||
// Generic FEC after that
|
||||
/** @var int */
|
||||
public static $EXPORT_TYPE_FEC = 1000;
|
||||
@@ -161,6 +163,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'),
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'),
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => 'Export iSuite Expert',
|
||||
self::$EXPORT_TYPE_ISTEA => $langs->trans('Modelcsv_ISTEA'),
|
||||
);
|
||||
|
||||
$listofgenericformatexport = array(
|
||||
@@ -223,6 +226,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_FEC => 'fec',
|
||||
self::$EXPORT_TYPE_FEC2 => 'fec2',
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => 'isuiteexpert',
|
||||
self::$EXPORT_TYPE_ISTEA => 'istea',
|
||||
);
|
||||
|
||||
global $hookmanager;
|
||||
@@ -317,6 +321,10 @@ class AccountancyExport
|
||||
'label' => 'iSuite Expert',
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||
),
|
||||
self::$EXPORT_TYPE_ISTEA => array(
|
||||
'label' => 'ISTEA',
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||
),
|
||||
),
|
||||
'cr' => array(
|
||||
'1' => $langs->trans("Unix"),
|
||||
@@ -539,6 +547,9 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_ISUITEEXPERT:
|
||||
$this->exportiSuiteExpert($TData, $exportFile);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_ISTEA:
|
||||
$this->exportISTEA($TData, $exportFile);
|
||||
break;
|
||||
default:
|
||||
global $hookmanager;
|
||||
$parameters = array('format' => $formatexportset, 'exportFile' => $exportFile);
|
||||
@@ -1345,6 +1356,63 @@ class AccountancyExport
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : ISTEA
|
||||
*
|
||||
* @param BookKeepingLine[] $objectLines data
|
||||
* @param ?resource $exportFile [=null] File resource to export or print if null
|
||||
* @return void
|
||||
*/
|
||||
public function exportISTEA($objectLines, $exportFile = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$separator = ';';
|
||||
$end_line = "\n";
|
||||
|
||||
// parcours du tableau pour recuperation des numero de compte des tiers pour pouvoir les fournir dans la bonne ligne pour istea
|
||||
$tiers = [];
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->subledger_account && substr($line->subledger_account, 0, 1) == '4') {
|
||||
$tiers[$line->piece_num] = $line->subledger_label;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date_document = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
/*** preparation du champ label operation pour istea ***/
|
||||
// retrecissement du champs car ISTEA n'affiche pas bcp de caract<63>re.
|
||||
$search = array('Paiement fournisseur ', 'Virement ', 'Paiement ');
|
||||
$replace = array('Paiemt fourn ','Virt ','Paiemt ');
|
||||
$label_operation = str_replace($search, $replace, $line->label_operation);
|
||||
// encadrement par des ' si le champs contient le separateur
|
||||
$label_operation = preg_match('/'.$separator.'/', $label_operation) ? "'".$label_operation."'" : $label_operation;
|
||||
|
||||
$tab = array();
|
||||
// export configurable
|
||||
$tab[] = $line->piece_num; // colonne 1 : numero de piece ISTEA
|
||||
$tab[] = $date_document; // colonne 2 : date ISTEA
|
||||
$tab[] = $line->doc_ref; // colonne 3 : reference piece ISTEA
|
||||
$tab[] = array_key_exists($line->piece_num, $tiers) ? $tiers[$line->piece_num] : ''; // colonne 4 : nom tiers ISTEA
|
||||
$tab[] = length_accountg(($line->subledger_account && (substr($line->subledger_account, 0, 2) == substr($line->numero_compte, 0, 2))) ? $line->subledger_account : $line->numero_compte); // colonne 5 : numero de compte ISTEA
|
||||
$tab[] = length_accountg($line->subledger_account ? $line->subledger_account : $line->numero_compte); // colonne 6 : numero de compte
|
||||
$tab[] = length_accountg($line->subledger_account ? $line->numero_compte : ''); // G // colonne 7 : numero de compte principal (divers paiement ou 40100000 ou 41100000)
|
||||
$tab[] = ($line->doc_type == 'bank') ? $label_operation : ($line->subledger_account ? $line->subledger_label : $line->label_compte); // colonne 8 : label de l'operation ISTEA
|
||||
$tab[] = $label_operation; // colonne 9 : label de l'operation (semble non prise en compte par ISTEA)
|
||||
$tab[] = price2num($line->debit); // colonne 10 : debit ISTEA
|
||||
$tab[] = price2num($line->credit); // colonne 11 : credit ISTEA
|
||||
$tab[] = $line->code_journal; // colonne 12 : journal ISTEA
|
||||
|
||||
$output = mb_convert_encoding('"'.implode('"'.$separator.'"', $tab).'"'.$this->end_line, 'ISO-8859-1');
|
||||
if ($exportFile) {
|
||||
fwrite($exportFile, $output);
|
||||
} else {
|
||||
print $output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : FEC
|
||||
* Last review for this format : 2023/10/12 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
@@ -1406,6 +1474,7 @@ class AccountancyExport
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
$refInvoice = '';
|
||||
$invoice = null;
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Customer invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
@@ -1508,10 +1577,9 @@ class AccountancyExport
|
||||
if (!getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_EXPENSEREPORT_SOURCE_FILE')) {
|
||||
$objectDirPath = !empty($conf->expensereport->multidir_output[$conf->entity]) ? $conf->expensereport->multidir_output[$conf->entity] : $conf->expensereport->dir_output;
|
||||
}
|
||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||
} elseif ($line->doc_type == 'supplier_invoice' && $invoice instanceof FactureFournisseur) {
|
||||
if (!getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_SUPPLIERINVOICE_SOURCE_FILE')) {
|
||||
'@phan-var-force FactureFournisseur $invoice';
|
||||
/** @var FactureFournisseur $invoice */
|
||||
$objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output;
|
||||
$objectDirPath .= '/' . rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/');
|
||||
}
|
||||
@@ -1626,6 +1694,7 @@ class AccountancyExport
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
$refInvoice = '';
|
||||
$invoice = null;
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Customer invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
@@ -1728,10 +1797,9 @@ class AccountancyExport
|
||||
if (!getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_EXPENSEREPORT_SOURCE_FILE')) {
|
||||
$objectDirPath = !empty($conf->expensereport->multidir_output[$conf->entity]) ? $conf->expensereport->multidir_output[$conf->entity] : $conf->expensereport->dir_output;
|
||||
}
|
||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||
} elseif ($line->doc_type == 'supplier_invoice' && $invoice instanceof FactureFournisseur) {
|
||||
if (!getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_SUPPLIERINVOICE_SOURCE_FILE')) {
|
||||
'@phan-var-force FactureFournisseur $invoice';
|
||||
/** @var FactureFournisseur $invoice */
|
||||
$objectDirPath = !empty($conf->fournisseur->facture->multidir_output[$conf->entity]) ? $conf->fournisseur->facture->multidir_output[$conf->entity] : $conf->fournisseur->facture->dir_output;
|
||||
$objectDirPath .= '/' . rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/');
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2022 OpenDSI <support@open-dsi.fr>
|
||||
/* Copyright (C) 2017-2022 OpenDSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Alexandre Janniaux <alexandre.janniaux@gmail.com>
|
||||
* Copyright (C) 2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -217,7 +218,7 @@ class AccountingJournal extends CommonObject
|
||||
|
||||
$result = '';
|
||||
|
||||
$url = DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35';
|
||||
$url = dolBuildUrl(DOL_URL_ROOT.'/accountancy/admin/journals_list.php', ['id' => 35]);
|
||||
|
||||
$label = '<u>'.$langs->trans("ShowAccountingJournal").'</u>';
|
||||
if (!empty($this->code)) {
|
||||
@@ -375,7 +376,24 @@ class AccountingJournal extends CommonObject
|
||||
} elseif (empty($reshook)) {
|
||||
switch ($this->nature) {
|
||||
case 1: // Various Journal
|
||||
$data = $this->getAssetData($user, $type, $date_start, $date_end, $in_bookkeeping);
|
||||
if (isModEnabled('asset') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_ASSETS')) {
|
||||
$tmp = $this->getAssetData($user, $type, $date_start, $date_end, $in_bookkeeping);
|
||||
if (is_array($tmp)) {
|
||||
$data = array_merge($data, $tmp);
|
||||
}
|
||||
}
|
||||
if (isModEnabled('invoice') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
|
||||
$tmp = $this->getDiscountCustomer($user, $type, $date_start, $date_end, $in_bookkeeping);
|
||||
if (is_array($tmp)) {
|
||||
$data = array_merge($data, $tmp);
|
||||
}
|
||||
}
|
||||
if (isModEnabled('supplier_invoice') && !getDolGlobalInt('ACCOUNTING_DISABLE_TRANSFER_ON_DISCOUNTS')) {
|
||||
$tmp = $this->getDiscountSupplier($user, $type, $date_start, $date_end, $in_bookkeeping);
|
||||
if (is_array($tmp)) {
|
||||
$data = array_merge($data, $tmp);
|
||||
}
|
||||
}
|
||||
break;
|
||||
// case 2: // Sells Journal
|
||||
// case 3: // Purchases Journal
|
||||
@@ -429,6 +447,7 @@ class AccountingJournal extends CommonObject
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "asset_depreciation as ad";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON a.rowid = ad.fk_asset";
|
||||
$sql .= " WHERE a.entity IN (" . getEntity('asset', 0) . ')'; // We don't share object for accountancy, we use source object sharing
|
||||
$sql .= " AND a.status > 0";
|
||||
if ($in_bookkeeping == 'already') {
|
||||
$sql .= " AND EXISTS (SELECT iab.fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping AS iab WHERE iab.fk_docdet = ad.rowid AND doc_type = 'asset')";
|
||||
} elseif ($in_bookkeeping == 'notyet') {
|
||||
@@ -507,7 +526,7 @@ class AccountingJournal extends CommonObject
|
||||
|
||||
$element = array(
|
||||
'ref' => dol_trunc($element_static->ref, 16, 'right', 'UTF-8', 1),
|
||||
'error' => array_key_exists('error', $pre_data_info) ? $pre_data_info['error'] : '',
|
||||
'error' => array_key_exists('error', $pre_data_info) ? $pre_data_info['error'] : '', // @phpstan-ignore-line
|
||||
'blocks' => array(),
|
||||
);
|
||||
|
||||
@@ -524,7 +543,7 @@ class AccountingJournal extends CommonObject
|
||||
$account_infos = $this->getAccountingAccountInfos($account);
|
||||
|
||||
if ($type == 'view') {
|
||||
$account_to_show = length_accounta($account);
|
||||
$account_to_show = length_accountg($account);
|
||||
if (($account_to_show == "") || $account_to_show == 'NotDefined') {
|
||||
$account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>';
|
||||
}
|
||||
@@ -644,7 +663,7 @@ class AccountingJournal extends CommonObject
|
||||
$account_infos = $this->getAccountingAccountInfos($account);
|
||||
|
||||
if ($type == 'view') {
|
||||
$account_to_show = length_accounta($account);
|
||||
$account_to_show = length_accountg($account);
|
||||
if (($account_to_show == "") || $account_to_show == 'NotDefined') {
|
||||
$account_to_show = '<span class="error">' . $langs->trans("AssetInAccountNotDefined") . '</span>';
|
||||
}
|
||||
@@ -711,6 +730,614 @@ class AccountingJournal extends CommonObject
|
||||
return $journal_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get customer discount (escompte) data for various journal
|
||||
*
|
||||
* @param User $user User who get infos
|
||||
* @param 'view'|'bookkeeping'|'csv' $type Type data returned ('view', 'bookkeeping', 'csv')
|
||||
* @param ?int $date_start Filter 'start date'
|
||||
* @param ?int $date_end Filter 'end date'
|
||||
* @param 'already'|'notyet' $in_bookkeeping Filter 'in bookkeeping' ('already', 'notyet')
|
||||
* @return int<-1,-1>|array<int,array{ref:string,error:?string,blocks:array<array<array{date:string,piece:string,account_accounting:string,subledger_account:string,label_operation:string,debit:string,credit:string}|array{doc_date:''|int,date_lim_reglement:string,doc_ref:string,date_creation:int,doc_type:string,fk_doc:int|string,fk_docdet:int|string,thirdparty_code:string,subledger_account:string,subledger_label:string,numero_compte:string,label_compte:string,label_operation:string,montant:string,sens:string,debit:int|float|string,credit:int|float|string,code_journal:string,journal_label:string,piece_num:string,import_key:string,fk_user_author:string,entity:string}>>}> Return integer <0 if KO, array
|
||||
*/
|
||||
public function getDiscountCustomer(User $user, $type = 'view', $date_start = null, $date_end = null, $in_bookkeeping = 'notyet')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
$langs->loadLangs(array('bills'));
|
||||
|
||||
// Clean parameters
|
||||
if (empty($type)) {
|
||||
$type = 'view';
|
||||
}
|
||||
if (empty($in_bookkeeping)) {
|
||||
$in_bookkeeping = 'notyet';
|
||||
}
|
||||
|
||||
// Build SQL - Customer invoices closed by discount
|
||||
$sql = "SELECT f.rowid, f.ref, f.datef, f.fk_soc, f.total_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " WHERE f.entity IN (".getEntity('invoice', 0).')'; // We don't share object for accountancy, we use source object sharing
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) { // Non common setup
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_DEPOSIT.",".Facture::TYPE_SITUATION.")";
|
||||
}
|
||||
$sql .= " AND f.close_code = 'discount_vat'";
|
||||
if ($date_start && $date_end) {
|
||||
$sql .= " AND f.datef >= '".$this->db->idate($date_start)."' AND f.datef <= '".$this->db->idate($date_end)."'";
|
||||
}
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND f.datef >= '".$this->db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
if ($in_bookkeeping == 'already') {
|
||||
$sql .= " AND EXISTS (SELECT 1 FROM ".MAIN_DB_PREFIX."accounting_bookkeeping ab";
|
||||
$sql .= " WHERE ab.doc_type = 'customer_invoice' AND ab.fk_doc = f.rowid AND ab.piece_num LIKE 'OD-ESC-%')";
|
||||
} elseif ($in_bookkeeping == 'notyet') {
|
||||
$sql .= " AND NOT EXISTS (SELECT 1 FROM ".MAIN_DB_PREFIX."accounting_bookkeeping ab";
|
||||
$sql .= " WHERE ab.doc_type = 'customer_invoice' AND ab.fk_doc = f.rowid AND ab.piece_num LIKE 'OD-ESC-%')";
|
||||
}
|
||||
$sql .= " ORDER BY f.datef";
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$journal = $this->code;
|
||||
$journal_label_formatted = $langs->transnoentities($this->label);
|
||||
$now = dol_now();
|
||||
|
||||
$journal_data = array();
|
||||
$invoice_static = new Facture($this->db);
|
||||
$customer_static = new Societe($this->db);
|
||||
|
||||
// Accounting accounts
|
||||
$acc_disc_granted = getDolGlobalString('ACCOUNTING_ACCOUNT_DISCOUNT_GRANTED');
|
||||
$acc_vat_coll_def = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT'); // Normal to apply vat default account for buy with customer's discount
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if ($invoice_static->fetch((int) $obj->rowid) <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$customer_static->fetch($invoice_static->socid);
|
||||
$account_customer_general = !empty($customer_static->accountancy_code_customer_general) ? $customer_static->accountancy_code_customer_general : getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER');
|
||||
$account_customer_subsidiary = !empty($customer_static->code_compta_client) ? $customer_static->code_compta_client : '';
|
||||
|
||||
$piece_link = $invoice_static->getNomUrl(1, 'withlabel');
|
||||
|
||||
// Discounted amount including tax
|
||||
$paid = (float) price2num($invoice_static->getSommePaiement(), 'MT');
|
||||
$usedcn = (float) price2num($invoice_static->getSumOfCreditNotesUsed(), 'MT');
|
||||
$useddep = (float) price2num($invoice_static->getSumDepositsUsed(), 'MT');
|
||||
$ttc_inv = (float) price2num($invoice_static->total_ttc, 'MT');
|
||||
$escompte_ttc = (float) price2num(max(0, $ttc_inv - $paid - $usedcn - $useddep), 'MT');
|
||||
if ($escompte_ttc <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bookkeeping_static = new BookKeeping($this->db);
|
||||
$label_discount = $bookkeeping_static->accountingLabelForOperation($customer_static->getNomUrl(1, 'customer'), $invoice_static->ref, $langs->trans('DiscountGranted'));
|
||||
|
||||
// Distribution including VAT by rate
|
||||
$ttcByRate = array();
|
||||
$totalTTC = 0.0;
|
||||
foreach ((array) $invoice_static->lines as $li) {
|
||||
$ttc = (float) $li->total_ttc;
|
||||
if (!$ttc) {
|
||||
continue;
|
||||
}
|
||||
$key = number_format((float) $li->tva_tx, 3, '.', '');
|
||||
if (!isset($ttcByRate[$key])) {
|
||||
$ttcByRate[$key] = 0.0;
|
||||
}
|
||||
$ttcByRate[$key] += $ttc;
|
||||
$totalTTC += $ttc;
|
||||
}
|
||||
if ($totalTTC <= 0) {
|
||||
$ttcByRate = array("0.000" => $escompte_ttc);
|
||||
$totalTTC = $escompte_ttc;
|
||||
}
|
||||
|
||||
$element = array(
|
||||
'ref' => dol_trunc($invoice_static->ref, 16, 'right', 'UTF-8', 1),
|
||||
'error' => '',
|
||||
'blocks' => array(),
|
||||
);
|
||||
|
||||
$docdate = $this->db->jdate($obj->datef);
|
||||
$docdate_fmt = dol_print_date($docdate, 'day');
|
||||
|
||||
$sumTTC = 0.0;
|
||||
$i = 0;
|
||||
$n = count($ttcByRate);
|
||||
foreach ($ttcByRate as $rateStr => $ttcRateOnInvoice) {
|
||||
$i++;
|
||||
$rate = (float) $rateStr;
|
||||
|
||||
$ttc_part = (float) $escompte_ttc * ($ttcRateOnInvoice / $totalTTC);
|
||||
if ($i == $n) {
|
||||
$ttc_part = (float) price2num($escompte_ttc - $sumTTC, 'MT');
|
||||
} else {
|
||||
$ttc_part = (float) price2num($ttc_part, 'MT');
|
||||
$sumTTC = (float) price2num($sumTTC + $ttc_part, 'MT');
|
||||
}
|
||||
|
||||
if ($rate > 0) {
|
||||
$ht_part = (float) price2num($ttc_part / (1 + $rate / 100), 'MT');
|
||||
$tva_part = (float) price2num($ttc_part - $ht_part, 'MT');
|
||||
} else {
|
||||
$ht_part = $ttc_part;
|
||||
$tva_part = 0.0;
|
||||
}
|
||||
|
||||
// VAT deductible account (by rate if available)
|
||||
// TODO write function to search the same vat code like the invoice
|
||||
$acc_vat_coll = $acc_vat_coll_def;
|
||||
|
||||
$lines_view = array();
|
||||
$lines_book = array();
|
||||
|
||||
// Discount granted
|
||||
$acc_info_discountgranted = $this->getAccountingAccountInfos($acc_disc_granted);
|
||||
if ($type == 'view') {
|
||||
$lines_view[] = array(
|
||||
'date' => $docdate_fmt,
|
||||
'piece' => $piece_link,
|
||||
'account_accounting' => length_accountg($acc_disc_granted),
|
||||
'subledger_account' => '',
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
|
||||
'debit' => price($ht_part),
|
||||
'credit' => '',
|
||||
);
|
||||
} elseif ($type == 'bookkeeping' && $acc_info_discountgranted['found']) {
|
||||
$lines_book[] = array(
|
||||
'doc_date' => $docdate,
|
||||
'date_lim_reglement' => '',
|
||||
'doc_ref' => $invoice_static->ref,
|
||||
'date_creation' => $now,
|
||||
'doc_type' => 'customer_invoice',
|
||||
'fk_doc' => $invoice_static->id,
|
||||
'fk_docdet' => 0,
|
||||
'thirdparty_code' => $customer_static->code_client,
|
||||
'subledger_account' => '',
|
||||
'subledger_label' => '',
|
||||
'numero_compte' => $acc_disc_granted,
|
||||
'label_compte' => $acc_info_discountgranted['label'],
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
|
||||
'montant' => $ht_part,
|
||||
'sens' => 'D',
|
||||
'debit' => $ht_part,
|
||||
'credit' => 0,
|
||||
'code_journal' => $journal,
|
||||
'journal_label' => $journal_label_formatted,
|
||||
'piece_num' => 'OD-ESC-'.$invoice_static->ref,
|
||||
'import_key' => '',
|
||||
'fk_user_author' => $user->id,
|
||||
'entity' => $conf->entity,
|
||||
);
|
||||
}
|
||||
|
||||
// VAT
|
||||
if ($tva_part > 0) {
|
||||
$acc_info_vatbuy = $this->getAccountingAccountInfos($acc_vat_coll);
|
||||
if ($type == 'view') {
|
||||
$lines_view[] = array(
|
||||
'date' => $docdate_fmt,
|
||||
'piece' => $piece_link,
|
||||
'account_accounting' => length_accountg($acc_vat_coll),
|
||||
'subledger_account' => '',
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
|
||||
'debit' => price($tva_part),
|
||||
'credit' => '',
|
||||
);
|
||||
} elseif ($type == 'bookkeeping' && $acc_info_vatbuy['found']) {
|
||||
$lines_book[] = array(
|
||||
'doc_date' => $docdate,
|
||||
'date_lim_reglement' => '',
|
||||
'doc_ref' => $invoice_static->ref,
|
||||
'date_creation' => $now,
|
||||
'doc_type' => 'customer_invoice',
|
||||
'fk_doc' => $invoice_static->id,
|
||||
'fk_docdet' => 0,
|
||||
'thirdparty_code' => $customer_static->code_client,
|
||||
'subledger_account' => '',
|
||||
'subledger_label' => '',
|
||||
'numero_compte' => $acc_vat_coll,
|
||||
'label_compte' => $acc_info_vatbuy['label'],
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
|
||||
'montant' => $tva_part,
|
||||
'sens' => 'D',
|
||||
'debit' => $tva_part,
|
||||
'credit' => 0,
|
||||
'code_journal' => $journal,
|
||||
'journal_label' => $journal_label_formatted,
|
||||
'piece_num' => 'OD-ESC-'.$invoice_static->ref,
|
||||
'import_key' => '',
|
||||
'fk_user_author' => $user->id,
|
||||
'entity' => $conf->entity,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Thirdparty
|
||||
$acc_info_customeraccount = $this->getAccountingAccountInfos($account_customer_general);
|
||||
if ($type == 'view') {
|
||||
$lines_view[] = array(
|
||||
'date' => $docdate_fmt,
|
||||
'piece' => $piece_link,
|
||||
'account_accounting' => length_accountg($account_customer_general),
|
||||
'subledger_account' => length_accounta($account_customer_subsidiary),
|
||||
'label_operation' => $label_discount.' - '.$langs->transnoentitiesnoconv('Customer'),
|
||||
'debit' => '',
|
||||
'credit' => price($ttc_part),
|
||||
);
|
||||
$element['blocks'][] = $lines_view;
|
||||
} elseif ($type == 'bookkeeping' && $acc_info_customeraccount['found']) {
|
||||
$lines_book[] = array(
|
||||
'doc_date' => $docdate,
|
||||
'date_lim_reglement' => '',
|
||||
'doc_ref' => $invoice_static->ref,
|
||||
'date_creation' => $now,
|
||||
'doc_type' => 'customer_invoice',
|
||||
'fk_doc' => $invoice_static->id,
|
||||
'fk_docdet' => 0,
|
||||
'thirdparty_code' => $customer_static->code_client,
|
||||
'subledger_account' => $account_customer_subsidiary,
|
||||
'subledger_label' => $customer_static->name,
|
||||
'numero_compte' => $account_customer_general,
|
||||
'label_compte' => $acc_info_customeraccount['label'],
|
||||
'label_operation' => $label_discount.' - '.$langs->transnoentitiesnoconv('Customer'),
|
||||
'montant' => $ttc_part,
|
||||
'sens' => 'C',
|
||||
'debit' => 0,
|
||||
'credit' => $ttc_part,
|
||||
'code_journal' => $journal,
|
||||
'journal_label' => $journal_label_formatted,
|
||||
'piece_num' => 'OD-ESC-'.$invoice_static->ref,
|
||||
'import_key' => '',
|
||||
'fk_user_author' => $user->id,
|
||||
'entity' => $conf->entity,
|
||||
);
|
||||
$element['blocks'][] = $lines_book;
|
||||
} else { // CSV
|
||||
$element['blocks'][] = array(
|
||||
$docdate, // Date
|
||||
$invoice_static->ref, // Piece
|
||||
length_accountg($acc_disc_granted), // Account
|
||||
$label_discount." (".$rateStr."%)", // Label
|
||||
price($ht_part), // Debit
|
||||
'', // Credit
|
||||
);
|
||||
if ($tva_part > 0) {
|
||||
$element['blocks'][] = array(
|
||||
$docdate, $invoice_static->ref, length_accountg($acc_vat_coll), $label_discount." ". $langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)", price($tva_part), ''
|
||||
);
|
||||
}
|
||||
$element['blocks'][] = array(
|
||||
$docdate, $invoice_static->ref, length_accountg($account_customer_general), $label_discount.' - '.$langs->transnoentitiesnoconv('Customer'), '', price($ttc_part)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$journal_data[(int) $invoice_static->id] = $element;
|
||||
}
|
||||
|
||||
return $journal_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get supplier discount (escompte) data for various journal
|
||||
*
|
||||
* @param User $user User who get infos
|
||||
* @param 'view'|'bookkeeping'|'csv' $type Type data returned ('view', 'bookkeeping', 'csv')
|
||||
* @param ?int $date_start Filter 'start date'
|
||||
* @param ?int $date_end Filter 'end date'
|
||||
* @param 'already'|'notyet' $in_bookkeeping Filter 'in bookkeeping' ('already', 'notyet')
|
||||
* @return int<-1,-1>|array<int,array{ref:string,error:?string,blocks:array<array<array{date:string,piece:string,account_accounting:string,subledger_account:string,label_operation:string,debit:string,credit:string}|array{doc_date:''|int,date_lim_reglement:string,doc_ref:string,date_creation:int,doc_type:string,fk_doc:int|string,fk_docdet:int|string,thirdparty_code:string,subledger_account:string,subledger_label:string,numero_compte:string,label_compte:string,label_operation:string,montant:string,sens:string,debit:int|float|string,credit:int|float|string,code_journal:string,journal_label:string,piece_num:string,import_key:string,fk_user_author:string,entity:string}>>}> Return integer <0 if KO, array
|
||||
*/
|
||||
public function getDiscountSupplier(User $user, $type = 'view', $date_start = null, $date_end = null, $in_bookkeeping = 'notyet')
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
$langs->loadLangs(array('suppliers'));
|
||||
|
||||
// Clean parameters
|
||||
if (empty($type)) {
|
||||
$type = 'view';
|
||||
}
|
||||
if (empty($in_bookkeeping)) {
|
||||
$in_bookkeeping = 'notyet';
|
||||
}
|
||||
|
||||
// SQL - Supplier invoices closed by discount
|
||||
$sql = "SELECT ff.rowid, ff.ref, ff.datef, ff.fk_soc, ff.total_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
|
||||
$sql .= " WHERE ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.fk_statut > 0";
|
||||
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_SITUATION.")";
|
||||
} else {
|
||||
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.",".FactureFournisseur::TYPE_SITUATION.")";
|
||||
}
|
||||
$sql .= " AND ff.close_code = 'discount_vat'";
|
||||
if ($date_start && $date_end) {
|
||||
$sql .= " AND ff.datef >= '".$this->db->idate($date_start)."' AND ff.datef <= '".$this->db->idate($date_end)."'";
|
||||
}
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND ff.datef >= '".$this->db->idate(getDolGlobalInt('ACCOUNTING_DATE_START_BINDING'))."'";
|
||||
}
|
||||
if ($in_bookkeeping == 'already') {
|
||||
$sql .= " AND EXISTS (SELECT 1 FROM ".MAIN_DB_PREFIX."accounting_bookkeeping ab";
|
||||
$sql .= " WHERE ab.doc_type = 'supplier_invoice' AND ab.fk_doc = ff.rowid AND ab.piece_num LIKE 'OD-ESC-FRS-%')";
|
||||
} elseif ($in_bookkeeping == 'notyet') {
|
||||
$sql .= " AND NOT EXISTS (SELECT 1 FROM ".MAIN_DB_PREFIX."accounting_bookkeeping ab";
|
||||
$sql .= " WHERE ab.doc_type = 'supplier_invoice' AND ab.fk_doc = ff.rowid AND ab.piece_num LIKE 'OD-ESC-FRS-%')";
|
||||
}
|
||||
$sql .= " ORDER BY ff.datef";
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
$journal = $this->code;
|
||||
$journal_label_formatted = $langs->transnoentities($this->label);
|
||||
$now = dol_now();
|
||||
|
||||
$journal_data = array();
|
||||
$invoicesupplier_static = new FactureFournisseur($this->db);
|
||||
$supplier_static = new Societe($this->db);
|
||||
|
||||
// Accounting accounts
|
||||
$acc_disc_recv = getDolGlobalString('ACCOUNTING_ACCOUNT_DISCOUNT_RECEIVED');
|
||||
$acc_vat_ded_def = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT'); // Normal to apply vat default account for sold with supplier's discount
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if ($invoicesupplier_static->fetch((int) $obj->rowid) <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$supplier_static->fetch($invoicesupplier_static->socid);
|
||||
$account_supplier_general = !empty($supplier_static->accountancy_code_supplier_general) ? $supplier_static->accountancy_code_supplier_general : getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER');
|
||||
$account_supplier_subsidiary = !empty($supplier_static->code_compta_fournisseur) ? $supplier_static->code_compta_fournisseur : '';
|
||||
|
||||
$piece_link = $invoicesupplier_static->getNomUrl(1, 'withlabel');
|
||||
|
||||
// Discounted amount including tax
|
||||
$paid = (float) price2num($invoicesupplier_static->getSommePaiement(), 'MT');
|
||||
$usedcn = (float) price2num($invoicesupplier_static->getSumOfCreditNotesUsed(), 'MT');
|
||||
$useddep = (float) price2num($invoicesupplier_static->getSumDepositsUsed(), 'MT');
|
||||
$ttc_inv = (float) price2num($invoicesupplier_static->total_ttc, 'MT');
|
||||
$escompte_ttc = (float) price2num(max(0, $ttc_inv - $paid - $usedcn - $useddep), 'MT');
|
||||
if ($escompte_ttc <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$bookkeeping_static = new BookKeeping($this->db);
|
||||
$label_discount = $bookkeeping_static->accountingLabelForOperation($supplier_static->getNomUrl(1, 'supplier'), $invoicesupplier_static->ref, $langs->trans('DiscountReceived'));
|
||||
|
||||
// Distribution including VAT by rate
|
||||
$ttcByRate = array();
|
||||
$totalTTC = 0.0;
|
||||
foreach ((array) $invoicesupplier_static->lines as $li) {
|
||||
$ttc = (float) $li->total_ttc;
|
||||
if (!$ttc) {
|
||||
continue;
|
||||
}
|
||||
$key = number_format((float) $li->tva_tx, 3, '.', '');
|
||||
if (!isset($ttcByRate[$key])) {
|
||||
$ttcByRate[$key] = 0.0;
|
||||
}
|
||||
$ttcByRate[$key] += $ttc;
|
||||
$totalTTC += $ttc;
|
||||
}
|
||||
if ($totalTTC <= 0) {
|
||||
$ttcByRate = array("0.000" => $escompte_ttc);
|
||||
$totalTTC = $escompte_ttc;
|
||||
}
|
||||
|
||||
$element = array(
|
||||
'ref' => dol_trunc($invoicesupplier_static->ref, 16, 'right', 'UTF-8', 1),
|
||||
'error' => '',
|
||||
'blocks' => array(),
|
||||
);
|
||||
|
||||
$docdate = $this->db->jdate($obj->datef);
|
||||
$docdate_fmt = dol_print_date($docdate, 'day');
|
||||
|
||||
$sumTTC = 0.0;
|
||||
$i = 0;
|
||||
$n = count($ttcByRate);
|
||||
foreach ($ttcByRate as $rateStr => $ttcRateOnInvoice) {
|
||||
$i++;
|
||||
$rate = (float) $rateStr;
|
||||
|
||||
$ttc_part = $escompte_ttc * ($ttcRateOnInvoice / $totalTTC);
|
||||
if ($i == $n) {
|
||||
$ttc_part = (float) price2num($escompte_ttc - $sumTTC, 'MT');
|
||||
} else {
|
||||
$ttc_part = (float) price2num($ttc_part, 'MT');
|
||||
$sumTTC = (float) price2num($sumTTC + $ttc_part, 'MT');
|
||||
}
|
||||
|
||||
if ($rate > 0) {
|
||||
$ht_part = (float) price2num($ttc_part / (1 + $rate / 100), 'MT');
|
||||
$tva_part = (float) price2num($ttc_part - $ht_part, 'MT');
|
||||
} else {
|
||||
$ht_part = $ttc_part;
|
||||
$tva_part = 0.0;
|
||||
}
|
||||
|
||||
// VAT collected account (by rate if available)
|
||||
// TODO write function to search the same vat code like the supplier invoice
|
||||
$acc_vat_ded = $acc_vat_ded_def;
|
||||
|
||||
$lines_view = array();
|
||||
$lines_book = array();
|
||||
|
||||
// Thirdparty
|
||||
$acc_info_supplieraccount = $this->getAccountingAccountInfos($account_supplier_general);
|
||||
if ($type == 'view') {
|
||||
$lines_view[] = array(
|
||||
'date' => $docdate_fmt,
|
||||
'piece' => $piece_link,
|
||||
'account_accounting' => length_accountg($account_supplier_general),
|
||||
'subledger_account' => length_accounta($account_supplier_subsidiary),
|
||||
'label_operation' => $label_discount.' - '.$langs->transnoentitiesnoconv('Supplier'),
|
||||
'debit' => price($ttc_part),
|
||||
'credit' => '',
|
||||
);
|
||||
} elseif ($type == 'bookkeeping' && $acc_info_supplieraccount['found']) {
|
||||
$lines_book[] = array(
|
||||
'doc_date' => $docdate,
|
||||
'date_lim_reglement' => '',
|
||||
'doc_ref' => $invoicesupplier_static->ref,
|
||||
'date_creation' => $now,
|
||||
'doc_type' => 'supplier_invoice',
|
||||
'fk_doc' => $invoicesupplier_static->id,
|
||||
'fk_docdet' => 0,
|
||||
'thirdparty_code' => $supplier_static->code_fournisseur,
|
||||
'subledger_account' => $account_supplier_subsidiary,
|
||||
'subledger_label' => $supplier_static->name,
|
||||
'numero_compte' => $account_supplier_general,
|
||||
'label_compte' => $acc_info_supplieraccount['label'],
|
||||
'label_operation' => $label_discount.' - '.$langs->transnoentitiesnoconv('Supplier'),
|
||||
'montant' => $ttc_part,
|
||||
'sens' => 'D',
|
||||
'debit' => $ttc_part,
|
||||
'credit' => 0,
|
||||
'code_journal' => $journal,
|
||||
'journal_label' => $journal_label_formatted,
|
||||
'piece_num' => 'OD-ESC-FRS-'.$invoicesupplier_static->ref,
|
||||
'import_key' => '',
|
||||
'fk_user_author' => $user->id,
|
||||
'entity' => $conf->entity,
|
||||
);
|
||||
}
|
||||
|
||||
// Discount received
|
||||
$acc_info_discountreceived = $this->getAccountingAccountInfos($acc_disc_recv);
|
||||
if ($type == 'view') {
|
||||
$lines_view[] = array(
|
||||
'date' => $docdate_fmt,
|
||||
'piece' => $piece_link,
|
||||
'account_accounting' => length_accountg($acc_disc_recv),
|
||||
'subledger_account' => '',
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
|
||||
'debit' => '',
|
||||
'credit' => price($ht_part),
|
||||
);
|
||||
} elseif ($type == 'bookkeeping' && $acc_info_discountreceived['found']) {
|
||||
$lines_book[] = array(
|
||||
'doc_date' => $docdate,
|
||||
'date_lim_reglement' => '',
|
||||
'doc_ref' => $invoicesupplier_static->ref,
|
||||
'date_creation' => $now,
|
||||
'doc_type' => 'supplier_invoice',
|
||||
'fk_doc' => $invoicesupplier_static->id,
|
||||
'fk_docdet' => 0,
|
||||
'thirdparty_code' => $supplier_static->code_fournisseur,
|
||||
'subledger_account' => '',
|
||||
'subledger_label' => '',
|
||||
'numero_compte' => $acc_disc_recv,
|
||||
'label_compte' => $acc_info_discountreceived['label'],
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('HT') . " (".$rateStr."%)",
|
||||
'montant' => $ht_part,
|
||||
'sens' => 'C',
|
||||
'debit' => 0,
|
||||
'credit' => $ht_part,
|
||||
'code_journal' => $journal,
|
||||
'journal_label' => $journal_label_formatted,
|
||||
'piece_num' => 'OD-ESC-FRS-'.$invoicesupplier_static->ref,
|
||||
'import_key' => '',
|
||||
'fk_user_author' => $user->id,
|
||||
'entity' => $conf->entity,
|
||||
);
|
||||
}
|
||||
|
||||
// VAT
|
||||
if ($tva_part > 0) {
|
||||
$acc_info_vatbuy = $this->getAccountingAccountInfos($acc_vat_ded);
|
||||
if ($type == 'view') {
|
||||
$lines_view[] = array(
|
||||
'date' => $docdate_fmt,
|
||||
'piece' => $piece_link,
|
||||
'account_accounting' => length_accountg($acc_vat_ded),
|
||||
'subledger_account' => '',
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
|
||||
'debit' => '',
|
||||
'credit' => price($tva_part),
|
||||
);
|
||||
$element['blocks'][] = $lines_view;
|
||||
} elseif ($type == 'bookkeeping' && $acc_info_vatbuy['found']) {
|
||||
$lines_book[] = array(
|
||||
'doc_date' => $docdate,
|
||||
'date_lim_reglement' => '',
|
||||
'doc_ref' => $invoicesupplier_static->ref,
|
||||
'date_creation' => $now,
|
||||
'doc_type' => 'supplier_invoice',
|
||||
'fk_doc' => $invoicesupplier_static->id,
|
||||
'fk_docdet' => 0,
|
||||
'thirdparty_code' => $supplier_static->code_fournisseur,
|
||||
'subledger_account' => '',
|
||||
'subledger_label' => '',
|
||||
'numero_compte' => $acc_vat_ded,
|
||||
'label_compte' => $acc_info_vatbuy['label'],
|
||||
'label_operation' => $label_discount." - " .$langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)",
|
||||
'montant' => $tva_part,
|
||||
'sens' => 'C',
|
||||
'debit' => 0,
|
||||
'credit' => $tva_part,
|
||||
'code_journal' => $journal,
|
||||
'journal_label' => $journal_label_formatted,
|
||||
'piece_num' => 'OD-ESC-FRS-'.$invoicesupplier_static->ref,
|
||||
'import_key' => '',
|
||||
'fk_user_author' => $user->id,
|
||||
'entity' => $conf->entity,
|
||||
);
|
||||
$element['blocks'][] = $lines_book;
|
||||
}
|
||||
} else {
|
||||
// si TVA = 0, pousser les 2 lignes view/bookkeeping déjà constituées
|
||||
if ($type == 'view') {
|
||||
$element['blocks'][] = $lines_view;
|
||||
} elseif ($type == 'bookkeeping') {
|
||||
$element['blocks'][] = $lines_book;
|
||||
} else { // csv
|
||||
$element['blocks'][] = array($docdate, $invoicesupplier_static->ref, length_accountg($account_supplier_general), $label_discount.' - '.$langs->transnoentitiesnoconv('Supplier'), price($ttc_part), '');
|
||||
$element['blocks'][] = array($docdate, $invoicesupplier_static->ref, length_accountg($acc_disc_recv), $label_discount.' ('.$rateStr.'%)', '', price($ht_part));
|
||||
}
|
||||
}
|
||||
|
||||
// CSV
|
||||
if ($type == 'csv') {
|
||||
$element['blocks'][] = array(
|
||||
$docdate, $invoicesupplier_static->ref, length_accountg($acc_vat_ded), $label_discount." ". $langs->transnoentitiesnoconv('VAT') . " (".$rateStr."%)", '', $tva_part > 0 ? price($tva_part) : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$journal_data[(int) $invoicesupplier_static->id] = $element;
|
||||
}
|
||||
|
||||
return $journal_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write bookkeeping
|
||||
*
|
||||
@@ -986,7 +1613,7 @@ class AccountingJournal extends CommonObject
|
||||
self::$accounting_account_cached[$account] = array(
|
||||
'found' => true,
|
||||
'label' => $accountingaccount->label,
|
||||
'code_formatted_1' => length_accounta(html_entity_decode($account)),
|
||||
'code_formatted_1' => length_accountg(html_entity_decode($account)),
|
||||
'label_formatted_1' => mb_convert_encoding(dol_trunc($accountingaccount->label, 32), 'ISO-8859-1'),
|
||||
'label_formatted_2' => dol_trunc($accountingaccount->label, 32),
|
||||
);
|
||||
@@ -994,7 +1621,7 @@ class AccountingJournal extends CommonObject
|
||||
self::$accounting_account_cached[$account] = array(
|
||||
'found' => false,
|
||||
'label' => '',
|
||||
'code_formatted_1' => length_accounta(html_entity_decode($account)),
|
||||
'code_formatted_1' => length_accountg(html_entity_decode($account)),
|
||||
'label_formatted_1' => '',
|
||||
'label_formatted_2' => '',
|
||||
);
|
||||
|
||||
@@ -595,7 +595,8 @@ class BookKeeping extends CommonObject
|
||||
$label .= '<br>';
|
||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
|
||||
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$this->piece_num;
|
||||
$baseurl = DOL_URL_ROOT.'/accountancy/bookkeeping/card.php';
|
||||
$query = ['piece_num' => $this->piece_num];
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
@@ -604,9 +605,10 @@ class BookKeeping extends CommonObject
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
$query += ['save_lastsearch_values' => 1];
|
||||
}
|
||||
}
|
||||
$url = dolBuildUrl($baseurl, $query);
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip)) {
|
||||
@@ -3539,7 +3541,7 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
public function newCloneMass($toselect, $code_journal, $docdate)
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $user;
|
||||
|
||||
$error = 0;
|
||||
$this->db->begin();
|
||||
@@ -3593,22 +3595,55 @@ class BookKeeping extends CommonObject
|
||||
if ($bookKeeping->fetch($toselectid)) {
|
||||
$code_journal = getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL') ? $code_journal : $bookKeeping->code_journal;
|
||||
$journal_label = getDolGlobalString('ACCOUNTING_CLONING_ENABLE_INPUT_JOURNAL') ? $accountingJournal->label : $bookKeeping->journal_label;
|
||||
$sql = "SELECT piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, fk_user_author, doc_ref, fk_doc, fk_docdet, debit, credit, journal_label, sens, montant ";
|
||||
$sql .= "FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE rowid = " . ((int) $toselectid);
|
||||
$sql = "SELECT piece_num, label_operation, numero_compte, label_compte, subledger_account, subledger_label, doc_type, code_journal, fk_user_author, doc_ref, fk_doc, fk_docdet, debit, credit, journal_label, sens, montant";
|
||||
$sql .= " FROM ".$this->db->prefix()."accounting_bookkeeping WHERE rowid = " . ((int) $toselectid);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$docRef = $langs->trans("CloneOf", $obj->doc_ref);
|
||||
|
||||
$sql_insert = "INSERT INTO ".$this->db->prefix()."accounting_bookkeeping";
|
||||
$sql_insert .= " (piece_num, label_operation, numero_compte, label_compte, doc_type, code_journal, doc_date,";
|
||||
$sql_insert .= " fk_user_author, doc_ref, fk_doc, fk_docdet, debit, credit, journal_label, sens, montant";
|
||||
$sql_insert = "INSERT INTO ".$this->db->prefix()."accounting_bookkeeping (";
|
||||
$sql_insert .= " piece_num";
|
||||
$sql_insert .= ", label_operation";
|
||||
$sql_insert .= ", numero_compte";
|
||||
$sql_insert .= ", label_compte";
|
||||
$sql_insert .= ", subledger_account";
|
||||
$sql_insert .= ", subledger_label";
|
||||
$sql_insert .= ", doc_type";
|
||||
$sql_insert .= ", code_journal";
|
||||
$sql_insert .= ", doc_date";
|
||||
$sql_insert .= ", date_creation";
|
||||
$sql_insert .= ", fk_user_author";
|
||||
$sql_insert .= ", doc_ref";
|
||||
$sql_insert .= ", fk_doc";
|
||||
$sql_insert .= ", fk_docdet";
|
||||
$sql_insert .= ", debit";
|
||||
$sql_insert .= ", credit";
|
||||
$sql_insert .= ", journal_label";
|
||||
$sql_insert .= ", sens";
|
||||
$sql_insert .= ", montant";
|
||||
$sql_insert .= ")";
|
||||
$sql_insert .= " VALUES (" . ((int) $pieceNumNext) . ", '" . $this->db->escape($obj->label_operation) . "', '" . $this->db->escape($obj->numero_compte) . "',";
|
||||
$sql_insert .= " '" . $this->db->escape($obj->label_compte) . "', '" . $this->db->escape($obj->doc_type) . "', '" . $this->db->escape($code_journal) . "', '" . $this->db->idate($docdate)."',";
|
||||
$sql_insert .= " '" . $this->db->escape($obj->fk_user_author) . "', '" . $this->db->escape($docRef) . "', " . ((int) $obj->fk_doc) . ", " . ((int) $obj->fk_docdet) . ",";
|
||||
$sql_insert .= " " . (float) $obj->debit . ", " . (float) $obj->credit . ", '" . $this->db->escape($journal_label) . "', '" . $this->db->escape($obj->sens) . "', " . (float) $obj->montant;
|
||||
$sql_insert .= " VALUES (";
|
||||
$sql_insert .= $pieceNumNext;
|
||||
$sql_insert .= ", '" . $this->db->escape($obj->label_operation) . "'";
|
||||
$sql_insert .= ", '" . $this->db->escape($obj->numero_compte) . "'";
|
||||
$sql_insert .= ", '" . $this->db->escape($obj->label_compte) . "'";
|
||||
$sql_insert .= ", '" . $this->db->escape($obj->subledger_account) . "'";
|
||||
$sql_insert .= ", '" . $this->db->escape($obj->subledger_label) . "'";
|
||||
$sql_insert .= ", ''";
|
||||
$sql_insert .= ", '" . $this->db->escape($code_journal) . "'";
|
||||
$sql_insert .= ", '" . $this->db->idate($docdate)."'";
|
||||
$sql_insert .= ", '" . $this->db->idate($now)."'";
|
||||
$sql_insert .= ", ".($user->id > 0 ? ((int) $user->id) : "NULL");
|
||||
$sql_insert .= ", '" . $this->db->escape($docRef) . "'";
|
||||
$sql_insert .= ", 0";
|
||||
$sql_insert .= ", 0";
|
||||
$sql_insert .= ", " . (float) $obj->debit;
|
||||
$sql_insert .= ", " . (float) $obj->credit;
|
||||
$sql_insert .= ", '" . $this->db->escape($journal_label) . "'";
|
||||
$sql_insert .= ", '" . $this->db->escape($obj->sens) . "'";
|
||||
$sql_insert .= ", " . (float) $obj->montant;
|
||||
$sql_insert .= ")";
|
||||
|
||||
$resqlInsert = $this->db->query($sql_insert);
|
||||
|
||||
@@ -557,7 +557,7 @@ class Lettering extends BookKeeping
|
||||
$group_error++;
|
||||
}
|
||||
|
||||
// Lettering/Unlettering the group of bookkeeping lines
|
||||
// Matching/Unmatching the group of bookkeeping lines
|
||||
if (!$group_error && $do_it) {
|
||||
if ($unlettering) {
|
||||
$result = $this->deleteLettering($bookkeeping_lines);
|
||||
@@ -929,6 +929,10 @@ class Lettering extends BookKeeping
|
||||
// Save list when is the first step of the recursive recursive function
|
||||
$save_link_by_element = $link_by_element;
|
||||
$save_element_by_link = $element_by_link;
|
||||
} else {
|
||||
// To satisfy static analysis (phpstan)
|
||||
$save_link_by_element = null;
|
||||
$save_element_by_link = null;
|
||||
}
|
||||
|
||||
do {
|
||||
|
||||
@@ -146,7 +146,7 @@ if (empty($reshook)) {
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("AllMovementsWereRecordedAsValidated"), null, 'mesgs');
|
||||
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?fiscal_period_id=' . $current_fiscal_period['id']);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($langs->trans("NotAllMovementsCouldBeRecordedAsValidated"), null, 'errors');
|
||||
@@ -176,7 +176,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($langs->trans("AccountancyClosureCloseSuccessfully"), null, 'mesgs');
|
||||
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?fiscal_period_id=' . $current_fiscal_period['id']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
setEventMessages($langs->trans("AccountancyClosureInsertAccountingReversalSuccessfully"), null, 'mesgs');
|
||||
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . (isset($current_fiscal_period) ? '?fiscal_period_id=' . $current_fiscal_period['id'] : ''));
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?fiscal_period_id=' . $current_fiscal_period['id']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -345,7 +345,7 @@ $fiscal_period_nav_text = $langs->trans("FiscalPeriod");
|
||||
$fiscal_period_nav_text .= ' <a href="' . (isset($last_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $last_fiscal_period['id'] : '#" class="disabled') . '">' . img_previous() . '</a>';
|
||||
$fiscal_period_nav_text .= ' <a href="' . (isset($next_fiscal_period) ? $_SERVER["PHP_SELF"] . '?fiscal_period_id=' . $next_fiscal_period['id'] : '#" class="disabled') . '">' . img_next() . '</a>';
|
||||
if (!empty($current_fiscal_period)) {
|
||||
$fiscal_period_nav_text .= $current_fiscal_period['label'].' (' . (isset($current_fiscal_period) ? dol_print_date($current_fiscal_period['date_start'], 'day') . ' - ' . dol_print_date($current_fiscal_period['date_end'], 'day') . ')' : '');
|
||||
$fiscal_period_nav_text .= $current_fiscal_period['label'].' (' . dol_print_date($current_fiscal_period['date_start'], 'day') . ' - ' . dol_print_date($current_fiscal_period['date_end'], 'day') . ')';
|
||||
}
|
||||
|
||||
print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy');
|
||||
|
||||
@@ -29,7 +29,14 @@
|
||||
* \brief Ventilation page from customers invoices
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
@@ -40,14 +47,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other", "productbatch", "products"));
|
||||
@@ -55,15 +54,12 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$toselect = GETPOST('toselect', 'array:aZ09'); // Value can be 'X_Y'
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancycustomerlist'; // To manage different context of search
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
$default_account = GETPOSTINT('default_account');
|
||||
|
||||
// Select Box
|
||||
$mesCasesCochees = GETPOST('toselect', 'array:int');
|
||||
|
||||
// Search Getpost
|
||||
$search_societe = GETPOST('search_societe', 'alpha');
|
||||
$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
|
||||
@@ -206,21 +202,20 @@ if (empty($reshook)) {
|
||||
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$msg = '';
|
||||
|
||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||
if (!empty($mesCasesCochees)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
|
||||
if (!empty($toselect)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($toselect).'</div>';
|
||||
$msg .= '<div class="detail">';
|
||||
$cpt = 0;
|
||||
$ok = 0;
|
||||
$ko = 0;
|
||||
|
||||
foreach ($mesCasesCochees as $maLigneCochee) {
|
||||
foreach ($toselect as $maLigneCochee) {
|
||||
$maLigneCourante = explode("_", $maLigneCochee);
|
||||
$monId = $maLigneCourante[0];
|
||||
$monCompte = GETPOSTINT('codeventil'.$monId);
|
||||
|
||||
if ($monCompte <= 0) {
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</span></div>';
|
||||
$msg .= '<div><span class="error">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
|
||||
@@ -51,14 +51,10 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$toselect = GETPOST('toselect', 'array:aZ09'); // Value can be 'X_Y'
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancyexpensereportlist'; // To manage different context of search
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
|
||||
// Select Box
|
||||
$mesCasesCochees = GETPOST('toselect', 'array:int');
|
||||
|
||||
// Search Getpost
|
||||
$search_login = GETPOST('search_login', 'alpha');
|
||||
$search_lineid = GETPOST('search_lineid', 'alpha');
|
||||
@@ -199,14 +195,14 @@ if (empty($reshook)) {
|
||||
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$msg = '';
|
||||
|
||||
if (!empty($mesCasesCochees)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
|
||||
if (!empty($toselect)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($toselect).'</div>';
|
||||
$msg .= '<div class="detail">';
|
||||
$cpt = 0;
|
||||
$ok = 0;
|
||||
$ko = 0;
|
||||
|
||||
foreach ($mesCasesCochees as $maLigneCochee) {
|
||||
foreach ($toselect as $maLigneCochee) {
|
||||
$maLigneCourante = explode("_", $maLigneCochee);
|
||||
$monId = $maLigneCourante[0];
|
||||
$monCompte = GETPOSTINT('codeventil'.$monId);
|
||||
|
||||
@@ -388,7 +388,7 @@ if ($result) {
|
||||
if (getDolGlobalString('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS') && ($lineisapurchase == 1 || $lineisasale == 1) ) {
|
||||
if ($lineisapurchase == 1) {
|
||||
$sqlamount = "SELECT SUM(pf.amount) as amount";
|
||||
$sqlamount .= " FROM ".MAIN_DB_PREFIX."paiementfounr_facturefourn AS pf";
|
||||
$sqlamount .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn AS pf";
|
||||
$sqlamount .= " INNER JOIN ".MAIN_DB_PREFIX."paiementfourn AS p ON pf.fk_paiementfourn = p.rowid";
|
||||
$sqlamount .= " RIGHT JOIN ".MAIN_DB_PREFIX."facture AS f ON pf.fk_facturefourn = f.rowid";
|
||||
$sqlamount .= " WHERE p.fk_bank = ".((int) $obj->rowid);
|
||||
|
||||
@@ -583,7 +583,7 @@ if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 !
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.csvClean($bookkeepingstatic->accountingLabelForOperation($userstatic->name, '', $langs->trans("VAT").implode($def_tva[$key][$k]).' %')).'"'.$sep;
|
||||
print '"'.csvClean($bookkeepingstatic->accountingLabelForOperation($userstatic->name, '', $langs->trans("VAT").(isset($def_tva[$key]) ? implode($def_tva[$key][$k]) : '').' %')).'"'.$sep;
|
||||
print '"'.($mt >= 0 ? price($mt) : '').'"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"';
|
||||
print "\n";
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Vincent de Grandporé <vincent@de-grandpre.quebec>
|
||||
*
|
||||
* 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
|
||||
@@ -139,7 +140,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle as label, f.ref_supplier, f.date_lim_reglement as dlr, f.close_code, f.vat_reverse_charge,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code, fd.info_bits,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.localtax1_tx, fd.localtax2_tx, fd.total_ttc, fd.vat_src_code, fd.info_bits,";
|
||||
$sql .= " p.default_vat_code AS product_buy_default_vat_code, p.tva_tx as product_buy_vat, p.localtax1_tx as product_buy_localvat1, p.localtax2_tx as product_buy_localvat2,";
|
||||
$sql .= " co.code as country_code, co.label as country_label,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.fk_pays,";
|
||||
@@ -225,6 +226,12 @@ $cptfour = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER', 'NotDefined');
|
||||
$cpttva = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
|
||||
$rcctva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined');
|
||||
$rcdtva = getDolGlobalString('ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined');
|
||||
$cptlocaltax1 = getDolGlobalString('ACCOUNTING_LT1_BUY_ACCOUNT', 'NotDefined');
|
||||
$rcclocaltax1 = getDolGlobalString('ACCOUNTING_LT1_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined');
|
||||
$rcdlocaltax1 = getDolGlobalString('ACCOUNTING_LT1_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined');
|
||||
$cptlocaltax2 = getDolGlobalString('ACCOUNTING_LT2_BUY_ACCOUNT', 'NotDefined');
|
||||
$rcclocaltax2 = getDolGlobalString('ACCOUNTING_LT2_BUY_REVERSE_CHARGES_CREDIT', 'NotDefined');
|
||||
$rcdlocaltax2 = getDolGlobalString('ACCOUNTING_LT2_BUY_REVERSE_CHARGES_DEBIT', 'NotDefined');
|
||||
$noTaxDispatchingKeepWithLines = getDolGlobalInt('ACCOUNTING_PURCHASES_DO_NOT_DISPATCH_TAXES'); //If enabled, Tax will NOT get split off from the base entry and credited to a separate tax account (good for non-VAT countries like USA)
|
||||
$country_code_in_EEC = getCountriesInEEC(); // This make a database call but there is a cache done into $conf->cache['country_code_in_EEC']
|
||||
|
||||
@@ -257,13 +264,19 @@ if ($result) {
|
||||
$vatdata_cache[$tax_id] = $vatdata;
|
||||
}
|
||||
$compta_tva = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||
$compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||
$compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||
$compta_localtax1 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cptlocaltax1);
|
||||
$compta_localtax2 = (!empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cptlocaltax2);
|
||||
$compta_counterpart_tva_npr = getDolGlobalString('ACCOUNTING_COUNTERPART_VAT_NPR', 'NotDefined');
|
||||
|
||||
// Define an array to display all VAT rates that use this accounting account $compta_tva
|
||||
if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) {
|
||||
$def_tva[$obj->rowid][$compta_tva][vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')] = (vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
if ($obj->localtax1_tx > 0.0) {
|
||||
$def_tva[$obj->rowid][$compta_localtax1][vatrate($obj->localtax1_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '').' LT1'] = (vatrate($obj->localtax1_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
}
|
||||
if ($obj->localtax2_tx > 0.0) {
|
||||
$def_tva[$obj->rowid][$compta_localtax2][vatrate($obj->localtax2_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '').' LT2'] = (vatrate($obj->localtax2_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
}
|
||||
}
|
||||
|
||||
//$line = new SupplierInvoiceLine($db);
|
||||
@@ -301,10 +314,10 @@ if ($result) {
|
||||
$rcvatdata = getTaxesFromId($obj->product_buy_vat . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : ''), $mysoc, $mysoc, 0);
|
||||
$rcc_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
|
||||
$rcd_compta_tva = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva);
|
||||
$rcc_compta_localtax1 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
|
||||
$rcd_compta_localtax1 = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva);
|
||||
$rcc_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcctva);
|
||||
$rcd_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdtva);
|
||||
$rcc_compta_localtax1 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcclocaltax1);
|
||||
$rcd_compta_localtax1 = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdlocaltax1);
|
||||
$rcc_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_credit']) ? $vatdata['accountancy_code_vat_reverse_charge_credit'] : $rcclocaltax2);
|
||||
$rcd_compta_localtax2 = (!empty($vatdata['accountancy_code_vat_reverse_charge_debit']) ? $vatdata['accountancy_code_vat_reverse_charge_debit'] : $rcdlocaltax2);
|
||||
if (price2num($obj->product_buy_vat) || !empty($obj->product_buy_default_vat_code)) {
|
||||
$vat_key = vatrate($obj->product_buy_vat) . ($obj->product_buy_default_vat_code ? ' (' . $obj->product_buy_default_vat_code . ')' : '');
|
||||
$val_value = $vat_key;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2025 Vincent de Grandporé <vincent@de-grandpre.quebec>
|
||||
*
|
||||
* 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
|
||||
@@ -140,7 +141,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref, f.type, f.situation_cycle_ref, f.datef as df, f.ref_client, f.date_lim_reglement as dlr, f.close_code, f.retained_warranty, f.revenuestamp, f.situation_final,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code, fd.info_bits,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.localtax1_tx, fd.localtax2_tx, fd.total_ttc, fd.situation_percent, fd.vat_src_code, fd.info_bits,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur,";
|
||||
if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
|
||||
$sql .= " spe.accountancy_code_customer_general,";
|
||||
@@ -223,6 +224,8 @@ $vatdata_cache = array();
|
||||
// Variables
|
||||
$cptcli = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER', 'NotDefined');
|
||||
$cpttva = getDolGlobalString('ACCOUNTING_VAT_SOLD_ACCOUNT', 'NotDefined');
|
||||
$cptlocaltax1 = getDolGlobalString('ACCOUNTING_LT1_SOLD_ACCOUNT', 'NotDefined');
|
||||
$cptlocaltax2 = getDolGlobalString('ACCOUNTING_LT2_SOLD_ACCOUNT', 'NotDefined');
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@@ -262,12 +265,18 @@ if ($result) {
|
||||
$vatdata_cache[$tax_id] = $vatdata;
|
||||
}
|
||||
$compta_tva = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
|
||||
$compta_localtax1 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
|
||||
$compta_localtax2 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
|
||||
$compta_localtax1 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cptlocaltax1);
|
||||
$compta_localtax2 = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cptlocaltax2);
|
||||
|
||||
// Define the array to store the detail of each vat rate and code for lines
|
||||
if (price2num($obj->tva_tx) || !empty($obj->vat_src_code)) {
|
||||
$def_tva[$obj->rowid][$compta_tva][vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '')] = (vatrate($obj->tva_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
if ($obj->localtax1_tx > 0.0) {
|
||||
$def_tva[$obj->rowid][$compta_localtax1][vatrate($obj->localtax1_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '').' LT1'] = (vatrate($obj->localtax1_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
}
|
||||
if ($obj->localtax2_tx > 0.0) {
|
||||
$def_tva[$obj->rowid][$compta_localtax2][vatrate($obj->localtax2_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : '').' LT2'] = (vatrate($obj->localtax2_tx).($obj->vat_src_code ? ' ('.$obj->vat_src_code.')' : ''));
|
||||
}
|
||||
}
|
||||
|
||||
// Create a compensation rate for situation invoice.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* Copyright (C) 2017-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2025 Hannes Hieronimi <hannes@innwerk.org>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -1206,15 +1207,15 @@ if ($action == 'writebookkeeping' /* && $user->hasRight('accounting', 'bind', 'w
|
||||
$accountingAccountInfos = $tabaccountingaccount[$accountancy_code];
|
||||
if ($idx < $nb_operation) {
|
||||
$amount = price2num($payment_total_ht * $operation['total_ht'] / $objectInfos['total_ht'], 'MT');
|
||||
$total_operation += $amount;
|
||||
$total_operation += (float) $amount;
|
||||
} else {
|
||||
$amount = $payment_total_ht - $total_operation;
|
||||
}
|
||||
$total_check -= $amount;
|
||||
$total_check -= (float) $amount;
|
||||
|
||||
$bookkeepingToCreate = new BookKeeping($db);
|
||||
//$result = $bookkeepingToCreate->createFromValues($payment["date"], $objectInfos['ref'], 'bank', $payment_id, $objectInfos['id'], $accountancy_code, $accountingAccountInfos['label'], (!empty($operation['label']) ? $operation['label'] : $accountingAccountInfos['label']), -$amount, $journal, $journal_label, '');
|
||||
$result = $bookkeepingToCreate->createFromValues($payment["date"], $objectInfos['ref'], 'bank', $payment_id, 0, $accountancy_code, $accountingAccountInfos['label'], (!empty($operation['label']) ? $operation['label'] : $accountingAccountInfos['label']), -$amount, $journal, $journal_label, '');
|
||||
$result = $bookkeepingToCreate->createFromValues($payment["date"], $objectInfos['ref'], 'bank', $payment_id, 0, $accountancy_code, $accountingAccountInfos['label'], (!empty($operation['label']) ? $operation['label'] : $accountingAccountInfos['label']), - (float) $amount, $journal, $journal_label, '');
|
||||
if ($result < 0) {
|
||||
$errorforline++;
|
||||
|
||||
@@ -1482,11 +1483,11 @@ if (empty($action) || $action == 'view') {
|
||||
if (!empty($operation['total_ht'])) {
|
||||
if ($idx < $nb_operation) {
|
||||
$value = price2num($payment_total_ht * $operation['total_ht'] / $objectInfos['total_ht'], 'MT');
|
||||
$total_operation += $value;
|
||||
$total_operation += (float) $value;
|
||||
} else {
|
||||
$value = $payment_total_ht - $total_operation;
|
||||
}
|
||||
FormAccounting::printJournalLine($langs, $date, $objectInfos['url'], $accountancy_code, (!empty($operation['label']) ? $operation['label'] : $accountingAccountInfos['label']), $payment['type_payment'], -$value);
|
||||
FormAccounting::printJournalLine($langs, $date, $objectInfos['url'], $accountancy_code, (!empty($operation['label']) ? $operation['label'] : $accountingAccountInfos['label']), $payment['type_payment'], - (float) $value);
|
||||
}
|
||||
$idx++;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
|
||||
@@ -56,15 +56,12 @@ $langs->loadLangs(array("bills", "companies", "compta", "accountancy", "other",
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$toselect = GETPOST('toselect', 'array:aZ09'); // Value can be 'X_Y'
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancysupplierlist'; // To manage different context of search
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
$default_account = GETPOSTINT('default_account');
|
||||
|
||||
// Select Box
|
||||
$mesCasesCochees = GETPOST('toselect', 'array:int');
|
||||
|
||||
// Search Getpost
|
||||
$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100'
|
||||
$search_societe = GETPOST('search_societe', 'alpha');
|
||||
@@ -212,14 +209,14 @@ if (empty($reshook)) {
|
||||
if ($massaction == 'ventil' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
$msg = '';
|
||||
|
||||
if (!empty($mesCasesCochees)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
|
||||
if (!empty($toselect)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($toselect).'</div>';
|
||||
$msg .= '<div class="detail">';
|
||||
$cpt = 0;
|
||||
$ok = 0;
|
||||
$ko = 0;
|
||||
|
||||
foreach ($mesCasesCochees as $maLigneCochee) {
|
||||
foreach ($toselect as $maLigneCochee) {
|
||||
$maLigneCourante = explode("_", $maLigneCochee);
|
||||
$monId = $maLigneCourante[0];
|
||||
$monCompte = GETPOSTINT('codeventil'.$monId);
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
@@ -76,9 +77,63 @@ $error = 0;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
global $conf;
|
||||
if ($action == 'updateMask') {
|
||||
$maskconst = GETPOST('maskconst', 'aZ09');
|
||||
$maskvalue = GETPOST('maskvalue', 'alpha');
|
||||
|
||||
if ($action == 'set_default') {
|
||||
$res = 0;
|
||||
|
||||
if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
|
||||
$res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'specimen') { // For fiche expensereport
|
||||
$modele = GETPOST('module', 'alpha');
|
||||
|
||||
$adherentspecimen = new Adherent($db);
|
||||
$adherentspecimen->initAsSpecimen();
|
||||
$adherentspecimen->status = 0; // Force statut draft to show watermark
|
||||
|
||||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/member/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
'@phan-var-force ModelePDFMember $module';
|
||||
/** @var ModelePDFMember $module */
|
||||
|
||||
if ($module->write_file($adherentspecimen, $langs) > 0) {
|
||||
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=member&file=SPECIMEN.pdf");
|
||||
return;
|
||||
} else {
|
||||
setEventMessages($module->error, $module->errors, 'errors');
|
||||
dol_syslog($module->error, LOG_ERR);
|
||||
}
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
|
||||
dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
|
||||
}
|
||||
} elseif ($action == 'set_default') {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
$res = true;
|
||||
} elseif ($action == 'del_default') {
|
||||
@@ -238,7 +293,7 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
|
||||
|
||||
@@ -286,6 +341,7 @@ foreach ($dirModMember as $dirroot) {
|
||||
continue;
|
||||
}
|
||||
$modCodeMember = new $file();
|
||||
/** @var ModeleNumRefMembers $modCodeMember */
|
||||
// Show modules according to features level
|
||||
if ($modCodeMember->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
continue;
|
||||
@@ -303,6 +359,7 @@ foreach ($dirModMember as $dirroot) {
|
||||
|
||||
$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
|
||||
'@phan-var-force array<string,ModeleNumRefMembers> $arrayofmodules';
|
||||
/** @var array<string,ModeleNumRefMembers> $arrayofmodules */
|
||||
|
||||
foreach ($arrayofmodules as $file => $modCodeMember) {
|
||||
print '<tr class="oddeven">'."\n";
|
||||
@@ -310,12 +367,13 @@ foreach ($arrayofmodules as $file => $modCodeMember) {
|
||||
print '<td>'.$modCodeMember->info($langs).'</td>'."\n";
|
||||
print '<td class="nowrap">'.$modCodeMember->getExample().'</td>'."\n";
|
||||
|
||||
if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == "$file") {
|
||||
if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON', 'mod_member_simple') == "$file") {
|
||||
print '<td class="center">'."\n";
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print "</td>\n";
|
||||
} else {
|
||||
$disabled = isModEnabled('multicompany') && ((is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity));
|
||||
$isshareonotherentity = (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity); // @phpstan-ignore-line
|
||||
$disabled = (isModEnabled('multicompany') && $isshareonotherentity);
|
||||
print '<td class="center">';
|
||||
if (!$disabled) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setcodemember&token='.newToken().'&value='.urlencode($file).'">';
|
||||
@@ -405,6 +463,7 @@ foreach ($dirmodels as $reldir) {
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $classname($db);
|
||||
'@phan-var-force doc_generic_member_odt|pdf_standard_member $module';
|
||||
/** @var doc_generic_member_odt|pdf_standard_member $module */
|
||||
|
||||
$modulequalified = 1;
|
||||
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
|
||||
@@ -65,17 +65,17 @@ $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL_
|
||||
|
||||
// Editing global variables not related to a specific theme
|
||||
$constantes = array(
|
||||
'MEMBER_REMINDER_EMAIL'=>array('type'=>'yesno', 'label'=>$langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name"))),
|
||||
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>array('type'=>'emailtemplate:member','label'=>''),
|
||||
'ADHERENT_MAIL_FROM' =>array('type'=>'string','label'=>''),
|
||||
'ADHERENT_CC_MAIL_FROM' =>array('type'=>'string','label'=>''),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' =>array('type'=>'string','label'=>''),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL' =>array('type'=>'html', 'tooltip'=>$helptext,'label'=>'')
|
||||
'MEMBER_REMINDER_EMAIL' => array('type'=>'yesno', 'label' => $langs->trans('MEMBER_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")), 'help' => $langs->trans('MEMBER_REMINDER_EMAILHelp', $langs->transnoentities("Module2300Name"))),
|
||||
'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' => array('type'=>'emailtemplate:member', 'label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' => array('type'=>'emailtemplate:member', 'label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' => array('type'=>'emailtemplate:member', 'label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' => array('type'=>'emailtemplate:member', 'label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_CANCELATION' => array('type'=>'emailtemplate:member', 'label'=>''),
|
||||
'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' => array('type'=>'emailtemplate:member', 'label'=>''),
|
||||
'ADHERENT_MAIL_FROM' => array('type'=>'string', 'label'=>''),
|
||||
'ADHERENT_CC_MAIL_FROM' => array('type'=>'string', 'label'=>''),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT' => array('type'=>'string', 'label'=>''),
|
||||
'ADHERENT_AUTOREGISTER_NOTIF_MAIL' => array('type'=>'html', 'tooltip' => $helptext, 'label' => '')
|
||||
);
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_emails');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
|
||||
|
||||
@@ -166,7 +166,131 @@ print '<input type="hidden" name="action" value="updateall">';
|
||||
|
||||
print '<br>';
|
||||
|
||||
form_constantes($constantes, 3, '');
|
||||
// TODO Try to use the formsetup class.
|
||||
|
||||
$tableau = $constantes;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($tableau as $key => $const) { // Loop on each param
|
||||
$label = '';
|
||||
$type = $const['type'];
|
||||
$label = $const['label'];
|
||||
$help = empty($const['help']) ? '' : $const['help'];
|
||||
$const = $key;
|
||||
|
||||
$sql = "SELECT rowid, ".$db->decrypt('name')." as name, ".$db->decrypt('value')." as value, type, note";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql .= " WHERE ".$db->decrypt('name')." = '".$db->escape($const)."'";
|
||||
$sql .= " AND entity IN (0, ".$conf->entity.")";
|
||||
$sql .= " ORDER BY name ASC, entity DESC";
|
||||
$resql = $db->query($sql);
|
||||
|
||||
dol_syslog("List params", LOG_DEBUG);
|
||||
|
||||
if ($resql) {
|
||||
$obj = $db->fetch_object($resql); // Take first result of select
|
||||
|
||||
if (empty($obj)) { // If not yet into table
|
||||
$obj = (object) array('rowid' => '', 'name' => $const, 'value' => '', 'type' => $type, 'note' => '');
|
||||
}
|
||||
if ($const == 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' && !getDolGlobalString('MEMBER_REMINDER_EMAIL')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Show label of parameter
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="rowid[]" value="'.$obj->rowid.'">';
|
||||
print '<input type="hidden" name="constname[]" value="'.$const.'">';
|
||||
print '<input type="hidden" name="constnote_'.$obj->name.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
|
||||
print '<input type="hidden" name="consttype_'.$obj->name.'" value="'.($obj->type ? $obj->type : 'string').'">';
|
||||
|
||||
$picto = '';
|
||||
$tmparray = explode(':', $obj->type);
|
||||
if (!empty($tmparray[1])) {
|
||||
$picto = preg_replace('/_send$/', '', $tmparray[1]);
|
||||
}
|
||||
if ($picto) {
|
||||
print img_picto('', $picto, 'class="pictofixedwidth"');
|
||||
}
|
||||
|
||||
if (!empty($tableau[$key]['tooltip'])) {
|
||||
print $form->textwithpicto($label ? $label : $langs->trans('Desc'.$const), $tableau[$key]['tooltip']);
|
||||
} else {
|
||||
print($label ? $label : $langs->trans('Desc'.$const));
|
||||
}
|
||||
|
||||
if (in_array($const, ['ADHERENT_MAIL_FROM', 'ADHERENT_CC_MAIL_FROM'])) {
|
||||
print ' '.img_help(1, $langs->trans("EMailHelpMsgSPFDKIM"));
|
||||
}
|
||||
if ($help) {
|
||||
print '<br><span class="opacitymedium">';
|
||||
//print $langs->trans("MEMBER_REMINDER_EMAILHelp");
|
||||
print $help;
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="consttype_'.$const.'" value="'.($obj->type ? $obj->type : 'string').'">';
|
||||
print '<input type="hidden" name="constnote_'.$const.'" value="'.nl2br(dol_escape_htmltag($obj->note)).'">';
|
||||
if ($obj->type == 'textarea') {
|
||||
print '<textarea class="flat" name="constvalue_'.$const.'" cols="50" rows="5" wrap="soft">'."\n";
|
||||
print $obj->value;
|
||||
print "</textarea>\n";
|
||||
} elseif ($obj->type == 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('constvalue_'.$const, $obj->value, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($obj->type == 'yesno') {
|
||||
print $form->selectyesno('constvalue_'.$const, $obj->value, 1, false, 0, 1);
|
||||
} elseif (preg_match('/emailtemplate/', $obj->type)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
$tmp = explode(':', $obj->type);
|
||||
|
||||
$formmail->fetchAllEMailTemplate($tmp[1], $user, null, -1); // We set lang=null to get in priority record with no lang
|
||||
$arrayofmessagename = array();
|
||||
if (is_array($formmail->lines_model)) {
|
||||
foreach ($formmail->lines_model as $modelmail) {
|
||||
//var_dump($modelmail);
|
||||
$moreonlabel = '';
|
||||
if (!empty($arrayofmessagename[$modelmail->label])) {
|
||||
$moreonlabel = ' <span class="opacitymedium">('.$langs->trans("SeveralLangugeVariatFound").')</span>';
|
||||
}
|
||||
// The 'label' is the key that is unique if we exclude the language
|
||||
$arrayofmessagename[$modelmail->label.':'.$tmp[1]] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel;
|
||||
}
|
||||
}
|
||||
//var_dump($arraydefaultmessage);
|
||||
//var_dump($arrayofmessagename);
|
||||
print $form->selectarray('constvalue_'.$const, $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
|
||||
print '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/mails_templates.php', ['action' => 'create', 'type_template' => $tmp[1], 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"])]).'">'.img_picto('', 'add').'</a>';
|
||||
} elseif (preg_match('/MAIL_FROM$/i', $const)) {
|
||||
print img_picto('', 'email', 'class="pictofixedwidth"').'<input type="text" class="flat minwidth300" name="constvalue_'.$const.'" value="'.dol_escape_htmltag($obj->value).'">';
|
||||
} else { // type = 'string' ou 'chaine'
|
||||
print '<input type="text" class="flat minwidth300" name="constvalue_'.$const .'" value="'.dol_escape_htmltag($obj->value).'">';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Update").'" name="update"></div>';
|
||||
print '</form>';
|
||||
|
||||
@@ -76,7 +76,7 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_extrafields');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_type_extrafields');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -29,21 +29,21 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*
|
||||
* @var string $dolibarr_main_url_root
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "members"));
|
||||
@@ -100,7 +100,7 @@ if ($action == 'update') {
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE", $forcetype, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if ($forcemorphy == '-1') {
|
||||
if (empty($forcemorphy) || $forcemorphy == '-1') {
|
||||
$res = dolibarr_del_const($db, "MEMBER_NEWFORM_FORCEMORPHY", $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, "MEMBER_NEWFORM_FORCEMORPHY", $forcemorphy, 'chaine', 0, '', $conf->entity);
|
||||
@@ -129,7 +129,7 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-admin_website');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($title, $linkback, 'title_setup');
|
||||
|
||||
@@ -222,7 +222,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Force Type
|
||||
@@ -233,18 +233,20 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
||||
$listofval = array();
|
||||
$listofval += $adht->liste_array(1);
|
||||
$forcetype = getDolGlobalInt('MEMBER_NEWFORM_FORCETYPE', -1);
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0);
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, $langs->trans("No"), 0, 0, '', 0, 0, 0, '', 'width200');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Force nature of member (mor/phy)
|
||||
$morphys = array();
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
$morphys = [
|
||||
"phy" => $langs->trans("Physical"),
|
||||
"mor" => $langs->trans("Moral"),
|
||||
];
|
||||
print '<tr class="oddeven drag" id="trforcenature"><td>';
|
||||
print $langs->trans("ForceMemberNature");
|
||||
print '</td><td>';
|
||||
$forcenature = getDolGlobalInt('MEMBER_NEWFORM_FORCEMORPHY', 0);
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
|
||||
|
||||
$forcenature = getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY'); // 'phy' or 'mor'
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, $langs->trans("No"), 0, 0, '', 0, 0, 0, '', 'width200');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Amount
|
||||
@@ -252,6 +254,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="right width50" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.getDolGlobalString('MEMBER_NEWFORM_AMOUNT').'">';
|
||||
print ' <span class="opacitymedium">'.$langs->getCurrencySymbol($mysoc->currency_code).'</span>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Min amount
|
||||
@@ -259,6 +262,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
||||
print $langs->trans("MinimumAmount");
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="right width50" id="MEMBER_MIN_AMOUNT" name="MEMBER_MIN_AMOUNT" value="'.getDolGlobalString('MEMBER_MIN_AMOUNT').'">';
|
||||
print ' <span class="opacitymedium">'.$langs->getCurrencySymbol($mysoc->currency_code).'</span>';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// SHow counter of validated members publicly
|
||||
@@ -308,6 +312,13 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, getDolGlobalString('MEMBER_NEWFORM_PAYONLINE'), 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Search a member after member creation form
|
||||
print '<tr class="oddeven" id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE");
|
||||
print '</td><td>';
|
||||
print $form->selectyesno("MEMBER_SEARCH_MEMBER_PUBLIC_FORM_CREATE"); // Reverse the logic "hide -> show" for retrocompatibility
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -155,10 +155,10 @@ if ($object->id > 0) {
|
||||
|
||||
print dol_get_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['restore_lastsearch_values' => 1]).'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/vcard.php', ['id' => $object->id]).'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= '</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
@@ -181,13 +181,13 @@ if ($object->id > 0) {
|
||||
|
||||
$newcardbutton = '';
|
||||
|
||||
$messagingUrl = DOL_URL_ROOT.'/adherents/messaging.php?rowid='.$object->id;
|
||||
$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/adherents/messaging.php', ['rowid' => $object->id]);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
|
||||
$messagingUrl = DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id;
|
||||
$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/adherents/agenda.php', ['id' => $object->id]);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']).($object->id > 0 ? '?id='.$object->id : '').'&origin=member&originid='.$id);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', dolBuildUrl(DOL_URL_ROOT.'/comm/action/card.php', ['action' => 'create', 'backtopage' => dolBuildUrl($_SERVER['PHP_SELF'], ['id' => $object->id, 'origin' => 'member', 'originid' => $id])]));
|
||||
}
|
||||
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) {
|
||||
|
||||
@@ -93,11 +93,12 @@ abstract class ActionsAdherentCardCommon
|
||||
/**
|
||||
* Set content of ->tpl array, to use into template
|
||||
*
|
||||
* @param string $action Type of action
|
||||
* @param string $action Type of action
|
||||
* @param int $id Id
|
||||
* @param string $ref Object ref (if id not provided) / Unused here
|
||||
* @return void
|
||||
*/
|
||||
public function assign_values(&$action, $id)
|
||||
public function assign_values(&$action, $id, $ref = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user, $canvas;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -78,11 +79,12 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
||||
/**
|
||||
* Assign custom values for canvas
|
||||
*
|
||||
* @param string $action Type of action
|
||||
* @param int $id Id
|
||||
* @param string $action Type of action
|
||||
* @param int $id Id
|
||||
* @param string $ref Object ref (if id not provided) / Unused here
|
||||
* @return void
|
||||
*/
|
||||
public function assign_values(&$action, $id)
|
||||
public function assign_values(&$action, $id, $ref = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db, $langs, $user;
|
||||
@@ -90,7 +92,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
||||
|
||||
$ret = $this->getObject($id);
|
||||
|
||||
parent::assign_values($action, $id);
|
||||
parent::assign_values($action, $id, $ref);
|
||||
|
||||
$this->tpl['title'] = $this->getTitle($action);
|
||||
$this->tpl['error'] = $this->error;
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
@@ -48,16 +56,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Societe $mysoc
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal"));
|
||||
|
||||
@@ -88,6 +86,7 @@ if (isModEnabled('mailmanspip')) {
|
||||
|
||||
$object = new Adherent($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$upload_dir = null;
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
@@ -134,7 +133,7 @@ if ($id) {
|
||||
$permissiontoeditextra = $canaddmember;
|
||||
if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
|
||||
// For action 'update_extras', is there a specific permission set for the attribute to update
|
||||
$permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
|
||||
$permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
|
||||
}
|
||||
|
||||
// Security check
|
||||
@@ -372,11 +371,15 @@ if (empty($reshook)) {
|
||||
//$object->note = trim(GETPOST("comment", "restricthtml"));
|
||||
$object->morphy = GETPOST("morphy", 'alpha');
|
||||
|
||||
if (GETPOST('deletephoto', 'alpha')) {
|
||||
$object->photo = '';
|
||||
} elseif (!empty($_FILES['photo']['name'])) {
|
||||
$current_photo = '';
|
||||
if (!empty($_FILES['photo']['name'])) {
|
||||
$current_photo = $object->photo;
|
||||
$object->photo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||
}
|
||||
if (GETPOST('deletephoto')) {
|
||||
$current_photo = $object->photo;
|
||||
$object->photo = '';
|
||||
}
|
||||
|
||||
// Get status and public property
|
||||
$object->statut = GETPOSTINT("statut");
|
||||
@@ -415,7 +418,9 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->update($user, 0, $nosyncuser, $nosyncuserpass);
|
||||
$nosyncthirdparty = getDolGlobalInt('MEMBER_NO_SYNC_LINKED_THIRDPARTY');
|
||||
|
||||
$result = $object->update($user, 0, $nosyncuser, $nosyncuserpass, $nosyncthirdparty);
|
||||
|
||||
if ($result >= 0 && !count($object->errors)) {
|
||||
$categories = GETPOST('memcats', 'array');
|
||||
@@ -424,16 +429,21 @@ if (empty($reshook)) {
|
||||
// Logo/Photo save
|
||||
$dir = $conf->member->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos';
|
||||
$file_OK = is_uploaded_file($_FILES['photo']['tmp_name']);
|
||||
if (GETPOST('deletephoto') && $current_photo) {
|
||||
$fileimg = $dir.'/'.$current_photo;
|
||||
$dirthumbs = $dir.'/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
if ($file_OK) {
|
||||
if (GETPOST('deletephoto')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileimg = $conf->member->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/'.$object->photo;
|
||||
$dirthumbs = $conf->member->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member').'/photos/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
|
||||
if (image_format_supported($_FILES['photo']['name']) > 0) {
|
||||
if ($current_photo != $object->photo) {
|
||||
$fileimg = $dir.'/'.$current_photo;
|
||||
$dirthumbs = $dir.'/thumbs';
|
||||
dol_delete_file($fileimg);
|
||||
dol_delete_dir_recursive($dirthumbs);
|
||||
}
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
if (@is_dir($dir)) {
|
||||
@@ -443,6 +453,15 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
// Create thumbs
|
||||
$object->addThumbs($newfile);
|
||||
|
||||
// Index file in database
|
||||
if (getDolGlobalString('MEMBER_PHOTO_ALLOW_EXTERNAL_DOWNLOAD')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
// the dir dirname($newfile) is directory of logo, so we should have only one file at once into index, so we delete indexes for the dir
|
||||
deleteFilesIntoDatabaseIndex(dirname($newfile), '', '', $object);
|
||||
// now we index the uploaded logo file
|
||||
addFileIntoDatabaseIndex(dirname($newfile), basename($newfile), '', 'uploaded', 1, $object);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1071,21 +1090,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '<span class="error">'.$langs->trans("NoTypeDefinedGoToSetup").'</span>';
|
||||
}
|
||||
if ($user->hasRight('member', 'configurer')) {
|
||||
print ' <a href="'.DOL_URL_ROOT.'/adherents/type.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&typeid=--IDFORBACKTOPAGE--').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("NewMemberType").'"></span></a>';
|
||||
print ' <a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/type.php', ['action' => 'create', 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['action' => 'create', 'typeid' => '--IDFORBACKTOPAGE--'])]).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("NewMemberType").'"></span></a>';
|
||||
}
|
||||
print "</td>\n";
|
||||
|
||||
// Morphy
|
||||
$morphys = array();
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
// Legal entity or natural person
|
||||
$morphys = [
|
||||
"phy" => $langs->trans("Physical"),
|
||||
"mor" => $langs->trans("Moral"),
|
||||
];
|
||||
$checkednature = GETPOST("morphy", 'alpha');
|
||||
$listetype_natures = $adht->morphyByType(1);
|
||||
$listetype_natures_json = json_encode($listetype_natures);
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MemberNature")."</td><td>\n";
|
||||
print '<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="valignmiddle">'.$morphys["phy"].'<input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature == "phy" ? ' checked="checked"' : '').'></label></span>';
|
||||
print '<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="valignmiddle">'.$morphys["mor"].'<input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature == "mor" ? ' checked="checked"' : '').'></label></span>';
|
||||
print '<span id="spannature1" class="nonature-back spannature paddinglarge marginrightonly"><label for="phisicalinput" class="spanlabel">'.$morphys["phy"].'</label><input id="phisicalinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="phy"'.($checkednature == "phy" ? ' checked="checked"' : '').'></span>';
|
||||
print '<span id="spannature2" class="nonature-back spannature paddinglarge marginrightonly"><label for="moralinput" class="spanlabel">'.$morphys["mor"].'</label><input id="moralinput" class="flat checkforselect marginleftonly valignmiddle" type="radio" name="morphy" value="mor"'.($checkednature == "mor" ? ' checked="checked"' : '').'></span>';
|
||||
|
||||
// Add JS to manage the background of nature
|
||||
if ($conf->use_javascript_ajax) {
|
||||
@@ -1166,7 +1186,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print "</td>\n";
|
||||
|
||||
// Company
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td>'.img_picto('', 'company', 'class="pictofixedwidth"').'<input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $soc->name).'"></td></tr>';
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").' / '.$langs->trans("Organization").'</td><td>'.img_picto('', 'company', 'class="pictofixedwidth"').'<input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $soc->name).'"></td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
@@ -1678,7 +1698,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = (string) $arraydefaultmessage->topic;
|
||||
$msg = (string) $arraydefaultmessage->content;
|
||||
$msg = (string) $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
@@ -1877,10 +1897,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$rowspan++;
|
||||
}
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['restore_lastsearch_values' => 1]).'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/vcard.php', ['id' => $object->id]).'" class="refid valignmiddle">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= '</a>';
|
||||
|
||||
|
||||
@@ -2075,7 +2095,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Send
|
||||
if (empty($user->socid)) {
|
||||
if (Adherent::STATUS_VALIDATED == $object->status) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'presend', 'mode' => 'init'], true).'#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2095,7 +2115,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Modify
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'edit'], true).'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
|
||||
}
|
||||
@@ -2103,7 +2123,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Validate
|
||||
if (Adherent::STATUS_DRAFT == $object->status) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=valid&token='.newToken().'">'.$langs->trans("Validate").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'valid'], true).'">'.$langs->trans("Validate").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\n";
|
||||
}
|
||||
@@ -2112,7 +2132,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Reactivate
|
||||
if (Adherent::STATUS_RESILIATED == $object->status || Adherent::STATUS_EXCLUDED == $object->status) {
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=valid&token='.newToken().'">'.$langs->trans("Reenable")."</a>\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'valid'], true).'">'.$langs->trans("Reenable")."</a>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\n";
|
||||
}
|
||||
@@ -2121,7 +2141,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Resiliate
|
||||
if (Adherent::STATUS_VALIDATED == $object->status) {
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=resiliate&token='.newToken().'">'.$langs->trans("Resiliate")."</a></span>\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'resiliate'], true).'">'.$langs->trans("Resiliate")."</a></span>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate").'</span>'."\n";
|
||||
}
|
||||
@@ -2130,7 +2150,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Exclude
|
||||
if (Adherent::STATUS_VALIDATED == $object->status) {
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=exclude&token='.newToken().'">'.$langs->trans("Exclude")."</a></span>\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'exclude'], true).'">'.$langs->trans("Exclude")."</a></span>\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Exclude").'</span>'."\n";
|
||||
}
|
||||
@@ -2140,7 +2160,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (isModEnabled('societe') && !$object->socid) {
|
||||
if ($user->hasRight('societe', 'creer')) {
|
||||
if (Adherent::STATUS_DRAFT != $object->status) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.((int) $object->id).'&action=create_thirdparty&token='.newToken().'" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'create_thirdparty'], true).'" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
|
||||
}
|
||||
@@ -2153,7 +2173,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (!$user->socid && !$object->user_id) {
|
||||
if ($user->hasRight('user', 'user', 'creer')) {
|
||||
if (Adherent::STATUS_DRAFT != $object->status) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.((int) $object->id).'&action=create_user&token='.newToken().'" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'create_user'], true).'" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
|
||||
}
|
||||
@@ -2167,19 +2187,19 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$isinspip = $mailmanspip->is_in_spip($object);
|
||||
|
||||
if ($isinspip == 1) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=del_spip&token='.newToken().'">'.$langs->trans("DeleteIntoSpip").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'del_spip'], true).'">'.$langs->trans("DeleteIntoSpip").'</a>'."\n";
|
||||
}
|
||||
if ($isinspip == 0) {
|
||||
print '<a class="butAction" href="card.php?rowid='.((int) $object->id).'&action=add_spip&token='.newToken().'">'.$langs->trans("AddIntoSpip").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'add_spip'], true).'">'.$langs->trans("AddIntoSpip").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Merge
|
||||
print dolGetButtonAction($langs->trans('MergeMembers'), $langs->trans('Merge'), 'danger', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=merge&token='.newToken(), '', $user->hasRight('adherent', 'supprimer'));
|
||||
print dolGetButtonAction($langs->trans('MergeMembers'), $langs->trans('Merge'), 'danger', dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'merge'], true), '', $user->hasRight('adherent', 'supprimer'));
|
||||
|
||||
// Delete
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="butActionDelete" href="card.php?rowid='.((int) $object->id).'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'delete'], true).'">'.$langs->trans("Delete").'</a>'."\n";
|
||||
} else {
|
||||
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete").'</span>'."\n";
|
||||
}
|
||||
@@ -2238,9 +2258,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$MAXEVENT = 10;
|
||||
|
||||
$morehtmlcenter = '';
|
||||
$messagingUrl = DOL_URL_ROOT.'/adherents/messaging.php?rowid='.$object->id;
|
||||
$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/adherents/messaging.php', ['id' => $object->id]);
|
||||
$morehtmlcenter .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
|
||||
$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id);
|
||||
$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', dolBuildUrl(DOL_URL_ROOT.'/adherents/agenda.php', ['id' => $object->id]));
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
|
||||
@@ -314,7 +314,6 @@ class Adherent extends CommonObject
|
||||
*/
|
||||
public $invoice;
|
||||
|
||||
|
||||
/**
|
||||
* 'type' field format:
|
||||
* 'integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]',
|
||||
@@ -712,23 +711,20 @@ class Adherent extends CommonObject
|
||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."adherent");
|
||||
if ($id > 0) {
|
||||
$this->id = $id;
|
||||
if (getDolGlobalString('MEMBER_CODEMEMBER_ADDON') == '') {
|
||||
// keep old numbering
|
||||
$this->ref = (string) $id;
|
||||
} else {
|
||||
// auto code
|
||||
$modfile = dol_buildpath('core/modules/member/'.getDolGlobalString('MEMBER_CODEMEMBER_ADDON').'.php', 0);
|
||||
try {
|
||||
require_once $modfile;
|
||||
$modname = getDolGlobalString('MEMBER_CODEMEMBER_ADDON');
|
||||
$modCodeMember = new $modname();
|
||||
'@phan-var-force ModeleNumRefMembers $modCodeMember';
|
||||
/** @var ModeleNumRefMembers $modCodeMember */
|
||||
$this->ref = $modCodeMember->getNextValue($mysoc, $this);
|
||||
} catch (Exception $e) {
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
$modulenum = getDolGlobalString('MEMBER_CODEMEMBER_ADDON', 'mod_member_simple');
|
||||
|
||||
$modfile = dol_buildpath('core/modules/member/'.$modulenum.'.php', 0);
|
||||
try {
|
||||
require_once $modfile;
|
||||
$modname = $modulenum;
|
||||
$modCodeMember = new $modname();
|
||||
'@phan-var-force ModeleNumRefMembers $modCodeMember';
|
||||
/** @var ModeleNumRefMembers $modCodeMember */
|
||||
$this->ref = $modCodeMember->getNextValue($mysoc, $this);
|
||||
} catch (Exception $e) {
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Update minor fields
|
||||
@@ -836,6 +832,7 @@ class Adherent extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||
$sql .= " ref = '".$this->db->escape($this->ref)."'";
|
||||
$sql .= ", ref_ext = ".(empty($this->ref_ext) ? "null" : "'".$this->db->escape($this->ref_ext)."'");
|
||||
$sql .= ", civility = ".($this->civility_id ? "'".$this->db->escape($this->civility_id)."'" : "null");
|
||||
$sql .= ", firstname = ".($this->firstname ? "'".$this->db->escape($this->firstname)."'" : "null");
|
||||
$sql .= ", lastname = ".($this->lastname ? "'".$this->db->escape($this->lastname)."'" : "null");
|
||||
@@ -1747,8 +1744,6 @@ class Adherent extends CommonObject
|
||||
public function fetch_subscriptions()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
|
||||
$sql = "SELECT c.rowid, c.fk_adherent, c.fk_type, c.subscription, c.note as note_public, c.fk_bank,";
|
||||
@@ -1811,8 +1806,6 @@ class Adherent extends CommonObject
|
||||
*/
|
||||
public function fetchPartnerships($mode)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
|
||||
|
||||
|
||||
@@ -1829,15 +1822,16 @@ class Adherent extends CommonObject
|
||||
* @param double $amount Amount of subscription (0 accepted for some members)
|
||||
* @param int $accountid Id bank account. NOT USED.
|
||||
* @param string $operation Code of payment mode (if Id bank account provided). Example: 'CB', ... NOT USED.
|
||||
* @param string $label Label operation (if Id bank account provided).
|
||||
* @param string $num_chq Numero cheque (if Id bank account provided)
|
||||
* @param string $label Label operation stored into public note.
|
||||
* @param string $num_chq Numero cheque (if Id bank account provided). NOT USED.
|
||||
* @param string $emetteur_nom Name of cheque writer
|
||||
* @param string $emetteur_banque Name of bank of cheque
|
||||
* @param int $datesubend Date end subscription
|
||||
* @param int $fk_type Member type id
|
||||
* @param string $ref_ext To save an external ref
|
||||
* @return int rowid of record added, <0 if KO
|
||||
*/
|
||||
public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = null)
|
||||
public function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0, $fk_type = null, $ref_ext = '')
|
||||
{
|
||||
global $user;
|
||||
|
||||
@@ -1866,9 +1860,10 @@ class Adherent extends CommonObject
|
||||
$subscription->dateh = $date; // Date of new subscription
|
||||
$subscription->datef = $datefin; // End data of new subscription
|
||||
$subscription->amount = $amount;
|
||||
$subscription->note = $label; // deprecated
|
||||
$subscription->note_public = $label;
|
||||
$subscription->note_private = '';
|
||||
$subscription->fk_type = $fk_type;
|
||||
$subscription->ref_ext = $ref_ext;
|
||||
|
||||
if (empty($subscription->user_creation_id)) {
|
||||
$subscription->user_creation_id = $user->id;
|
||||
@@ -2546,10 +2541,11 @@ class Adherent extends CommonObject
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT.'/adherents/card.php?rowid='.((int) $this->id);
|
||||
$baseurl = DOL_URL_ROOT . '/adherents/card.php';
|
||||
if ($option == 'subscription') {
|
||||
$url = DOL_URL_ROOT.'/adherents/subscription.php?rowid='.((int) $this->id);
|
||||
$baseurl = DOL_URL_ROOT . '/adherents/subscription.php';
|
||||
}
|
||||
$query = ['rowid' => $this->id];
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
@@ -2558,9 +2554,10 @@ class Adherent extends CommonObject
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
$query = array_merge($query, ['save_lastsearch_values' => 1]);
|
||||
}
|
||||
}
|
||||
$url = dolBuildUrl($baseurl, $query);
|
||||
|
||||
$linkstart .= '<a href="'.$url.'"';
|
||||
$linkclose = "";
|
||||
@@ -2777,10 +2774,10 @@ class Adherent extends CommonObject
|
||||
$warning_delay = getWarningDelay('member', 'subscription') / 60 / 60 / 24;
|
||||
$label = $langs->trans("MembersWithSubscriptionToReceive");
|
||||
$labelShort = $langs->trans("MembersWithSubscriptionToReceiveShort");
|
||||
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut='.self::STATUS_VALIDATED.'&filter=outofdate';
|
||||
$url = dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['mainmenu' => 'members', 'statut' => self::STATUS_VALIDATED, 'filter' => 'outofdate']);
|
||||
} elseif ($mode == 'shift') {
|
||||
$warning_delay = getWarningDelay('member', 'subscription') / 60 / 60 / 24;
|
||||
$url = DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut='.self::STATUS_DRAFT;
|
||||
$url = dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['mainmenu' => 'members', 'statut' => self::STATUS_DRAFT]);
|
||||
$label = $langs->trans("MembersListToValid");
|
||||
$labelShort = $langs->trans("ToValidate");
|
||||
}
|
||||
|
||||
@@ -929,15 +929,17 @@ class AdherentType extends CommonObject
|
||||
$label = implode($this->getTooltipContentArray($params));
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
|
||||
$baseurl = DOL_URL_ROOT . '/adherents/type.php';
|
||||
$query = ['rowid' => $this->id];
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && isset($_SERVER["PHP_SELF"]) && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
$query = array_merge($query, ['save_lastsearch_values' => 1]);
|
||||
}
|
||||
$url = dolBuildUrl($baseurl, $query);
|
||||
|
||||
$linkstart = '<a href="'.$url.'"';
|
||||
$linkstart .= ($label ? ' title="'.dolPrintHTMLForAttribute($label).'"' : ' title="tocomplete"');
|
||||
|
||||
@@ -68,11 +68,11 @@ class AdherentStats extends Stats
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $socid Id third party
|
||||
* @param int $userid Id user for filter
|
||||
* @param DoliDB $db Database handler
|
||||
* @param int $socid Id third party
|
||||
* @param int $userid Id user for filter
|
||||
*/
|
||||
public function __construct($db, $socid = 0, $userid = 0)
|
||||
{
|
||||
@@ -97,11 +97,11 @@ class AdherentStats extends Stats
|
||||
|
||||
|
||||
/**
|
||||
* Return the number of proposition by month for a given year
|
||||
* Return the number of members by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
*/
|
||||
public function getNbByMonth($year, $format = 0)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ class AdherentStats extends Stats
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
* @return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
*/
|
||||
public function getAmountByMonth($year, $format = 0)
|
||||
{
|
||||
@@ -193,8 +193,6 @@ class AdherentStats extends Stats
|
||||
*/
|
||||
public function countMembersByTypeAndStatus($numberYears = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$now = dol_now();
|
||||
$endYear = (int) date('Y');
|
||||
$startYear = $endYear - $numberYears;
|
||||
@@ -268,8 +266,6 @@ class AdherentStats extends Stats
|
||||
*/
|
||||
public function countMembersByTagAndStatus($numberYears = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$now = dol_now();
|
||||
$endYear = (int) date('Y');
|
||||
$startYear = $endYear - $numberYears;
|
||||
@@ -338,4 +334,62 @@ class AdherentStats extends Stats
|
||||
|
||||
return $MembersCountArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of last modified members
|
||||
*
|
||||
* @param int $max Max Number of result
|
||||
* @return array<int,array{id:int,ref:string,firstname:string,lastname:string,company:string,fk_soc:?int,datec:int|'',datem:int|'',status:int,date_end_subscription:int|'',photo:null|string,email:string,gender:string,morphy:string,typeid:int,need_subscription:0|1|null,subscription:'0'|'1'|null,label:string}> Array of last modified members
|
||||
*/
|
||||
public function getLastModifiedMembers($max = 0)
|
||||
{
|
||||
$lastModifiedMembers = [];
|
||||
|
||||
$sql = "SELECT a.rowid, a.ref, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
|
||||
$sql .= " a.datec, GREATEST(a.tms, aef.tms) as datem, a.statut as status, a.datefin as date_end_subscription,";
|
||||
$sql .= ' a.photo, a.email, a.gender, a.morphy,';
|
||||
$sql .= " t.rowid as typeid, t.subscription, t.libelle as label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as aef ON aef.fk_object = a.rowid';
|
||||
$sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
|
||||
$sql .= " WHERE a.entity IN (".getEntity('member').")";
|
||||
$sql .= " AND a.fk_adherent_type = t.rowid";
|
||||
$sql .= " ORDER BY datem DESC";
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
|
||||
$line = 0;
|
||||
while ($line < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$lastModifiedMembers[] = [
|
||||
'id' => (int) $objp->rowid,
|
||||
'ref' => (string) $objp->ref,
|
||||
'lastname' => (string) $objp->lastname,
|
||||
'firstname' => (string) $objp->firstname,
|
||||
'company' => (string) $objp->company,
|
||||
'fk_soc' => $objp->fk_soc ? (int) $objp->fk_soc : null,
|
||||
'datec' => $this->db->jdate($objp->datec),
|
||||
'datem' => $this->db->jdate($objp->datem),
|
||||
'status' => (int) $objp->status,
|
||||
'date_end_subscription' => $this->db->jdate($objp->date_end_subscription),
|
||||
'photo' => isset($objp->photo) ? (string) $objp->photo : null,
|
||||
'email' => $objp->email,
|
||||
'gender' => $objp->gender,
|
||||
'morphy' => $objp->morphy,
|
||||
'typeid' => $objp->typeid,
|
||||
'need_subscription' => isset($objp->subscription) ? ($objp->subscription ? 1 : 0) : null,
|
||||
'subscription' => isset($objp->subscription) ? ($objp->subscription ? '1' : '0') : null,
|
||||
'label' => (string) $objp->label,
|
||||
];
|
||||
|
||||
$line++;
|
||||
}
|
||||
$this->db->free($result);
|
||||
}
|
||||
|
||||
return $lastModifiedMembers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherentstats.class.php';
|
||||
|
||||
|
||||
/**
|
||||
@@ -44,6 +45,11 @@ class Members extends DolibarrApi
|
||||
'typeid'
|
||||
);
|
||||
|
||||
/**
|
||||
* @var AdherentStats
|
||||
*/
|
||||
public $memberstats;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -51,6 +57,7 @@ class Members extends DolibarrApi
|
||||
{
|
||||
global $db;
|
||||
$this->db = $db;
|
||||
$this->memberstats = new AdherentStats($this->db, DolibarrApiAccess::$user->socid, DolibarrApiAccess::$user->id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -655,6 +662,7 @@ class Members extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 403 Access denied
|
||||
* @throws RestException 404 Member not found
|
||||
* @throws RestException 422 Malformed data
|
||||
*/
|
||||
public function createSubscription($id, $start_date, $end_date, $amount, $label = '')
|
||||
{
|
||||
@@ -981,6 +989,91 @@ class Members extends DolibarrApi
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array with the number of members by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text
|
||||
* 1=Label of abscissa is month number
|
||||
* 2=Label of abscissa is first letter of month
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
* @phpstan-return array<int<0,11>,array{0:int<1,12>,1:int}> Array of nb each month
|
||||
*
|
||||
* @url GET stats/nbbymonth
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getNbByMonth($year, $format = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getNbByMonth($year, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array with the number of subscriptions by year
|
||||
*
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<array{0:int,1:int}> Array of nb each year
|
||||
* @phpstan-return array<array{0:int,1:int}> Array of nb each year
|
||||
*
|
||||
* @url GET stats/nbbyyear
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getNbByYear()
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getNbByYear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of subscriptions by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
* @phpstan-return array<int<0,11>,array{0:int<1,12>,1:int|float}> Array of values by month
|
||||
*
|
||||
* @url GET stats/amountbymonth
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getAmountByMonth($year, $format = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getAmountByMonth($year, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Last Modified Members
|
||||
*
|
||||
* Get an array of statistics for last modified members
|
||||
*
|
||||
* @param int $max Max numbers of members
|
||||
* @return array Array of statistics for last modified members
|
||||
* @phan-return array<int,array{id:int,ref:string,firstname:string,lastname:string,company:string,fk_soc:?int,datec:int|'',datem:int|'',status:int,date_end_subscription:int|'',photo:null|string,email:string,gender:string,morphy:string,typeid:int,need_subscription:0|1|null,subscription:'0'|'1'|null,label:string}>
|
||||
* @phpstan-return array<int,array{id:int,ref:string,firstname:string,lastname:string,company:string,fk_soc:?int,datec:int|'',datem:int|'',status:int,date_end_subscription:int|'',photo:null|string,email:string,gender:string,morphy:string,typeid:int,need_subscription:0|1|null,subscription:'0'|'1'|null,label:string}>
|
||||
*
|
||||
* @url GET stats/lastmodifiedmembers
|
||||
* @throws RestException 403 Access denied
|
||||
*/
|
||||
public function getLastModifiedMembers($max)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->hasRight('adherent', 'lire')) {
|
||||
throw new RestException(403);
|
||||
}
|
||||
|
||||
return $this->memberstats->getLastModifiedMembers($max);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate fields before creating an object
|
||||
*
|
||||
|
||||
@@ -98,7 +98,7 @@ class Subscription extends CommonObject
|
||||
public $fk_bank;
|
||||
|
||||
/**
|
||||
* @var array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @var array<string,array{type:string,label:string,langfile?:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>|string,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,cssview?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>|string,disabled?:int<0,1>,arrayofkeyval?:array<int|string,string>,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>,searchmulti?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10),
|
||||
@@ -113,6 +113,7 @@ class Subscription extends CommonObject
|
||||
'fk_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => -1, 'position' => 55),
|
||||
'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 60),
|
||||
'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 65),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805),
|
||||
);
|
||||
|
||||
|
||||
@@ -144,6 +145,11 @@ class Subscription extends CommonObject
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->import_key)) {
|
||||
$this->import_key = trim($this->import_key);
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if ($this->datef <= $this->dateh) {
|
||||
$this->error = $langs->trans("ErrorBadValueForDate");
|
||||
@@ -165,13 +171,16 @@ class Subscription extends CommonObject
|
||||
$type = $this->fk_type;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, fk_user_creat)";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, note_private, ref_ext, fk_user_creat, import_key)";
|
||||
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape((string) $type)."', '".$this->db->idate($now)."',";
|
||||
$sql .= " '".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " '".$this->db->idate($this->datef)."',";
|
||||
$sql .= " ".((float) $this->amount).",";
|
||||
$sql .= " '".$this->db->escape($this->note_public ? $this->note_public : $this->note)."',";
|
||||
$sql .= " '".$this->db->escape($this->note_private)."',";
|
||||
$sql .= " ".(empty($this->ref_ext) ? "null" : "'".$this->db->escape($this->ref_ext)."'").",";
|
||||
$sql .= " ".((int) ($this->user_creation_id > 0 ? $this->user_creation_id : $user->id));
|
||||
$sql .= ", ".(!empty($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null");
|
||||
$sql .= ")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -443,9 +452,8 @@ class Subscription extends CommonObject
|
||||
if (!empty($this->datef)) {
|
||||
$label .= '<br><b>'.$langs->trans('DateEnd').':</b> '.dol_print_date($this->datef, 'day');
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT.'/adherents/subscription/card.php?rowid='.((int) $this->id);
|
||||
|
||||
$baseurl = DOL_URL_ROOT . '/adherents/subscription/card.php';
|
||||
$query = ['rowid' => $this->id];
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
@@ -453,9 +461,10 @@ class Subscription extends CommonObject
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
$query = array_merge($query, ['save_lastsearch_values' => 1]);
|
||||
}
|
||||
}
|
||||
$url = dolBuildUrl($baseurl, $query);
|
||||
|
||||
$linkstart = '<a href="'.$url.'" class="classfortooltip" title="'.dol_escape_htmltag($label, 1).'">';
|
||||
$linkend = '</a>';
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -150,7 +150,7 @@ if ($id > 0) {
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= '</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
@@ -127,13 +127,14 @@ if ($conf->use_javascript_ajax) {
|
||||
}
|
||||
}
|
||||
|
||||
$dataseries = array();
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']); // Draft, not yet validated
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']);
|
||||
$dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']);
|
||||
$dataseries = [
|
||||
[$langs->transnoentitiesnoconv("MembersStatusToValid"), $sumMembers['total']['members_draft']], // Draft, not yet validated
|
||||
[$langs->transnoentitiesnoconv("WaitingSubscription"), $sumMembers['total']['members_pending']],
|
||||
[$langs->transnoentitiesnoconv("UpToDate"), $sumMembers['total']['members_uptodate']],
|
||||
[$langs->transnoentitiesnoconv("OutOfDate"), $sumMembers['total']['members_expired']],
|
||||
[$langs->transnoentitiesnoconv("MembersStatusExcluded"), $sumMembers['total']['members_excluded']],
|
||||
[$langs->transnoentitiesnoconv("MembersStatusResiliated"), $sumMembers['total']['members_resiliated']],
|
||||
];
|
||||
|
||||
/**
|
||||
* @var string $badgeStatus0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
/* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -174,7 +174,7 @@ print dol_get_fiche_end();
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (getDolGlobalString('LDAP_MEMBER_ACTIVE') && getDolGlobalString('LDAP_MEMBER_ACTIVE') != Ldap::SYNCHRO_LDAP_TO_DOLIBARR) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dolibarr2ldap">'.$langs->trans("ForceSynchronize").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'dolibarr2ldap'], true).'">'.$langs->trans("ForceSynchronize").'</a></div>';
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
@@ -50,51 +50,50 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("members", "companies", "categories"));
|
||||
|
||||
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOSTINT('show_files');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'aZ');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'aZ');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
|
||||
|
||||
// Search fields
|
||||
$search = GETPOST("search", 'alpha');
|
||||
$search = GETPOST("search", 'alpha');
|
||||
$search_id = GETPOST('search_id', 'int');
|
||||
$search_ref = GETPOST("search_ref", 'alpha');
|
||||
$search_lastname = GETPOST("search_lastname", 'alpha');
|
||||
$search_firstname = GETPOST("search_firstname", 'alpha');
|
||||
$search_gender = GETPOST("search_gender", 'alpha');
|
||||
$search_civility = GETPOST("search_civility", 'alpha');
|
||||
$search_company = GETPOST('search_company', 'alphanohtml');
|
||||
$search_login = GETPOST("search_login", 'alpha');
|
||||
$search_address = GETPOST("search_address", 'alpha');
|
||||
$search_zip = GETPOST("search_zip", 'alpha');
|
||||
$search_town = GETPOST("search_town", 'alpha');
|
||||
$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state
|
||||
$search_country = GETPOST("search_country", 'alpha');
|
||||
$search_phone = GETPOST("search_phone", 'alpha');
|
||||
$search_ref = GETPOST("search_ref", 'alpha');
|
||||
$search_lastname = GETPOST("search_lastname", 'alpha');
|
||||
$search_firstname = GETPOST("search_firstname", 'alpha');
|
||||
$search_gender = GETPOST("search_gender", 'alpha');
|
||||
$search_civility = GETPOST("search_civility", 'alpha');
|
||||
$search_company = GETPOST('search_company', 'alphanohtml');
|
||||
$search_login = GETPOST("search_login", 'alpha');
|
||||
$search_address = GETPOST("search_address", 'alpha');
|
||||
$search_zip = GETPOST("search_zip", 'alpha');
|
||||
$search_town = GETPOST("search_town", 'alpha');
|
||||
$search_state = GETPOST("search_state", 'alpha'); // county / departement / federal state
|
||||
$search_country = GETPOST("search_country", 'alpha');
|
||||
$search_phone = GETPOST("search_phone", 'alpha');
|
||||
$search_phone_perso = GETPOST("search_phone_perso", 'alpha');
|
||||
$search_phone_mobile = GETPOST("search_phone_mobile", 'alpha');
|
||||
$search_type = GETPOST("search_type", 'alpha');
|
||||
$search_email = GETPOST("search_email", 'alpha');
|
||||
$search_categ = GETPOST("search_categ", 'intcomma');
|
||||
$search_morphy = GETPOST("search_morphy", 'alpha');
|
||||
$search_import_key = trim(GETPOST("search_import_key", 'alpha'));
|
||||
$search_type = GETPOST("search_type", 'alpha');
|
||||
$search_email = GETPOST("search_email", 'alpha');
|
||||
$search_categ = GETPOST("search_categ", 'intcomma');
|
||||
$search_morphy = GETPOST("search_morphy", 'alpha');
|
||||
$search_import_key = trim(GETPOST("search_import_key", 'alpha'));
|
||||
|
||||
$socid = GETPOSTINT('socid');
|
||||
if (GETPOSTINT('catid') && empty($search_categ)) {
|
||||
$search_categ = GETPOSTINT('catid');
|
||||
}
|
||||
|
||||
$search_filter = GETPOST("search_filter", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'intcomma'); // status
|
||||
$search_filter = GETPOST("search_filter", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'intcomma'); // status
|
||||
$search_datec_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datec_start_month'), GETPOSTINT('search_datec_start_day'), GETPOSTINT('search_datec_start_year'));
|
||||
$search_datec_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datec_end_month'), GETPOSTINT('search_datec_end_day'), GETPOSTINT('search_datec_end_year'));
|
||||
$search_datem_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datem_start_month'), GETPOSTINT('search_datem_start_day'), GETPOSTINT('search_datem_start_year'));
|
||||
@@ -208,7 +207,7 @@ foreach ($object->fields as $key => $val) {
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? '0' : '1'),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
|
||||
'position' => (int) $val['position'],
|
||||
'help' => isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
@@ -645,98 +644,116 @@ if ($search_type > 0) {
|
||||
}
|
||||
|
||||
// $parameters
|
||||
$param = '';
|
||||
$query = [];
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
$query += ['mode' => $mode];
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$query += ['contextpage' => $contextpage];
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.((int) $limit);
|
||||
$query += ['limit' => $limit];
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
$query += ['optioncss' => $optioncss];
|
||||
}
|
||||
if ($groupby != '') {
|
||||
$param .= '&groupby='.urlencode($groupby);
|
||||
$query += ['groupby' => $groupby];
|
||||
}
|
||||
if ($search_all != "") {
|
||||
$param .= "&search_all=".urlencode($search_all);
|
||||
$query += ['search_all' => $search_all];
|
||||
}
|
||||
if ($search_ref) {
|
||||
$param .= "&search_ref=".urlencode($search_ref);
|
||||
$query += ['search_ref' => $search_ref];
|
||||
}
|
||||
if ($search_civility) {
|
||||
$param .= "&search_civility=".urlencode($search_civility);
|
||||
$query += ['search_civility' => $search_civility];
|
||||
}
|
||||
if ($search_firstname) {
|
||||
$param .= "&search_firstname=".urlencode($search_firstname);
|
||||
$query += ['search_firstname' => $search_firstname];
|
||||
}
|
||||
if ($search_lastname) {
|
||||
$param .= "&search_lastname=".urlencode($search_lastname);
|
||||
$query += ['search_lastname' => $search_lastname];
|
||||
}
|
||||
if ($search_gender) {
|
||||
$param .= "&search_gender=".urlencode($search_gender);
|
||||
$query += ['search_gender' => $search_gender];
|
||||
}
|
||||
if ($search_morphy != '' && $search_morphy != '-1') {
|
||||
$query += ['search_morphy' => $search_morphy];
|
||||
}
|
||||
if ($search_login) {
|
||||
$param .= "&search_login=".urlencode($search_login);
|
||||
$query += ['search_login' => $search_login];
|
||||
}
|
||||
if ($search_email) {
|
||||
$param .= "&search_email=".urlencode($search_email);
|
||||
$query += ['search_email' => $search_email];
|
||||
}
|
||||
if ($search_categ > 0 || $search_categ == -2) {
|
||||
$param .= "&search_categ=".urlencode((string) ($search_categ));
|
||||
$query += ['search_categ' => $search_categ];
|
||||
}
|
||||
if ($search_company) {
|
||||
$param .= "&search_company=".urlencode($search_company);
|
||||
$query += ['search_company' => $search_company];
|
||||
}
|
||||
if ($search_address != '') {
|
||||
$param .= "&search_address=".urlencode($search_address);
|
||||
$query += ['search_address' => $search_address];
|
||||
}
|
||||
if ($search_town != '') {
|
||||
$param .= "&search_town=".urlencode($search_town);
|
||||
$query += ['search_town' => $search_town];
|
||||
}
|
||||
if ($search_zip != '') {
|
||||
$param .= "&search_zip=".urlencode($search_zip);
|
||||
$query += ['search_zip' => $search_zip];
|
||||
}
|
||||
if ($search_state != '') {
|
||||
$param .= "&search_state=".urlencode($search_state);
|
||||
$query += ['search_state' => $search_state];
|
||||
}
|
||||
if ($search_country != '') {
|
||||
$param .= "&search_country=".urlencode($search_country);
|
||||
$query += ['search_country' => $search_country];
|
||||
}
|
||||
if ($search_phone != '') {
|
||||
$param .= "&search_phone=".urlencode($search_phone);
|
||||
$query += ['search_phone' => $search_phone];
|
||||
}
|
||||
if ($search_phone_perso != '') {
|
||||
$param .= "&search_phone_perso=".urlencode($search_phone_perso);
|
||||
$query += ['search_phone_perso' => $search_phone_perso];
|
||||
}
|
||||
if ($search_phone_mobile != '') {
|
||||
$param .= "&search_phone_mobile=".urlencode($search_phone_mobile);
|
||||
$query += ['search_phone_mobile' => $search_phone_mobile];
|
||||
}
|
||||
if ($search_filter && $search_filter != '-1') {
|
||||
$param .= "&search_filter=".urlencode($search_filter);
|
||||
$query += ['search_filter' => $search_filter];
|
||||
}
|
||||
if ($search_status != "" && $search_status != -3) {
|
||||
$param .= "&search_status=".urlencode($search_status);
|
||||
$query += ['search_status' => $search_status];
|
||||
}
|
||||
if ($search_import_key != '') {
|
||||
$param .= '&search_import_key='.urlencode($search_import_key);
|
||||
$query += ['search_import_key' => $search_import_key];
|
||||
}
|
||||
if ($search_type > 0) {
|
||||
$param .= "&search_type=".urlencode($search_type);
|
||||
$query += ['search_type' => $search_type];
|
||||
}
|
||||
if ($search_datec_start) {
|
||||
$param .= '&search_datec_start_day='.dol_print_date($search_datec_start, '%d').'&search_datec_start_month='.dol_print_date($search_datec_start, '%m').'&search_datec_start_year='.dol_print_date($search_datec_start, '%Y');
|
||||
$query += [
|
||||
'search_datec_start_day' => dol_print_date($search_datec_start, '%d'),
|
||||
'search_datec_start_month' => dol_print_date($search_datec_start, '%m'),
|
||||
'search_datec_start_year' => dol_print_date($search_datec_start, '%Y'),
|
||||
];
|
||||
}
|
||||
if ($search_datem_end) {
|
||||
$param .= '&search_datem_end_day='.dol_print_date($search_datem_end, '%d').'&search_datem_end_month='.dol_print_date($search_datem_end, '%m').'&search_datem_end_year='.dol_print_date($search_datem_end, '%Y');
|
||||
$query += [
|
||||
'search_datem_end_day' => dol_print_date($search_datem_end, '%d'),
|
||||
'search_datem_end_month' => dol_print_date($search_datem_end, '%m'),
|
||||
'search_datem_end_year' => dol_print_date($search_datem_end, '%Y'),
|
||||
];
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
// Add $query from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
// Add $query from hooks
|
||||
$parameters = array('query' => &$query);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
// build $param
|
||||
$param = http_build_query($query);
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
@@ -776,12 +793,14 @@ print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$queryforbutton = $query;
|
||||
$queryforbutton['mode'] = 'common';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', dolBuildUrl($_SERVER["PHP_SELF"], $queryforbutton), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$queryforbutton['mode'] = 'kanban';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', dolBuildUrl($_SERVER["PHP_SELF"], $queryforbutton), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create', '', $user->hasRight('adherent', 'creer'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', dolBuildUrl(DOL_URL_ROOT.'/adherents/card.php', ['action' => 'create']), '', $user->hasRight('adherent', 'creer'));
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -147,7 +147,7 @@ print dol_get_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user');
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= '</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
@@ -181,9 +181,9 @@ if ((!empty($objUser->id) || !empty($objcon->id)) && $permok) {
|
||||
|
||||
$morehtmlright = '';
|
||||
|
||||
$messagingUrl = DOL_URL_ROOT.'/adherents/messaging.php?rowid='.$object->id;
|
||||
$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/adherents/messaging.php', ['rowid' => $object->id]);
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2);
|
||||
$messagingUrl = DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id;
|
||||
$messagingUrl = dolBuildUrl(DOL_URL_ROOT.'/adherents/agenda.php', ['id' => $object->id]);
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1);
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
@@ -195,7 +195,7 @@ if (isModEnabled('agenda')) {
|
||||
if (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allaactions', 'read'))) {
|
||||
print '<br>';
|
||||
$param = '&userid='.urlencode((string) ($id));
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
if ($contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2015-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
@@ -28,11 +28,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -41,6 +36,11 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "members", "bills"));
|
||||
|
||||
@@ -128,10 +128,10 @@ if (is_object($adht)) {
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['restore_lastsearch_values' => 1]).'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/vcard.php', ['id' => $object->id]).'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= '</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 NextGestion <contact@nextgestion.com>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -175,7 +175,7 @@ if ($id > 0) {
|
||||
|
||||
print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['restore_lastsearch_values' => 1]).'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
@@ -272,12 +272,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
} else {
|
||||
if (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($fadherent->statut > 0) {
|
||||
if ($fadherent->status > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($fadherent->statut > 0) {
|
||||
if ($fadherent->status > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ $langs->loadLangs(array("companies", "members"));
|
||||
|
||||
$memberstatic = new Adherent($db);
|
||||
|
||||
$title = $langs->trans("MembersStatisticsByProperties");
|
||||
$title = $langs->trans("MembershipStatistics");
|
||||
$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, array('https://www.google.com/jsapi'), '', '', 'mod-member page-stats_byproperties');
|
||||
@@ -84,6 +84,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.row
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY d.morphy";
|
||||
|
||||
$foundphy = $foundmor = 0;
|
||||
|
||||
// Define $data array
|
||||
|
||||
@@ -72,19 +72,7 @@ if (!empty($conf->dol_use_jmobile)) {
|
||||
$arrayjs = array();
|
||||
}
|
||||
|
||||
$title = $langs->trans("Statistics");
|
||||
if ($mode == 'memberbycountry') {
|
||||
$title = $langs->trans("MembersStatisticsByCountries");
|
||||
}
|
||||
if ($mode == 'memberbystate') {
|
||||
$title = $langs->trans("MembersStatisticsByState");
|
||||
}
|
||||
if ($mode == 'memberbytown') {
|
||||
$title = $langs->trans("MembersStatisticsByTown");
|
||||
}
|
||||
if ($mode == 'memberbyregion') {
|
||||
$title = $langs->trans("MembersStatisticsByRegion");
|
||||
}
|
||||
$title = $langs->trans("MembershipStatistics");
|
||||
|
||||
$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder';
|
||||
|
||||
@@ -184,7 +172,7 @@ if ($mode) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($mode == 'memberbycountry') {
|
||||
$data[] = array(
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? picto_from_langcode($obj->code, 'class="saturatemedium paddingrightonly"', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'code' => (string) $obj->code,
|
||||
'nb' => (int) $obj->nb,
|
||||
@@ -194,7 +182,7 @@ if ($mode) {
|
||||
}
|
||||
if ($mode == 'memberbyregion') { //+
|
||||
$data[] = array(
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? picto_from_langcode($obj->code, 'class="saturatemedium paddingrightonly"', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label2' => ($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||
'nb' => (int) $obj->nb,
|
||||
@@ -204,7 +192,7 @@ if ($mode) {
|
||||
}
|
||||
if ($mode == 'memberbystate') {
|
||||
$data[] = array(
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? picto_from_langcode($obj->code, 'class="saturatemedium paddingrightonly"', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label2' => ($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||
'nb' => (int) $obj->nb,
|
||||
@@ -214,7 +202,7 @@ if ($mode) {
|
||||
}
|
||||
if ($mode == 'memberbytown') {
|
||||
$data[] = array(
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label' => (string) (($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? picto_from_langcode($obj->code, 'class="saturatemedium paddingrightonly"', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en' => (string) (($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label2' => (string) ($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||
'nb' => (int) $obj->nb,
|
||||
@@ -242,7 +230,7 @@ if ($mode && !count($data)) {
|
||||
print $langs->trans("NoValidatedMemberYet").'<br>';
|
||||
print '<br>';
|
||||
} else {
|
||||
if ($mode == 'memberbycountry') {
|
||||
if (empty($mode) || $mode == 'memberbycountry') {
|
||||
print '<span class="opacitymedium">'.$langs->trans("MembersByCountryDesc");
|
||||
if (getDolGlobalString("GOOGLE_SHOW_COUNTRY_GRAPH")) {
|
||||
print $langs->trans("MembersByCountryDesc2");
|
||||
@@ -254,16 +242,6 @@ if ($mode && !count($data)) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("MembersByTownDesc").'</span><br>';
|
||||
} elseif ($mode == 'memberbyregion') {
|
||||
print '<span class="opacitymedium">'.$langs->trans("MembersByRegion").'</span><br>'; //+
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("MembersStatisticsDesc").'</span><br>';
|
||||
print '<br>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbycountry">'.$langs->trans("MembersStatisticsByCountries").'</a><br>';
|
||||
print '<br>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbystate">'.$langs->trans("MembersStatisticsByState").'</a><br>';
|
||||
print '<br>';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbytown">'.$langs->trans("MembersStatisticsByTown").'</a><br>';
|
||||
print '<br>'; //+
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=memberbyregion">'.$langs->trans("MembersStatisticsByRegion").'</a><br>'; //+
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -77,14 +77,14 @@ $langs->loadLangs(array("companies", "members"));
|
||||
$memberstatic = new Adherent($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans("SubscriptionsStatistics");
|
||||
$title = $langs->trans("MembershipStatistics");
|
||||
$help_url = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios|DE:Modul_Mitglieder';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-stats');
|
||||
|
||||
print load_fiche_titre($title, '', $memberstatic->picto);
|
||||
|
||||
$dir = $conf->adherent->dir_temp;
|
||||
$dir = $conf->member->dir_temp;
|
||||
|
||||
dol_mkdir($dir);
|
||||
|
||||
@@ -165,7 +165,7 @@ print dol_get_fiche_head($head, 'statssubscription', '', -1, '');
|
||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||
|
||||
// Show filter box
|
||||
/*print '<form name="stats" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
/*print '<form name="stats" method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@@ -493,10 +493,10 @@ print '<input type="hidden" name="rowid" value="'.$object->id.'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'subscription', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/list.php', ['restore_lastsearch_values' => 1]).'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'" class="refid">';
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard', 'class="valignmiddle marginleftonly paddingrightonly"');
|
||||
$morehtmlref .= '</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
|
||||
@@ -951,7 +951,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
|
||||
}
|
||||
|
||||
|
||||
print '<form name="subscription" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form name="subscription" method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="subscription">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
|
||||
@@ -25,14 +25,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
if (isModEnabled("bank")) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -40,6 +32,13 @@ if (isModEnabled("bank")) {
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
if (isModEnabled("bank")) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "members", "bills", "users", "banks"));
|
||||
@@ -373,7 +372,7 @@ if ($rowid && $action != 'edit') {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($user->hasRight('adherent', 'cotisation', 'creer')) {
|
||||
if (empty($bankline->rappro) || empty($bankline)) {
|
||||
if (empty($bankline) || empty($bankline->rappro)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".((int) $object->id).'&action=edit&token='.newToken().'">'.$langs->trans("Modify")."</a></div>";
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" title="'.$langs->trans("BankLineConciliated").'" href="#">'.$langs->trans("Modify")."</a></div>";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -57,7 +57,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="right"></td>';
|
||||
echo '<td class="right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
echo '<td class="right"><a class="reposition" href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $object->id, 'action' => 'dellink', 'dellinkid' => $key], true).'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@@ -33,12 +33,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -47,14 +41,20 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("members");
|
||||
|
||||
$rowid = GETPOSTINT('rowid');
|
||||
$rowid = GETPOSTINT('rowid');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$toselect = GETPOST('toselect', 'array:int');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$mode = GETPOST('mode', 'alpha');
|
||||
@@ -331,7 +331,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
@@ -554,10 +554,11 @@ if ($action == 'create') {
|
||||
print '</td></tr>';
|
||||
|
||||
// Morphy
|
||||
$morphys = array();
|
||||
$morphys[""] = $langs->trans("MorAndPhy");
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Moral");
|
||||
$morphys = [
|
||||
"" => $langs->trans("MorAndPhy"), // for empty choice
|
||||
"phy" => $langs->trans("Physical"),
|
||||
"mor" => $langs->trans("Moral"),
|
||||
];
|
||||
print '<tr><td><span>'.$langs->trans("MembersNature").'</span></td><td>';
|
||||
print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy');
|
||||
print "</td></tr>";
|
||||
@@ -696,7 +697,7 @@ if ($rowid > 0) {
|
||||
|
||||
// Edit
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'edit', 'rowid' => $object->id], true).'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
// Add
|
||||
@@ -709,14 +710,14 @@ if ($rowid > 0) {
|
||||
}
|
||||
|
||||
if ($user->hasRight('adherent', 'configurer') && !empty($object->status)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.($morphy ? '&morphy='.urlencode($morphy) : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.dolBuildUrl('card.php', ['action' => 'create', 'typeid' => $object->id, 'morphy' => ($morphy ? $morphy : ''), 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['rowid' => $object->id])], true).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("DeleteType").'</a></div>';
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'delete', 'rowid' => $object->id], true).'">'.$langs->trans("DeleteType").'</a></div>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
@@ -828,34 +829,35 @@ if ($rowid > 0) {
|
||||
$titre .= " (".$membertype->label.")";
|
||||
}
|
||||
|
||||
$param = "&rowid=".urlencode((string) ($object->id));
|
||||
$query = ['rowid' => $object->id];
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
$query+= ['mode' => $mode];
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
$query += ['contextpage' => $contextpage];
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.((int) $limit);
|
||||
$query += ['limit' => $limit];
|
||||
}
|
||||
if (!empty($status)) {
|
||||
$param .= "&status=".urlencode($status);
|
||||
$query += ['status' => $status];
|
||||
}
|
||||
if (!empty($search_ref)) {
|
||||
$param .= "&search_ref=".urlencode($search_ref);
|
||||
$query += ['search_ref' => $search_ref];
|
||||
}
|
||||
if (!empty($search_lastname)) {
|
||||
$param .= "&search_lastname=".urlencode($search_lastname);
|
||||
$query += ['search_lastname' => $search_lastname];
|
||||
}
|
||||
if (!empty($search_login)) {
|
||||
$param .= "&search_login=".urlencode($search_login);
|
||||
$query += ['search_login' => $search_login];
|
||||
}
|
||||
if (!empty($search_email)) {
|
||||
$param .= "&search_email=".urlencode($search_email);
|
||||
$query += ['search_email' => $search_email];
|
||||
}
|
||||
if (!empty($filter)) {
|
||||
$param .= "&filter=".urlencode($filter);
|
||||
$query += ['filter' => $filter];
|
||||
}
|
||||
$param = '&' . http_build_query($query);
|
||||
|
||||
if ($sall) {
|
||||
print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
|
||||
@@ -953,10 +955,10 @@ if ($rowid > 0) {
|
||||
if ($conf->main_checkbox_left_column) {
|
||||
print '<td class="center">';
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda marginleftonly" href="'.dolBuildUrl('card.php', ['rowid' => $objp->rowid, 'action' => 'edit', 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['rowid' => $object->id])], true).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'unlink').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
@@ -1021,10 +1023,10 @@ if ($rowid > 0) {
|
||||
if (!$conf->main_checkbox_left_column) {
|
||||
print '<td class="center">';
|
||||
if ($user->hasRight('adherent', 'creer')) {
|
||||
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda marginleftonly" href="'.dolBuildUrl('card.php', ['rowid' => $objp->rowid, 'action' => 'edit', 'backtopage' => dolBuildUrl($_SERVER["PHP_SELF"], ['rowid' => $object->id])], true).'">'.img_edit().'</a>';
|
||||
}
|
||||
if ($user->hasRight('adherent', 'supprimer')) {
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
|
||||
print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'unlink').'</a>';
|
||||
}
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2010-2012 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Henry Florian <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.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
|
||||
@@ -29,11 +29,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -42,6 +37,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('members', 'languages'));
|
||||
|
||||
@@ -75,7 +75,7 @@ if ($action == 'delete' && GETPOST('langtodelete', 'alpha') && $user->hasRight('
|
||||
$result = $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
header("Location: ".dolBuildUrl($_SERVER["PHP_SELF"], ['id' => $id]));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -90,9 +90,9 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->hasRight('
|
||||
|
||||
// update of object
|
||||
if ($forcelangprod == $current_lang) {
|
||||
$object->label = GETPOST("libelle", 'alphanohtml');
|
||||
$object->label = GETPOST("libelle", 'alphanohtml');
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||
//$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||
//$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||
} else {
|
||||
$object->multilangs[$forcelangprod]["label"] = GETPOST("libelle", 'alphanohtml');
|
||||
$object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||
@@ -116,13 +116,13 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->hasRight(
|
||||
|
||||
foreach ($object->multilangs as $key => $value) { // saving new values in the object
|
||||
if ($key == $current_lang) {
|
||||
$object->label = GETPOST("libelle-".$key, 'alphanohtml');
|
||||
$object->label = GETPOST("libelle-".$key, 'alphanohtml');
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
|
||||
$object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||
$object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||
} else {
|
||||
$object->multilangs[$key]["label"] = GETPOST("libelle-".$key, 'alphanohtml');
|
||||
$object->multilangs[$key]["label"] = GETPOST("libelle-".$key, 'alphanohtml');
|
||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
|
||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,9 +200,9 @@ print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($action == '') {
|
||||
if ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=create&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||
print '<a class="butAction" href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/type_translation.php', ['action' => 'create', 'rowid' => $object->id], true).'">'.$langs->trans("Add").'</a>';
|
||||
if ($cnt_trans > 0) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/adherents/type_translation.php?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||
print '<a class="butAction" href="'.dolBuildUrl(DOL_URL_ROOT.'/adherents/type_translation.php', ['action' => 'edit', 'rowid' => $object->id], true).'">'.$langs->trans("Update").'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ if ($action == 'edit') {
|
||||
print($s ? $s.' ' : '').'<b>'.$langs->trans('Language_'.$key).':</b>';
|
||||
print '</div>';
|
||||
print '<div class="inline-block marginbottomonly floatright">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"')."</a><br>";
|
||||
print '<a href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['rowid' => $object->id, 'action' => 'delete', 'langtodelete' => $key], true).'">'.img_delete('', 'class="valigntextbottom"')."</a><br>";
|
||||
print '</div>';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
@@ -254,7 +254,7 @@ if ($action == 'edit') {
|
||||
print($s ? $s.' ' : '').'<b>'.$langs->trans('Language_'.$key).':</b>';
|
||||
print '</div>';
|
||||
print '<div class="inline-block marginbottomonly floatright">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=delete&token='.newToken().'&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').'</a>';
|
||||
print '<a href="'.dolBuildUrl($_SERVER["PHP_SELF"], ['rowid' => $object->id, 'action' => 'delete', 'langtodelete' => $key], true).'">'.img_delete('', 'class="valigntextbottom"').'</a>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/accountant.php
|
||||
* \ingroup core
|
||||
* \brief Setup page to configure accountant / auditor
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'companies'));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
|
||||
$object = new stdClass();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (($action == 'update' && !GETPOST("cancel", 'alpha'))
|
||||
|| ($action == 'updateedit')) {
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NAME", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOSTINT("state_id"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOSTINT('country_id'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_CODE", GETPOST("code", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_NOTE", GETPOST("note", 'restricthtml'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if ($action != 'updateedit' && !$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("CompanyFoundation"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-accountant');
|
||||
|
||||
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
|
||||
|
||||
$head = company_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'accountant', '', -1, '');
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
/**
|
||||
* Edit parameters
|
||||
*/
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#selectcountry_id").change(function() {
|
||||
console.log("selectcountry_id change");
|
||||
document.form_index.action.value="updateedit";
|
||||
document.form_index.submit();
|
||||
});
|
||||
});';
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th></th></tr>'."\n";
|
||||
|
||||
// Name of Accountant Company
|
||||
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag(GETPOSTISSET('nom') ? GETPOST('nom', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_NAME')).'"'.(!getDolGlobalString('MAIN_INFO_ACCOUNTANT_NAME') ? ' autofocus="autofocus"' : '').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
print '<tr class="oddeven"><td><label for="address">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||
print '<textarea name="address" id="address" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOSTISSET('address') ? GETPOST('address', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_ADDRESS')).'</textarea></td></tr>'."\n";
|
||||
|
||||
// ZIP
|
||||
print '<tr class="oddeven"><td><label for="zipcode">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||
print '<input class="width100" name="zipcode" id="zipcode" value="'.dol_escape_htmltag(GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_ZIP')).'"></td></tr>'."\n";
|
||||
|
||||
// Town/City
|
||||
print '<tr class="oddeven"><td><label for="town">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||
print '<input name="town" class="minwidth100" id="town" value="'.dol_escape_htmltag(GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_TOWN')).'"></td></tr>'."\n";
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
|
||||
print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'country_id');
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// State
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY')), 'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Telephone
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', 0, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="phone" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('phone') ? GETPOST('phone', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_PHONE')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Fax
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', 0, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_FAX')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// eMail
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', 0, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="mail" id="email" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_MAIL')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', 0, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.dol_escape_htmltag(GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_WEB')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Code
|
||||
print '<tr class="oddeven"><td><label for="code">'.$langs->trans("AccountantFileNumber").'</label></td><td>';
|
||||
print '<input name="code" id="code" class="minwidth100" value="'.dol_escape_htmltag(GETPOSTISSET('code') ? GETPOST('code', 'alphanohtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_CODE')).'"></td></tr>'."\n";
|
||||
|
||||
// Note
|
||||
print '<tr class="oddeven"><td class="tdtop"><label for="note">'.$langs->trans("Note").'</label></td><td>';
|
||||
print '<textarea class="flat quatrevingtpercent" name="note" id="note" rows="'.ROWS_5.'">'.(GETPOSTISSET('note') ? GETPOST('note', 'restricthtml') : getDolGlobalString('MAIN_INFO_ACCOUNTANT_NOTE')).'</textarea></td></tr>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
@@ -67,13 +67,13 @@ $help_url = '';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-accounting');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($title, $linkback, 'title_setup');
|
||||
|
||||
print "<br>\n";
|
||||
$texttoshow = $langs->trans("AccountancySetupDoneFromAccountancyMenu", '{s1}'.$langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup").'{s2}');
|
||||
$texttoshow = str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/accountancy/index.php?mainmenu=accountancy&leftmenu=accountancy_admin&showtuto=1">', $texttoshow);
|
||||
$texttoshow = str_replace('{s1}', '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/accountancy/index.php', ['mainmenu' => 'accountancy', 'leftmenu' => 'accountancy_admin', 'showtuto' => 1]).'">', $texttoshow);
|
||||
$texttoshow = str_replace('{s2}', '</a>'.img_picto("", "url", 'class="paddingleft"'), $texttoshow);
|
||||
print '<span class="opacitymedium">'.$texttoshow."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
@@ -129,7 +129,7 @@ $help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Ter
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-agenda');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ $textobject = $langs->transnoentitiesnoconv("Agenda");
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_extrafields');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ $arrayofcss = array();
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-admin page-agenda-extsites');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_other');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ $formactions = new FormActions($db);
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-agenda_reminder');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -49,21 +49,23 @@ if (!$user->admin) {
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "agenda"));
|
||||
|
||||
$def = array();
|
||||
$actionsave = GETPOST('save', 'alpha');
|
||||
|
||||
// Get value in setup
|
||||
$MAIN_AGENDA_XCAL_EXPORTKEY = getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY');
|
||||
$MAIN_AGENDA_EXPORT_PAST_DELAY = getDolGlobalString('MAIN_AGENDA_EXPORT_PAST_DELAY', 100);
|
||||
$MAIN_AGENDA_EXPORT_PAST_DELAY = getDolGlobalInt('MAIN_AGENDA_EXPORT_PAST_DELAY', 100);
|
||||
$MAIN_AGENDA_EXPORT_CACHE = getDolGlobalInt('MAIN_AGENDA_EXPORT_CACHE');
|
||||
$AGENDA_EXPORT_FIX_TZ = getDolGlobalString('AGENDA_EXPORT_FIX_TZ');
|
||||
|
||||
// Overwrite with post values
|
||||
if (GETPOSTISSET('MAIN_AGENDA_XCAL_EXPORTKEY')) {
|
||||
$MAIN_AGENDA_XCAL_EXPORTKEY = trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY', 'alpha'));
|
||||
}
|
||||
if (GETPOSTISSET('MAIN_AGENDA_EXPORT_PAST_DELAY')) {
|
||||
$MAIN_AGENDA_EXPORT_PAST_DELAY = intval(GETPOSTINT('MAIN_AGENDA_EXPORT_PAST_DELAY'));
|
||||
$MAIN_AGENDA_EXPORT_PAST_DELAY = GETPOSTINT('MAIN_AGENDA_EXPORT_PAST_DELAY');
|
||||
}
|
||||
if (GETPOSTISSET('MAIN_AGENDA_EXPORT_CACHE')) {
|
||||
$MAIN_AGENDA_EXPORT_CACHE = intval(GETPOSTINT('MAIN_AGENDA_EXPORT_CACHE'));
|
||||
$MAIN_AGENDA_EXPORT_CACHE = GETPOSTINT('MAIN_AGENDA_EXPORT_CACHE');
|
||||
}
|
||||
if (GETPOSTISSET('AGENDA_EXPORT_FIX_TZ')) {
|
||||
$AGENDA_EXPORT_FIX_TZ = trim(GETPOST('AGENDA_EXPORT_FIX_TZ', 'alpha'));
|
||||
@@ -97,14 +99,10 @@ if ($actionsave) {
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
|
||||
$conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY = 100;
|
||||
}
|
||||
|
||||
$wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("AgendaSetup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-agenda_xcal');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
|
||||
|
||||
@@ -241,8 +239,6 @@ $message .= $langs->trans("AgendaUrlOptionsProject", $user->login, $user->login)
|
||||
$message .= $langs->trans("AgendaUrlOptionsType", 'systemauto|system').'<br>';
|
||||
$message .= $langs->trans("AgendaUrlOptionsCode", 'AC_COMPANY_CREATE,AC_PROPAL_VALIDATE,AC_CODE...').'<br>';
|
||||
$message .= $langs->trans("AgendaUrlOptionsIncludeHolidays", '1', '1').'<br>';
|
||||
//$defaultnotolderthan = getDolGlobalString('MAIN_AGENDA_EXPORT_PAST_DELAY', 100);
|
||||
//$message .= $langs->trans("AgendaUrlOptionsLimitDays", 'X', 'X', $defaultnotolderthan).'<br>'; // This option is hidden because already set and defined into previous options
|
||||
$message .= $langs->trans("AgendaUrlOptionsLimit", '1000').'<br>';
|
||||
|
||||
print info_admin($message);
|
||||
|
||||
@@ -224,7 +224,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader("", $langs->trans("BankSetupModule"), '', '', 0, 0, '', '', '', 'mod-admin page-bank');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ $page_name = "BankSetupModule";
|
||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bank_extrafields');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ $page_name = "BankSetupModule";
|
||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bank_payments_extrafields');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ $page_name = "BankSetupModule";
|
||||
llxHeader('', $langs->trans("BankSetupModule"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bankline_extrafields');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ $formbarcode = new FormBarCode($db);
|
||||
$help_url = 'EN:Module_Barcode|FR:Module_Codes_Barre|ES:Módulo Código de barra|DE:Modul_Barcode';
|
||||
llxHeader('', $langs->trans("BarcodeSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-barcode');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BarcodeSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -162,6 +162,13 @@ if ($action == 'updateMask') {
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'updateoptions') {
|
||||
if (GETPOST('BOM_USE_SEARCH_TO_SELECT')) {
|
||||
$bomsearch = GETPOST('activate_BOM_USE_SEARCH_TO_SELECT', 'alpha');
|
||||
if (dolibarr_set_const($db, "BOM_USE_SEARCH_TO_SELECT", $bomsearch, 'chaine', 0, '', $conf->entity)) {
|
||||
$conf->global->BOM_USE_SEARCH_TO_SELECT = $bomsearch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +182,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
llxHeader("", $langs->trans("BOMsSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-bom');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup');
|
||||
|
||||
@@ -478,6 +485,30 @@ if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 1) {
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updateoptions">';
|
||||
print '<td>'.$langs->trans("UseSearchToSelectBom").'</td>';
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
print '<td></td>';
|
||||
print '<td class="nowrap right">';
|
||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td class="right">';
|
||||
$arrval = array('0' => $langs->trans("No"),
|
||||
'1' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 1).')',
|
||||
'2' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 2).')',
|
||||
'3' => $langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch", 3).')',
|
||||
);
|
||||
print $form->selectarray("activate_BOM_USE_SEARCH_TO_SELECT", $arrval, getDolGlobalString("BOM_USE_SEARCH_TO_SELECT")).'</td>';
|
||||
print '<td class="right"><input type="submit" class="button small reposition" name="BOM_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
}
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
|
||||
$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
|
||||
$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
||||
@@ -517,6 +548,8 @@ print '</form>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
@@ -76,7 +76,7 @@ $help_url = '';
|
||||
llxHeader('', $langs->trans("BOMsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bom_extrafiels');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ $help_url = '';
|
||||
llxHeader('', $langs->trans("BOMsSetup"), $help_url, '', 0, 0, '', '', '', 'mod-admin page-bomline_extrafields');
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BOMsSetup"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ $sql .= " bd.rowid as boxid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."boxes as b, ".MAIN_DB_PREFIX."boxes_def as bd";
|
||||
$sql .= " WHERE b.box_id = bd.rowid";
|
||||
$sql .= " AND b.entity IN (0,".$conf->entity.")";
|
||||
$sql .= " AND b.fk_user=0";
|
||||
$sql .= " AND b.fk_user = 0";
|
||||
$sql .= " ORDER by b.position, b.box_order";
|
||||
//print $sql;
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ llxHeader("", $langs->trans("BankSetupModule"), '', '', 0, 0, '', '', '', 'mod-a
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup');
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user