mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-03-07 10:56:50 +01:00
Compare commits
1310 Commits
revert-368
...
phpstan-ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3d0aad269 | ||
|
|
3d1491d312 | ||
|
|
9fc1076361 | ||
|
|
28563cd261 | ||
|
|
a2397ff88b | ||
|
|
a94c77edd0 | ||
|
|
e773d3bb81 | ||
|
|
90070c8c7e | ||
|
|
374d609ce8 | ||
|
|
db3df89ee2 | ||
|
|
df352dfbb3 | ||
|
|
a7a5e211c2 | ||
|
|
65516a3f99 | ||
|
|
84e509394c | ||
|
|
bb8285cb4d | ||
|
|
36b07475dc | ||
|
|
06d1b2bc14 | ||
|
|
a705472811 | ||
|
|
ff146c4713 | ||
|
|
3d88e03c88 | ||
|
|
6041233c4b | ||
|
|
f919a83721 | ||
|
|
c8111f9726 | ||
|
|
472665c038 | ||
|
|
7e20cd27f6 | ||
|
|
de9bf13ddd | ||
|
|
06e67ee3da | ||
|
|
f15efe2ca8 | ||
|
|
08feb72c6c | ||
|
|
dd3709be29 | ||
|
|
dad5f55081 | ||
|
|
717f315551 | ||
|
|
c15994cbf8 | ||
|
|
6b228411de | ||
|
|
f87a5ab46a | ||
|
|
be46c48f55 | ||
|
|
9dd8492475 | ||
|
|
79c6f82841 | ||
|
|
020f552410 | ||
|
|
ff7e2c4292 | ||
|
|
00a64df8e4 | ||
|
|
7de8680a37 | ||
|
|
dc29ebfb87 | ||
|
|
cbdeebd338 | ||
|
|
e31e6371e3 | ||
|
|
0b34a66fe6 | ||
|
|
d3652eac53 | ||
|
|
095f72a3a7 | ||
|
|
9560eb00bd | ||
|
|
4117aa4e31 | ||
|
|
e52c212a81 | ||
|
|
1a8f540dc8 | ||
|
|
de8f15ce38 | ||
|
|
fe4648657e | ||
|
|
2d5b6ea490 | ||
|
|
f810a89977 | ||
|
|
cea9183889 | ||
|
|
3fa9d82ca5 | ||
|
|
95e941dd23 | ||
|
|
68385e59d0 | ||
|
|
e3e15e5df1 | ||
|
|
0ca643dffb | ||
|
|
e728453b7a | ||
|
|
c73820a931 | ||
|
|
2821d18720 | ||
|
|
0eeac1817d | ||
|
|
3d2c20193f | ||
|
|
cdbd56c0ba | ||
|
|
bb8290ef23 | ||
|
|
7df18dbad8 | ||
|
|
63ed00fdba | ||
|
|
b34fb98b52 | ||
|
|
48cb31224e | ||
|
|
ac8af31c51 | ||
|
|
7728f8c895 | ||
|
|
acc5f754e6 | ||
|
|
9e3f3e70d6 | ||
|
|
829ea724cd | ||
|
|
c1db001cd8 | ||
|
|
4f17908c59 | ||
|
|
12f0351deb | ||
|
|
8efce11329 | ||
|
|
80d48a0d52 | ||
|
|
9a9784238c | ||
|
|
97dcd936df | ||
|
|
a2fb7eea1b | ||
|
|
38ca2ddefe | ||
|
|
a318ee912b | ||
|
|
b2fc785985 | ||
|
|
e8a053f1df | ||
|
|
2c6a346811 | ||
|
|
89634f83da | ||
|
|
d6b780eab3 | ||
|
|
3c531d2058 | ||
|
|
4fb2746e6f | ||
|
|
a4d5990c2e | ||
|
|
4a212daf49 | ||
|
|
9738ce853a | ||
|
|
11d4fafca0 | ||
|
|
dec4b2b0a2 | ||
|
|
0250d5de8a | ||
|
|
e6cb968eff | ||
|
|
970b07f646 | ||
|
|
5bf181adf7 | ||
|
|
5033716755 | ||
|
|
b0489d32ab | ||
|
|
35caafadb7 | ||
|
|
23da8b6934 | ||
|
|
aac5629f55 | ||
|
|
9b7afdcbbd | ||
|
|
d4ff519b75 | ||
|
|
deeb710d2b | ||
|
|
81ac910ede | ||
|
|
41294d5a27 | ||
|
|
03ab77c861 | ||
|
|
da4baf4255 | ||
|
|
bff98ad817 | ||
|
|
7ccd12e865 | ||
|
|
e64ab3c751 | ||
|
|
6adc5dc78d | ||
|
|
2a41e1f714 | ||
|
|
917c2d6be8 | ||
|
|
7a37ebbeb3 | ||
|
|
83b137d854 | ||
|
|
9f4674806e | ||
|
|
30f7f34708 | ||
|
|
ed868d6dd3 | ||
|
|
a8e0508343 | ||
|
|
e850355b30 | ||
|
|
673659de98 | ||
|
|
1a83124ca6 | ||
|
|
718f318089 | ||
|
|
da6de62ad9 | ||
|
|
7a1a00e5d3 | ||
|
|
bf9e154deb | ||
|
|
094e42fd4f | ||
|
|
5846921e37 | ||
|
|
d87b93cebd | ||
|
|
e43438cc7b | ||
|
|
0b8e0c4765 | ||
|
|
4532d69220 | ||
|
|
0cc80e65ed | ||
|
|
7b5ddac963 | ||
|
|
4951edfbd0 | ||
|
|
e596bdada1 | ||
|
|
7f9bdc5f45 | ||
|
|
b220cf0832 | ||
|
|
94d4f2661d | ||
|
|
9ec77dada2 | ||
|
|
afc3879d84 | ||
|
|
4660d0eec9 | ||
|
|
7bb57721bb | ||
|
|
01e947cfad | ||
|
|
3361d4b0ba | ||
|
|
6ef62a45b5 | ||
|
|
7eae776e13 | ||
|
|
251b57641b | ||
|
|
2b3ae6c2d7 | ||
|
|
da0ece345f | ||
|
|
173c6865cb | ||
|
|
59ce599ba5 | ||
|
|
66c552ccb2 | ||
|
|
0f378d5ecf | ||
|
|
07a3d0e4b7 | ||
|
|
6ce11adba1 | ||
|
|
72ed29a599 | ||
|
|
e2aed0f5c1 | ||
|
|
f7092b4377 | ||
|
|
87f81fb853 | ||
|
|
2e768edbb2 | ||
|
|
6b73bb78a4 | ||
|
|
aa33f7c155 | ||
|
|
70b3be5e7f | ||
|
|
07ff579416 | ||
|
|
51e61c8ef3 | ||
|
|
e69d016b9f | ||
|
|
53dbc754f6 | ||
|
|
a9dcecbc2f | ||
|
|
5d524f7973 | ||
|
|
1b2f16b01a | ||
|
|
b623ea1f57 | ||
|
|
360718fa7b | ||
|
|
c6a398639c | ||
|
|
c933e4a25a | ||
|
|
449870d347 | ||
|
|
bf09f22239 | ||
|
|
5595cdbb25 | ||
|
|
dece1bc0f7 | ||
|
|
a0e2235adf | ||
|
|
bec138412b | ||
|
|
8c179fad46 | ||
|
|
e3323c3ff1 | ||
|
|
c1ab24f227 | ||
|
|
685ec96807 | ||
|
|
8dafeb0984 | ||
|
|
adc4405d98 | ||
|
|
9f972a7b4f | ||
|
|
ee32411d6a | ||
|
|
7842897373 | ||
|
|
364a3d3614 | ||
|
|
63fd9d326d | ||
|
|
c19e4e33cb | ||
|
|
835d3811a4 | ||
|
|
7c9eb40000 | ||
|
|
f44dc26e63 | ||
|
|
36b681153e | ||
|
|
059656b5ef | ||
|
|
be0f368629 | ||
|
|
926ed04ebe | ||
|
|
a025628c97 | ||
|
|
b304e13499 | ||
|
|
f9c8164e57 | ||
|
|
39d30a23fe | ||
|
|
048d71dec3 | ||
|
|
d4d3c2089e | ||
|
|
e18526dec5 | ||
|
|
7c11c3a2a5 | ||
|
|
7df6595351 | ||
|
|
2cfdbd6b5f | ||
|
|
00d1bbce9c | ||
|
|
7f407a1183 | ||
|
|
2e7ab21d01 | ||
|
|
de96c57acf | ||
|
|
fcef8ec922 | ||
|
|
4c1cde76d5 | ||
|
|
362113e653 | ||
|
|
6b19b592ad | ||
|
|
04787d8cb0 | ||
|
|
39ed2ece8f | ||
|
|
6d6dfb3a5e | ||
|
|
608f89e882 | ||
|
|
7b6051a0d0 | ||
|
|
6fabf82f1d | ||
|
|
b3669d4333 | ||
|
|
a5b106fe70 | ||
|
|
f497a6a4fe | ||
|
|
db3d8a0a1a | ||
|
|
d5cab67f4c | ||
|
|
85a0383b46 | ||
|
|
c981b7ccb6 | ||
|
|
590bf2dd0e | ||
|
|
c25dda01b4 | ||
|
|
f450dd00a8 | ||
|
|
ad3304832d | ||
|
|
c33b7e0bf1 | ||
|
|
c017ea0341 | ||
|
|
eb4d9dec53 | ||
|
|
2ca80ffa67 | ||
|
|
8d84cec3ca | ||
|
|
2ee07bb049 | ||
|
|
3416c6ccc0 | ||
|
|
92197cb100 | ||
|
|
9319059349 | ||
|
|
1eed0e18a9 | ||
|
|
2153dbb0f1 | ||
|
|
52446678d0 | ||
|
|
b986f2f1a7 | ||
|
|
74157e15d2 | ||
|
|
fb70814412 | ||
|
|
c295e97f9c | ||
|
|
8478c38477 | ||
|
|
f6db26a21d | ||
|
|
3b9f0d9ce6 | ||
|
|
ca41760a68 | ||
|
|
483523e24c | ||
|
|
935374d368 | ||
|
|
5ea91b5399 | ||
|
|
e09180ce0c | ||
|
|
de56758859 | ||
|
|
cc6b3f968c | ||
|
|
70d711e083 | ||
|
|
10beb6cfc6 | ||
|
|
f72245353f | ||
|
|
717af97307 | ||
|
|
ef7f607978 | ||
|
|
429f01e72a | ||
|
|
9ff8eb695e | ||
|
|
753d89d4ca | ||
|
|
cd6a3b8767 | ||
|
|
ba01664d57 | ||
|
|
158119361f | ||
|
|
5433a5642d | ||
|
|
02f23d5193 | ||
|
|
7a73ad9566 | ||
|
|
96cd5b9afb | ||
|
|
1d3cfdb654 | ||
|
|
808a3f820c | ||
|
|
4e8f3b921f | ||
|
|
d1977c8e56 | ||
|
|
62c6d8cbb8 | ||
|
|
ba1cecb17e | ||
|
|
0b81bef078 | ||
|
|
daa109f1d5 | ||
|
|
c820404856 | ||
|
|
caa5d7b347 | ||
|
|
6d48243b68 | ||
|
|
8b0ed977e8 | ||
|
|
d51f2b0c34 | ||
|
|
85ccca6ca3 | ||
|
|
f23e6b541a | ||
|
|
a139ab1b20 | ||
|
|
fa55a2987a | ||
|
|
9743441127 | ||
|
|
1de655faaa | ||
|
|
44fcbb4c18 | ||
|
|
97a3cf5f0c | ||
|
|
785d94bc13 | ||
|
|
404f7288d9 | ||
|
|
dac3b74111 | ||
|
|
bbbf405d3a | ||
|
|
d278909f5b | ||
|
|
6d0e42a82e | ||
|
|
26787b8666 | ||
|
|
033667e0cc | ||
|
|
7801d27d82 | ||
|
|
3339d78245 | ||
|
|
db5154871c | ||
|
|
178d6dbadc | ||
|
|
f9aaaffcd1 | ||
|
|
49f44ab3c0 | ||
|
|
016e3901c3 | ||
|
|
fc2888b42d | ||
|
|
4aae67aa27 | ||
|
|
ccaf2eae29 | ||
|
|
75378a3eed | ||
|
|
1ee972d997 | ||
|
|
b69f2b81dd | ||
|
|
f69d0dd04e | ||
|
|
1950fbdd5f | ||
|
|
d711c93577 | ||
|
|
62779ae0bc | ||
|
|
3b441d22f6 | ||
|
|
5e3c3fd582 | ||
|
|
07cb0adade | ||
|
|
a7a7dfb738 | ||
|
|
008a22eb17 | ||
|
|
79bf9a0a4b | ||
|
|
c386f94fab | ||
|
|
1173164d7e | ||
|
|
3b6c448787 | ||
|
|
ba28d16da4 | ||
|
|
8feb5275ba | ||
|
|
8d96ed3a03 | ||
|
|
4a7c6c6700 | ||
|
|
534995dd6c | ||
|
|
d0c5d523a3 | ||
|
|
574b4b5d62 | ||
|
|
713918dadf | ||
|
|
0111114502 | ||
|
|
79ba81a75d | ||
|
|
08040ec30e | ||
|
|
51c7074687 | ||
|
|
ce6802ab77 | ||
|
|
6bc3bb0761 | ||
|
|
a48485195f | ||
|
|
556b103dc6 | ||
|
|
205cb50766 | ||
|
|
2ceadc0741 | ||
|
|
c852aa346a | ||
|
|
c352ae9615 | ||
|
|
8d54cac841 | ||
|
|
fab3521672 | ||
|
|
012c1fb078 | ||
|
|
7b91fdcfa5 | ||
|
|
50e7d41f7a | ||
|
|
447242b3d5 | ||
|
|
529db21a6c | ||
|
|
943827834c | ||
|
|
d11c85be43 | ||
|
|
c92a6aaf04 | ||
|
|
bbac3b9a4a | ||
|
|
8a4d4a8056 | ||
|
|
7e3df7c5f8 | ||
|
|
081e05047d | ||
|
|
65224fe6cc | ||
|
|
30e8eff3d9 | ||
|
|
cabc42f308 | ||
|
|
1ede9e3630 | ||
|
|
ca64d18833 | ||
|
|
2304e4ccfe | ||
|
|
4fdbfcf581 | ||
|
|
2a157d1aec | ||
|
|
456affb148 | ||
|
|
4cdd513914 | ||
|
|
cd71bf33ca | ||
|
|
581aafdbff | ||
|
|
ac5b2c994b | ||
|
|
29cadfb644 | ||
|
|
276cbb2cd7 | ||
|
|
de4dd2e735 | ||
|
|
fe6b6a8e42 | ||
|
|
3379457ed7 | ||
|
|
b28c19d48d | ||
|
|
9ce603eb97 | ||
|
|
c2574715f1 | ||
|
|
440050b7a8 | ||
|
|
4faef8f791 | ||
|
|
3a67d56a4f | ||
|
|
b74382c7e2 | ||
|
|
3eed365991 | ||
|
|
51b66f0c17 | ||
|
|
280fb84147 | ||
|
|
19a29402de | ||
|
|
01faea65d5 | ||
|
|
265acd7133 | ||
|
|
a71e07c6e4 | ||
|
|
8d7588fbf6 | ||
|
|
4fd58bf4ea | ||
|
|
00bc3e60d9 | ||
|
|
92e655a28d | ||
|
|
39ca59eb37 | ||
|
|
805f0ed971 | ||
|
|
8923cd9ac0 | ||
|
|
413021900a | ||
|
|
0b891d1790 | ||
|
|
7c02095d4d | ||
|
|
78b21d26d1 | ||
|
|
479fcde7e9 | ||
|
|
26630a746b | ||
|
|
6469399afc | ||
|
|
6b0a3e0f68 | ||
|
|
75ae360898 | ||
|
|
0e4243a994 | ||
|
|
416370eddf | ||
|
|
e4d4f65b27 | ||
|
|
285371f49e | ||
|
|
ca017aa342 | ||
|
|
28925a4fa1 | ||
|
|
65c38c92fb | ||
|
|
192ac39831 | ||
|
|
67fe092db0 | ||
|
|
a02cf18703 | ||
|
|
62fe933b79 | ||
|
|
cbc64dfcbf | ||
|
|
47f8bec9ce | ||
|
|
abb195ff68 | ||
|
|
84ef61596d | ||
|
|
050f3ec78a | ||
|
|
812ea8f66f | ||
|
|
cd0b8ceab5 | ||
|
|
4017f8166e | ||
|
|
2d4e09b519 | ||
|
|
08bf5af5d4 | ||
|
|
97b7e52a97 | ||
|
|
70089d2e4d | ||
|
|
48f067fdfc | ||
|
|
4224c9fc05 | ||
|
|
299380057b | ||
|
|
7e29718148 | ||
|
|
1db633ee43 | ||
|
|
e6fc383355 | ||
|
|
3e2217c47f | ||
|
|
35847a94f0 | ||
|
|
7efb82fc79 | ||
|
|
98cba6a94a | ||
|
|
3822ae8e77 | ||
|
|
e3eb12c9d7 | ||
|
|
388c25f588 | ||
|
|
a452dfb596 | ||
|
|
1ddbaf1181 | ||
|
|
1eb0970e11 | ||
|
|
c134da09ea | ||
|
|
17c50b10a3 | ||
|
|
023c7f4d1b | ||
|
|
ea69506e53 | ||
|
|
ed84b59f22 | ||
|
|
ebbaeb5129 | ||
|
|
b79814f864 | ||
|
|
2fc7d78709 | ||
|
|
5e176ab605 | ||
|
|
daae0f6f82 | ||
|
|
42d270d3df | ||
|
|
39d39f475d | ||
|
|
6a6994cbdc | ||
|
|
efa4a27b2a | ||
|
|
4c0f567ced | ||
|
|
081a1abbe8 | ||
|
|
ecee7722c5 | ||
|
|
9a6f9c6190 | ||
|
|
3fc7f06a30 | ||
|
|
35285756a9 | ||
|
|
5e406a945b | ||
|
|
882dc419d4 | ||
|
|
669e2bd726 | ||
|
|
34a195c810 | ||
|
|
0e960ea32d | ||
|
|
4e9965ea70 | ||
|
|
585c4ae04e | ||
|
|
ff1bf6b2df | ||
|
|
12ca0fc894 | ||
|
|
f39ef3d5c7 | ||
|
|
0daf289924 | ||
|
|
d4602e6b6f | ||
|
|
7c533b7068 | ||
|
|
b0a67d5c4d | ||
|
|
068fdc9431 | ||
|
|
ec77531a2a | ||
|
|
70d7357128 | ||
|
|
f8d9a2e829 | ||
|
|
7e17711871 | ||
|
|
b769c1a8b0 | ||
|
|
f8123ebc64 | ||
|
|
5e72196245 | ||
|
|
9aa5bf4aef | ||
|
|
aee871f0b5 | ||
|
|
b2c5ee5c4a | ||
|
|
99d1aad0b2 | ||
|
|
cba8ccaa32 | ||
|
|
3e3e2a3759 | ||
|
|
8757990a52 | ||
|
|
dec35ff489 | ||
|
|
28cdf7d121 | ||
|
|
3f14dc0562 | ||
|
|
1175f20f97 | ||
|
|
7d62a04fda | ||
|
|
6cde33dfd1 | ||
|
|
07d10fdb22 | ||
|
|
e00086d057 | ||
|
|
e3d1e21df3 | ||
|
|
8dd729af9a | ||
|
|
9857539204 | ||
|
|
abb256212a | ||
|
|
fd1b690813 | ||
|
|
05f8d70c39 | ||
|
|
e6c735b66e | ||
|
|
d4860519a6 | ||
|
|
af24facf4a | ||
|
|
2a2bc335c8 | ||
|
|
b12b20221b | ||
|
|
0fb5a9b3e9 | ||
|
|
b46b8b4476 | ||
|
|
22283af99c | ||
|
|
6a103a9ac9 | ||
|
|
3043cf65d1 | ||
|
|
5ab2014e09 | ||
|
|
5c63541097 | ||
|
|
99c7effb9b | ||
|
|
e61c8989f3 | ||
|
|
e52bd93ce0 | ||
|
|
f4693352ca | ||
|
|
a85e25c807 | ||
|
|
6ed576bc9f | ||
|
|
6a5a8ad951 | ||
|
|
a42ce189ea | ||
|
|
a9abf5c9f2 | ||
|
|
5d18db5aea | ||
|
|
f94e1c24fc | ||
|
|
062f6d18a4 | ||
|
|
8b79913f6f | ||
|
|
d953f0caf8 | ||
|
|
a7d0206156 | ||
|
|
5bb00b827a | ||
|
|
f240f53e8c | ||
|
|
020895f404 | ||
|
|
d378d1f8cc | ||
|
|
79d5c0c418 | ||
|
|
8ed279a488 | ||
|
|
7abf0cfe68 | ||
|
|
f8e0ff19da | ||
|
|
24d7e4f24d | ||
|
|
87c01a3371 | ||
|
|
7f2d0efa22 | ||
|
|
bedf25f1f4 | ||
|
|
1be0b12b3f | ||
|
|
89d380db67 | ||
|
|
a5dd3cf63b | ||
|
|
69de2e8cdd | ||
|
|
4b9b0877b1 | ||
|
|
091b2b3f77 | ||
|
|
4126329f3d | ||
|
|
f17cc801b6 | ||
|
|
4af57f9f46 | ||
|
|
d4051faf35 | ||
|
|
e510043ade | ||
|
|
9ff559a0ad | ||
|
|
6a80ef4019 | ||
|
|
0a12caf313 | ||
|
|
c940376446 | ||
|
|
efdbf9a95c | ||
|
|
b487a95d86 | ||
|
|
053cd4e020 | ||
|
|
3e2598f8ff | ||
|
|
e266a42545 | ||
|
|
dec9dfc06b | ||
|
|
8e4762b2e1 | ||
|
|
02656bbcb8 | ||
|
|
1eda4e6157 | ||
|
|
85c8612c87 | ||
|
|
dc5b719065 | ||
|
|
58d1254212 | ||
|
|
ab9c1a80e6 | ||
|
|
9cd99ba4d2 | ||
|
|
e1345e225f | ||
|
|
fcedaa150e | ||
|
|
9140e0599a | ||
|
|
2754b6485d | ||
|
|
544f4971bc | ||
|
|
a56645784c | ||
|
|
b533548caa | ||
|
|
aa0563a54a | ||
|
|
9c68ba8759 | ||
|
|
2759d409e4 | ||
|
|
049fcba06a | ||
|
|
342a6f754b | ||
|
|
a96bba2199 | ||
|
|
6e9225ce8b | ||
|
|
a41e9941f9 | ||
|
|
99b88e876f | ||
|
|
c698f4dc28 | ||
|
|
391fd8dab6 | ||
|
|
8e37e310e0 | ||
|
|
cc88462e1a | ||
|
|
22a1340ba9 | ||
|
|
2faa32b9c8 | ||
|
|
1a3662176b | ||
|
|
177c5eb51f | ||
|
|
dff4b0077b | ||
|
|
f1c47cf536 | ||
|
|
233865da21 | ||
|
|
30e1fc6c9f | ||
|
|
de0832bcea | ||
|
|
6cf4969100 | ||
|
|
bebc6fbb78 | ||
|
|
589fe1215a | ||
|
|
cfedd3b485 | ||
|
|
d2a78ce515 | ||
|
|
b1aefa13d7 | ||
|
|
9d0a2c0978 | ||
|
|
2328de8e7c | ||
|
|
c205803687 | ||
|
|
b595f8468d | ||
|
|
9c837750a5 | ||
|
|
769b1935e3 | ||
|
|
da3edf38ed | ||
|
|
8f0d1d4e25 | ||
|
|
8dbdf910f9 | ||
|
|
d0c80f3228 | ||
|
|
22391f32dd | ||
|
|
16542692d5 | ||
|
|
fbc9934e62 | ||
|
|
125d97cf5d | ||
|
|
a544af5d02 | ||
|
|
8fde66127c | ||
|
|
45483a6fd9 | ||
|
|
ecf01bacd7 | ||
|
|
d66612eb55 | ||
|
|
cc9f0e5bcf | ||
|
|
87fc31fa7c | ||
|
|
1a2813e13c | ||
|
|
904dbef1b2 | ||
|
|
db521258ea | ||
|
|
adc251a053 | ||
|
|
a8675af65b | ||
|
|
66a9b7b7c3 | ||
|
|
7f06c6b326 | ||
|
|
f9b19c8336 | ||
|
|
549fa27308 | ||
|
|
b31ff84b11 | ||
|
|
1dbf850bf1 | ||
|
|
bc9ce0c208 | ||
|
|
4655321e82 | ||
|
|
7328aeacf9 | ||
|
|
1d8e24660c | ||
|
|
252811d116 | ||
|
|
dad0061495 | ||
|
|
75a54088fc | ||
|
|
160f061326 | ||
|
|
51bd610f0c | ||
|
|
ebe7aacf54 | ||
|
|
03c3218a0c | ||
|
|
59a51cc3ed | ||
|
|
15b9cab91c | ||
|
|
7e8e7a24c3 | ||
|
|
414ea91137 | ||
|
|
0a172228f9 | ||
|
|
f36f7c62a5 | ||
|
|
b5260fc0cc | ||
|
|
0dda1f9a3e | ||
|
|
055add5503 | ||
|
|
2ec81d9a18 | ||
|
|
0152770cfe | ||
|
|
310cad4455 | ||
|
|
454f381e11 | ||
|
|
717d769009 | ||
|
|
77b557e954 | ||
|
|
dd08c92f2a | ||
|
|
6bd194b3fa | ||
|
|
061ebaf0b9 | ||
|
|
9529bd2f3a | ||
|
|
f5d90ef9c0 | ||
|
|
6a6a24ee3c | ||
|
|
b313d7c0fd | ||
|
|
793bfde2a6 | ||
|
|
4d319bc2e1 | ||
|
|
8978367505 | ||
|
|
b416748451 | ||
|
|
961989d149 | ||
|
|
0463e210d8 | ||
|
|
e9b064b7f0 | ||
|
|
efd79201dc | ||
|
|
3bc7eb5c59 | ||
|
|
f022de3ff2 | ||
|
|
c47998522a | ||
|
|
56618e0c59 | ||
|
|
e1c499bbe7 | ||
|
|
0fdb91548f | ||
|
|
c0911e55c8 | ||
|
|
2f584530ce | ||
|
|
7f38769d62 | ||
|
|
6a9d4c5ca9 | ||
|
|
f8e609b3b3 | ||
|
|
d5cc1d7754 | ||
|
|
b1d60ec82b | ||
|
|
bada2c29df | ||
|
|
7b453994d8 | ||
|
|
8436004ce6 | ||
|
|
ed0b3a6f4d | ||
|
|
d092852768 | ||
|
|
de948fad37 | ||
|
|
b6f9a62a65 | ||
|
|
09b69a178b | ||
|
|
e199ef7cae | ||
|
|
358a4883c6 | ||
|
|
ff63da5fac | ||
|
|
bd65974d56 | ||
|
|
411a18ec9f | ||
|
|
00136cf9e3 | ||
|
|
67c9853cd2 | ||
|
|
4bf8b3097f | ||
|
|
ca854a434e | ||
|
|
8a8a7f4e95 | ||
|
|
3623872851 | ||
|
|
55c33edeec | ||
|
|
602bcc5361 | ||
|
|
b699b3f9b9 | ||
|
|
92562150ec | ||
|
|
9ac93e1e98 | ||
|
|
8a52b78f3d | ||
|
|
89698730d0 | ||
|
|
9f9ca3faf7 | ||
|
|
019e17c040 | ||
|
|
448bd21195 | ||
|
|
9d14dd25c4 | ||
|
|
b6f714fe44 | ||
|
|
89d15ac306 | ||
|
|
52de478d6a | ||
|
|
7601198799 | ||
|
|
830fdbdaca | ||
|
|
23780ad765 | ||
|
|
72a2510b46 | ||
|
|
1774bca857 | ||
|
|
8150d06abe | ||
|
|
7715579d71 | ||
|
|
db7a02f33d | ||
|
|
16cec77d5b | ||
|
|
0341d1b961 | ||
|
|
0cda79c2d9 | ||
|
|
8f32564580 | ||
|
|
249feb265f | ||
|
|
9b7fb5e28f | ||
|
|
6d26cec36c | ||
|
|
fb39d0973d | ||
|
|
36108255e3 | ||
|
|
acb45dd61c | ||
|
|
2353b94eb7 | ||
|
|
1090494e90 | ||
|
|
fd0b21a5a6 | ||
|
|
f7db0d6cb7 | ||
|
|
b6980ebb8f | ||
|
|
3429546116 | ||
|
|
14180b3a40 | ||
|
|
6251540dc9 | ||
|
|
a7f13f59c1 | ||
|
|
4075db8df5 | ||
|
|
7221f0a8ef | ||
|
|
fd9f4484fa | ||
|
|
34f1ec1f94 | ||
|
|
853f09ccef | ||
|
|
1c59868e79 | ||
|
|
45abf7643c | ||
|
|
cec0c2086c | ||
|
|
332fb8c3ef | ||
|
|
233a70b5e2 | ||
|
|
4c4a3d23eb | ||
|
|
414337e358 | ||
|
|
a2822764e5 | ||
|
|
426f13d495 | ||
|
|
22c824642a | ||
|
|
616ba86bb8 | ||
|
|
5321c29a00 | ||
|
|
eaa146293e | ||
|
|
9da14a6eb2 | ||
|
|
71e4553504 | ||
|
|
a84271f339 | ||
|
|
776fed3834 | ||
|
|
ed03a6f1f8 | ||
|
|
f921204bd4 | ||
|
|
8eda44e96a | ||
|
|
822bc7ffef | ||
|
|
a25d4e0e22 | ||
|
|
8eb76e4da8 | ||
|
|
900b28b97a | ||
|
|
9ab084cee2 | ||
|
|
0e27ee5643 | ||
|
|
7e1fb745b5 | ||
|
|
1025c6798a | ||
|
|
9d52c129e4 | ||
|
|
138c571c75 | ||
|
|
67a598d0be | ||
|
|
1c435e2a67 | ||
|
|
102b65364c | ||
|
|
fe3314d07a | ||
|
|
b74c6d3ee0 | ||
|
|
b560a05e68 | ||
|
|
938f8b2d46 | ||
|
|
8c5fe25137 | ||
|
|
48254ef6d0 | ||
|
|
f4dc5dfee9 | ||
|
|
de71085394 | ||
|
|
1166dd305b | ||
|
|
2b1d0e1012 | ||
|
|
8a8ba06698 | ||
|
|
f70eaae6f5 | ||
|
|
28a7c69f11 | ||
|
|
d15f196249 | ||
|
|
f6ec5b44fe | ||
|
|
7496ec701c | ||
|
|
1cd73239fc | ||
|
|
aa36309755 | ||
|
|
c939f56b56 | ||
|
|
3f412cf745 | ||
|
|
ce50e32a71 | ||
|
|
5e960ae089 | ||
|
|
04c72eea0f | ||
|
|
eeae12ed63 | ||
|
|
9fa2fd0b92 | ||
|
|
5c6bc657f4 | ||
|
|
02d0b6524c | ||
|
|
61ece3d5c5 | ||
|
|
9369f4aea3 | ||
|
|
192e181d8a | ||
|
|
b82f488c54 | ||
|
|
7cd3abb9f8 | ||
|
|
ebce799bdb | ||
|
|
f20eb01d0e | ||
|
|
fd6ecb3901 | ||
|
|
43034bfc30 | ||
|
|
ee0df74f83 | ||
|
|
e364607856 | ||
|
|
5078e42330 | ||
|
|
712b4ce5c4 | ||
|
|
a781d91469 | ||
|
|
e5b2243565 | ||
|
|
1ec65e0589 | ||
|
|
d03e1bd940 | ||
|
|
a1bc833c3f | ||
|
|
5b0b22fe28 | ||
|
|
0ee93311e9 | ||
|
|
8ba58b33ae | ||
|
|
2f023619e9 | ||
|
|
eaab8a8242 | ||
|
|
fbd92432b1 | ||
|
|
bbba60fa3f | ||
|
|
e907abd201 | ||
|
|
5bde9c7b56 | ||
|
|
38690cd872 | ||
|
|
92e05a521d | ||
|
|
d909b6cb75 | ||
|
|
53045c7377 | ||
|
|
4721d852bf | ||
|
|
954233c67d | ||
|
|
f4b7ce7f20 | ||
|
|
5728e44c3d | ||
|
|
7c20573ef2 | ||
|
|
22e7100281 | ||
|
|
5e206952f4 | ||
|
|
920627e75f | ||
|
|
2dada142ba | ||
|
|
26aabf9e2d | ||
|
|
9d68bebac4 | ||
|
|
4112213431 | ||
|
|
7bc2523f57 | ||
|
|
7773c2504f | ||
|
|
b74e50d7e6 | ||
|
|
c9b270b035 | ||
|
|
efb61ca449 | ||
|
|
86a913d5b1 | ||
|
|
feca86b812 | ||
|
|
16fe32f908 | ||
|
|
a798501af3 | ||
|
|
77a033999d | ||
|
|
7b33e1c752 | ||
|
|
ccdcee471b | ||
|
|
e79416c801 | ||
|
|
15658c56d5 | ||
|
|
c681071c65 | ||
|
|
5ed012c6e5 | ||
|
|
d75499d076 | ||
|
|
2905b6096e | ||
|
|
5453a7a79b | ||
|
|
af7f01750b | ||
|
|
7b96c31789 | ||
|
|
5b20b70b66 | ||
|
|
3399db3471 | ||
|
|
0ca6f7366b | ||
|
|
09a840b6c3 | ||
|
|
f3aa82e4ba | ||
|
|
d6bff9f364 | ||
|
|
e3b3a8bbec | ||
|
|
8bca07597d | ||
|
|
5fa75e981b | ||
|
|
e22ba4a3d2 | ||
|
|
624407afcc | ||
|
|
34f7bf1e68 | ||
|
|
96a9d1f4e5 | ||
|
|
89c40d9be6 | ||
|
|
1a26f9a42e | ||
|
|
80f9839253 | ||
|
|
82d4bb9df6 | ||
|
|
d45ed9d78e | ||
|
|
00b04e9691 | ||
|
|
1cfb3dfaa3 | ||
|
|
85687d5d88 | ||
|
|
8b920938de | ||
|
|
70d522a6d4 | ||
|
|
11241cd8da | ||
|
|
4b3a8ff24f | ||
|
|
fdce9453bc | ||
|
|
ca7e4346f0 | ||
|
|
3a6bd97fc8 | ||
|
|
9d8314a65a | ||
|
|
2faa3a0ae2 | ||
|
|
62384bedb4 | ||
|
|
fd41237049 | ||
|
|
faa60854f9 | ||
|
|
0a247c57ca | ||
|
|
95da49edf3 | ||
|
|
3ff9722903 | ||
|
|
b5d5087550 | ||
|
|
84592e1f5d | ||
|
|
f8d8abd70b | ||
|
|
d02b05f1a7 | ||
|
|
73273a48da | ||
|
|
079f0565d7 | ||
|
|
5b8eeba33d | ||
|
|
e2206a5849 | ||
|
|
d3dbfd8c6e | ||
|
|
1395b5f66c | ||
|
|
429aff6991 | ||
|
|
4e8b6dc21d | ||
|
|
c5582f5085 | ||
|
|
a84b9cf89d | ||
|
|
d02dfe0966 | ||
|
|
3ac710d260 | ||
|
|
20186dd991 | ||
|
|
9bb2ae7772 | ||
|
|
892f49ffb2 | ||
|
|
296372cf5f | ||
|
|
1e5a12708d | ||
|
|
09ded05029 | ||
|
|
47089ec3e1 | ||
|
|
93c1013eff | ||
|
|
d74cbcb26d | ||
|
|
2e21b1d596 | ||
|
|
d4f68f8986 | ||
|
|
84774abc2c | ||
|
|
e444abc3d1 | ||
|
|
1ac1cbf8de | ||
|
|
73ec501b20 | ||
|
|
f64c0136d7 | ||
|
|
66746b7e18 | ||
|
|
4ec7c5c3f6 | ||
|
|
003c22e772 | ||
|
|
5ae622fb28 | ||
|
|
611188e32c | ||
|
|
08b55f54c5 | ||
|
|
a02afa7641 | ||
|
|
2f76d0bc5a | ||
|
|
51c6165983 | ||
|
|
1f77162fef | ||
|
|
764f23c1b8 | ||
|
|
a8cbcd7150 | ||
|
|
dd7906a1d9 | ||
|
|
fd71ba3fec | ||
|
|
adec349442 | ||
|
|
842b09b2f5 | ||
|
|
8882c5e79a | ||
|
|
c9dee9bcd1 | ||
|
|
965fa8da72 | ||
|
|
22ef8998fb | ||
|
|
b5d1f8d569 | ||
|
|
001755285b | ||
|
|
3fef69e9bf | ||
|
|
ab0395e8c9 | ||
|
|
bb5a37e0ef | ||
|
|
63e4f2305f | ||
|
|
8befaf1ae6 | ||
|
|
736c269790 | ||
|
|
9140024505 | ||
|
|
01d715053a | ||
|
|
2af5a71c91 | ||
|
|
a1662ed122 | ||
|
|
be86aa3c37 | ||
|
|
16bdaa5b50 | ||
|
|
f30acef13a | ||
|
|
bb833f7641 | ||
|
|
225eda7d18 | ||
|
|
07a2920ef6 | ||
|
|
252ac1e008 | ||
|
|
eed9d743c1 | ||
|
|
d9910be2ea | ||
|
|
8abe26fde8 | ||
|
|
2b1a2e1357 | ||
|
|
a746d9b122 | ||
|
|
c1456e9db9 | ||
|
|
48791de235 | ||
|
|
ac8c35fa9d | ||
|
|
cde20fd1b9 | ||
|
|
0e86d0c33a | ||
|
|
758ee4bef7 | ||
|
|
5cf7b54c41 | ||
|
|
234607a3dd | ||
|
|
c23b58d416 | ||
|
|
c07ac38ddb | ||
|
|
183451c607 | ||
|
|
aa451769ce | ||
|
|
ffc5ee41f9 | ||
|
|
ec69a624e0 | ||
|
|
42751b532e | ||
|
|
3a80f4296f | ||
|
|
863b5e4303 | ||
|
|
de7190eb24 | ||
|
|
72a13b8586 | ||
|
|
2ed9107dc0 | ||
|
|
d9ee7a6b5e | ||
|
|
4682a9bbfa | ||
|
|
4f2d91d30b | ||
|
|
6323e09ba9 | ||
|
|
0ccb67c2ef | ||
|
|
fdaff88ff7 | ||
|
|
49589ab9b1 | ||
|
|
568e69d537 | ||
|
|
2890d4a196 | ||
|
|
35305eb56e | ||
|
|
0ccc9c2802 | ||
|
|
71cb371a1a | ||
|
|
9c832c58ad | ||
|
|
11c2feb486 | ||
|
|
27db2c8169 | ||
|
|
d3bb30c1d5 | ||
|
|
882200d897 | ||
|
|
fa800c532a | ||
|
|
2977297582 | ||
|
|
58709579cc | ||
|
|
f403a0c705 | ||
|
|
06e328eb0b | ||
|
|
afc22d2ba0 | ||
|
|
1819296689 | ||
|
|
8710651e45 | ||
|
|
1bcc8e7fbd | ||
|
|
35b74ef7d6 | ||
|
|
3646b8cbe7 | ||
|
|
f23394dd53 | ||
|
|
18e7d44790 | ||
|
|
58ee81186f | ||
|
|
8d6e02c373 | ||
|
|
0a98a5ca44 | ||
|
|
3ff33915c0 | ||
|
|
6808e132f3 | ||
|
|
1212f640c0 | ||
|
|
8fbb1afae9 | ||
|
|
5efcd7652f | ||
|
|
9ab11b497e | ||
|
|
c1cb839d7d | ||
|
|
801fcfbf34 | ||
|
|
375fb90bed | ||
|
|
45b15db4c6 | ||
|
|
d3a1bd58eb | ||
|
|
00e19d474e | ||
|
|
fab5a769e4 | ||
|
|
ba3df067f3 | ||
|
|
22ffe7f645 | ||
|
|
0b7dfad2cf | ||
|
|
28ce9c657c | ||
|
|
a3c8a832a2 | ||
|
|
8ef582eaf5 | ||
|
|
4b2ca3bd28 | ||
|
|
619fb3a590 | ||
|
|
156828ac1f | ||
|
|
57950b25fd | ||
|
|
6318b1a836 | ||
|
|
e79c8d0b87 | ||
|
|
1da17070f5 | ||
|
|
82cf80cbc3 | ||
|
|
57be3472a2 | ||
|
|
3a61d3f2c9 | ||
|
|
7f13a3035c | ||
|
|
06e2e60364 | ||
|
|
6b8214ea6a | ||
|
|
27026eced9 | ||
|
|
c8e755e5a8 | ||
|
|
101b0d7e12 | ||
|
|
bb28eed850 | ||
|
|
88a1b168ad | ||
|
|
7b17ceeefa | ||
|
|
e18220e8eb | ||
|
|
0e51a7a529 | ||
|
|
0029d891a6 | ||
|
|
b6c9c42144 | ||
|
|
237d623d31 | ||
|
|
639e75b8ae | ||
|
|
455f91c215 | ||
|
|
eed0f219a1 | ||
|
|
de877188c1 | ||
|
|
818dea526b | ||
|
|
4c07ef386e | ||
|
|
61c913dff0 | ||
|
|
bf9f0e6eb8 | ||
|
|
e1b48219df | ||
|
|
b75383670c | ||
|
|
4f15a2e408 | ||
|
|
037ba0212a | ||
|
|
a92cd402d6 | ||
|
|
21102855a7 | ||
|
|
6d03ec417a | ||
|
|
237d8d5b90 | ||
|
|
fd44a5f0e8 | ||
|
|
ec04a1bbbd | ||
|
|
35f3c56b96 | ||
|
|
ca56cbdaf7 | ||
|
|
cc222b3ca7 | ||
|
|
1fd2674795 | ||
|
|
f848220c59 | ||
|
|
0ae23ec0d1 | ||
|
|
7ad0874162 | ||
|
|
3cbe24ad8c | ||
|
|
a3e6bbb862 | ||
|
|
1edf2a6ae1 | ||
|
|
508cf6fba9 | ||
|
|
3a3a20e537 | ||
|
|
e72345334a | ||
|
|
7f3a6a5a40 | ||
|
|
b14bae17ae | ||
|
|
c89d710fdd | ||
|
|
a79d80e11a | ||
|
|
ad092a37f3 | ||
|
|
d4030302c9 | ||
|
|
fba2a97ab6 | ||
|
|
a2555bab6b | ||
|
|
eff943bbcf | ||
|
|
47ae685061 | ||
|
|
9a75f66e29 | ||
|
|
5672008258 | ||
|
|
5ecc8fe61e | ||
|
|
01c2c563fb | ||
|
|
c570b91c96 | ||
|
|
fb7232dc82 | ||
|
|
60dcff1475 | ||
|
|
0698c3316b | ||
|
|
db49600983 | ||
|
|
33c51e3704 | ||
|
|
8d388632cf | ||
|
|
106ffcfbd6 | ||
|
|
38f6c4bce1 | ||
|
|
53231470fc | ||
|
|
715aeb91d9 | ||
|
|
d77fe3afe8 | ||
|
|
b93aacbba2 | ||
|
|
618ef9925b | ||
|
|
6549f135d1 | ||
|
|
8da132d4ce | ||
|
|
d8a146d6f3 | ||
|
|
a6c11e27b1 | ||
|
|
275b82e51e | ||
|
|
6f8a8834b8 | ||
|
|
d51a5a9068 | ||
|
|
4ee6eb2e2d | ||
|
|
7d13c12252 | ||
|
|
3913f4418e | ||
|
|
ff4b7c54d8 | ||
|
|
1e8fdd41c9 | ||
|
|
7b9a485f17 | ||
|
|
8af405a3e8 | ||
|
|
ae52d75335 | ||
|
|
20dfc743e0 | ||
|
|
6571096107 | ||
|
|
6e6779f401 | ||
|
|
b79ade4c1f | ||
|
|
61f90ab20c | ||
|
|
9c899899f3 | ||
|
|
3401bd6249 | ||
|
|
92048de0f5 | ||
|
|
01e37657a6 | ||
|
|
f7e688f580 | ||
|
|
566aec36c6 | ||
|
|
eeaa02390e | ||
|
|
2893311770 | ||
|
|
9790bf61c6 | ||
|
|
13d872a265 | ||
|
|
94217e800d | ||
|
|
3b23e76237 | ||
|
|
7b12b10f9b | ||
|
|
68d92e59d2 | ||
|
|
76a2945d88 | ||
|
|
99f5ede0ec | ||
|
|
3a01cd9002 | ||
|
|
60fbdb1bc9 | ||
|
|
76399298dc | ||
|
|
b79aaf99d7 | ||
|
|
27aa36b537 | ||
|
|
a7e54c5e36 | ||
|
|
f2455704d2 | ||
|
|
354559aa19 | ||
|
|
820f3f44c7 | ||
|
|
47c4ebeb14 | ||
|
|
e26c965b7c | ||
|
|
3ba8daab0c | ||
|
|
f99df3ddc8 | ||
|
|
2e3d1b0ccd | ||
|
|
ec27124e24 | ||
|
|
c3e043d656 | ||
|
|
06a5ea19c4 | ||
|
|
3cc2f1b146 | ||
|
|
7dee283762 | ||
|
|
949c111f68 | ||
|
|
d07ce2bd08 | ||
|
|
8838ad7636 | ||
|
|
5180d59fc3 | ||
|
|
723df03c0d | ||
|
|
b5394f763a | ||
|
|
9c04379799 | ||
|
|
7f6966ee06 | ||
|
|
0aa629cfe0 | ||
|
|
bd4b90eadf | ||
|
|
b6a49cb4bd | ||
|
|
d770d37e29 | ||
|
|
2c5be593c4 | ||
|
|
5929de443e | ||
|
|
7b9a878af2 | ||
|
|
d37d84b66e | ||
|
|
a994dbf674 | ||
|
|
f1b4379a0e | ||
|
|
200c88a55b | ||
|
|
417bdc88ce | ||
|
|
35602c6ff4 | ||
|
|
4255228273 | ||
|
|
c39939fb21 | ||
|
|
263cba5c0e | ||
|
|
4cffb37310 | ||
|
|
e2cd37a178 | ||
|
|
4d65ce61d6 | ||
|
|
e9ac39c031 | ||
|
|
cb99921d7c | ||
|
|
b02d1e0ada | ||
|
|
7a93278cb7 | ||
|
|
750e1ccc90 | ||
|
|
72b746ddd3 | ||
|
|
4abad0b347 | ||
|
|
f1e45a3f69 | ||
|
|
f373c65b08 | ||
|
|
5c43f8a2cf | ||
|
|
8531f6a2aa | ||
|
|
509e93e425 | ||
|
|
6ca16f700d | ||
|
|
8ed5f73a71 | ||
|
|
98a179f638 | ||
|
|
9464f88162 | ||
|
|
1d37667947 | ||
|
|
84ac2a32ee | ||
|
|
9f151233be | ||
|
|
c92b7874a3 | ||
|
|
91c35d4e40 | ||
|
|
15054810ba | ||
|
|
8dd0aeb1c8 | ||
|
|
041f50a438 | ||
|
|
fb99d6e736 | ||
|
|
8d1cb356c3 | ||
|
|
9403eb5aab | ||
|
|
94c75d399d | ||
|
|
d280468216 | ||
|
|
c019159f05 | ||
|
|
a303b97330 | ||
|
|
382a211962 | ||
|
|
a4852508e3 | ||
|
|
d803fc5f28 | ||
|
|
4d23bfbffa | ||
|
|
3fbee82d99 | ||
|
|
ca52029551 | ||
|
|
9fa9d395dc | ||
|
|
cf621642fb | ||
|
|
61188c10c0 | ||
|
|
219cd50c17 | ||
|
|
de83d6b1c8 | ||
|
|
7d89635c5b | ||
|
|
bd2ff84a95 | ||
|
|
af872c27f7 | ||
|
|
753fbda91e | ||
|
|
48391fdbfa | ||
|
|
d213cc82f0 | ||
|
|
043e1520a6 | ||
|
|
2aa45a3897 | ||
|
|
8558744df1 | ||
|
|
60ed6ed3ca | ||
|
|
da1ea959cb | ||
|
|
7786bfcd0a | ||
|
|
aef5a5ee91 | ||
|
|
0f397ece1c | ||
|
|
26aefd139e | ||
|
|
26a78801d5 | ||
|
|
37a67f6fa6 |
@@ -18,6 +18,8 @@ insert_final_newline = true
|
||||
indent_style = tab
|
||||
[*.css]
|
||||
indent_style = tab
|
||||
[*.sh]
|
||||
indent_style = tab
|
||||
[*.xml]
|
||||
indent_style = tab
|
||||
[*.md]
|
||||
|
||||
1
.github/workflows/ci-on-pull_request.yml
vendored
1
.github/workflows/ci-on-pull_request.yml
vendored
@@ -9,6 +9,7 @@ jobs:
|
||||
with:
|
||||
gh_event: ${{ github.event_name }}
|
||||
phan:
|
||||
# if: false # Uncommenting this line disables phan
|
||||
uses: ./.github/workflows/phan.yml
|
||||
secrets: inherit
|
||||
needs: [pre-commit]
|
||||
|
||||
58
.github/workflows/phan.yml
vendored
58
.github/workflows/phan.yml
vendored
@@ -13,7 +13,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: phan-${{ github.workflow }}-${{ github.ref }}
|
||||
group: phan-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
@@ -34,13 +34,65 @@ jobs:
|
||||
|| github.event.schedule == false
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
# Another method to get the list of changed files
|
||||
# It sets the variable steps.changed-php.outputs.all_changed_files for other steps
|
||||
- name: Get all changed php files (if PR)
|
||||
id: changed-php
|
||||
if: env.gh_event == 'pull_request'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./.github/scripts/get_changed_php.sh
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: 8.2
|
||||
coverage: none # disable xdebug, pcov
|
||||
tools: phan
|
||||
tools: cs2pr,phan:5.5.2
|
||||
|
||||
|
||||
- name: Run Phan analysis
|
||||
# Proceed when:
|
||||
# - the action is not cancelled
|
||||
# AND
|
||||
# - the branch is an integration branch (no merge), or,
|
||||
# - the merge from branch contains 'phan_full', or,
|
||||
# - there are changes in PHP files.
|
||||
# Note: --output-mode=github does not provide file:line, so using checkstyle and cs2pr
|
||||
if: ${{ ! cancelled() && (github.ref_name == 'develop' || github.ref_name == 'refs/heads/develop' || endsWith(github.ref_name, '.0') || contains(github.head_ref, 'phan_full') || steps.changed-php.outputs.any_changed == 'true') }}
|
||||
env:
|
||||
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
|
||||
# shellcheck disable=2086
|
||||
FILE_CHANGED_LIST: /tmp/phan-changed.lst
|
||||
run: |
|
||||
# shellcheck disable=2086
|
||||
phan $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=github
|
||||
if [ "${{ github.ref_name }}" == "develop" ] || [[ "${{ github.ref_name }}" == *.0 ]]|| [[ "${{ github.head_ref }}" == *"phan_full"* ]] ; then
|
||||
echo phan $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=checkstyle -o _phan.xml
|
||||
phan $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=checkstyle -o _phan.xml
|
||||
else
|
||||
echo -n "" > "$FILE_CHANGED_LIST"
|
||||
for f in $ALL_CHANGED_FILES; do echo "$f" >> "$FILE_CHANGED_LIST"; done
|
||||
# Must exclude same files as in phan configuration
|
||||
grep -v -E '^htdocs/(custom/|.*/canvas/.*/tpl/.*.tpl.php|admin/tools/ui/|includes/(nusoap/|restler/|stripe/)|conf/conf.php)$' "$FILE_CHANGED_LIST"> "$FILE_CHANGED_LIST".tmp || true
|
||||
mv "$FILE_CHANGED_LIST".tmp "$FILE_CHANGED_LIST"
|
||||
if [ ! -s "$FILE_CHANGED_LIST" ] ; then
|
||||
echo "All changed files are excluded for phan"
|
||||
else
|
||||
echo phan --file-list "$FILE_CHANGED_LIST" $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=checkstyle -o _phan.xml
|
||||
phan --file-list "$FILE_CHANGED_LIST" $PHAN_QUICK -k "$PHAN_CONFIG" -B "$PHAN_BASELINE" --analyze-twice --minimum-target-php-version "$PHAN_MIN_PHP" --output-mode=checkstyle -o _phan.xml
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Add results to PR as Github notices
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
cs2pr --prepend-filename --prepend-source --notices-as-warnings _phan.xml
|
||||
|
||||
- name: Provide phan log as artifact
|
||||
uses: actions/upload-artifact@v6
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
name: phan-srcrt
|
||||
path: ${{ github.workspace }}/_phan.xml
|
||||
retention-days: 2
|
||||
|
||||
44
.github/workflows/phpstan.yml
vendored
44
.github/workflows/phpstan.yml
vendored
@@ -62,14 +62,55 @@ jobs:
|
||||
phpstan-cache-${{ matrix.php-version }}-${{ github.head_ref }}-
|
||||
phpstan-cache-${{ matrix.php-version }}-${{ github.base_ref }}-
|
||||
phpstan-cache-${{ matrix.php-version }}-
|
||||
|
||||
- name: Show debug into
|
||||
run: cd ./.github/tmp && ls -al
|
||||
|
||||
# Another method to get the list of changed files
|
||||
# It sets the variable steps.changed-php.outputs.all_changed_files for other steps
|
||||
- name: Get all changed php files (if PR)
|
||||
id: changed-php
|
||||
if: env.gh_event == 'pull_request'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./.github/scripts/get_changed_php.sh
|
||||
|
||||
#- name: Get changed PHP files
|
||||
# id: files
|
||||
# run: |
|
||||
# git fetch origin ${{ github.base_ref }}
|
||||
# FILES=$(git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep '\.php$' || true)
|
||||
# {
|
||||
# echo "files<<EOF"
|
||||
# echo "$FILES"
|
||||
# echo "EOF"
|
||||
# } > "$GITHUB_OUTPUT"
|
||||
|
||||
# Run PHPStan
|
||||
- name: Run PHPStan
|
||||
id: phpstan
|
||||
# Proceed when:
|
||||
# - the action is not cancelled
|
||||
# AND
|
||||
# - the branch is an integration branch (no merge), or,
|
||||
# - the merge from branch contains 'phpstan_full', or,
|
||||
# - there are changes in PHP files.
|
||||
if: ${{ ! cancelled() && (github.ref_name == 'develop' || github.ref_name == 'refs/heads/develop' || endsWith(github.ref_name, '.0') || contains(github.head_ref, 'phpstan_full') || steps.changed-php.outputs.any_changed == 'true') }}
|
||||
env:
|
||||
ALL_CHANGED_FILES: ${{ steps.changed-php.outputs.all_changed_files }}
|
||||
# shellcheck disable=2086
|
||||
run: |
|
||||
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings
|
||||
# shellcheck disable=2086
|
||||
> /tmp/phpstan-files.txt
|
||||
if [ "${{ github.ref_name }}" == "develop" ] || [[ "${{ github.ref_name }}" == *.0 ]]|| [[ "${{ github.head_ref }}" == *"phpstan_full"* ]] ; then
|
||||
# Run on all files in integration branch
|
||||
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php | tee _stan.xml | cs2pr --graceful-warnings
|
||||
|
||||
else
|
||||
echo "$ALL_CHANGED_FILES" >> /tmp/phpstan-files.txt
|
||||
cat /tmp/phpstan-files.txt
|
||||
phpstan -vvv analyse --error-format=checkstyle --memory-limit 7G -a dev/build/phpstan/bootstrap_action.php ${ALL_CHANGED_FILES} | tee _stan.xml | cs2pr --graceful-warnings
|
||||
fi
|
||||
# continue-on-error: true
|
||||
|
||||
# Save cache
|
||||
@@ -87,6 +128,7 @@ jobs:
|
||||
name: phpstan-srcrt
|
||||
path: ${{ github.workspace }}/_stan.xml
|
||||
retention-days: 2
|
||||
|
||||
# Run PHPStan generate baseline
|
||||
# - name: Run PHPStan generate baseline
|
||||
# id: phpstan-baseline
|
||||
|
||||
9
.github/workflows/pre-commit.yml
vendored
9
.github/workflows/pre-commit.yml
vendored
@@ -12,8 +12,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: pre-commit-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
|
||||
}}
|
||||
group: pre-commit-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
env:
|
||||
gh_event: ${{ inputs.gh_event || github.event_name }}
|
||||
@@ -110,15 +109,15 @@ jobs:
|
||||
tools: phpcs
|
||||
|
||||
# Install perltidy and perlcritic
|
||||
- name: Install perltidy and perlcritic
|
||||
run: sudo apt-get update && sudo apt-get install -y perltidy libperl-critic-perl
|
||||
#- name: Install perltidy and perlcritic
|
||||
# run: sudo apt-get update && sudo apt-get install -y perltidy libperl-critic-perl
|
||||
|
||||
# Run all the precommit tools (defined into pre-commit-config.yaml).
|
||||
# We can force exclusion of some of them here.
|
||||
- name: Run pre-commit hooks
|
||||
env:
|
||||
# SKIP is used by pre-commit to not execute certain hooks
|
||||
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer
|
||||
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer,shellcheck
|
||||
run: |
|
||||
set -o pipefail
|
||||
pre-commit gc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
exclude: (?x)^( htdocs/includes/ckeditor/.*|htdocs/public/includes/ckeditor/.*|(\.(?!github/workflows)[^/]*/.*))$
|
||||
exclude: (?x)^( htdocs/includes/ckeditor/.*|htdocs/public/includes/ckeditor/.*|htdocs/public/includes/jquery/.*|(\.(?!github/workflows)[^/]*/.*))$
|
||||
repos:
|
||||
# Several miscellaneous checks and fix (on yaml files, end of files fix)
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
@@ -60,25 +60,28 @@ repos:
|
||||
|
||||
# Gitleaks is a SAST tool for detecting and preventing hardcoded secrets like passwords, api keys, and tokens in git repos
|
||||
- repo: https://github.com/gitleaks/gitleaks.git
|
||||
rev: v8.29.0
|
||||
rev: v8.30.0
|
||||
hooks:
|
||||
- id: gitleaks
|
||||
|
||||
# Check github actions
|
||||
- repo: https://github.com/rhysd/actionlint
|
||||
rev: v1.7.8
|
||||
rev: v1.7.11
|
||||
hooks:
|
||||
- id: actionlint
|
||||
stages: [manual] # To run: pre-commit run -a --hook-stage=manual actionlint
|
||||
|
||||
# Beautify shell scripts
|
||||
- repo: https://github.com/lovesegfault/beautysh.git
|
||||
rev: v6.2.1
|
||||
hooks:
|
||||
- id: beautysh
|
||||
exclude: |
|
||||
(?x)^(dev/setup/git/hooks/pre-commit
|
||||
)$
|
||||
args: [--tab]
|
||||
#- repo: https://github.com/lovesegfault/beautysh.git
|
||||
# rev: v6.4.2
|
||||
# hooks:
|
||||
# - id: beautysh
|
||||
# exclude: |
|
||||
# (?x)^(dev/setup/git/hooks/pre-commit
|
||||
# |dev/initdemo/initdemo.sh # indent/outdent mismatch
|
||||
# |dev/build/debian/dolibarr.postrm # indent/outdent mismatch
|
||||
# )$
|
||||
# args: [--tab]
|
||||
|
||||
# Run local script
|
||||
#
|
||||
@@ -193,7 +196,7 @@ repos:
|
||||
|
||||
# Check format of yaml files
|
||||
- repo: https://github.com/adrienverge/yamllint.git
|
||||
rev: v1.37.1
|
||||
rev: v1.38.0
|
||||
hooks:
|
||||
- id: yamllint
|
||||
args:
|
||||
@@ -249,11 +252,12 @@ repos:
|
||||
rev: v0.11.0.1
|
||||
hooks:
|
||||
- id: shellcheck
|
||||
stages: [manual] # To run: `pre-commit run -a --hook-stage=manual shellcheck`
|
||||
args: [-W, "100"]
|
||||
|
||||
# Check sql file syntax
|
||||
- repo: https://github.com/sqlfluff/sqlfluff
|
||||
rev: 3.3.1
|
||||
rev: 4.0.4
|
||||
hooks:
|
||||
- id: sqlfluff-lint
|
||||
stages: [pre-commit, manual] # manual needed for ci
|
||||
@@ -275,15 +279,15 @@ repos:
|
||||
|htdocs/modulebuilder/template/sql/.*\.sql
|
||||
)$
|
||||
|
||||
- repo: https://github.com/perltidy/perltidy
|
||||
rev: '20250105.03'
|
||||
hooks:
|
||||
- id: perltidy
|
||||
# virtualmin excuded - reason https://github.com/Dolibarr/dolibarr/pull/36370#issuecomment-3565101823
|
||||
exclude: (?x)^
|
||||
(dev/build/perl/virtualmin/dolibarr.pl
|
||||
)$
|
||||
args: [ --tabs, --nola ]
|
||||
#- repo: https://github.com/perltidy/perltidy
|
||||
# rev: '20250105.03'
|
||||
# hooks:
|
||||
# - id: perltidy
|
||||
# # virtualmin excuded - reason https://github.com/Dolibarr/dolibarr/pull/36370#issuecomment-3565101823
|
||||
# exclude: (?x)^
|
||||
# (dev/build/perl/virtualmin/dolibarr.pl
|
||||
# )$
|
||||
# args: [ --tabs, --nola ]
|
||||
|
||||
#- repo: https://github.com/henryykt/pre-commit-perl
|
||||
# rev: v0.0.5
|
||||
@@ -292,4 +296,4 @@ repos:
|
||||
# # virtualmin excluded - reason https://github.com/Dolibarr/dolibarr/pull/36370#issuecomment-3565101823
|
||||
# exclude: (?x)^
|
||||
# (dev/build/perl/virtualmin/dolibarr.pl
|
||||
# )$
|
||||
# across all file typese )$
|
||||
|
||||
@@ -531,6 +531,9 @@ script:
|
||||
php upgrade.php 22.0.0 23.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade22002300.log || cat $TRAVIS_BUILD_DIR/upgrade22002300.log
|
||||
php upgrade2.php 22.0.0 23.0.0 > $TRAVIS_BUILD_DIR/upgrade22002300-2.log || cat $TRAVIS_BUILD_DIR/upgrade22002300-2.log
|
||||
php step5.php 22.0.0 23.0.0 > $TRAVIS_BUILD_DIR/upgrade22002300-3.log || cat $TRAVIS_BUILD_DIR/upgrade22002300-3.log
|
||||
php upgrade.php 23.0.0 24.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade23002400.log || cat $TRAVIS_BUILD_DIR/upgrade23002400.log
|
||||
php upgrade2.php 23.0.0 24.0.0 > $TRAVIS_BUILD_DIR/upgrade23002400-2.log || cat $TRAVIS_BUILD_DIR/upgrade23002400-2.log
|
||||
php step5.php 23.0.0 24.0.0 > $TRAVIS_BUILD_DIR/upgrade23002400-3.log || cat $TRAVIS_BUILD_DIR/upgrade23002400-3.log
|
||||
set +e
|
||||
echo
|
||||
|
||||
@@ -571,6 +574,8 @@ script:
|
||||
# Execute phpunit, check its exit status and that the phpunit output shows a test summary
|
||||
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php | tee /dev/tty | grep -qE "(OK .*[0-9]+ tests.*[0-9]+ assertions|Tests: [0-9]+)" ; phpunitresult=$((PIPESTATUS[0]?PIPESTATUS[0]:PIPESTATUS[2]))
|
||||
echo "Phpunit return code = $phpunitresult"
|
||||
echo "Content of end of apache error.log"
|
||||
sudo tail -n 200 /var/log/apache2/travis_error_log
|
||||
# Comment next line if you want to go to the end to see the dolibarr.log file.
|
||||
[ $phpunitresult == 0 ] || exit $phpunitresult
|
||||
echo
|
||||
|
||||
@@ -189,6 +189,8 @@ NEW: action to clone ticket
|
||||
WARNING:
|
||||
--------
|
||||
The following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* If you were using the website module with PHP page, you must add the following parameter $dolibarr_website_allow_custom_php=2; into your conf.php to continue to be
|
||||
allowed to edit PHP content into the website module.
|
||||
* The deprecated column "egroupware_id" has been dropped from table llx_user.
|
||||
* The property $sumpayed (duplicated of $totalpaid), $sumdeposit (duplicate of $totaldeposits) and $sumcreditnote (duplicate of $totalcreditnotes) has
|
||||
been removed (there are replaced with the property that was a duplication of (same for $sumpayed_multicurrency, $sumdeposit_multicurrency, $sumcreditnote_multicurrency).
|
||||
|
||||
2
dev/build/.gitignore
vendored
2
dev/build/.gitignore
vendored
@@ -7,4 +7,4 @@
|
||||
/dolibarr-*.zip
|
||||
/*.exe
|
||||
/html
|
||||
/makepack-dolibarr.pl.bak
|
||||
/*.bak
|
||||
|
||||
@@ -299,12 +299,12 @@ If script fails with error Bad certificate, you can set "export PERL_LWP_SSL_VER
|
||||
|
||||
* Edit orig.tar.gz file to remove
|
||||
- debian
|
||||
- htdocs/includes/ckeditor
|
||||
- htdocs/includes/jquery/css
|
||||
- htdocs/includes/jquery/js
|
||||
- htdocs/includes/jquery/plugins/flot
|
||||
- htdocs/includes/jquery/plugins/multiselect
|
||||
- htdocs/includes/jquery/plugins/datatables
|
||||
- htdocs/public/includes/ckeditor
|
||||
- htdocs/public/includes/jquery/css
|
||||
- htdocs/public/includes/jquery/js
|
||||
- htdocs/public/includes/jquery/plugins/flot
|
||||
- htdocs/public/includes/jquery/plugins/multiselect
|
||||
- htdocs/public/includes/jquery/plugins/datatables
|
||||
- htdocs/includes/jszip
|
||||
- htdocs/includes/mike42
|
||||
- htdocs/includes/phpoffice
|
||||
|
||||
@@ -61,7 +61,7 @@ License: GPL-3+
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/ckeditor/*
|
||||
Files: htdocs/public/includes/ckeditor/*
|
||||
Copyright: 2003-2012 CKSource - Frederico Knabben
|
||||
License: GPL-2+
|
||||
The ckeditor is triple licensed under the GNU General Public License (GPL),
|
||||
@@ -190,7 +190,7 @@ License: CC-By-SA
|
||||
|
||||
------------------------------------------------------------
|
||||
|
||||
Files: htdocs/includes/jquery/*
|
||||
Files: htdocs/public/includes/jquery/*
|
||||
Copyright: JQuery team
|
||||
https://www.jquery.com
|
||||
License: GPL-2+ or MIT
|
||||
|
||||
@@ -97,10 +97,9 @@ override_dh_install:
|
||||
# rm -fr htdocs/includes/nusoap
|
||||
# rm -fr htdocs/includes/odtphp/zip/pclzip
|
||||
# clean from all JS-CSS embedded libraries (we use package dependencies instead)
|
||||
# rm -fr htdocs/includes/ckeditor
|
||||
# rm -fr htdocs/includes/jquery/js
|
||||
# rm -fr htdocs/includes/jquery/css
|
||||
# rm -fr htdocs/includes/jquery/plugins/flot
|
||||
# rm -fr htdocs/public/includes/ckeditor
|
||||
# rm -fr htdocs/public/includes/jquery/js
|
||||
# rm -fr htdocs/public/includes/jquery/css
|
||||
# clean from all embedded fonts (we use package dependencies instead)
|
||||
# rm -fr htdocs/includes/fonts
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# Remove warning, we want to keep both standard and minified sources.
|
||||
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jquery/*
|
||||
dolibarr: source-contains-prebuilt-javascript-object htdocs/public/includes/jquery/*
|
||||
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jsgantt/*
|
||||
dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jstz/*
|
||||
# Those are false positives, the files are their own sources since
|
||||
# they are not minified
|
||||
source-is-missing htdocs/includes/ckeditor/ckeditor/plugins/a11yhelp/dialogs/lang/*.js
|
||||
source-is-missing htdocs/includes/ckeditor/ckeditor/plugins/specialchar/dialogs/lang/*.js
|
||||
source-is-missing htdocs/includes/ckeditor/ckeditor/lang/*.js
|
||||
source-is-missing htdocs/includes/ckeditor/ckeditor/plugins/*/dialogs/*.js
|
||||
source-is-missing htdocs/includes/ckeditor/ckeditor/plugins/*/filter/*.js
|
||||
source-is-missing htdocs/includes/ckeditor/ckeditor/plugins/templates/templates/default.js
|
||||
source-is-missing htdocs/public/includes/ckeditor/ckeditor/plugins/a11yhelp/dialogs/lang/*.js
|
||||
source-is-missing htdocs/public/includes/ckeditor/ckeditor/plugins/specialchar/dialogs/lang/*.js
|
||||
source-is-missing htdocs/public/includes/ckeditor/ckeditor/lang/*.js
|
||||
source-is-missing htdocs/public/includes/ckeditor/ckeditor/plugins/*/dialogs/*.js
|
||||
source-is-missing htdocs/public/includes/ckeditor/ckeditor/plugins/*/filter/*.js
|
||||
source-is-missing htdocs/public/includes/ckeditor/ckeditor/plugins/templates/templates/default.js
|
||||
source-is-missing htdocs/includes/restler/framework/Luracast/Restler/explorer/lib/*.js
|
||||
# Those are false positives, the files are their own sources since
|
||||
# they are data files
|
||||
|
||||
@@ -40,9 +40,11 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
|
||||
define('DOL_DOCUMENT_ROOT', dirname(dirname($path)).'/htdocs');
|
||||
|
||||
//$algo = 'md5'; // Old algorithm
|
||||
$algo = 'sha256';
|
||||
|
||||
require_once $path."../../htdocs/master.inc.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/blockedlog/versionmod.inc.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
|
||||
|
||||
|
||||
@@ -127,7 +129,10 @@ if ($tmpver[0] == 'auto') {
|
||||
$release .= '-'.$tmpver[1];
|
||||
}
|
||||
}
|
||||
// If release is auto, we take current version
|
||||
|
||||
$releaseblockedlog = DOLCERT_VERSION;
|
||||
|
||||
// If release is auto, we take current version to read checklock file
|
||||
$tmpver = explode('-', $checklock, 2);
|
||||
if ($tmpver[0] == 'auto') {
|
||||
$checklock = DOL_VERSION;
|
||||
@@ -182,6 +187,8 @@ if ($checklock && empty($checksource)) {
|
||||
if ($release) {
|
||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||
print "Version of target release : ".$release."\n";
|
||||
print "Version of blockedlog module : ".$releaseblockedlog."\n";
|
||||
print "Algo : ".$algo."\n";
|
||||
print "Include custom dir in signature : ".(empty($includecustom) ? 'no' : 'yes')."\n";
|
||||
print "Include constants in signature : ".(empty($includeconstants) ? 'none' : '');
|
||||
foreach ($includeconstants as $countrycode => $tmp) {
|
||||
@@ -190,6 +197,7 @@ if ($release) {
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
print "\n";
|
||||
}
|
||||
if ($checklock) {
|
||||
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
|
||||
@@ -335,13 +343,13 @@ if ($release) {
|
||||
|
||||
$checksumconcat = array();
|
||||
|
||||
if ($release) {
|
||||
fputs($fp, '<dolibarr_unalterable_files version="'.$release.'">'."\n");
|
||||
if ($release && $releaseblockedlog) {
|
||||
fputs($fp, '<dolibarr_unalterable_files version="'.$releaseblockedlog.'">'."\n");
|
||||
}
|
||||
|
||||
// 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/', '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'),
|
||||
@@ -425,6 +433,7 @@ foreach ($arrayofunalterablefiles as $entry) {
|
||||
}
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
|
||||
$hashunalterable_files = hash($algo, join(',', $checksumconcat));
|
||||
|
||||
if ($release) {
|
||||
|
||||
@@ -20,27 +20,28 @@ use Cwd;
|
||||
use Term::ANSIColor;
|
||||
|
||||
# Change this to defined target for option 98 and 99
|
||||
$PROJECT = "dolibarr";
|
||||
my $PROJECT = "dolibarr";
|
||||
|
||||
$PUBLISHBETARC =
|
||||
my $PUBLISHBETARC =
|
||||
"$ENV{'DESTIASSOLOGIN'}\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
|
||||
$PUBLISHSTABLE =
|
||||
my $PUBLISHSTABLE =
|
||||
"$ENV{'DESTISFLOGIN'}\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
|
||||
# due to implicit origin on git commands, example: implicit origin, lionel upstream, eric dolibarr
|
||||
$GITREMOTENAME = "$ENV{'GITREMOTENAME'}";
|
||||
my $GITREMOTENAME = "$ENV{'GITREMOTENAME'}";
|
||||
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@LISTETARGET = (
|
||||
my @LISTETARGET = (
|
||||
"TGZ", "ZIP", "RPM_GENERIC", "RPM_FEDORA",
|
||||
"RPM_MANDRIVA", "RPM_OPENSUSE", "DEB", "EXEDOLIWAMP",
|
||||
"SNAPSHOT"
|
||||
); # Possible packages
|
||||
%REQUIREMENTPUBLISH = (
|
||||
my %REQUIREMENTPUBLISH = (
|
||||
"SF" => "git ssh rsync",
|
||||
"ASSO" => "git ssh rsync"
|
||||
);
|
||||
%REQUIREMENTTARGET = ( # Tool requirement for each package
|
||||
my %REQUIREMENTTARGET = ( # Tool requirement for each package
|
||||
"-CHKSUM" => "",
|
||||
"TGZ" => "tar",
|
||||
"ZIP" => "7z",
|
||||
"XZ" => "xz",
|
||||
@@ -53,18 +54,18 @@ $GITREMOTENAME = "$ENV{'GITREMOTENAME'}";
|
||||
"EXEDOLIWAMP" => "ISCC.exe",
|
||||
"SNAPSHOT" => "tar"
|
||||
);
|
||||
%ALTERNATEPATH = (
|
||||
my %ALTERNATEPATH = (
|
||||
"7z" => "7-ZIP",
|
||||
"makensis.exe" => "NSIS"
|
||||
);
|
||||
|
||||
$RPMSUBVERSION = "auto"; # auto use value found into BUILD
|
||||
my $RPMSUBVERSION = "auto"; # auto use value found into BUILD
|
||||
if ( -d "/usr/src/redhat" ) { $RPMDIR = "/usr/src/redhat"; } # redhat
|
||||
if ( -d "/usr/src/packages" ) { $RPMDIR = "/usr/src/packages"; } # opensuse
|
||||
if ( -d "/usr/src/RPM" ) { $RPMDIR = "/usr/src/RPM"; } # mandrake
|
||||
|
||||
use vars qw/ $REVISION $VERSION /;
|
||||
$VERSION = "4.0";
|
||||
my $VERSION = "4.0";
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# MAIN
|
||||
@@ -198,7 +199,7 @@ open( my $IN, "<", $SOURCE . "/htdocs/version.inc.php" )
|
||||
while (<$IN>) {
|
||||
if ( $_ =~ /define\('DOL_MAJOR_VERSION',\s*'([\d\.a-z\-]+)'\)/ ) {
|
||||
$MAJORVERSION = $1;
|
||||
break;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close $IN;
|
||||
@@ -209,7 +210,7 @@ open( my $IN2, "<", $SOURCE . "/htdocs/filefunc.inc.php" )
|
||||
while (<$IN2>) {
|
||||
if ( $_ =~ /define\('DOL_MINOR_VERSION',\s*'([\d\.a-z\-]+)'\)/ ) {
|
||||
$MINORVERSION = $1;
|
||||
break;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close $IN2;
|
||||
@@ -395,6 +396,7 @@ foreach my $target ( sort keys %CHOOSEDTARGET ) {
|
||||
}
|
||||
$atleastonerpm = 1;
|
||||
}
|
||||
|
||||
foreach my $req ( split( /[,\s]/, $REQUIREMENTTARGET{$target} ) ) {
|
||||
|
||||
# Test
|
||||
@@ -814,19 +816,19 @@ if ($nboftargetok) {
|
||||
$ret = `rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||
$ret = `rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`
|
||||
`rm -fr $BUILDROOT/$PROJECT/htdocs/public/includes/ckeditor/ckeditor/adapters`
|
||||
; # Keep this removal in case we embed libraries
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`
|
||||
`rm -fr $BUILDROOT/$PROJECT/htdocs/public/includes/ckeditor/ckeditor/samples`
|
||||
; # Keep this removal in case we embed libraries
|
||||
$ret = `rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`
|
||||
$ret = `rm -fr $BUILDROOT/$PROJECT/htdocs/public/includes/ckeditor/_source`
|
||||
; # _source must be kept into tarball for official debian, not for the rest
|
||||
$ret = `rm -f $BUILDROOT/$PROJECT/htdocs/includes/composer`;
|
||||
$ret = `rm -f $BUILDROOT/$PROJECT/htdocs/includes/doctrine`;
|
||||
$ret =
|
||||
`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||
`rm -f $BUILDROOT/$PROJECT/htdocs/public/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||
$ret =
|
||||
`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
||||
`rm -f $BUILDROOT/$PROJECT/htdocs/public/includes/jquery/plugins/select2/release.sh`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||
$ret =
|
||||
@@ -932,7 +934,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret = `rm -fr $BUILDROOT/$FILENAMETGZ/dev/build/exe`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`
|
||||
`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/public/includes/ckeditor/_source`
|
||||
; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||
@@ -969,7 +971,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret = `rm -fr $BUILDROOT/$FILENAMEXZ/dev/build/exe`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`
|
||||
`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/public/includes/ckeditor/_source`
|
||||
; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n";
|
||||
@@ -1008,7 +1010,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret = `rm -fr $BUILDROOT/$FILENAMEZIP/dev/build/exe`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$FILENAMEZIP/htdocs/includes/ckeditor/_source`
|
||||
`rm -fr $BUILDROOT/$FILENAMEZIP/htdocs/public/includes/ckeditor/_source`
|
||||
; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
print "Compress $FILENAMEZIP into $FILENAMEZIP.zip...\n";
|
||||
@@ -1060,7 +1062,7 @@ if ($nboftargetok) {
|
||||
$ret = `$cmd`;
|
||||
|
||||
# Removed files we don't need (already removed before)
|
||||
#$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/includes/ckeditor/_source`;
|
||||
#$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2/htdocs/public/includes/ckeditor/_source`;
|
||||
|
||||
print "Set permissions on files/dir\n";
|
||||
$ret = `chmod -R 755 $BUILDROOT/$FILENAMETGZ2`;
|
||||
@@ -1259,17 +1261,17 @@ if ($nboftargetok) {
|
||||
|
||||
# Removed duplicate license files
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source/LICENSE.md`;
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/_source/LICENSE.md`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source/plugins/scayt/LICENSE.md`;
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/_source/plugins/scayt/LICENSE.md`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source/plugins/wsc/LICENSE.md`;
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/_source/plugins/wsc/LICENSE.md`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/LICENSE.md`;
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/LICENSE.md`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/plugins/scayt/LICENSE.md`;
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/plugins/scayt/LICENSE.md`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/plugins/wsc/LICENSE.md`;
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/plugins/wsc/LICENSE.md`;
|
||||
$ret =
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/php-iban/LICENSE`;
|
||||
$ret =
|
||||
@@ -1292,7 +1294,7 @@ if ($nboftargetok) {
|
||||
`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`;
|
||||
|
||||
# Removed files we don't need (already removed)
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/public/includes/ckeditor/ckeditor/_source`;
|
||||
$ret = `rm -fr $BUILDROOT/$PROJECT.tmp/.codeclimate.yml`;
|
||||
$ret = `rm -fr $BUILDROOT/$PROJECT.tmp/.pre-commit-config.yaml`;
|
||||
$ret = `rm -fr $BUILDROOT/$PROJECT.tmp/.vscode`;
|
||||
@@ -1376,61 +1378,41 @@ if ($nboftargetok) {
|
||||
|
||||
print "Set permissions on files/dir\n";
|
||||
$ret = `chmod -R 755 $BUILDROOT/$PROJECT.tmp`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp -type f -exec chmod 644 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp/dev/build -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp/dev/build -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp/dev/build -name '*.dpatch' -type f -exec chmod 755 {} \\; ";
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp/dev/build -name '*.dpatch' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp/dev/build -name '*.pl' -type f -exec chmod 755 {} \\; ";
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp/dev/build -name '*.pl' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp/dev -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp/dev -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
$ret = `chmod 755 $BUILDROOT/$PROJECT.tmp/debian/rules`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_mymodule.class.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`;
|
||||
$ret =
|
||||
`chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`;
|
||||
$ret =
|
||||
`chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/mymodule.php`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/translation/autotranslator.class.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/actions_mymodule.class.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/api_mymodule.class.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/class/myobject.class.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/core/modules/modMyModule.class.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/mymoduleindex.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_card.php`;
|
||||
$ret = `chmod -R 644 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/myobject_list.php`;
|
||||
$ret = `chmod -R 755 $BUILDROOT/$PROJECT.tmp/htdocs/modulebuilder/template/scripts/mymodule.php`;
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp/scripts -name '*.php' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
$cmd =
|
||||
"find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
|
||||
$cmd = "find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
|
||||
$ret = `$cmd`;
|
||||
|
||||
print
|
||||
"Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
$cmd =
|
||||
"mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||
print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
$cmd = "mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||
$ret = `$cmd`;
|
||||
|
||||
print "Go into directory $BUILDROOT\n";
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
|
||||
print
|
||||
"Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
|
||||
$cmd =
|
||||
"tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/dev/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
|
||||
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
|
||||
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
|
||||
$cmd = "tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/dev/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
|
||||
print $cmd. "\n";
|
||||
$ret = `$cmd`;
|
||||
|
||||
@@ -1447,10 +1429,8 @@ if ($nboftargetok) {
|
||||
|
||||
chdir("$olddir");
|
||||
|
||||
print
|
||||
"You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
|
||||
print
|
||||
"You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
|
||||
print "You can check bin package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}_all.deb\"\n";
|
||||
print "You can check src package with lintian --pedantic -E -I \"$NEWDESTI/${FILENAMEDEB}.dsc\"\n";
|
||||
|
||||
# Move to final dir
|
||||
print "Move *_all.deb *.dsc *.orig.tar.gz *.changes to $NEWDESTI\n";
|
||||
@@ -1458,7 +1438,7 @@ if ($nboftargetok) {
|
||||
$ret = `mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
||||
$ret = `mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
||||
|
||||
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
|
||||
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
|
||||
$ret = `mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
|
||||
$ret = `mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
||||
next;
|
||||
@@ -1480,17 +1460,15 @@ if ($nboftargetok) {
|
||||
print "Check that ISCC.exe is in your PATH.\n";
|
||||
}
|
||||
else {
|
||||
print
|
||||
"Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n";
|
||||
print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n";
|
||||
}
|
||||
|
||||
$SOURCEBACK = $SOURCE;
|
||||
$SOURCEBACK =~ s/\//\\/g;
|
||||
|
||||
print
|
||||
"Prepare file \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||
print "Prepare file \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||
|
||||
#$ret=`cat "$SOURCE/dev/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||
#$ret=`cat "$SOURCE/dev/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||
open( my $IN3, '<',
|
||||
$SOURCE . "/dev/build/exe/doliwamp/doliwamp.iss" )
|
||||
or die $!;
|
||||
@@ -1504,40 +1482,35 @@ if ($nboftargetok) {
|
||||
close($IN3);
|
||||
close($OUT);
|
||||
|
||||
print
|
||||
"Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n";
|
||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n";
|
||||
|
||||
if ( $OS eq 'windows' ) {
|
||||
$cmd =
|
||||
"ISCC.exe \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
||||
$cmd = "ISCC.exe \"$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
||||
}
|
||||
else {
|
||||
#$cmd= "wine ISCC.exe \"Z:$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
||||
#$cmd= "wine ISCC.exe \"Z:$SOURCEBACK\\dev\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
||||
}
|
||||
print "$cmd\n";
|
||||
$ret = `$cmd`;
|
||||
print "ret=$ret\n";
|
||||
|
||||
# Move to final dir
|
||||
print
|
||||
"Move \"$SOURCE\\dev\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
print "Move \"$SOURCE\\dev\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
rename(
|
||||
"$SOURCE/dev/build/$FILENAMEEXEDOLIWAMP.exe",
|
||||
"$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"
|
||||
);
|
||||
print
|
||||
"Move $SOURCE/dev/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
print "Move $SOURCE/dev/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
|
||||
use File::Copy;
|
||||
|
||||
#$ret=`mv "$SOURCE/dev/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
|
||||
#$ret=`mv "$SOURCE/dev/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
|
||||
$ret = move(
|
||||
"$SOURCE/dev/build/$FILENAMEEXEDOLIWAMP.exe",
|
||||
"$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"
|
||||
);
|
||||
|
||||
print
|
||||
"Remove tmp file $SOURCE/dev/build/exe/doliwamp/doliwamp.tmp.iss\n";
|
||||
print "Remove tmp file $SOURCE/dev/build/exe/doliwamp/doliwamp.tmp.iss\n";
|
||||
|
||||
#$ret=`rm "$SOURCE/dev/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||
$ret = unlink("$SOURCE/dev/build/exe/doliwamp/doliwamp.tmp.iss");
|
||||
@@ -1556,7 +1529,7 @@ if ($nboftargetok) {
|
||||
"$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml" =>
|
||||
'none', # none means it won't be published on SF
|
||||
"$DESTI/package_rpm_generic/$FILENAMERPM" =>
|
||||
'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
||||
'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
||||
"$DESTI/package_rpm_generic/$FILENAMERPMSRC" =>
|
||||
'none', # none means it won't be published on SF
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb" =>
|
||||
@@ -1587,8 +1560,7 @@ if ($nboftargetok) {
|
||||
'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc" =>
|
||||
'package_debian-ubuntu',
|
||||
|
||||
#"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
|
||||
#"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz" =>
|
||||
'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz" =>
|
||||
@@ -1650,8 +1622,7 @@ if ($nboftargetok) {
|
||||
$NUM_SCRIPT = <STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
|
||||
print
|
||||
"Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
|
||||
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
|
||||
$ret = `mkdir -p "/tmp/emptydir/"`;
|
||||
|
||||
%filestoscan = %filestoscansf;
|
||||
@@ -1695,13 +1666,13 @@ if ($nboftargetok) {
|
||||
#use String::ShellQuote qw( shell_quote );
|
||||
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
|
||||
|
||||
#use Net::SFTP::Foreign;
|
||||
#my $sftp = Net::SFTP::Foreign->new($ip, user => $user, password => $pass, autodie => 1);
|
||||
#$sftp->mkdir($destFolder)
|
||||
#use Net::SFTP::Foreign;
|
||||
#my $sftp = Net::SFTP::Foreign->new($ip, user => $user, password => $pass, autodie => 1);
|
||||
#$sftp->mkdir($destFolder)
|
||||
|
||||
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
|
||||
#print "$command\n";
|
||||
#my $ret=`$command 2>&1`;
|
||||
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
|
||||
#print "$command\n";
|
||||
#my $ret=`$command 2>&1`;
|
||||
|
||||
$command = "rsync -s -e 'ssh' --recursive /tmp/emptydir/ \""
|
||||
. $destFolder . "\"";
|
||||
|
||||
@@ -7,24 +7,24 @@
|
||||
#----------------------------------------------------------------------------
|
||||
## no critic (InputOutput::ProhibitExplicitStdin,InputOutput::RequireBriefOpen)
|
||||
|
||||
use strict;
|
||||
#use strict;
|
||||
use warnings;
|
||||
use Cwd;
|
||||
use Term::ANSIColor;
|
||||
|
||||
$OWNER = "ldestailleur";
|
||||
$GROUP = "ldestailleur";
|
||||
my $OWNER = "ldestailleur";
|
||||
my $GROUP = "ldestailleur";
|
||||
|
||||
@LISTETARGET = ("ZIP"); # Possible packages
|
||||
%REQUIREMENTTARGET = ( # Tool requirement for each package
|
||||
my @LISTETARGET = ("ZIP"); # Possible packages
|
||||
my %REQUIREMENTTARGET = ( # Tool requirement for each package
|
||||
"TGZ" => "tar",
|
||||
"ZIP" => "7z"
|
||||
);
|
||||
%ALTERNATEPATH = ();
|
||||
my %ALTERNATEPATH = ();
|
||||
|
||||
use vars qw/ $REVISION $VERSION /;
|
||||
$REVISION = '1.0';
|
||||
$VERSION = "3.5 (build $REVISION)";
|
||||
my $REVISION = '1.0';
|
||||
my $VERSION = "3.5 (build $REVISION)";
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# MAIN
|
||||
@@ -184,7 +184,7 @@ foreach my $PROJECT (@PROJECTLIST) {
|
||||
while (<$IN>) {
|
||||
if ( $_ =~ /this->version\s*=\s*'([\d\.]+)'/ ) {
|
||||
$PROJVERSION = $1;
|
||||
break;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close $IN;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -103,7 +103,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr dev/build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/dev/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/public/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr dev/build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/dev/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/public/includes/ckeditor/_source
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/nusoap
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
@@ -102,7 +102,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr dev/build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/dev/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/public/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
|
||||
@@ -102,7 +102,7 @@ cui hai bisogno ed essere facile da usare.
|
||||
%{__cp} -pr dev/build/tgz/* $RPM_BUILD_ROOT%{_datadir}/%{name}/dev/build/tgz
|
||||
%{__cp} -pr htdocs $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__cp} -pr scripts $RPM_BUILD_ROOT%{_datadir}/%{name}
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/public/includes/ckeditor/_source
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/includes/fonts
|
||||
|
||||
# Lang
|
||||
|
||||
@@ -263,7 +263,19 @@ with
|
||||
|
||||
PHP JQUERYFILETREE:
|
||||
-------------------
|
||||
* Remove directory htdocs/includes/jquery/plugins/jqueryFileTree/connectors
|
||||
* Remove directory htdocs/public/includes/jquery/plugins/jqueryFileTree/connectors
|
||||
|
||||
|
||||
|
||||
PHP Mobile_DETECT:
|
||||
------------------
|
||||
Remplacer:
|
||||
|
||||
array $headers = null,
|
||||
|
||||
par
|
||||
|
||||
$headers = null,
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"npm": ">=5.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"zapier-platform-core": "17.5.0"
|
||||
"zapier-platform-core": "18.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^5.2.0",
|
||||
|
||||
1
dev/initdemo/.gitignore
vendored
1
dev/initdemo/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
/initdemopostsql.sql
|
||||
/mysqldump_dolibarr_24.0.0.sql2
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
BEGIN - regnumber=7dd3b63bd8… - date=2025-02-05T11:54:50Z - period=2025-01 - entity=1 - formatexport=VE1 - user=Alice Adminson;Id;Date création;Action;Origine;Montant HT;Montant TTC;Réf.;Date;Utilisateur;Lier à;Type de lien;Données complètes;Version;Version de la signature;Signature dans la base de données;État;NOTE - previoushash=b63e359ffca54d5c2bab869916eaf23d4a736703028ccbf77ce1167c5f830e7b
|
||||
;"411";"1736932388";"MODULE_SET";"";"0";"0";"systemevent";"1736932388";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""id"":0,""ref"":""systemevent"",""entity"":1,""date"":1736932388}";"24.0.0-alpha";"V2";"2031b54f7017f18227cbee83d2e0c3beec2cf2169e472719dd6b920f143ed94e";"Valid";
|
||||
;"413";"1736932630";"BLOCKEDLOG_EXPORT";"";"0";"0";"systemevent";"1736932630";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""id"":0,""ref"":""systemevent"",""entity"":1,""date"":1736932630,""fullname"":""Alice Adminson"",""label"":""Export unalterable logs"",""period"":""year=2024 month=1""}";"24.0.0-alpha";"V2";"b850352ef955c0b8133386b79f88dd347e2c625ed133e30e49314f502ace54fc";"Valid";
|
||||
;"414";"1736932963";"BILL_VALIDATE";"";"9";"9";"FA2501-0037";"1736895600";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""FA2501-0037"",""module_source"":"""",""pos_source"":"""",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""PINKDRESS"",""product_type"":""0"",""product_label"":""Pink dress"",""qty"":""1"",""subprice"":""9.00000000"",""tva_tx"":""0.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""9.00000000"",""total_tva"":""0.00000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""9.00000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""9.00000000"",""multicurrency_total_tva"":""0.00000000"",""multicurrency_total_ttc"":""9.00000000""}},""type"":""0"",""date"":1736895600,""total_ht"":9,""total_tva"":0,""total_ttc"":9,""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"1e43eda5e73678c9275d0137cbf5684d12a79b3d0d32eafa79583b8e21ae4869";"Valid";
|
||||
;"415";"1737018433";"BILL_VALIDATE";"";"11";"11";"FA2501-0038";"1737018433";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""FA2501-0038"",""module_source"":"""",""pos_source"":"""",""pos_print_counter"":0,""email_sent_counter"":0,""invoiceline"":{""1"":{""product_type"":""1"",""product_label"":""Adh\u00e9sion \/ cotisation 2025"",""qty"":""1"",""subprice"":""11.00000000"",""tva_tx"":""0.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""11.00000000"",""total_tva"":""0.00000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""11.00000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""11.00000000"",""multicurrency_total_tva"":""0.00000000"",""multicurrency_total_ttc"":""11.00000000""}},""type"":0,""date"":1737018433,""total_ht"":11,""total_tva"":0,""total_ttc"":11}";"24.0.0-alpha";"V2";"20ea65b804e7250ef18a4c4bb40c0dc66362c0b1bf3a2055a596920f808a15ae";"Valid";
|
||||
;"416";"1737018433";"PAYMENT_CUSTOMER_CREATE";"";"";"11";"PAY2501-0001";"1736982000";"Alice Adminson";"FA2501-0038";"payment";"{""thirdparty"":{""name"":""test test"",""email"":""test@test.com"",""idprof1"":"""",""idprof2"":"""",""tva_assuj"":""1"",""tva_intra"":"""",""code_client"":""CU2501-00037"",""country_code"":""FR""},""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""PAY2501-0001"",""date"":1736982000,""type_code"":""CHQ"",""payment_part"":{""1"":{""amount"":""11"",""invoice"":{""ref"":""FA2501-0038"",""module_source"":"""",""pos_source"":"""",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""type"":""0"",""date"":1736982000,""total_ht"":""11.00000000"",""total_tva"":""0.00000000"",""total_ttc"":""11.00000000"",""revenuestamp"":""0.00000000""}}},""amount"":11}";"24.0.0-alpha";"V2";"af79bb9344a27868825a1c22b2c9ab6d2f7db2aef315541f049490ea620daae5";"Valid";
|
||||
;"417";"1737018535";"BILL_VALIDATE";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":1.25,""total_tva"":0.25,""total_ttc"":1.5,""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"b9c58af18960660e2d98b7ca5539677ee0b611f2f49c2ce3ddcd2a7fff06e2b8";"Valid";
|
||||
;"418";"1737018536";"PAYMENT_CUSTOMER_CREATE";"takepos";"";"1.5";"PAY2501-0002";"1737018535";"Alice Adminson";"TC1-2501-0009";"payment";"{""thirdparty"":{""name"":""Generic customer"",""email"":""ttt@ttt.com"",""idprof1"":"""",""idprof2"":"""",""tva_assuj"":""1"",""tva_intra"":"""",""capital"":""0.00000000"",""typent_code"":""TE_PRIVATE"",""code_client"":""CU1302-0011"",""country_code"":""GB""},""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""PAY2501-0002"",""date"":1737018535,""type_code"":""LIQ"",""payment_part"":{""1"":{""amount"":""1.5"",""invoice"":{""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}}},""amount"":1.5}";"24.0.0-alpha";"V2";"bb3ffec5b8e04ceb0f1a469b882487aadd6f5e1e04244f5e7ddf1cc2f2f2e3c4";"Valid";
|
||||
;"419";"1737019049";"DOC_PREVIEW";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":1,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"17a3c6170409b72a5fedf853abb00581877b18320a207e479c42d77b3d07c4d6";"Valid";
|
||||
;"420";"1737019181";"DOC_PREVIEW";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":2,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"d8770dd062220b8332d304039a53565de2d2d5f917f0aa5620dbcb634e75462e";"Valid";
|
||||
;"421";"1737019353";"DOC_PREVIEW";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":3,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"dbb2d0f11a6ed01566b69717ddb1c08cee10f6964c47cd6b5f0da213027fd1be";"Valid";
|
||||
;"422";"1737019636";"DOC_PREVIEW";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":4,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"e6e65a101521cb8b3921ae31d9565be3432ac94703f2e055e8f1229cb2abee6b";"Valid";
|
||||
;"423";"1737020016";"DOC_PREVIEW";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":5,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"24e0d354f83b5e216414930cfa0b07923725a98a0457969df3f962111932baa2";"Valid";
|
||||
;"424";"1737024079";"DOC_PREVIEW";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":6,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"f1daed6d4977aed9427b2f6530c340b2613e0d9dbfc748d68cf5320af1def9ea";"Valid";
|
||||
;"431";"1737028500";"BILL_SENTBYMAIL";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":""8"",""email_sent_counter"":5,""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000"",""action_email_sent"":{""email_from"":""myemail@mybigcompany.com"",""email_to"":""ttt@ttt.com"",""email_msgid"":""6788f3948bc635.10121388.phpmail@cc385f40e47e5be82815b1fa583939f749c7f86e""}}";"24.0.0-alpha";"V2";"749dbdedc18a10087649f00ee3e6b27ce8d092c513450174dc54503959d8a2f8";"Valid";
|
||||
;"432";"1737028654";"BILL_SENTBYMAIL";"takepos";"1.25";"1.5";"TC1-2501-0009";"1736982000";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC1-2501-0009"",""module_source"":""takepos"",""pos_source"":""1"",""pos_print_counter"":""6"",""email_sent_counter"":2,""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""}},""type"":""0"",""date"":1736982000,""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_ttc"":""1.50000000"",""revenuestamp"":""0.00000000"",""action_email_sent"":{""email_from"":""aaaa <aaaa@aa.com>"",""email_to"":""test@test.com"",""email_msgid"":""6788f42ecbbfd9.77578037.phpmail-dolibarr-inv460@cc385f40e47e5be82815b1fa583939f749c7f86e""}}";"24.0.0-alpha";"V2";"2456751468d90ed6cdd06da34cf8a392585eb152db6a9d457c8f6f97539a77ae";"Valid";
|
||||
;"433";"1737102950";"DOC_PREVIEW";"takepos";"2.33";"2.8";"(PROV-POS2-0)";"1737068400";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""(PROV-POS2-0)"",""module_source"":""takepos"",""pos_source"":""2"",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""},""2"":{""ref"":""POS-KIWI"",""product_type"":""0"",""product_label"":""Kiwi"",""qty"":""1"",""subprice"":""1.08333000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.08000000"",""total_tva"":""0.22000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.30000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.08000000"",""multicurrency_total_tva"":""0.22000000"",""multicurrency_total_ttc"":""1.30000000""}},""type"":""0"",""date"":1737068400,""total_ht"":""2.33000000"",""total_tva"":""0.47000000"",""total_ttc"":""2.80000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"451b90f983512fa095ef9475876d130084489f3e2cb89464ad522391dc1b06a2";"Valid";
|
||||
;"434";"1737102963";"BILL_VALIDATE";"takepos";"2.33";"2.8";"TC2-2501-0001";"1737068400";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC2-2501-0001"",""module_source"":""takepos"",""pos_source"":""2"",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""},""2"":{""ref"":""POS-KIWI"",""product_type"":""0"",""product_label"":""Kiwi"",""qty"":""1"",""subprice"":""1.08333000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.08000000"",""total_tva"":""0.22000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.30000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.08000000"",""multicurrency_total_tva"":""0.22000000"",""multicurrency_total_ttc"":""1.30000000""}},""type"":""0"",""date"":1737068400,""total_ht"":2.33,""total_tva"":0.47,""total_ttc"":2.8,""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"a4f51205e87339187636bd26df2b330dba86c404204144a69711ec4e0e0cc58f";"Valid";
|
||||
;"435";"1737102963";"PAYMENT_CUSTOMER_CREATE";"takepos";"";"2.8";"PAY2501-0003";"1737102963";"Alice Adminson";"TC2-2501-0001";"payment";"{""thirdparty"":{""name"":""Generic customer"",""email"":""ttt@ttt.com"",""idprof1"":"""",""idprof2"":"""",""tva_assuj"":""1"",""tva_intra"":"""",""capital"":""0.00000000"",""typent_code"":""TE_PRIVATE"",""code_client"":""CU1302-0011"",""country_code"":""GB""},""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""PAY2501-0003"",""date"":1737102963,""type_code"":""LIQ"",""payment_part"":{""1"":{""amount"":""2.8"",""invoice"":{""ref"":""TC2-2501-0001"",""module_source"":""takepos"",""pos_source"":""2"",""pos_print_counter"":""0"",""email_sent_counter"":""0"",""type"":""0"",""date"":1737068400,""total_ht"":""2.33000000"",""total_tva"":""0.47000000"",""total_ttc"":""2.80000000"",""revenuestamp"":""0.00000000""}}},""amount"":2.8}";"24.0.0-alpha";"V2";"e095af5c7eec1f1d0272d1ab633c9f9b78d5f9ee44f425f3fed5ed844ea700b2";"Valid";
|
||||
;"436";"1737102971";"DOC_PREVIEW";"takepos";"2.33";"2.8";"TC2-2501-0001";"1737068400";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC2-2501-0001"",""module_source"":""takepos"",""pos_source"":""2"",""pos_print_counter"":1,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""},""2"":{""ref"":""POS-KIWI"",""product_type"":""0"",""product_label"":""Kiwi"",""qty"":""1"",""subprice"":""1.08333000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.08000000"",""total_tva"":""0.22000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.30000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.08000000"",""multicurrency_total_tva"":""0.22000000"",""multicurrency_total_ttc"":""1.30000000""}},""type"":""0"",""date"":1737068400,""total_ht"":""2.33000000"",""total_tva"":""0.47000000"",""total_ttc"":""2.80000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"fc5c19832334b5c00d7cc3a4414a5ca37867fa9ee5c367c921324aaebd0f81de";"Valid";
|
||||
;"437";"1737102993";"DOC_PREVIEW";"takepos";"2.33";"2.8";"TC2-2501-0001";"1737068400";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC2-2501-0001"",""module_source"":""takepos"",""pos_source"":""2"",""pos_print_counter"":2,""email_sent_counter"":""0"",""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""},""2"":{""ref"":""POS-KIWI"",""product_type"":""0"",""product_label"":""Kiwi"",""qty"":""1"",""subprice"":""1.08333000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.08000000"",""total_tva"":""0.22000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.30000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.08000000"",""multicurrency_total_tva"":""0.22000000"",""multicurrency_total_ttc"":""1.30000000""}},""type"":""0"",""date"":1737068400,""total_ht"":""2.33000000"",""total_tva"":""0.47000000"",""total_ttc"":""2.80000000"",""revenuestamp"":""0.00000000""}";"24.0.0-alpha";"V2";"91cf7545174270befeb93fcefb67acb2f07525c7d73a190eee76936cfa7dfd7d";"Valid";
|
||||
;"438";"1737104486";"BILL_SENTBYMAIL";"takepos";"2.33";"2.8";"TC2-2501-0001";"1737068400";"Alice Adminson";"";"";"{""mycompany"":{""name"":""MyBigCompany"",""phone"":""09123123"",""fax"":""09123124"",""email"":""myemail@mybigcompany.com"",""idprof1"":""123456"",""idprof2"":""ABC-DEF"",""idprof3"":""15E-45-8D"",""tva_assuj"":1,""tva_intra"":""FR12345678"",""localtax1_assuj"":0,""localtax2_assuj"":0,""managers"":""Zack Zeceo"",""capital"":10000,""forme_juridique_code"":0,""country_code"":""FR"",""address"":""21 Jump street."",""zip"":""75500"",""town"":""MyTown""},""ref"":""TC2-2501-0001"",""module_source"":""takepos"",""pos_source"":""2"",""pos_print_counter"":""2"",""email_sent_counter"":1,""invoiceline"":{""1"":{""ref"":""POS-APPLE"",""product_type"":""0"",""product_label"":""Apple"",""qty"":""1"",""subprice"":""1.25000000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.25000000"",""total_tva"":""0.25000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.50000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.25000000"",""multicurrency_total_tva"":""0.25000000"",""multicurrency_total_ttc"":""1.50000000""},""2"":{""ref"":""POS-KIWI"",""product_type"":""0"",""product_label"":""Kiwi"",""qty"":""1"",""subprice"":""1.08333000"",""tva_tx"":""20.000"",""localtax1_tx"":""0.000"",""localtax2_tx"":""0.000"",""total_ht"":""1.08000000"",""total_tva"":""0.22000000"",""total_localtax1"":""0.00000000"",""total_localtax2"":""0.00000000"",""total_ttc"":""1.30000000"",""info_bits"":""0"",""special_code"":""0"",""multicurrency_code"":""EUR"",""multicurrency_total_ht"":""1.08000000"",""multicurrency_total_tva"":""0.22000000"",""multicurrency_total_ttc"":""1.30000000""}},""type"":""0"",""date"":1737068400,""total_ht"":""2.33000000"",""total_tva"":""0.47000000"",""total_ttc"":""2.80000000"",""revenuestamp"":""0.00000000"",""action_email_sent"":{""email_from"":""Alice Adminson <laurent@destailleur.fr>"",""email_to"":""Generic customer <ttt@ttt.com>"",""email_msgid"":""678a1c6608cdb4.28637446.phpmail-dolibarr-inv461@cc385f40e47e5be82815b1fa583939f749c7f86e""}}";"24.0.0-alpha";"V2";"7ebd906d6133f5526411664bc637ad88fc5d30bd147d4e6dcfc460520144411f";"Valid";
|
||||
END - sha256=14290f951be42f11da5b36274cdbb9d018ea1787855c19c92f317152bf7bb9e6 - hmac_sha256=851ac6dc40c60faf69efeb4ef6712abacfffe5a986c674ca478f8c1525a126eb
|
||||
|
Can't render this file because it has a wrong number of fields in line 23.
|
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
# Copyright (C) 2010-2026 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
# Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
||||
#------------------------------------------------------
|
||||
# Script to purge and initialize a database with demo values.
|
||||
@@ -11,8 +12,8 @@
|
||||
# Regis Houssin - regis.houssin@inodbox.com
|
||||
# Laurent Destailleur - eldy@users.sourceforge.net
|
||||
#------------------------------------------------------
|
||||
# Usage: initdemo.sh confirm
|
||||
# usage: initdemo.sh confirm mysqldump_dolibarr_x.x.x.sql database port login pass
|
||||
# Usage: initdemo.sh confirm|confirmresetblockedlog
|
||||
# usage: initdemo.sh confirm|confirmresetblockedlog mysqldump_dolibarr_x.x.x.sql database port login pass
|
||||
#------------------------------------------------------
|
||||
|
||||
|
||||
@@ -37,18 +38,18 @@ fi
|
||||
# ----------------------------- command line params
|
||||
confirm=$1
|
||||
dumpfile=$2
|
||||
base=$3
|
||||
port=$4
|
||||
base="${3:-dolibarrdemo}"
|
||||
port="${4:-3306}"
|
||||
admin=$5
|
||||
passwd=$6
|
||||
|
||||
# ----------------------------- check params
|
||||
if [ "$confirm" != "confirm" ]
|
||||
if [ "$confirm" != "confirm" ] && [ "$confirm" != "confirmresetblockedlog" ]
|
||||
then
|
||||
echo "----- $0 -----"
|
||||
echo "Usage: initdemo.sh confirm "
|
||||
echo "Usage: initdemo.sh confirm|confirmresetblockedlog "
|
||||
echo " or"
|
||||
echo "Usage: initdemo.sh confirm [mysqldump_dolibarr_x.x.x.sql database port login pass]"
|
||||
echo "Usage: initdemo.sh confirm|confirmresetblockedlog [mysqldump_dolibarr_x.x.x.sql database port login pass]"
|
||||
exit
|
||||
fi
|
||||
|
||||
@@ -91,7 +92,7 @@ then
|
||||
fichtemp=$(mktemp 2>/dev/null) || fichtemp=/tmp/test$$
|
||||
# shellcheck disable=2064,2172
|
||||
trap "rm -f '$fichtemp'" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear --inputbox "Mysql database name :" 16 55 dolibarrdemo 2> "$fichtemp"
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear --inputbox "Mysql database name :" 16 55 "$base" 2> "$fichtemp"
|
||||
valret=$?
|
||||
case $valret in
|
||||
0)
|
||||
@@ -107,7 +108,7 @@ then
|
||||
fichtemp=$(mktemp 2>/dev/null) || fichtemp=/tmp/test$$
|
||||
# shellcheck disable=2064,2172
|
||||
trap "rm -f '$fichtemp'" 0 1 2 5 15
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear --inputbox "Mysql port (ex: 3306):" 16 55 3306 2> "$fichtemp"
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear --inputbox "Mysql port (ex: 3306):" 16 55 "$port" 2> "$fichtemp"
|
||||
valret=$?
|
||||
|
||||
case $valret in
|
||||
@@ -161,7 +162,7 @@ then
|
||||
|
||||
|
||||
# ---------------------------- confirmation
|
||||
$DIALOG --title "Init Dolibarr with demo values" --clear --yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Document dir : '$documentdir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : --hidden--" 15 55
|
||||
$DIALOG --title "Erase Dolibarr with demo values" --clear --yesno "Do you confirm ? \n Dump file : '$dumpfile' \n Dump dir : '$mydir' \n Document dir : '$documentdir' \n Mysql database : '$base' \n Mysql port : '$port' \n Mysql login: '$admin' \n Mysql password : --hidden--" 15 55
|
||||
|
||||
case $? in
|
||||
0) echo "Ok, start process..." ;;
|
||||
@@ -172,7 +173,7 @@ then
|
||||
fi
|
||||
|
||||
|
||||
# ---------------------------- run sql file
|
||||
# ---------------------------- Run sql file
|
||||
if [ "$passwd" != "" ]
|
||||
then
|
||||
export passwd="-p$passwd"
|
||||
@@ -181,8 +182,11 @@ fi
|
||||
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
|
||||
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
|
||||
#echo "drop old table"
|
||||
echo "drop table"
|
||||
echo "drop table if exists llx_accounting_account;"
|
||||
echo "drop table if exists llx_accounting_account;" | mysql "-P$port" "-u$admin" "$passwd" "$base"
|
||||
echo "drop table if exists llx_accounting_system;"
|
||||
echo "drop table if exists llx_accounting_system;" | mysql "-P$port" "-u$admin" "$passwd" "$base"
|
||||
|
||||
echo "mysql -P$port -u$admin $passwdshown $base < '$mydir/$dumpfile'"
|
||||
mysql "-P$port" "-u$admin" "$passwd" "$base" < "$mydir/$dumpfile"
|
||||
export res=$?
|
||||
@@ -192,10 +196,24 @@ if [ $res -ne 0 ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
# ---------------------------- Run update of demo data
|
||||
echo
|
||||
echo Run script updatedemo.php confirm
|
||||
"$mydir/updatedemo.php" confirm
|
||||
export res=$?
|
||||
|
||||
# ---------------------------- copy demo files
|
||||
|
||||
# ---------------------------- Run update of demo data
|
||||
if [ "$confirm" == "confirmresetblockedlog" ]; then
|
||||
echo
|
||||
echo Run script updatedemo.php confirmresetblockedlog
|
||||
"$mydir/updatedemo.php" confirmresetblockedlog
|
||||
export res=$?
|
||||
fi
|
||||
|
||||
|
||||
# ---------------------------- Copy demo files
|
||||
export documentdir
|
||||
# shellcheck disable=2016
|
||||
documentdir=$(< "$mydir/../../htdocs/conf/conf.php" grep '^\$dolibarr_main_data_root' | sed -e 's/$dolibarr_main_data_root=//' | sed -e 's/;//' | sed -e "s/'//g" | sed -e 's/"//g')
|
||||
@@ -246,8 +264,8 @@ fi
|
||||
|
||||
if [ "$res" = "0" ]
|
||||
then
|
||||
echo "Success, file successfully loaded."
|
||||
echo "Success, file successfully loaded: Note that crypted data need to have dolibarr_main_instance_unique_id=11f3c81e86fc9e3b3fd11d81c9a31bd0 with this data set to be readable."
|
||||
else
|
||||
echo "Error, load failed."
|
||||
echo "Error, 1 step of script has failed."
|
||||
fi
|
||||
echo
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2010-2026 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
|
||||
#------------------------------------------------------
|
||||
# Script to extract a database with demo values.
|
||||
# Note: "dialog" tool need to be available if no parameter provided.
|
||||
@@ -11,26 +13,28 @@
|
||||
#------------------------------------------------------
|
||||
# shellcheck disable=2012,2006,2034,2046,2064,2086,2155,2166,2186,2172,2268
|
||||
|
||||
export mydir=`echo "$0" | sed -e 's/savedemo.sh//'`;
|
||||
if [ "x$mydir" = "x" ]
|
||||
export mydir
|
||||
mydir=${0//savedemo.sh/}
|
||||
if [ "$mydir" = "" ] || [ "$mydir" = "./" ]
|
||||
then
|
||||
export mydir="."
|
||||
fi
|
||||
export id=`id -u`;
|
||||
export id
|
||||
id=$(id -u)
|
||||
|
||||
|
||||
# ----------------------------- check if root
|
||||
if [ "x$id" != "x0" -a "x$id" != "x1001" ]
|
||||
if [ "$id" != "0" ] && [ "$id" != "1001" ]
|
||||
then
|
||||
echo "Script must be ran as root"
|
||||
echo "Script must be executed as root"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
# ----------------------------- command line params
|
||||
dumpfile=$1;
|
||||
base=$2;
|
||||
port=$3;
|
||||
base="${2:-dolibarrdemo}"
|
||||
port="${3:-3306}"
|
||||
admin=$4;
|
||||
passwd=$5;
|
||||
|
||||
@@ -54,7 +58,7 @@ then
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Save Dolibarr with demo values" --clear \
|
||||
--inputbox "Output dump file :" 16 55 $dumpfile 2> $fichtemp
|
||||
--inputbox "Output dump file :" 16 55 "$dumpfile" 2> $fichtemp
|
||||
valret=$?
|
||||
case $valret in
|
||||
0)
|
||||
@@ -71,7 +75,7 @@ then
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Save Dolibarr with demo values" --clear \
|
||||
--inputbox "Mysql database name :" 16 55 dolibarrdemo 2> $fichtemp
|
||||
--inputbox "Mysql database name :" 16 55 "$base" 2> $fichtemp
|
||||
valret=$?
|
||||
case $valret in
|
||||
0)
|
||||
@@ -87,7 +91,7 @@ then
|
||||
fichtemp=`tempfile 2>/dev/null` || fichtemp=/tmp/test$$
|
||||
trap "rm -f $fichtemp" 0 1 2 5 15
|
||||
$DIALOG --title "Save Dolibarr with demo values" --clear \
|
||||
--inputbox "Mysql port (ex: 3306):" 16 55 3306 2> $fichtemp
|
||||
--inputbox "Mysql port (ex: 3306):" 16 55 "$port" 2> $fichtemp
|
||||
|
||||
valret=$?
|
||||
|
||||
@@ -172,6 +176,7 @@ fi
|
||||
if [ "x$passwd" != "x" ]
|
||||
then
|
||||
export passwd="-p$passwd"
|
||||
export passwdshown="-p*****"
|
||||
fi
|
||||
export list="
|
||||
--ignore-table=$base.llx_abonne
|
||||
@@ -256,6 +261,7 @@ export list="
|
||||
--ignore-table=$base.llx_c_ticketsup_type
|
||||
--ignore-table=$base.llx_cabinetmed_c_banques
|
||||
--ignore-table=$base.llx_cabinetmed_c_examconclusion
|
||||
--ignore-table=$base.llx_cabinetmed_cons
|
||||
--ignore-table=$base.llx_cabinetmed_cons_extrafields
|
||||
--ignore-table=$base.llx_cabinetmed_diaglec
|
||||
--ignore-table=$base.llx_cabinetmed_examaut
|
||||
@@ -269,6 +275,7 @@ export list="
|
||||
--ignore-table=$base.llx_congespayes_events
|
||||
--ignore-table=$base.llx_congespayes_logs
|
||||
--ignore-table=$base.llx_congespayes_users
|
||||
--ignore-table=$base.llx_deplacement
|
||||
--ignore-table=$base.llx_dolicloud_customers
|
||||
--ignore-table=$base.llx_dolicloud_stats
|
||||
--ignore-table=$base.llx_dolicloud_emailstemplates
|
||||
@@ -345,20 +352,24 @@ export list="
|
||||
--ignore-table=$base.llx_ultimatepdf
|
||||
--ignore-table=$base.llx_update_modules
|
||||
--ignore-table=$base.llx_ventilation_achat
|
||||
--ignore-table=$base.llx_verifactudolibarr_add_tpls
|
||||
--ignore-table=$base.llx_verifactudolibarr_facture_log
|
||||
--ignore-table=$base.llx_verifactudolibarr_messages
|
||||
--ignore-table=$base.llx_verifactudolibarr_tax_type
|
||||
--ignore-table=$base.tmp_llx_accouting_account
|
||||
--ignore-table=$base.tmp_llx_product_batch
|
||||
--ignore-table=$base.tmp_llx_product_batch2
|
||||
--ignore-table=$base.tmp_tmp
|
||||
--ignore-table=$base.tmp_user
|
||||
"
|
||||
echo "mysqldump -P$port -u$admin -p***** $list $base > $mydir/$dumpfile"
|
||||
echo "mysqldump -P$port -u$admin $passwdshown $list $base > $mydir/$dumpfile"
|
||||
mysqldump -P$port -u$admin $passwd $list $base > $mydir/$dumpfile
|
||||
export res=$?
|
||||
|
||||
if [ "x$res" = "x0" ]
|
||||
then
|
||||
echo "Success, file successfully loaded."
|
||||
echo "Success, file successfully dumped."
|
||||
else
|
||||
echo "Error, load failed."
|
||||
echo "Error, dump failed."
|
||||
fi
|
||||
echo
|
||||
|
||||
@@ -36,6 +36,7 @@ $confirm = isset($argv[1]) ? $argv[1] : '';
|
||||
|
||||
// Include Dolibarr environment
|
||||
$res = 0;
|
||||
$reg = array();
|
||||
if (!$res && file_exists($path."../../master.inc.php")) {
|
||||
$res = @include $path."../../master.inc.php";
|
||||
}
|
||||
@@ -60,24 +61,32 @@ if (!$res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) {
|
||||
if (!$res) {
|
||||
die("Failed to include master.inc.php file\n");
|
||||
}
|
||||
/**
|
||||
* @var DoliDB $db
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||
|
||||
|
||||
/*
|
||||
* Main
|
||||
*/
|
||||
|
||||
print "***** ".$script_file." *****\n";
|
||||
print "Update dates to current year for database name = ".$db->database_name."\n";
|
||||
print "***** ".$script_file." ".$confirm." *****\n";
|
||||
if (empty($confirm)) {
|
||||
print "Usage: $script_file confirm\n";
|
||||
print "Usage: $script_file confirm|confirmresetblockedlog\n";
|
||||
print "Return code: 0 if success, <>0 if error\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
$tmp = dol_getdate(dol_now());
|
||||
$dolnow = dol_now();
|
||||
|
||||
// Current year
|
||||
$tmp = dol_getdate($dolnow);
|
||||
|
||||
$year = 2010; // Old year in demo
|
||||
$lastyear = $tmp['year'] - 2; // New year in demo
|
||||
|
||||
$tables = array(
|
||||
'propal' => array(0 => 'datep', 1 => 'fin_validite', 2 => 'date_valid', 3 => 'date_cloture'),
|
||||
@@ -92,55 +101,312 @@ $tables = array(
|
||||
'ticket' => array(0 => 'datec', 1 => 'date_read', 2 => 'date_close')
|
||||
);
|
||||
|
||||
$year = 2010;
|
||||
$currentyear = $tmp['year'];
|
||||
while ($year <= $currentyear) {
|
||||
//$year=2021;
|
||||
$delta1 = ($currentyear - $year);
|
||||
$delta2 = ($currentyear - $year - 1);
|
||||
//$delta=-1;
|
||||
|
||||
if ($delta1) {
|
||||
foreach ($tables as $tablekey => $tableval) {
|
||||
print "Correct ".$tablekey." for year ".$year." and move them to current year ".$currentyear." ";
|
||||
$sql = "select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
|
||||
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
print ".";
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
|
||||
$j = 0;
|
||||
foreach ($tableval as $field) {
|
||||
if ($j) {
|
||||
$sql2 .= ", ";
|
||||
}
|
||||
$sql2 .= $field." = ".$db->ifsql("DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR) > NOW()", "DATE_ADD(".$field.", INTERVAL ".$delta2." YEAR)", "DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR)");
|
||||
$j++;
|
||||
}
|
||||
$sql2 .= " WHERE rowid = ".$obj->rowid;
|
||||
//print $sql2."\n";
|
||||
$resql2 = $db->query($sql2);
|
||||
if (!$resql2) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
if ($confirm == 'regenerate') {
|
||||
$entity = 1;
|
||||
$fromrowid = 0;
|
||||
//$fromrowid = 442;
|
||||
|
||||
$block_static = new BlockedLog($db);
|
||||
$block_static->loadTrackedEvents();
|
||||
|
||||
print "TZ=".date_default_timezone_get()."\n";
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Now restart request with all data, so without the limit(1) in sql request
|
||||
$sql = "SELECT rowid, entity, date_creation, tms, user_fullname, action, module_source, amounts_taxexcl, amounts, element, fk_object, date_object, ref_object,";
|
||||
$sql .= " linktoref, linktype, signature, fk_user, object_data, object_version, object_format, debuginfo";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."blockedlog";
|
||||
$sql .= " WHERE entity = ".((int) $entity);
|
||||
$sql .= " AND rowid >= ".((int) $fromrowid);
|
||||
$sql .= " ORDER BY date_creation ASC, rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature()
|
||||
|
||||
$i = 0;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
// Make the first fetch to get first line and then get the previous hash.
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
// We set here all data used into signature calculation (see checkSignature method) and more
|
||||
|
||||
// IMPORTANT: We must have here, the same rule for transformation of data than into
|
||||
// the blockedlog->fetch() method (db->jdate for date, ...)
|
||||
|
||||
$block_static->id = $obj->rowid;
|
||||
$block_static->entity = $obj->entity;
|
||||
|
||||
if ($i == 0) {
|
||||
$tmparray = $block_static->getPreviousHash(0, $block_static->id);
|
||||
$previoushash = $tmparray['previoushash'];
|
||||
}
|
||||
print "\n";
|
||||
|
||||
$tz = 'gmt';
|
||||
if (empty($obj->object_format) || $obj->object_format == 'V1') {
|
||||
$tz = 'tzserver';
|
||||
}
|
||||
|
||||
$block_static->date_creation = $db->jdate($obj->date_creation, $tz); // jdate(date_creation) is UTC
|
||||
$block_static->date_modification = $db->jdate($obj->tms, $tz); // jdate(tms) is UTC
|
||||
|
||||
$block_static->action = $obj->action;
|
||||
$block_static->module_source = $obj->module_source;
|
||||
|
||||
$block_static->amounts_taxexcl = is_null($obj->amounts_taxexcl) ? null : (float) $obj->amounts_taxexcl; // Database store value with 8 digits, we cut ending 0 them with (flow)
|
||||
$block_static->amounts = (float) $obj->amounts; // Database store value with 8 digits, we cut ending 0 them with (flow)
|
||||
|
||||
$block_static->fk_object = $obj->fk_object; // Not in signature
|
||||
$block_static->date_object = $db->jdate($obj->date_object, $tz); // jdate(date_object) is UTC
|
||||
$block_static->ref_object = $obj->ref_object;
|
||||
|
||||
$block_static->linktoref = $obj->linktoref;
|
||||
$block_static->linktype = $obj->linktype;
|
||||
|
||||
$block_static->fk_user = $obj->fk_user; // Not in signature
|
||||
$block_static->user_fullname = $obj->user_fullname;
|
||||
|
||||
$block_static->object_data = $block_static->dolDecodeBlockedData($obj->object_data);
|
||||
|
||||
// Old hash + Previous fields concatenated = signature
|
||||
$block_static->signature = $obj->signature;
|
||||
|
||||
$block_static->element = $obj->element; // Not in signature
|
||||
|
||||
$block_static->object_format = $obj->object_format; // Not in signature.
|
||||
$block_static->object_version = $obj->object_version; // Not in signature
|
||||
|
||||
//$block_static->certified = ($obj->certified == 1); // Not in signature
|
||||
|
||||
//var_dump($obj->date_creation, $tz, $block_static->date_creation);
|
||||
|
||||
// Build/Check the string for the signature
|
||||
$signature = $block_static->checkSignature($previoushash, 2);
|
||||
|
||||
print "For ROWID ".$obj->rowid." - Previous hash = ".$previoushash."\n";
|
||||
print "Signature in db: ".$obj->signature." - New calculated: ".$signature['calculatedsignature']."\n";
|
||||
if ($obj->signature != $signature['calculatedsignature']) {
|
||||
$tmpsql = "UPDATE ".MAIN_DB_PREFIX."blockedlog SET signature = '".$db->escape($signature['calculatedsignature'])."'";
|
||||
$tmpsql .= " WHERE rowid = ".((int) $obj->rowid);
|
||||
|
||||
print "Update for ROWID ".$obj->rowid." with ".$tmpsql."\n";
|
||||
$tmpresult = $db->query($tmpsql);
|
||||
}
|
||||
|
||||
$previoushash = $signature['calculatedsignature'];
|
||||
|
||||
|
||||
// Set new previous hash for next fetch
|
||||
|
||||
$i++;
|
||||
|
||||
// Uncomment to proceed one only
|
||||
//break;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($db->lasterror, null, 'errors');
|
||||
}
|
||||
|
||||
$year++;
|
||||
$db->commit();
|
||||
}
|
||||
|
||||
|
||||
if ($confirm == 'confirm') {
|
||||
print "Update dates to current year for database name = ".$db->database_name."\n";
|
||||
|
||||
// Upgrade dates from 2010 to current year - 2.
|
||||
while ($year <= $lastyear) {
|
||||
//$year=2021;
|
||||
$delta1 = ($lastyear - $year);
|
||||
$delta2 = ($lastyear - $year - 1);
|
||||
//$delta=-1;
|
||||
|
||||
if ($delta1) {
|
||||
foreach ($tables as $tablekey => $tableval) {
|
||||
print "Correct ".$tablekey." for year ".$year." and move them to current year ".$lastyear." ";
|
||||
$sql = "select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." < DATE_ADD(NOW(), INTERVAL -1 YEAR)";
|
||||
//$sql="select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31' and ".$tableval[0]." > NOW()";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
print ".";
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
|
||||
$j = 0;
|
||||
foreach ($tableval as $field) {
|
||||
if ($j) {
|
||||
$sql2 .= ", ";
|
||||
}
|
||||
$sql2 .= $field." = ".$db->ifsql("DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR) > NOW()", "DATE_ADD(".$field.", INTERVAL ".$delta2." YEAR)", "DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR)");
|
||||
$j++;
|
||||
}
|
||||
$sql2 .= " WHERE rowid = ".$obj->rowid;
|
||||
//print $sql2."\n";
|
||||
$resql2 = $db->query($sql2);
|
||||
if (!$resql2) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$year++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($confirm == 'confirmresetblockedlog') {
|
||||
$year = $tmp['year']; // Old year in demo
|
||||
$lastyear = $tmp['year'] - 2; // New year in demo
|
||||
|
||||
// Upgrade dates from current year to current year - 2.
|
||||
while ($year >= $lastyear) {
|
||||
//$year=2021;
|
||||
$delta1 = ($lastyear - $year); // negative value
|
||||
$delta2 = ($lastyear - $year - 1); // negative value
|
||||
//$delta=-1;
|
||||
|
||||
if ($delta1) {
|
||||
foreach ($tables as $tablekey => $tableval) {
|
||||
print "Correct ".$tablekey." for year ".$year." and move them to current year ".$lastyear." ";
|
||||
$sql = "select rowid from ".MAIN_DB_PREFIX.$tablekey." where ".$tableval[0]." between '".$year."-01-01' and '".$year."-12-31'";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
print ".";
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX.$tablekey." set ";
|
||||
$j = 0;
|
||||
foreach ($tableval as $field) {
|
||||
if ($j) {
|
||||
$sql2 .= ", ";
|
||||
}
|
||||
$sql2 .= $field." = DATE_ADD(".$field.", INTERVAL ".$delta1." YEAR)";
|
||||
$j++;
|
||||
}
|
||||
$sql2 .= " WHERE rowid = ".$obj->rowid;
|
||||
//print $sql2."\n";
|
||||
$resql2 = $db->query($sql2);
|
||||
if (!$resql2) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$year--;
|
||||
}
|
||||
|
||||
|
||||
$sql = "CREATE TABLE tmp_delete (SELECT pf.fk_paiement FROM llx_paiement_facture as pf WHERE pf.fk_facture IN (SELECT f.rowid FROM llx_facture as f WHERE f.datef < '2024-12-31'))";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."paiement_facture WHERE fk_paiement IN (SELECT fk_paiement FROM tmp_delete)";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."paiement WHERE rowid IN (SELECT fk_paiement FROM tmp_delete)";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facturedet as fd WHERE fd.fk_facture IN (SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE datef < '".$lastyear."-12-31')";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."facture WHERE datef < '".$lastyear."-12-31'";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DROP TABLE tmp_delete";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture SET datef = datec";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."paiement as p SET datep = (SELECT datef FROM ".MAIN_DB_PREFIX."facture as f WHERE f.rowid = (SELECT fk_facture FROM ".MAIN_DB_PREFIX."paiement_facture as pf WHERE pf.fk_paiement = p.rowid AND pf.fk_facture = f.rowid) LIMIT 1)";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."blockedlog";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_FIRST_REGISTRATION_OK_DATE'";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
|
||||
/*
|
||||
// Delete corrupted record no more used that still exists in demo image but can't exist in a production env
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."blockedlog WHERE action LIKE 'PAYMENT_VARIOUS_%'";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."blockedlog WHERE rowid < 199";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."blockedlog WHERE action LIKE 'MODULE_RESET'";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."blockedlog";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."blockedlog SET date_creation = tms WHERE date_creation <> tms";
|
||||
print $sql;
|
||||
print "\n";
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."blockedlog WHERE date_creation > '".dol_print_date($dolnow, 'day')."'";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."blockedlog SET debuginfo = NULL WHERE debuginfo IS NOT NULL";
|
||||
print $sql;
|
||||
print "\n";
|
||||
$db->query($sql);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
print "\n";
|
||||
|
||||
exit(0);
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
# You may also want to allow access to everyone to wrappers for api, document, viewimage, manifest and public json/img
|
||||
# You may also want to allow access to everyone to wrappers for api, document, viewimage, manifest and public json/img files
|
||||
# but if you can avoid it, it is better.
|
||||
<Files /home/admin/wwwroot/dolibarr/htdocs/api/index.php>
|
||||
AuthType None
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/* Copyright (C) 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/>.
|
||||
*/
|
||||
|
||||
namespace codesniffer\Sniffs\Dolibarr;
|
||||
|
||||
use PHP_CodeSniffer\Sniffs\Sniff;
|
||||
use PHP_CodeSniffer\Files\File;
|
||||
|
||||
/**
|
||||
* CheckIsModEnabledArgumentSniff
|
||||
*/
|
||||
class CheckIsModEnabledArgumentSniff implements Sniff
|
||||
{
|
||||
// Nom de la fonction cible
|
||||
protected $targetFunction = 'ismodenabled';
|
||||
|
||||
protected $deprecatedModulesNames = [
|
||||
'actioncomm' => 'agenda',
|
||||
'adherent' => 'member',
|
||||
'adherent_type' => 'member_type',
|
||||
'banque' => 'bank',
|
||||
'categorie' => 'category',
|
||||
'commande' => 'order',
|
||||
'contrat' => 'contract',
|
||||
'entrepot' => 'stock',
|
||||
'expedition' => 'shipping',
|
||||
'facture' => 'invoice',
|
||||
'ficheinter' => 'intervention',
|
||||
'product_fournisseur_price' => 'productsupplierprice',
|
||||
'product_price' => 'productprice',
|
||||
'projet' => 'project',
|
||||
'propale' => 'propal',
|
||||
'socpeople' => 'contact',
|
||||
];
|
||||
|
||||
/**
|
||||
* register
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
// We are listening function calls (T_STRING)
|
||||
return [T_STRING];
|
||||
}
|
||||
|
||||
/**
|
||||
* process
|
||||
*
|
||||
* @param File $phpcsFile file to process
|
||||
* @param mixed $stackPtr pointer
|
||||
* @return void
|
||||
*/
|
||||
public function process(File $phpcsFile, $stackPtr)
|
||||
{
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
|
||||
if (strtolower($tokens[$stackPtr]['content']) !== strtolower($this->targetFunction)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that it is a function call (followed by '(')
|
||||
$openParen = $phpcsFile->findNext(T_WHITESPACE, $stackPtr + 1, null, true);
|
||||
if ($tokens[$openParen]['code'] !== T_OPEN_PARENTHESIS) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We are looking for the first 'useful' token after the parenthesis
|
||||
$firstArgTokenPtr = $phpcsFile->findNext(T_WHITESPACE, $openParen + 1, null, true);
|
||||
|
||||
// If the function is called without arguments (isModEnabled()), we stop
|
||||
if ($tokens[$firstArgTokenPtr]['code'] === T_CLOSE_PARENTHESIS) {
|
||||
return;
|
||||
}
|
||||
|
||||
// check value of argument
|
||||
$argContent = str_replace(["'", '"'], '', $tokens[$firstArgTokenPtr]['content']);
|
||||
$argCode = $tokens[$firstArgTokenPtr]['code'];
|
||||
|
||||
if (array_key_exists($argContent, $this->deprecatedModulesNames)) {
|
||||
$phpcsFile->addError(
|
||||
'The function "%s" has deprecated argument ("%s") to replace with "%s".',
|
||||
$firstArgTokenPtr,
|
||||
'DeprecatedArgument',
|
||||
[$tokens[$stackPtr]['content'], $argContent, $this->deprecatedModulesNames[$argContent]]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/* Copyright (C) 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/>.
|
||||
*/
|
||||
namespace codesniffer\Sniffs\Dolibarr;
|
||||
|
||||
use PHP_CodeSniffer\Sniffs\Sniff;
|
||||
use PHP_CodeSniffer\Files\File;
|
||||
|
||||
/**
|
||||
* LanguageOfCommentsSniff
|
||||
*/
|
||||
class LanguageOfCommentsSniff implements Sniff
|
||||
{
|
||||
// List of words that betray a comment in French
|
||||
public $frenchWords = [
|
||||
' additionner ',
|
||||
' arrondir ',
|
||||
' avec ',
|
||||
' calculer ',
|
||||
' chaine ',
|
||||
' chaîne ',
|
||||
' chercher ',
|
||||
' chiffre ',
|
||||
' chiffres ',
|
||||
// ' commande ',
|
||||
' commandes ',
|
||||
' compteur ',
|
||||
' compteurs ',
|
||||
' contrats ',
|
||||
' depuis ',
|
||||
' diviser ',
|
||||
' donnée ',
|
||||
' entier ',
|
||||
// ' facture ', // avoid french name of dolibarr object
|
||||
' factures ',
|
||||
' ligne ',
|
||||
' lignes ',
|
||||
' modèle ',
|
||||
' niveau ',
|
||||
' niveaux ',
|
||||
' nombre ',
|
||||
' parametrage ',
|
||||
' paramétrage ',
|
||||
' pourcentage ',
|
||||
' produit ',
|
||||
' produits ',
|
||||
' quand ',
|
||||
' rechercher ',
|
||||
' sinon ',
|
||||
' stocker ',
|
||||
' soustraire ',
|
||||
' sujet ',
|
||||
' sujets ',
|
||||
' suppression ',
|
||||
' utilisateur ',
|
||||
' utilisateurs ',
|
||||
' valeur ',
|
||||
' valeurs ',
|
||||
];
|
||||
|
||||
/**
|
||||
* Which tokens to listen ?
|
||||
* T_COMMENT = comments // or #
|
||||
* T_DOC_COMMENT_STRING = text in block comments
|
||||
* @return int[]
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
return [
|
||||
T_COMMENT,
|
||||
T_DOC_COMMENT_STRING,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* process
|
||||
*
|
||||
* @param File $phpcsFile file to process
|
||||
* @param mixed $stackPtr pointer
|
||||
* @return void
|
||||
*/
|
||||
public function process(File $phpcsFile, $stackPtr)
|
||||
{
|
||||
$tokens = $phpcsFile->getTokens();
|
||||
$content = $tokens[$stackPtr]['content'];
|
||||
|
||||
// Basic cleanup (lowercase for comparison)
|
||||
$contentLower = strtolower($content);
|
||||
|
||||
foreach ($this->frenchWords as $word) {
|
||||
if (strpos($contentLower, $word) !== false) {
|
||||
$error = "The comment appears to be in French (word detected: '%s'). Please write in English.";
|
||||
$data = [trim($word)];
|
||||
$phpcsFile->addWarning($error, $stackPtr, 'FrenchDetected', $data);
|
||||
return; // We stop at the first occurrence.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,11 @@
|
||||
<exclude-pattern>/\.git/</exclude-pattern>
|
||||
<exclude-pattern>/\.cache/</exclude-pattern>
|
||||
|
||||
<!-- Custom rules -->
|
||||
<config name="installed_paths" value="/dev/setup/codesniffer" />
|
||||
<rule ref="codesniffer.Dolibarr.LanguageOfComments"/>
|
||||
<rule ref="codesniffer.Dolibarr.CheckIsModEnabledArgument"/>
|
||||
|
||||
<!-- List of all tests -->
|
||||
|
||||
|
||||
@@ -31,12 +36,12 @@
|
||||
<!-- Rules from Generic Standard -->
|
||||
<!--
|
||||
<rule ref="PSR12.Files.OpenTag">
|
||||
<properties>
|
||||
<property name="ignoreIndent" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<properties>
|
||||
<property name="ignoreIndent" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<exclude name="PSR12.WhiteSpace.ScopeIndent"/>
|
||||
-->
|
||||
-->
|
||||
|
||||
<!-- We want to allow empty statement: It allows to put some code comments into the else for examples -->
|
||||
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
||||
@@ -76,16 +81,16 @@
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
<!-- Lower severity on warnings we do not want to show in the pre-commit reports -->
|
||||
<rule ref="Generic.Files.LineLength.TooLong">
|
||||
<!-- Lower severity on warnings we do not want to show in the pre-commit reports -->
|
||||
<rule ref="Generic.Files.LineLength.TooLong">
|
||||
<severity>4</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity.TooHigh">
|
||||
</rule>
|
||||
<rule ref="Generic.Metrics.CyclomaticComplexity.TooHigh">
|
||||
<severity>4</severity>
|
||||
</rule>
|
||||
<rule ref="Generic.Metrics.NestingLevel.TooHigh">
|
||||
</rule>
|
||||
<rule ref="Generic.Metrics.NestingLevel.TooHigh">
|
||||
<severity>4</severity>
|
||||
</rule>
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- Warnings on TODO -->
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Fail2Ban configuration file
|
||||
#
|
||||
# Regexp to detect try to check a couple login/password so we can add mitigation
|
||||
# on IP making too much tries.
|
||||
# Regexp to detect try to check a couple login/password so we can add mitigation on IPs making too much tries.
|
||||
|
||||
[Definition]
|
||||
|
||||
# To test, you can inject this example into log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 functions_dolibarr::check_user_password_abcd Authentication KO" >> /mypath/documents/dolibarr.log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 1234567 33 functions_dolibarr::check_user_password_abcd Authentication KO" >> /mypath/documents/dolibarr.log
|
||||
#
|
||||
# then
|
||||
# fail2ban-client status web-dol-bruteforce
|
||||
# fail2ban-client status web-dolibarr-bruteforce
|
||||
#
|
||||
# To test rule file on a existing log file
|
||||
# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-rulesbruteforce.conf --print-all-matched
|
||||
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s+functions_.*::check_user_.* Authentication KO
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s.*functions_.*::check_user_.* Authentication KO
|
||||
ignoreregex =
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
# To test, you can inject this example into log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 Hack attempt detected - xxx" >> /mypath/documents/dolibarr.log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 1234567 33 Hack attempt detected - xxx" >> /mypath/documents/dolibarr.log
|
||||
#
|
||||
# then
|
||||
# fail2ban-client status web-dolibarr-hackattempt
|
||||
@@ -14,5 +15,5 @@
|
||||
# To test rule file on a existing log file
|
||||
# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-hackattempt.conf --print-all-matched
|
||||
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s+Hack attempt detected
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s.*Hack attempt detected
|
||||
ignoreregex =
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
[Definition]
|
||||
|
||||
# To test, you can inject this example into log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /public/clicktodial/cidlookup.php" >> /mypath/documents/dolibarr.log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 --- Access to GET /public/clicktodial/cidlookup.php" >> /mypath/documents/dolibarr.log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 1234567 33 --- Access to GET /public/clicktodial/cidlookup.php" >> /mypath/documents/dolibarr.log
|
||||
#
|
||||
# then
|
||||
# fail2ban-client status web-dolibarr-limitpublic
|
||||
@@ -14,5 +15,5 @@
|
||||
# To test rule file on a existing log file
|
||||
# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-limitpublic.conf --print-all-matched
|
||||
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s+--- Access to .*/public/
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s.*--- Access to .*/public/
|
||||
ignoreregex =
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
[Definition]
|
||||
|
||||
# To test, you can inject this example into log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" INFO 1.2.3.4 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log
|
||||
# echo `date +'%Y-%m-%d %H:%M:%S'`" NOTICE 1.2.3.4 1234567 33 --- Access to GET /passwordforgotten.php - action=buildnewpassword, massaction=" >> /mypath/documents/dolibarr.log
|
||||
#
|
||||
# then
|
||||
# fail2ban-client status web-dolibarr-passf
|
||||
@@ -14,5 +15,5 @@
|
||||
# To test rule file on a existing log file
|
||||
# fail2ban-regex /mypath/documents/dolibarr.log /etc/fail2ban/filter.d/web-dolibarr-passf.conf --print-all-matched
|
||||
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s+--- Access to .*/passwordforgotten.php - action=buildnewpassword
|
||||
failregex = ^ [A-Z\s]+ <HOST>\s.*--- Access to .*/passwordforgotten.php - action=buildnewpassword
|
||||
ignoreregex =
|
||||
|
||||
@@ -883,7 +883,7 @@ foreach ($arrayofalerts as $key => $alert) {
|
||||
// VDP ID
|
||||
$html .= '<td style="white-space: nowrap">';
|
||||
if (!empty($alert['issueidvdp'])) {
|
||||
$html .= '#vdp'.$alert['issueidvdp'];
|
||||
$html .= '#'.$alert['issueidvdp'];
|
||||
$arrayofalerts[$key]['description'] .= "\n<br>".'VDP ID #'.$alert['issueidvdp'];
|
||||
} else {
|
||||
//$html .= '<span class="opacitymedium">public issue</span>';
|
||||
@@ -1158,11 +1158,11 @@ function cleanVal2($val)
|
||||
if (preg_match('/CVE([0-9\-\s]+)/', $tmpval['title'], $reg)) {
|
||||
$tmpval['issueidcve'] = preg_replace('/^\-/', '', preg_replace('/\s+/', '-', trim($reg[1])));
|
||||
}
|
||||
if (preg_match('/#yogosha(\d+)/i', $tmpval['title'], $reg)) {
|
||||
$tmpval['issueidvdp'] = $reg[1];
|
||||
if (preg_match('/#(yogosha\d+)/i', $tmpval['title'], $reg)) {
|
||||
$tmpval['issueidvdp'] = strtolower($reg[1]);
|
||||
}
|
||||
if (preg_match('/#ghsa([a-z\-\d]+)/i', $tmpval['title'], $reg)) {
|
||||
$tmpval['issueidvdp'] = $reg[1];
|
||||
if (preg_match('/#(ghsa[a-z\-\d]+)/i', $tmpval['title'], $reg)) {
|
||||
$tmpval['issueidvdp'] = strtolower($reg[1]);
|
||||
}
|
||||
|
||||
return $tmpval;
|
||||
|
||||
@@ -9,19 +9,18 @@
|
||||
*/
|
||||
return [
|
||||
// # Issue statistics:
|
||||
// PhanUndeclaredProperty : 410+ occurrences
|
||||
// PhanTypeMismatchArgument : 65+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 60+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 20+ occurrences
|
||||
// PhanUndeclaredProperty : 400+ occurrences
|
||||
// PhanTypeMismatchArgument : 60+ occurrences
|
||||
// PhanUndeclaredGlobalVariable : 50+ occurrences
|
||||
// PhanTypeMismatchProperty : 20+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 15+ occurrences
|
||||
// PhanTypeInvalidDimOffset : 10+ occurrences
|
||||
// PhanTypeMismatchDimFetch : 10+ occurrences
|
||||
// PhanTypeMismatchArgumentNullable : 7 occurrences
|
||||
// PhanTypeArraySuspiciousNull : 5 occurrences
|
||||
// PhanTypeExpectedObjectPropAccess : 5 occurrences
|
||||
// PhanUndeclaredMethod : 5 occurrences
|
||||
// PhanPluginDuplicateArrayKey : 4 occurrences
|
||||
// PhanPluginUndeclaredVariableIsset : 2 occurrences
|
||||
// PhanPossiblyUndeclaredGlobalVariable : 2 occurrences
|
||||
// PhanTypeMismatchArgumentProbablyReal : 2 occurrences
|
||||
// PhanParamTooMany : 1 occurrence
|
||||
// PhanPossiblyUndeclaredVariable : 1 occurrence
|
||||
@@ -30,7 +29,6 @@ return [
|
||||
|
||||
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
|
||||
'file_suppressions' => [
|
||||
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/comm/action/pertype.php' => ['PhanTypeExpectedObjectPropAccess'],
|
||||
'htdocs/comm/action/peruser.php' => ['PhanTypeMismatchArgument'],
|
||||
@@ -41,16 +39,12 @@ return [
|
||||
'htdocs/commande/class/commande.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/commande/list.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/commande/list_det.php' => ['PhanTypeInvalidDimOffset'],
|
||||
'htdocs/compta/bank/account_statement_document.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/bank/class/account.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/bank/various_payment/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/document.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/bank/various_payment/info.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/compta/clients.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
@@ -59,7 +53,6 @@ return [
|
||||
'htdocs/compta/paiement/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/compta/paiement/cheque/list.php' => ['PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/compta/paiement/rapport.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/prelevement/card.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/clientfourn.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'],
|
||||
@@ -76,7 +69,7 @@ return [
|
||||
'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/class/canvas.class.php' => ['PhanUndeclaredMethod'],
|
||||
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -101,38 +94,32 @@ return [
|
||||
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'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_einstein.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_storm.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/delivery/doc/pdf_typhon.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/contract/doc/pdf_strato.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/delivery/mod_delivery_saphir.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_merou.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_rouget.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/expedition/doc/pdf_espadon.modules.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php' => ['PhanTypeMismatchArgumentNullable'],
|
||||
'htdocs/core/modules/facture/doc/pdf_octopus.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/mrp/mod_mo_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/oauth/github_oauthcallback.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'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/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'],
|
||||
'htdocs/core/modules/workstation/mod_workstation_advanced.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/core/multicompany_page.php' => ['PhanTypeMismatchArgument'],
|
||||
@@ -146,7 +133,6 @@ return [
|
||||
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
|
||||
'htdocs/eventorganization/core/actions_massactions_mail.inc.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -235,16 +221,15 @@ return [
|
||||
'htdocs/salaries/virement_request.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/ajax/company.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/societe/class/societe.class.php' => ['PhanTypeMismatchProperty'],
|
||||
'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'],
|
||||
'htdocs/societe/paymentmodes.php' => ['PhanTypeMismatchArgument'],
|
||||
'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/invoice.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/takepos/invoice.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset'],
|
||||
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/actions_ticket.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/cticketcategory.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/ticket/class/ticket.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/user/class/user.class.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'],
|
||||
'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'],
|
||||
@@ -253,7 +238,6 @@ return [
|
||||
'htdocs/webhook/target_card.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/webportal/admin/setup.php' => ['PhanTypeMismatchArgument'],
|
||||
'htdocs/webportal/class/html.formlistwebportal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/webportal/class/webportalpropal.class.php' => ['PhanUndeclaredProperty'],
|
||||
'htdocs/webservices/server_project.php' => ['PhanUndeclaredProperty'],
|
||||
],
|
||||
// 'directory_suppressions' => ['src/directory_name' => ['PhanIssueName1', 'PhanIssueName2']] can be manually added if needed.
|
||||
|
||||
@@ -227,6 +227,24 @@ return [
|
||||
'backward_compatibility_checks' => false,
|
||||
'simplify_ast' => true,
|
||||
'analyzed_file_extensions' => ['php','inc'],
|
||||
/*'included_extension_subset' => [
|
||||
'curl',
|
||||
'dom',
|
||||
'filter',
|
||||
'gd',
|
||||
'imap',
|
||||
'intl',
|
||||
'json',
|
||||
'libxml',
|
||||
'mbstring',
|
||||
'mysqli',
|
||||
'opcache',
|
||||
'openssl',
|
||||
'session',
|
||||
'sqlite3',
|
||||
'xml',
|
||||
'zip'
|
||||
],*/
|
||||
'globals_type_map' => [
|
||||
'_Avery_Labels' => 'array<string,array{name:string,paper-size:string|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:int,custom_x:float,custom_y:float}>',
|
||||
'action' => 'string',
|
||||
@@ -439,6 +457,7 @@ return [
|
||||
'PhanTypeObjectUnsetDeclaredProperty',
|
||||
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
// 'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
'PhanTypeMismatchArgumentSuperType', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr uses tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
|
||||
@@ -74,6 +74,7 @@ $config['suppress_issue_types'] = [
|
||||
'PhanTypeObjectUnsetDeclaredProperty',
|
||||
'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
'PhanTypeMismatchArgumentSuperType', // a lot of false positive, in most cases, we want to keep the code as it is
|
||||
|
||||
'PhanPluginWhitespaceTab', // Dolibarr used tabs
|
||||
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
|
||||
|
||||
@@ -76,6 +76,8 @@ parameters:
|
||||
- '#Empty array passed to foreach#'
|
||||
- '#Unable to resolve the template type T#'
|
||||
- '#in empty\(\) always exists and is always falsy#'
|
||||
- '#in empty\(\) always exists and is not falsy#'
|
||||
- '#in isset\(\) is not nullable#'
|
||||
- '#is always#'
|
||||
internalErrorsCountLimit: 50
|
||||
cache:
|
||||
|
||||
@@ -939,7 +939,6 @@ Don
|
||||
ECM
|
||||
EmptyMessageNotAllowedError
|
||||
ErrorInputRequired
|
||||
ErrorLDAPFunctionsAreDisabledOnThisPHP
|
||||
ErrorUpdating
|
||||
Extra
|
||||
FailedToConnectToSFTPAfterSSHAuthentication
|
||||
@@ -1014,7 +1013,6 @@ TicketMessageMailSignatureText
|
||||
TicketSetupPage
|
||||
Timeline
|
||||
Transfer
|
||||
TryAnotherConnectionMode
|
||||
UndefinedKey
|
||||
UnknownType
|
||||
UpdateMember
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# - Some side effects from translations on variables.
|
||||
# - Some other minors side effects to be examined (#, %).
|
||||
#
|
||||
# Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
# Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
||||
LANG_DIR=htdocs/langs/en_US/
|
||||
MYDIR=$(dirname "$(realpath "$0")")
|
||||
@@ -141,10 +141,10 @@ sed -n 's@< \(.*\)@^\1\\s*=@p' \
|
||||
#
|
||||
REPL_STR=""
|
||||
for t in trans transnoentities transnoentitiesnoconv newItem buttonsSaveCancel; do
|
||||
REPL_STR="${REPL_STR}\n->${t}(\"\\1\","
|
||||
REPL_STR="${REPL_STR}\n->${t}('\\1',"
|
||||
REPL_STR="${REPL_STR}\n->${t}(\"\\1\")"
|
||||
REPL_STR="${REPL_STR}\n->${t}('\\1')"
|
||||
REPL_STR="${REPL_STR}\n->${t}(\"\\1\","
|
||||
REPL_STR="${REPL_STR}\n->${t}('\\1',"
|
||||
REPL_STR="${REPL_STR}\n->${t}(\"\\1\")"
|
||||
REPL_STR="${REPL_STR}\n->${t}('\\1')"
|
||||
done
|
||||
|
||||
rm -f "${MISSING_FILE}.grep" >/dev/null 2>&1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2013-2026 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-2025 Frédéric France <frederic.france@free.fr>
|
||||
@@ -27,11 +27,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -39,6 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries'));
|
||||
@@ -260,6 +259,9 @@ if ($action == 'delete') {
|
||||
$pcgver = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
|
||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent, aa.label, aa.labelshort, aa.fk_accounting_category,";
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
|
||||
$sql .= " (SELECT COUNT(*) FROM ".MAIN_DB_PREFIX."accounting_category_account aca WHERE aca.fk_accounting_account = aa.rowid) as nb_categories,";
|
||||
}
|
||||
$sql .= " aa.reconcilable, aa.centralized, aa.active, aa.import_key,";
|
||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||
|
||||
@@ -440,7 +442,9 @@ if ($resql) {
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accounting_account', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
@@ -467,7 +471,7 @@ if ($resql) {
|
||||
$obj = $db->fetch_object($resqlchart);
|
||||
if ($obj) {
|
||||
$labeltoshow = $obj->country_code.' - '.$obj->pcg_version.' - '.$obj->label;
|
||||
$htmltoshow = picto_from_langcode($obj->country_code).' '.$obj->country_code.' - '.$obj->pcg_version.' - '.$obj->label;
|
||||
$htmltoshow = picto_from_langcode($obj->country_code).' '.$obj->country_code.' - '.$obj->pcg_version.' <span class="opacitymedium">- '.$obj->label.'</span>';
|
||||
print '<option value="'.$obj->rowid.'" data-html="'.dolPrintHTMLForAttribute($htmltoshow).'"';
|
||||
print ($pcgver == $obj->rowid) ? ' selected' : '';
|
||||
print '>'.$labeltoshow.'</option>';
|
||||
@@ -760,9 +764,31 @@ if ($resql) {
|
||||
}
|
||||
// Custom accounts
|
||||
if (!empty($arrayfields['categories']['checked'])) {
|
||||
print '<td class="right">';
|
||||
// TODO Get all custom groups labels the account is in
|
||||
print dol_escape_htmltag($obj->fk_accounting_category);
|
||||
print '<td>';
|
||||
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
|
||||
// Multi report system
|
||||
if (!empty($obj->nb_categories)) {
|
||||
$accountingcategory_temp = new AccountancyCategory($db);
|
||||
$categories = $accountingcategory_temp->getCategoriesForAccount($obj->rowid);
|
||||
|
||||
$categoriesLabels = array();
|
||||
foreach ($categories as $cat) {
|
||||
$categoriesLabels[] = '<span class="badge badge-status4" title="'.dol_escape_htmltag($cat['label']).'">'.dol_escape_htmltag($cat['code']).'</span>';
|
||||
}
|
||||
print implode(' ', $categoriesLabels);
|
||||
} else {
|
||||
print '<span class="opacitymedium">-</span>';
|
||||
}
|
||||
} else {
|
||||
// OLD SYSTEM: One-to-many
|
||||
if (!empty($obj->fk_accounting_category)) {
|
||||
print dol_escape_htmltag($obj->fk_accounting_category);
|
||||
} else {
|
||||
print '<span class="opacitymedium">-</span>';
|
||||
}
|
||||
}
|
||||
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -842,11 +868,11 @@ if ($resql) {
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="center nowraponall">';
|
||||
// if ($permissiontoadd) { // test is always true
|
||||
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
|
||||
print '<a class="editfielda" href="./card.php?action=update&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param.'&page='.$page).'">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'">';
|
||||
print '<a class="marginleftonly" href="./card.php?action=delete&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param.'&page='.$page).'">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
print ' ';
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
|
||||
* Copyright (C) 2011-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2011-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2026 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
|
||||
@@ -196,7 +196,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
||||
}
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
// In case of 'actionadd' and with valid parameters, add the line
|
||||
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||
$newid = 0;
|
||||
|
||||
@@ -241,11 +241,11 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
}
|
||||
}
|
||||
|
||||
// Si verif ok et action modify, on modifie la ligne
|
||||
// In case of 'actionmodify' and with valid parameters, modify the line
|
||||
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
// Change field's value
|
||||
|
||||
$i = 0;
|
||||
foreach ($listfieldmodify as $field) {
|
||||
@@ -268,7 +268,6 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
$sql .= " WHERE rowid = ".((int) $rowid);
|
||||
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
setEventMessages($db->error(), null, 'errors');
|
||||
@@ -327,13 +326,13 @@ $linkback = '';
|
||||
print load_fiche_titre($titre, $linkback, 'title_accountancy');
|
||||
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
// Confirmation of line deletion
|
||||
if ($action == 'delete') {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
// Complete requete recherche valeurs avec critere de tri
|
||||
// Complete the values search query with the sort order
|
||||
$sql = $tabsql[$id];
|
||||
|
||||
if ($search_country_id > 0) {
|
||||
@@ -351,7 +350,6 @@ if ($sortfield == 'country') {
|
||||
}
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->plimit($listlimit + 1, $offset);
|
||||
//print $sql;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
@@ -368,8 +366,8 @@ $fieldlist = explode(',', $tabfield[$id]);
|
||||
// Line for title
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
// Determine the field name based on the possible names
|
||||
// in the data dictionaries
|
||||
$valuetoshow = ucfirst($fieldlist[$field]); // By default
|
||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||
$class = "left";
|
||||
@@ -393,7 +391,6 @@ foreach ($fieldlist as $field => $value) {
|
||||
if ($fieldlist[$field] == 'pcg_version' || $fieldlist[$field] == 'fk_pcg_version') {
|
||||
$valuetoshow = $langs->trans("Pcg_version");
|
||||
}
|
||||
//var_dump($value);
|
||||
|
||||
if ($valuetoshow != '') {
|
||||
print '<td class="'.$class.'">';
|
||||
@@ -588,8 +585,7 @@ if ($resql) {
|
||||
'page' => $page,
|
||||
'sortfield' => $sortfield,
|
||||
'sortorder' => $sortorder,
|
||||
'rowid' => (!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')),
|
||||
'code' => $obj->code,
|
||||
'rowid' => (!empty($obj->rowid) ? $obj->rowid : '')
|
||||
]);
|
||||
|
||||
// Active
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
@@ -72,7 +72,7 @@ $object = new AccountingAccount($db);
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php';
|
||||
$urltogo = (!empty($backtopage) ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php');
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ if ($action == 'add' /* && $user->hasRight('accounting', 'chartofaccount') // al
|
||||
}
|
||||
if (!$error) {
|
||||
setEventMessages("RecordCreatedSuccessfully", null, 'mesgs');
|
||||
$urltogo = $backtopage ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php';
|
||||
$urltogo = (!empty($backtopage) ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php');
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ if ($action == 'add' /* && $user->hasRight('accounting', 'chartofaccount') // al
|
||||
$result = $object->update($user);
|
||||
|
||||
if ($result > 0) {
|
||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||
$urltogo = (!empty($backtopage) ? $backtopage : ($_SERVER["PHP_SELF"] . "?id=" . $id));
|
||||
header("Location: " . $urltogo);
|
||||
exit();
|
||||
} elseif ($result == -2) {
|
||||
@@ -179,7 +179,7 @@ if ($action == 'add' /* && $user->hasRight('accounting', 'chartofaccount') // al
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$urltogo = $backtopage ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id);
|
||||
$urltogo = (!empty($backtopage) ? $backtopage : ($_SERVER["PHP_SELF"]."?id=".$id));
|
||||
header("Location: ".$urltogo);
|
||||
exit();
|
||||
}
|
||||
@@ -190,7 +190,8 @@ if ($action == 'add' /* && $user->hasRight('accounting', 'chartofaccount') // al
|
||||
$result = $object->delete($user);
|
||||
|
||||
if ($result > 0) {
|
||||
header("Location: account.php");
|
||||
$urltogo = (!empty($backtopage) ? $backtopage : DOL_URL_ROOT.'/accountancy/admin/account.php');
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2014-2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024-2026 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
|
||||
@@ -27,9 +27,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
@@ -39,187 +36,399 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("bills", "accountancy", "compta"));
|
||||
$langs->loadLangs(array("accountancy", "admin", "bills", "compta"));
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cat_id = GETPOSTINT('account_category');
|
||||
$selectcpt = GETPOST('cpt_bk', 'array');
|
||||
$cpt_id = GETPOSTINT('cptid');
|
||||
|
||||
if ($cat_id == 0) {
|
||||
$cat_id = null;
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
if (empty($sortfield)) {
|
||||
$sortfield = 'account_number';
|
||||
}
|
||||
if (empty($sortorder)) {
|
||||
$sortorder = 'ASC';
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$id = GETPOSTINT('id');
|
||||
$catid = GETPOSTINT('catid'); // Alternative parameter name for consistency
|
||||
if (empty($id) && !empty($catid)) {
|
||||
$id = $catid;
|
||||
}
|
||||
$account_id = GETPOSTINT('account_id');
|
||||
$cpt_id = GETPOSTINT('cpt'); // For compatibility with old system
|
||||
|
||||
// Security check
|
||||
if (!$user->hasRight('accounting', 'chartofaccount')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
// Initialize objects
|
||||
$accountingcategory = new AccountancyCategory($db);
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
// Load category
|
||||
if ($id > 0) {
|
||||
$result = $accountingcategory->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($accountingcategory->error, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Parameters for list (new system only)
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
// Search filters (new system only)
|
||||
$search_account = GETPOST('search_account', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
|
||||
if (empty($sortfield)) {
|
||||
$sortfield = "aa.account_number";
|
||||
}
|
||||
if (empty($sortorder)) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
// Use new multi report system
|
||||
$useNewSystem = (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// If we add account
|
||||
if (!empty($selectcpt)) {
|
||||
$cpts = array();
|
||||
foreach ($selectcpt as $selectedoption) {
|
||||
if (!array_key_exists($selectedoption, $cpts)) {
|
||||
$cpts[$selectedoption] = "'".$selectedoption."'";
|
||||
}
|
||||
if ($useNewSystem) {
|
||||
// Remove filter
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
$search_account = '';
|
||||
$search_label = '';
|
||||
}
|
||||
|
||||
$return = $accountingcategory->updateAccAcc((int) $cat_id, $cpts);
|
||||
// Add account to category
|
||||
if ($action == 'add_account' && !empty($account_id)) {
|
||||
$result = $accountingcategory->addAccountToCategory($account_id);
|
||||
|
||||
if ($return < 0) {
|
||||
setEventMessages($langs->trans('errors'), $accountingcategory->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('RecordModifiedSuccessfully'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete') {
|
||||
if ($cpt_id) {
|
||||
if ($accountingcategory->deleteCptCat($cpt_id)) {
|
||||
setEventMessages($langs->trans('AccountRemovedFromGroup'), null, 'mesgs');
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("AccountAddedToCategory"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
} elseif ($result == 0) {
|
||||
setEventMessages($langs->trans("AccountAlreadyInCategory"), null, 'warnings');
|
||||
} else {
|
||||
setEventMessages($langs->trans('errors'), null, 'errors');
|
||||
setEventMessages($accountingcategory->error, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Remove account from category
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes' && !empty($account_id)) {
|
||||
$result = $accountingcategory->deleteAccountFromCategory($account_id);
|
||||
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("AccountRemovedFromCategory"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($accountingcategory->error, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Add multiple accounts
|
||||
if ($action == 'add_multiple' && GETPOST('accounts_to_add', 'array')) {
|
||||
$accounts_to_add = GETPOST('accounts_to_add', 'array');
|
||||
|
||||
$result = $accountingcategory->addMultipleAccountsToCategory($accounts_to_add);
|
||||
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans("XAccountsAdded", $result), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
} elseif ($result < 0) {
|
||||
setEventMessages($accountingcategory->error, $accountingcategory->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans("NoAccountAdded"), null, 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all accounts
|
||||
if ($action == 'confirm_remove_all' && $confirm == 'yes') {
|
||||
$result = $accountingcategory->removeAllAccountsFromCategory();
|
||||
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans("XAccountsRemoved", $result), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($accountingcategory->error, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// OLD SYSTEM: One-to-many via fk_accounting_category field
|
||||
if ($action == 'clean') {
|
||||
$result = $accountingcategory->deleteCptCat($cpt_id);
|
||||
if ($result >= 0) {
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($accountingcategory->error, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
|
||||
llxHeader('', $langs->trans("AccountingCategory"), $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin-categories');
|
||||
|
||||
$title = $langs->trans('AccountingCategory');
|
||||
$help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
|
||||
if ($useNewSystem) {
|
||||
// ============================================================================
|
||||
// NEW SYSTEM VIEW
|
||||
// ============================================================================
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_categories');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
$titlepicto = 'setup';
|
||||
|
||||
print load_fiche_titre($langs->trans('AccountingCategory'), $linkback, $titlepicto);
|
||||
|
||||
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="display">';
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Select the category
|
||||
print '<tr><td class="titlefield">'.$langs->trans("AccountingCategory").'</td>';
|
||||
print '<td>';
|
||||
$s = $formaccounting->select_accounting_category((int) $cat_id, 'account_category', 1, 0, 0, 0);
|
||||
if ($formaccounting->nbaccounts_category <= 0) {
|
||||
print '<span class="opacitymedium">'.$s.'</span>';
|
||||
} else {
|
||||
print $s;
|
||||
print '<input type="submit" class="button small" value="'.$langs->trans("Select").'">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
// Select the accounts
|
||||
if (!empty($cat_id)) {
|
||||
$return = $accountingcategory->getAccountsWithNoCategory($cat_id);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
$arraykeyvalue = array();
|
||||
foreach ($accountingcategory->lines_cptbk as $key => $val) {
|
||||
$doc_ref = !empty($val->doc_ref) ? $val->doc_ref : '';
|
||||
$arraykeyvalue[length_accountg($val->numero_compte)] = length_accountg($val->numero_compte) . ' - ' . $val->label_compte . ($doc_ref ? ' '.$doc_ref : '');
|
||||
// Confirmation dialogs
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm(
|
||||
$_SERVER["PHP_SELF"].'?id='.$id.'&account_id='.$account_id,
|
||||
$langs->trans('RemoveAccountFromCategory'),
|
||||
$langs->trans('ConfirmRemoveAccountFromCategory'),
|
||||
'confirm_delete',
|
||||
'',
|
||||
0,
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
||||
print img_picto($langs->trans("AccountingAccount"), 'accounting_account', 'class="pictofixedwidth"');
|
||||
print $form->multiselectarray('cpt_bk', $arraykeyvalue, GETPOST('cpt_bk', 'array'), 0, 0, '', 0, "80%", '', '', $langs->transnoentitiesnoconv("AddAccountFromBookKeepingWithNoCategories"));
|
||||
print '<input type="submit" class="button button-add small" id="" class="action-delete" value="'.$langs->trans("Add").'"> ';
|
||||
if ($action == 'remove_all') {
|
||||
print $form->formconfirm(
|
||||
$_SERVER["PHP_SELF"].'?id='.$id,
|
||||
$langs->trans('RemoveAllAccountsFromCategory'),
|
||||
$langs->trans('ConfirmRemoveAllAccountsFromCategory'),
|
||||
'confirm_remove_all',
|
||||
'',
|
||||
0,
|
||||
1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
// Page title
|
||||
$title = $langs->trans("AccountingCategory").': '.$accountingcategory->label;
|
||||
print load_fiche_titre($title, '', 'title_accountancy');
|
||||
|
||||
// Category information card
|
||||
print dol_get_fiche_head();
|
||||
|
||||
if ((empty($action) || $action == 'display' || $action == 'delete') && $cat_id > 0) {
|
||||
$param = 'account_category='.((int) $cat_id);
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Code").'</td><td>'.$accountingcategory->code.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$accountingcategory->label.'</td></tr>';
|
||||
if (!empty($accountingcategory->range_account)) {
|
||||
print '<tr><td>'.$langs->trans("Comment").'</td><td>'.$accountingcategory->range_account.'</td></tr>';
|
||||
}
|
||||
print '<tr><td>'.$langs->trans("AccountsLinked").'</td><td><strong>'.$accountingcategory->countAccountsInCategory().'</strong></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// Build SQL for linked accounts
|
||||
$sql = "SELECT aa.rowid, aa.account_number, aa.label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account as aca";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = aca.fk_accounting_account";
|
||||
$sql .= " WHERE aca.fk_accounting_category = ".((int) $id);
|
||||
$sql .= " AND aa.entity = ".$conf->entity;
|
||||
|
||||
// Search filters
|
||||
if (!empty($search_account)) {
|
||||
$sql .= natural_search("aa.account_number", $search_account);
|
||||
}
|
||||
if (!empty($search_label)) {
|
||||
$sql .= natural_search("aa.label", $search_label);
|
||||
}
|
||||
|
||||
// Count total
|
||||
$nbtotalofrecords = '';
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
if (($page * $limit) > $nbtotalofrecords) {
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// Add sort and limit
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
// Parameters
|
||||
$param = '&id='.$id;
|
||||
if (!empty($search_account)) {
|
||||
$param .= '&search_account='.urlencode($search_account);
|
||||
}
|
||||
if (!empty($search_label)) {
|
||||
$param .= '&search_label='.urlencode($search_label);
|
||||
}
|
||||
|
||||
// Form to add accounts
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add_multiple">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
// Get available accounts
|
||||
$availableAccounts = $accountingcategory->getAvailableAccountsForCategory();
|
||||
|
||||
if (count($availableAccounts) > 0) {
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("AddAccountsToCategory").": ".'</td><td>';
|
||||
|
||||
// Prepare array for multiselectarray
|
||||
$arrayofaccounts = array();
|
||||
foreach ($availableAccounts as $account) {
|
||||
$arrayofaccounts[$account['id']] = $account['account_number'].' - '.$account['label'];
|
||||
}
|
||||
|
||||
// Use Dolibarr native multiselect with search
|
||||
print $form->multiselectarray('accounts_to_add', $arrayofaccounts, array(), 0, 0, '', 0, '100%', '', '', $langs->trans("SelectAccountsToAdd"));
|
||||
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button button-save" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="button" class="button button-cancel" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<div class="info">'.$langs->trans("AllAccountsAlreadyLinked").'</div>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
|
||||
// List of linked accounts
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
$massactionbutton = '';
|
||||
$title = $langs->trans("AccountsLinked");
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'accountancy', 0, '', '', $limit);
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable nobottomiftotal liste">';
|
||||
|
||||
// Search filters row
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList('AccountAccounting', 0, $_SERVER['PHP_SELF'], 'account_number', '', $param, '', $sortfield, $sortorder, '')."\n";
|
||||
print getTitleFieldOfList('Label', 0, $_SERVER['PHP_SELF'], 'label', '', $param, '', $sortfield, $sortorder, '')."\n";
|
||||
print getTitleFieldOfList('', 0, $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, '')."\n";
|
||||
print '</tr>'."\n";
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_account" value="'.dol_escape_htmltag($search_account).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth200" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if (!empty($cat_id)) {
|
||||
$return = $accountingcategory->display($cat_id); // This load ->lines_display
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
// Header row
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("AccountNumber", $_SERVER["PHP_SELF"], "aa.account_number", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "aa.label", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
print '</tr>';
|
||||
|
||||
if (is_array($accountingcategory->lines_display) && count($accountingcategory->lines_display) > 0) {
|
||||
$accountingcategory->lines_display = dol_sort_array($accountingcategory->lines_display, $sortfield, $sortorder, -1, 0, 1);
|
||||
// Data rows
|
||||
$i = 0;
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
foreach ($accountingcategory->lines_display as $cpt) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.length_accountg($cpt->account_number).'</td>';
|
||||
print '<td>'.$cpt->label.'</td>';
|
||||
print '<td class="right">';
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&account_category='.$cat_id.'&cptid='.$cpt->rowid.'">';
|
||||
print $langs->trans("DeleteFromCat");
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', 'class="paddingleft"');
|
||||
print "</a>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
} else {
|
||||
print '<tr><td colspan="3"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Account number
|
||||
print '<td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/card.php?id='.$obj->rowid.'">';
|
||||
print $obj->account_number;
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
// Label
|
||||
print '<td>';
|
||||
print dol_escape_htmltag($obj->label);
|
||||
print '</td>';
|
||||
|
||||
// Actions
|
||||
print '<td class="center">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$id.'&account_id='.$obj->rowid.'" class="reposition">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
if ($num == 0) {
|
||||
print '<tr><td colspan="3"><span class="opacitymedium">'.$langs->trans("NoAccountLinked").'</span></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</form>';
|
||||
|
||||
// Button to remove all
|
||||
if ($num > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=remove_all&token='.newToken().'&id='.$id.'">'.$langs->trans("RemoveAllAccountsFromCategory").'</a>';
|
||||
print '</div>';
|
||||
}
|
||||
} else {
|
||||
// ============================================================================
|
||||
// OLD SYSTEM VIEW (compatibility)
|
||||
// ============================================================================
|
||||
|
||||
$listcpt = $accountingcategory->display($id);
|
||||
$listcptNotIn = $accountingcategory->getAccountsWithNoCategory($id);
|
||||
|
||||
print load_fiche_titre($langs->trans('AccountingCategory')." : ".$accountingcategory->label);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="clean">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("AccountNumber").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if (is_array($listcpt) && count($listcpt) > 0) {
|
||||
foreach ($listcpt as $cpt) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.length_accountg($cpt->account_number).'</td>';
|
||||
print '<td>'.$cpt->label.'</td>';
|
||||
print '<td>';
|
||||
print '<input type="submit" class="button smallpaddingimp" name="cpt" value="'.$cpt->rowid.'" title="'.$langs->trans("DeleteFromCat").'">';
|
||||
print img_picto($langs->trans("DeleteFromCat"), 'unlink', 'class="paddingleft"');
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
}
|
||||
} else {
|
||||
print '<tr><td colspan="3"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2011-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2026 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
|
||||
@@ -26,14 +26,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
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/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
@@ -43,6 +35,16 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
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/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyreport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "accountancy", "hrm"));
|
||||
|
||||
@@ -70,7 +72,7 @@ $listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000;
|
||||
$sortfield = (string) GETPOST("sortfield", 'aZ09comma');
|
||||
$sortorder = GETPOST("sortorder", 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
if (empty($page) || $page < 0 || GETPOST('button_refresh', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
}
|
||||
@@ -80,6 +82,22 @@ $pagenext = $page + 1;
|
||||
|
||||
$search_country_id = GETPOST('search_country_id', 'int');
|
||||
|
||||
// Report filter (Multi report)
|
||||
$search_report = GETPOSTINT('search_report');
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
|
||||
if (empty($search_report)) {
|
||||
// Try to get from session
|
||||
if (!empty($_SESSION['accounting_category_report_filter'])) {
|
||||
$search_report = $_SESSION['accounting_category_report_filter'];
|
||||
} else {
|
||||
$search_report = 1; // Default report
|
||||
}
|
||||
} else {
|
||||
// Save in session
|
||||
$_SESSION['accounting_category_report_filter'] = $search_report;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
@@ -99,7 +117,7 @@ $tablib[32] = "DictionaryAccountancyCategory";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql = array();
|
||||
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
|
||||
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_report, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort = array();
|
||||
@@ -147,6 +165,12 @@ $accountingcategory = new AccountancyCategory($db);
|
||||
|
||||
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) {
|
||||
$search_country_id = '';
|
||||
|
||||
// Reset report filter
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
|
||||
$search_report = 1;
|
||||
$_SESSION['accounting_category_report_filter'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Actions add or modify an entry into a dictionary
|
||||
@@ -209,7 +233,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
setEventMessages($langs->transnoentities('ErrorFieldMustBeANumeric', $langs->transnoentities("Position")), null, 'errors');
|
||||
}
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
// In case of 'actionadd' and with valid parameters, add the line
|
||||
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||
$newid = 0;
|
||||
|
||||
@@ -280,7 +304,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
// Modify field values
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $db->sanitize($tabrowid[$id])." = ";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
@@ -426,6 +450,71 @@ print load_fiche_titre($titre, $linkback, $titlepicto);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
|
||||
|
||||
// Report selector (New System)
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" id="form_report_selector">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Report").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
|
||||
// Get list of reports
|
||||
$reports_list = array();
|
||||
|
||||
$sql_reports = "SELECT r.rowid, r.code, r.label";
|
||||
$sql_reports .= " FROM ".MAIN_DB_PREFIX."c_accounting_report as r";
|
||||
$sql_reports .= " WHERE r.active = 1";
|
||||
$sql_reports .= " ORDER BY r.code ASC";
|
||||
|
||||
$resql_reports = $db->query($sql_reports);
|
||||
if ($resql_reports) {
|
||||
$num_reports = $db->num_rows($resql_reports);
|
||||
$i_report = 0;
|
||||
while ($i_report < $num_reports) {
|
||||
$obj_report = $db->fetch_object($resql_reports);
|
||||
$reports_list[$obj_report->rowid] = $obj_report->label.' ('.$obj_report->code.')';
|
||||
$i_report++;
|
||||
}
|
||||
$db->free($resql_reports);
|
||||
}
|
||||
|
||||
if (empty($reports_list)) {
|
||||
$reports_list[1] = $langs->trans("ReportPersonalized");
|
||||
}
|
||||
|
||||
// Display select with auto-submit
|
||||
print '<select name="search_report" id="search_report" class="flat minwidth200">';
|
||||
foreach ($reports_list as $report_id => $report_label) {
|
||||
$selected = ($report_id == $search_report) ? ' selected' : '';
|
||||
print '<option value="'.$report_id.'"'.$selected.'>'.dol_escape_htmltag($report_label).'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
|
||||
print ' ';
|
||||
print '<input type="submit" class="button button-add" name="button_refresh" value="'.$langs->trans("Refresh").'">';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
print '<div class="clearboth"></div>';
|
||||
}
|
||||
|
||||
// Confirmation of the deletion of the line
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
@@ -443,6 +532,15 @@ if ($search_country_id > 0) {
|
||||
$sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)";
|
||||
}
|
||||
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT') && $search_report > 0) {
|
||||
if (preg_match('/ WHERE /', $sql)) {
|
||||
$sql .= " AND ";
|
||||
} else {
|
||||
$sql .= " WHERE ";
|
||||
}
|
||||
$sql .= " a.fk_report = ".((int) $search_report);
|
||||
}
|
||||
|
||||
// If sort order is "country", we use country_code instead
|
||||
if ($sortfield == 'country') {
|
||||
$sortfield = 'country_code';
|
||||
@@ -461,6 +559,9 @@ $param = '&id='.$id;
|
||||
if ($search_country_id > 0) {
|
||||
$param .= '&search_country_id='.urlencode((string) ($search_country_id));
|
||||
}
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT') && $search_report > 0) {
|
||||
$param .= '&search_report='.urlencode((string) ($search_report));
|
||||
}
|
||||
$paramwithsearch = $param;
|
||||
if ($sortorder) {
|
||||
$paramwithsearch .= '&sortorder='.urlencode($sortorder);
|
||||
@@ -493,8 +594,8 @@ if ($tabname[$id]) {
|
||||
print '<td></td>';
|
||||
}
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
// Determine the field name based on the possible names
|
||||
// in the data dictionaries.
|
||||
$valuetoshow = ucfirst($fieldlist[$field]); // By default
|
||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||
$class = "left";
|
||||
@@ -889,11 +990,18 @@ if ($resql) {
|
||||
print '<td>';
|
||||
if (empty($obj->formula)) {
|
||||
// Count number of accounts into group
|
||||
$nbofaccountintogroup = 0;
|
||||
$listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid);
|
||||
$nbofaccountintogroup = count($listofaccountintogroup);
|
||||
if (getDolGlobalInt('ACCOUNTING_ENABLE_MULTI_REPORT')) {
|
||||
// NEW SYSTEM: Multi report
|
||||
$accountingcategory_temp = new AccountancyCategory($db);
|
||||
$accountingcategory_temp->id = $obj->rowid;
|
||||
$nbofaccountintogroup = $accountingcategory_temp->countAccountsInCategory();
|
||||
} else {
|
||||
// OLD SYSTEM: Only one report
|
||||
$listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid);
|
||||
$nbofaccountintogroup = count($listofaccountintogroup);
|
||||
}
|
||||
|
||||
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories.php?action=display&save_lastsearch_values=1&account_category='.$obj->rowid.'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories.php?id='.$obj->rowid.'">';
|
||||
print $langs->trans("NAccounts", $nbofaccountintogroup);
|
||||
print '</a>';
|
||||
} else {
|
||||
@@ -902,7 +1010,7 @@ if ($resql) {
|
||||
print '</td>';
|
||||
|
||||
// Active
|
||||
print '<td class="center" class="nowrap">';
|
||||
print '<td class="center nowrap">';
|
||||
if ($canbedisabled) {
|
||||
print '<a class="reposition" href="'.$url.'action='.urlencode($acts[$obj->active]).'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
||||
} else {
|
||||
|
||||
@@ -24,11 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -36,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
@@ -123,7 +121,8 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-adm
|
||||
|
||||
$sql = "SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut as status, f.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear as f";
|
||||
$sql .= " WHERE f.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.entity = ".((int) $conf->entity);
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -36,13 +32,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "compta"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOSTINT('id');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$ref = GETPOST('ref', 'alpha') ? GETPOST('ref', 'alpha') : GETPOST('label', 'alpha');
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
@@ -62,17 +60,16 @@ $extrafields = new ExtraFields($db);
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
|
||||
|
||||
// List of status
|
||||
/*
|
||||
static $tmpstatus2label = array(
|
||||
'0' => 'OpenFiscalYear',
|
||||
'1' => 'CloseFiscalYear'
|
||||
);
|
||||
$status2label = array(
|
||||
'' => ''
|
||||
'0' => 'OpenFiscalYear',
|
||||
'1' => 'CloseFiscalYear'
|
||||
);
|
||||
$status2label = array('' => '');
|
||||
foreach ($tmpstatus2label as $key => $val) {
|
||||
$status2label[$key] = $langs->trans($val);
|
||||
}
|
||||
|
||||
*/
|
||||
$date_start = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearmonth'), GETPOSTINT('fiscalyearday'), GETPOSTINT('fiscalyearyear'));
|
||||
$date_end = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearendmonth'), GETPOSTINT('fiscalyearendday'), GETPOSTINT('fiscalyearendyear'));
|
||||
|
||||
@@ -128,16 +125,19 @@ if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // a
|
||||
$db->begin();
|
||||
|
||||
$id = $object->create($user);
|
||||
|
||||
if ($id > 0) {
|
||||
$db->commit();
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit();
|
||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||
exit;
|
||||
} else {
|
||||
$db->rollback();
|
||||
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
// Handle overlap error
|
||||
if ($id == -5 && !empty($object->errors[0])) {
|
||||
setEventMessages($langs->trans($object->error, $object->errors[0]), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
$action = 'create';
|
||||
}
|
||||
} else {
|
||||
@@ -145,7 +145,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // a
|
||||
}
|
||||
} else {
|
||||
header("Location: ./fiscalyear.php");
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
} elseif ($action == 'update' /* && $permissiontoadd // always true */) {
|
||||
// Update record
|
||||
@@ -158,16 +158,20 @@ if ($action == 'confirm_delete' && $confirm == "yes" /* && $permissiontoadd // a
|
||||
$object->status = GETPOSTINT('status');
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
if ($result > 0) {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit();
|
||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
// Handle overlap error
|
||||
if ($result == -5 && !empty($object->errors[0])) {
|
||||
setEventMessages($langs->trans($object->error, $object->errors[0]), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit();
|
||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
|
||||
exit;
|
||||
}
|
||||
} elseif ($action == 'reopen' /* && $permissiontoadd // always true */ && getDolGlobalString('ACCOUNTING_CAN_REOPEN_CLOSED_PERIOD')) {
|
||||
$result = $object->fetch($id);
|
||||
@@ -343,6 +347,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Id
|
||||
@@ -373,6 +378,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -35,10 +31,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "compta"));
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
$ref = GETPOST('ref', 'alpha') ? GETPOST('ref', 'alpha') : GETPOST('label', 'alpha');
|
||||
|
||||
$object = new Fiscalyear($db);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
accessforbidden();
|
||||
@@ -47,10 +54,17 @@ if (!$user->hasRight('accounting', 'fiscalyear', 'write')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$id = GETPOSTINT('id');
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
|
||||
// View
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("Fiscalyear")." - ".$langs->trans("Info");
|
||||
|
||||
@@ -59,19 +73,18 @@ $help_url = 'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilit&eacut
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin_fiscalyear_info');
|
||||
|
||||
if ($id) {
|
||||
$object = new Fiscalyear($db);
|
||||
$object->fetch($id);
|
||||
$object->info($id);
|
||||
|
||||
$head = fiscalyear_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), -1, $object->picto);
|
||||
print dol_get_fiche_head($head, 'info', $langs->trans("Fiscalyear"), -1, $object->picto, 0, '', '', 0, '', 1);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/fiscalyear.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '';
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
dol_banner_tab($object, 'label', $linkback, 1, 'label', 'label', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -32,13 +32,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
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.'/accountancy/class/accountancyexport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -47,6 +40,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
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.'/accountancy/class/accountancyexport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
|
||||
@@ -482,33 +481,28 @@ print '<br>';
|
||||
|
||||
|
||||
// Case of the parameter ACCOUNTING_MODE
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updatemode">';
|
||||
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1) {
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="updatemode">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans('OptionMode').'</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode != 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeVirtual').'</label> ('.$langs->trans('Default').')</td>';
|
||||
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).'</span>';
|
||||
print "</td></tr>\n";
|
||||
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode == 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeTrue').'</label></td>';
|
||||
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc'))."</span>";
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans('OptionMode').'</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_1" name="accounting_mode" value="CREANCES-DETTES"'.($accounting_mode != 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_1"> '.$langs->trans('OptionModeVirtual').'</label> ('.$langs->trans('Default').')</td>';
|
||||
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_NON_TREASURY_Desc')).'</span>';
|
||||
print "</td></tr>\n";
|
||||
print '<tr class="oddeven"><td class="nowraponall"><input type="radio" id="accounting_mode_2" name="accounting_mode" value="RECETTES-DEPENSES"'.($accounting_mode == 'RECETTES-DEPENSES' ? ' checked' : '').'><label for="accounting_mode_2"> '.$langs->trans('OptionModeTrue').'</label></td>';
|
||||
print '<td><span class="opacitymedium">'.nl2br($langs->trans('ACCOUNTING_USE_TREASURY_Desc'))."</span>";
|
||||
print "</td></tr>\n";
|
||||
print "</table>\n";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
|
||||
print '</form>';
|
||||
|
||||
|
||||
print '<br><br>';
|
||||
}
|
||||
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
|
||||
print '</form>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Show form main options
|
||||
print $formSetup->generateOutput(true);
|
||||
@@ -660,7 +654,7 @@ print '</form>';
|
||||
print '<br><br>';
|
||||
|
||||
// Accountancy Numbering model
|
||||
$dirmodels = array_merge(array('/'), $conf->modules_parts['models']);
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2026 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
|
||||
@@ -194,7 +194,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
$ok = 0;
|
||||
}
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
// In case of 'actionadd' and with valid parameters, add the line
|
||||
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||
$newid = 0; // Initialise before if for static analysis
|
||||
if ($tabrowid[$id]) {
|
||||
@@ -251,7 +251,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
}
|
||||
}
|
||||
|
||||
// Si verif ok et action modify, on modifie la ligne
|
||||
// If check ok and action modify, we modify the line
|
||||
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
||||
if ($tabrowid[$id]) {
|
||||
$rowidcol = $tabrowid[$id];
|
||||
@@ -261,7 +261,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
// Modify the field values
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $db->sanitize($tabrowid[$id])." = ";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
@@ -373,7 +373,7 @@ $titlepicto = 'title_accountancy';
|
||||
print load_fiche_titre($titre, $linkback, $titlepicto);
|
||||
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
// Generate a form to confirm the deletion of the row
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
@@ -382,7 +382,7 @@ if ($action == 'delete') {
|
||||
* Show a dictionary
|
||||
*/
|
||||
|
||||
// Complete requete recherche valeurs avec critere de tri
|
||||
// Complete the search query with sort criteria
|
||||
$sql = $tabsql[$id];
|
||||
$sql .= " WHERE a.entity = ".((int) $conf->entity);
|
||||
|
||||
@@ -409,8 +409,8 @@ if ($tabname[$id]) {
|
||||
// Line for title
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
// Determine the field name based on the possible names
|
||||
// in the data dictionaries.
|
||||
$valuetoshow = ucfirst($fieldlist[$field]); // By default
|
||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||
$class = "left";
|
||||
@@ -522,8 +522,8 @@ if ($resql) {
|
||||
// Title of lines
|
||||
print '<tr class="liste_titre liste_titre_add">';
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
// Determine the field name based on the possible names
|
||||
// in the data dictionaries.
|
||||
$class = "left";
|
||||
$sortable = 1;
|
||||
$valuetoshow = '';
|
||||
|
||||
@@ -552,10 +552,12 @@ if ($resql) {
|
||||
|
||||
if ($massaction == 'set_default_account') {
|
||||
$formquestion = array();
|
||||
$formquestion[] = array('type' => 'other',
|
||||
$formquestion[] = array(
|
||||
'type' => 'other',
|
||||
'name' => 'set_default_account',
|
||||
'label' => $langs->trans("AccountancyCode"),
|
||||
'value' => $form->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'));
|
||||
'value' => $form->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone')
|
||||
);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmPreselectAccount"), $langs->trans("ConfirmPreselectAccountQuestion", $nbselected), "confirm_set_default_account", $formquestion, 1, 0, 200, 500, 1);
|
||||
}
|
||||
|
||||
@@ -563,7 +565,7 @@ if ($resql) {
|
||||
$moreforfilter = '';
|
||||
if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
|
||||
$formcategory = new FormCategory($db);
|
||||
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $searchCategoryProductList, 'minwidth300', $searchCategoryProductList ? $searchCategoryProductList : 0);
|
||||
$moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $searchCategoryProductList, 'minwidth300', $searchCategoryProductList ? $searchCategoryProductOperator : 0);
|
||||
}
|
||||
|
||||
// Show/hide child products. Hidden by default
|
||||
@@ -662,7 +664,7 @@ if ($resql) {
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
// Ref produit as link
|
||||
// Product ref as link
|
||||
$product_static->ref = $obj->ref;
|
||||
$product_static->id = $obj->rowid;
|
||||
$product_static->type = $obj->product_type;
|
||||
@@ -907,49 +909,48 @@ if ($resql) {
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_savebutton() {
|
||||
console.log("We check if at least one line is checked")
|
||||
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_savebutton()
|
||||
{
|
||||
console.log("We check if at least one line is checked")
|
||||
atleastoneselected = 0;
|
||||
jQuery(".checkforselect").each(function(index) {
|
||||
/* console.log( index + ": " + $( this ).text() ); */
|
||||
if ($(this).is(':checked')) atleastoneselected++;
|
||||
});
|
||||
|
||||
atleastoneselected=0;
|
||||
jQuery(".checkforselect").each(function( index ) {
|
||||
/* console.log( index + ": " + $( this ).text() ); */
|
||||
if ($(this).is(\':checked\')) atleastoneselected++;
|
||||
});
|
||||
if (atleastoneselected) jQuery("#changeaccount").removeAttr('disabled');
|
||||
else jQuery("#changeaccount").attr('disabled', 'disabled');
|
||||
if (atleastoneselected) jQuery("#changeaccount").attr('class', 'button');
|
||||
else jQuery("#changeaccount").attr('class', 'button');
|
||||
}
|
||||
|
||||
if (atleastoneselected) jQuery("#changeaccount").removeAttr(\'disabled\');
|
||||
else jQuery("#changeaccount").attr(\'disabled\',\'disabled\');
|
||||
if (atleastoneselected) jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||
else jQuery("#changeaccount").attr(\'class\',\'button\');
|
||||
}
|
||||
|
||||
jQuery(".checkforselect").change(function() {
|
||||
init_savebutton();
|
||||
});
|
||||
jQuery(".productforselect").change(function() {
|
||||
console.log($(this).attr("id")+" "+$(this).val());
|
||||
jQuery(".checkforselect").change(function() {
|
||||
init_savebutton();
|
||||
});
|
||||
jQuery(".productforselect").change(function() {
|
||||
console.log($(this).attr("id") + " " + $(this).val());
|
||||
if ($(this).val() && $(this).val() != -1) {
|
||||
$(".productforselect"+$(this).attr("id")).prop(\'checked\', true);
|
||||
$(".productforselect"+$(this).attr("id")).prop('checked', true);
|
||||
} else {
|
||||
$(".productforselect"+$(this).attr("id")).prop(\'checked\', false);
|
||||
$(".productforselect"+$(this).attr("id")).prop('checked', false);
|
||||
}
|
||||
init_savebutton();
|
||||
});
|
||||
init_savebutton();
|
||||
});
|
||||
|
||||
init_savebutton();
|
||||
init_savebutton();
|
||||
|
||||
jQuery("#search_current_account").keyup(function() {
|
||||
if (jQuery("#search_current_account").val() != \'\')
|
||||
{
|
||||
console.log("We set a value of account to search "+jQuery("#search_current_account").val()+", so we disable the other search criteria on account");
|
||||
jQuery("#search_current_account_valid").val(-1);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
jQuery("#search_current_account").keyup(function() {
|
||||
if (jQuery("#search_current_account").val() != '') {
|
||||
console.log("We set a value of account to search " + jQuery("#search_current_account").val() + ", so we disable the other search criteria on account");
|
||||
jQuery("#search_current_account_valid").val(-1);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2026 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
|
||||
@@ -183,7 +184,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
}
|
||||
}
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
// In case of 'actionadd' and with valid parameters, add the line
|
||||
if ($ok && GETPOST('actionadd', 'alpha')) {
|
||||
$newid = 0;
|
||||
|
||||
@@ -254,7 +255,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$db->sanitize($tabname[$id])." SET ";
|
||||
// Modifie valeur des champs
|
||||
// Modify field values
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $db->sanitize($tabrowid[$id])." = ";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
@@ -427,8 +428,8 @@ if ($tabname[$id]) {
|
||||
print '<td></td>';
|
||||
}
|
||||
foreach ($fieldlist as $field => $value) {
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
// Determine the field name based on the possible names
|
||||
// in the data dictionaries.
|
||||
$valuetoshow = ucfirst($fieldlist[$field]); // By default
|
||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||
$class = "left";
|
||||
|
||||
651
htdocs/accountancy/admin/template/card.php
Normal file
651
htdocs/accountancy/admin/template/card.php
Normal file
@@ -0,0 +1,651 @@
|
||||
<?php
|
||||
/* Copyright (C) 2024 AWeerWolf
|
||||
* Copyright (C) 2026 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
|
||||
* 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 accountancy/admin/template/card.php
|
||||
* \ingroup accountancy
|
||||
* \brief Page to create/edit/view bookkeeping template
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeepingtemplate.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeepingtemplateline.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy", "other"));
|
||||
|
||||
// Set needed objects
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$code = GETPOST('code', 'alpha');
|
||||
$lineid = GETPOSTINT('lineid');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepingtemplatecard';
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new BookkeepingTemplate($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->accounting->dir_output . '/temp/massgeneration/' . $user->id;
|
||||
$hookmanager->initHooks(array($object->element . 'card', 'globalcard'));
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Initialize array of search criteria
|
||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_' . $key, 'alpha')) {
|
||||
$search[$key] = GETPOST('search_' . $key, 'alpha');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($action) && empty($id) && empty($code)) {
|
||||
$action = 'view';
|
||||
}
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';
|
||||
|
||||
if ($id > 0 && empty($object->id)) {
|
||||
dol_print_error($db, 'Failed to load object');
|
||||
}
|
||||
|
||||
// Security check
|
||||
$permissiontoread = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissiontoadd = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissionnote = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissiondellink = $user->hasRight('accounting', 'chartofaccount');
|
||||
|
||||
$upload_dir = $conf->accounting->multidir_output[isset($object->entity) ? $object->entity : 1];
|
||||
|
||||
if (!$permissiontoread) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
$error = 0;
|
||||
|
||||
$backurlforlist = DOL_URL_ROOT . '/accountancy/admin/template/list.php';
|
||||
|
||||
if (empty($backtopage) || ($cancel && empty($id))) {
|
||||
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
|
||||
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
|
||||
$backtopage = $backurlforlist;
|
||||
} else {
|
||||
$backtopage = DOL_URL_ROOT . '/accountancy/admin/template/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$triggermodname = 'ACCOUNTING_BOOKKEEPINGTEMPLATE_MODIFY';
|
||||
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';
|
||||
|
||||
// Actions when printing a doc from card
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
|
||||
|
||||
// Action to build doc
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
|
||||
|
||||
// Actions to send emails
|
||||
$triggersendname = 'ACCOUNTING_BOOKKEEPINGTEMPLATE_SENTBYMAIL';
|
||||
$autocopy = 'MAIN_MAIL_AUTOCOPY_BOOKKEEPINGTEMPLATE_TO';
|
||||
$trackid = 'bookkeepingtemplate' . $object->id;
|
||||
include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
|
||||
}
|
||||
|
||||
// Action to add a new line
|
||||
if ($action == 'addline' && $permissiontoadd) {
|
||||
$error = 0;
|
||||
|
||||
// Get line data from POST
|
||||
$general_account = GETPOST('general_account', 'alphanohtml');
|
||||
$subledger_account = GETPOST('subledger_account', 'alphanohtml');
|
||||
if ($subledger_account == '-1') {
|
||||
$subledger_account = null;
|
||||
}
|
||||
$subledger_label = GETPOST('subledger_label', 'alphanohtml');
|
||||
$operation_label = GETPOST('operation_label', 'alphanohtml');
|
||||
$debit = price2num(GETPOST('debit', 'alpha'));
|
||||
$credit = price2num(GETPOST('credit', 'alpha'));
|
||||
|
||||
// Validation
|
||||
if (((float) $debit != 0.0) && ((float) $credit != 0.0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$action = 'edit';
|
||||
}
|
||||
|
||||
if (empty($general_account) || $general_account == '-1') {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountNumber")), null, 'errors');
|
||||
$action = 'edit';
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Fetch account label
|
||||
$accountingaccount->fetch(0, $general_account, 1);
|
||||
$general_label = $accountingaccount->label;
|
||||
|
||||
// Create line object
|
||||
$line = new BookkeepingTemplateLine($db);
|
||||
$line->fk_transaction_template = $object->id;
|
||||
$line->general_account = $general_account;
|
||||
$line->general_label = $general_label;
|
||||
$line->subledger_account = $subledger_account;
|
||||
$line->subledger_label = $subledger_label;
|
||||
$line->operation_label = $operation_label;
|
||||
$line->debit = $debit;
|
||||
$line->credit = $credit;
|
||||
|
||||
$result = $line->create($user, 0);
|
||||
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($line->error, $line->errors, 'errors');
|
||||
$action = 'edit';
|
||||
} else {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Action to update a line
|
||||
if ($action == 'updateline' && $permissiontoadd) {
|
||||
$error = 0;
|
||||
|
||||
// Get line data from POST
|
||||
$general_account = GETPOST('general_account', 'alphanohtml');
|
||||
$subledger_account = GETPOST('subledger_account', 'alphanohtml');
|
||||
if ($subledger_account == '-1') {
|
||||
$subledger_account = null;
|
||||
}
|
||||
$subledger_label = GETPOST('subledger_label', 'alphanohtml');
|
||||
$operation_label = GETPOST('operation_label', 'alphanohtml');
|
||||
$debit = price2num(GETPOST('debit', 'alpha'));
|
||||
$credit = price2num(GETPOST('credit', 'alpha'));
|
||||
|
||||
// Validation
|
||||
if (((float) $debit != 0.0) && ((float) $credit != 0.0)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorDebitCredit'), null, 'errors');
|
||||
$action = 'editline';
|
||||
}
|
||||
|
||||
if (empty($general_account) || $general_account == '-1') {
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountNumber")), null, 'errors');
|
||||
$action = 'editline';
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Fetch account label
|
||||
$accountingaccount->fetch(0, $general_account, 1);
|
||||
$general_label = $accountingaccount->label;
|
||||
|
||||
// Load and update line
|
||||
$line = new BookkeepingTemplateLine($db);
|
||||
$result = $line->fetch($lineid);
|
||||
|
||||
if ($result > 0) {
|
||||
$line->general_account = $general_account;
|
||||
$line->general_label = $general_label;
|
||||
$line->subledger_account = $subledger_account;
|
||||
$line->subledger_label = $subledger_label;
|
||||
$line->operation_label = $operation_label;
|
||||
$line->debit = $debit;
|
||||
$line->credit = $credit;
|
||||
|
||||
$result = $line->update($user, 0);
|
||||
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($line->error, $line->errors, 'errors');
|
||||
$action = 'editline';
|
||||
} else {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($line->error, $line->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Action to delete a line
|
||||
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $permissiontodelete) {
|
||||
$result = $object->deleteLine($user, $lineid);
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs');
|
||||
header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $object->id);
|
||||
exit;
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans('BookkeepingTemplate') . " - " . $langs->trans('Card');
|
||||
if ($action == 'create') {
|
||||
$title = $langs->trans("NewBookkeepingTemplate");
|
||||
}
|
||||
$help_url = '';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-accountancy page-admin-template-card');
|
||||
|
||||
// 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";
|
||||
}
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
if (empty($permissiontoadd)) {
|
||||
accessforbidden('NotEnoughPermissions', 0, 1);
|
||||
}
|
||||
|
||||
print load_fiche_titre($title, '', 'object_' . $object->picto);
|
||||
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head(array(), '');
|
||||
|
||||
print '<table class="border centpercent tableforfieldcreate">' . "\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php';
|
||||
|
||||
print '</table>' . "\n";
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print $form->buttonsSaveCancel("Create");
|
||||
|
||||
print '</form>';
|
||||
|
||||
dol_set_focus('input[name="code"]');
|
||||
}
|
||||
|
||||
// Part to edit record
|
||||
if (($id || $code) && $action == 'edit') {
|
||||
print load_fiche_titre($langs->trans("BookkeepingTemplate"), '', 'object_' . $object->picto);
|
||||
|
||||
print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="' . $backtopageforcancel . '">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
print '<table class="border centpercent tableforfieldedit">' . "\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print $form->buttonsSaveCancel();
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
$head = accountingTransactionTemplatePrepareHead($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("BookkeepingTemplate"), -1, $object->picto, 0, '', '', 0, '', 1);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation to delete template
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteBookkeepingTemplate'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
}
|
||||
|
||||
// Confirmation to delete line
|
||||
if ($action == 'deleteline') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
|
||||
}
|
||||
|
||||
// Clone confirmation
|
||||
if ($action == 'clone') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->code), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$formconfirm .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 0) {
|
||||
$formconfirm = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
// Object card
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/template/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'code', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">' . "\n";
|
||||
|
||||
// Common attributes
|
||||
$keyforbreak = '';
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// Buttons for actions
|
||||
if ($action != 'presend' && $action != 'editline' && $action != 'addline') {
|
||||
print '<div class="tabsAction">' . "\n";
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Modify
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit&token=' . newToken(), '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=clone&token=' . newToken(), '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete);
|
||||
}
|
||||
print '</div>' . "\n";
|
||||
}
|
||||
|
||||
// Lines section
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
if (!empty($object->table_element_line)) {
|
||||
// Show object lines
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print '<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST">';
|
||||
print '<input type="hidden" name="token" value="' . newToken() . '">';
|
||||
print '<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">';
|
||||
print '<input type="hidden" name="mode" value="">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="id" value="' . $object->id . '">';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
|
||||
// Define required variables for ajaxrow.tpl.php
|
||||
$fk_element = 'fk_transaction_template';
|
||||
$table_element_line = $object->table_element_line;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelines" class="noborder noshadow centpercent">';
|
||||
|
||||
// Show header
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("AccountAccountingShort");
|
||||
print_liste_field_titre("SubledgerAccount");
|
||||
print_liste_field_titre("LabelOperation");
|
||||
print_liste_field_titre("AccountingDebit", "", "", "", "", 'class="right"');
|
||||
print_liste_field_titre("AccountingCredit", "", "", "", "", 'class="right"');
|
||||
print_liste_field_titre("Action", "", "", "", "", 'width="60"', "", "", 'center ');
|
||||
print "</tr>\n";
|
||||
|
||||
$i = 0;
|
||||
|
||||
// Show existing lines
|
||||
foreach ($object->lines as $line) {
|
||||
// Line in view mode
|
||||
if ($action != 'editline' || GETPOST('lineid', 'int') != $line->id) {
|
||||
print '<tr class="oddeven" id="row-' . $line->id . '">';
|
||||
print '<!-- td columns in display mode -->';
|
||||
$resultfetch = $accountingaccount->fetch(0, $line->general_account, true);
|
||||
print '<td>';
|
||||
if ($resultfetch > 0) {
|
||||
print $accountingaccount->getNomUrl(0, 1, 1, '', 0);
|
||||
} else {
|
||||
print dol_escape_htmltag($line->general_account).' <span class="warning">('.$langs->trans("AccountRemovedFromCurrentChartOfAccount").')</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.length_accounta($line->subledger_account ?? '');
|
||||
if (!empty($line->subledger_label)) {
|
||||
print ' - <span class="opacitymedium">'.dol_escape_htmltag($line->subledger_label).'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>' . ($line->operation_label ? dol_escape_htmltag($line->operation_label) : '') . '</td>';
|
||||
print '<td class="right">' . ($line->debit ? price($line->debit) : '') . '</td>';
|
||||
print '<td class="right">' . ($line->credit ? price($line->credit) : '') . '</td>';
|
||||
|
||||
// Edit link
|
||||
print '<td class="center">';
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&token=' . newToken() . '&lineid=' . $line->id . '#line_' . $line->id . '">';
|
||||
print img_edit('', 0, 'class="marginrightonly"');
|
||||
print '</a> ';
|
||||
}
|
||||
|
||||
// Delete link
|
||||
if ($permissiontodelete) {
|
||||
print '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=deleteline&token=' . newToken() . '&lineid=' . $line->id . '">';
|
||||
print img_delete();
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Line in edit mode
|
||||
if ($action == 'editline' && GETPOST('lineid', 'int') == $line->id) {
|
||||
print '<tr class="oddeven" data-lineid="'.((int) $line->id).'">';
|
||||
print '<input type="hidden" name="lineid" value="' . GETPOST('lineid', 'int') . '">';
|
||||
|
||||
// Account number
|
||||
print '<td>';
|
||||
print $formaccounting->select_account((GETPOSTISSET("accountingaccount_number") ? GETPOST("accountingaccount_number", "alpha") : $line->general_account), 'general_account', 1, array(), 1, 1, 'minwidth200 maxwidth500');
|
||||
print '</td>';
|
||||
|
||||
// Subledger account
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
|
||||
print $formaccounting->select_auxaccount((GETPOSTISSET("subledger_account") ? GETPOST("subledger_account", "alpha") : $line->subledger_account), 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
|
||||
} else {
|
||||
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 '</td>';
|
||||
|
||||
// Operation label
|
||||
print '<td>';
|
||||
print '<input type="text" class="minwidth200" name="operation_label" value="'.(GETPOSTISSET("operation_label") ? GETPOST("operation_label", "alpha") : $line->operation_label).'">';
|
||||
print '</td>';
|
||||
|
||||
// Debit
|
||||
print '<td class="right">';
|
||||
print '<input type="text" name="debit" class="flat right maxwidth75" value="' . ($line->debit ? price($line->debit) : '') . '">';
|
||||
print '</td>';
|
||||
|
||||
// Credit
|
||||
print '<td class="right">';
|
||||
print '<input type="text" name="credit" class="flat right maxwidth75" value="' . ($line->credit ? price($line->credit) : '') . '">';
|
||||
print '</td>';
|
||||
|
||||
// Save button
|
||||
print '<td class="center" colspan="2">';
|
||||
print '<input type="submit" class="button buttongen marginbottomonly button-save" name="save" value="' . $langs->trans("Save") . '">';
|
||||
print '<br>';
|
||||
print '<input type="submit" class="button buttongen marginbottomonly button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
if ($action != 'editline' && $permissiontoadd) {
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account('', 'general_account', 1, [], 1, 1, 'maxwidth300');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (getDolGlobalString('ACCOUNTANCY_COMBO_FOR_AUX')) {
|
||||
print $formaccounting->select_auxaccount('', 'subledger_account', 1, 'maxwidth250', '', 'subledger_label');
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="new_subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="new_subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" name="operation_label" class="flat minwidth150"></td>';
|
||||
print '<td class="right"><input type="text" name="debit" class="flat right maxwidth75"></td>';
|
||||
print '<td class="right"><input type="text" name="credit" class="flat right maxwidth75"></td>';
|
||||
print '<td class="center" colspan="2"><input type="submit" class="button buttongen marginbottomonly" name="addline" value="' . $langs->trans("Add") . '"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
701
htdocs/accountancy/admin/template/list.php
Normal file
701
htdocs/accountancy/admin/template/list.php
Normal file
@@ -0,0 +1,701 @@
|
||||
<?php
|
||||
/* Copyright (C) 2024 AWeerWolf
|
||||
* Copyright (C) 2026 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
|
||||
* 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 accountancy/admin/template/list.php
|
||||
* \ingroup accountancy
|
||||
* \brief List page for bookkeeping templates
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../../main.inc.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeepingtemplate.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy", "other"));
|
||||
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view';
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$show_files = GETPOST('show_files', 'int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$toselect = GETPOST('toselect', 'array');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepingtemplatelist';
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'aZ');
|
||||
$mode = GETPOST('mode', 'aZ');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new BookkeepingTemplate($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->accounting->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array($contextpage));
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Default sort order (if not yet defined by previous GETPOST)
|
||||
if (!$sortfield) {
|
||||
reset($object->fields);
|
||||
$sortfield = "t.".key($object->fields);
|
||||
}
|
||||
if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
// Initialize array of search criteria
|
||||
$search_all = trim(GETPOST('search_all', 'alphanohtml'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
|
||||
$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
|
||||
}
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (!empty($val['searchall'])) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
}
|
||||
}
|
||||
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
// Security check
|
||||
$permissiontoread = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissiontoadd = $user->hasRight('accounting', 'chartofaccount');
|
||||
$permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
|
||||
|
||||
if (!$permissiontoread) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
// Selection of new fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$search[$key] = '';
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = '';
|
||||
$search[$key.'_dtend'] = '';
|
||||
}
|
||||
}
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
}
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
// Mass actions
|
||||
$objectclass = 'BookkeepingTemplate';
|
||||
$objectlabel = 'BookkeepingTemplate';
|
||||
$uploaddir = $conf->accounting->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$title = $langs->trans("BookkeepingTemplates");
|
||||
$help_url = '';
|
||||
$morejs = array();
|
||||
$morecss = array();
|
||||
|
||||
// Build and execute select
|
||||
$sql = 'SELECT ';
|
||||
$sql .= $object->getFieldList('t');
|
||||
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
}
|
||||
}
|
||||
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action);
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
|
||||
$sqlfields = $sql;
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
|
||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action);
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql .= " WHERE t.entity IN (".getEntity('accounting').")";
|
||||
} else {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
|
||||
foreach ($search as $key => $val) {
|
||||
if (array_key_exists($key, $object->fields)) {
|
||||
if ($key == 'status' && $search[$key] == -1) {
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
|
||||
if ($search[$key] == '-1') {
|
||||
$search[$key] = '';
|
||||
$modesearch = 2;
|
||||
} elseif ($search[$key] === '0' && (!isset($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval']))) {
|
||||
$search[$key] = '';
|
||||
$modesearch = 2;
|
||||
}
|
||||
}
|
||||
if ($search[$key] != '') {
|
||||
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
||||
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
|
||||
if (preg_match('/_dtstart$/', $key)) {
|
||||
$sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
if (preg_match('/_dtend$/', $key)) {
|
||||
$sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_all) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
}
|
||||
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action);
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) {
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
// Complete request and execute it with limit
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".DOL_URL_ROOT.'/accountancy/admin/template/card.php?id='.((int) $id));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Output page
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.((int) $limit);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
|
||||
$param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int'));
|
||||
$param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int'));
|
||||
$param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int'));
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action);
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array();
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewBookkeepingTemplate'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/accountancy/admin/template/card.php?action=create', '', $permissiontoadd);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendBookkeepingTemplateRef";
|
||||
$modelmail = "bookkeepingtemplate";
|
||||
$objecttmp = new BookkeepingTemplate($db);
|
||||
$trackid = 'bookkeepingtemplate'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($search_all) {
|
||||
$setupstring = '';
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
$setupstring .= $key."=".$val.";";
|
||||
}
|
||||
print '<!-- Search done like if BOOKKEEPINGTEMPLATE_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$moreforfilter .= $hookmanager->resPrint;
|
||||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : '');
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||
|
||||
// Fields title search
|
||||
print '<tr class="liste_titre_filter">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
} elseif ($key == 'lang') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
$formadmin = new FormAdmin($db);
|
||||
print $formadmin->select_language($search[$key], 'search_lang', 0, [], 1, 0, 0, 'minwidth150 maxwidth200', 2);
|
||||
} else {
|
||||
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action);
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Fields title label
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
$cssforfield = preg_replace('/small\s*/', '', $cssforfield);
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.'.$key]['label'], $_SERVER["PHP_SELF"], 't.'.$key, '', $param, '', $sortfield, $sortorder, $cssforfield.' ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action);
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Loop on record
|
||||
$i = 0;
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break;
|
||||
}
|
||||
|
||||
$object->setVarsFromFetchObj($obj);
|
||||
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) {
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif ($key == 'ref') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, (string) $object->id, '');
|
||||
} elseif ($key == 'code') {
|
||||
// Display code with link to card using getNomUrl
|
||||
print $object->getNomUrl(1);
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
if (!isset($totalarray['val'])) {
|
||||
$totalarray['val'] = array();
|
||||
}
|
||||
if (!isset($totalarray['val']['t.'.$key])) {
|
||||
$totalarray['val']['t.'.$key] = 0;
|
||||
}
|
||||
$totalarray['val']['t.'.$key] += $object->$key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action);
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) {
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
// Show total line
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||
|
||||
// If no record found
|
||||
if ($num == 0) {
|
||||
$colspan = 1;
|
||||
foreach ($arrayfields as $key => $val) {
|
||||
if (!empty($val['checked'])) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action);
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>'."\n";
|
||||
|
||||
print '</form>'."\n";
|
||||
|
||||
if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
|
||||
$hidegeneratedfilelistifempty = 1;
|
||||
if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
|
||||
$hidegeneratedfilelistifempty = 0;
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
// Show list of available documents
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
|
||||
$urlsource .= str_replace('&', '&', $param);
|
||||
|
||||
$filedir = $diroutputmassaction;
|
||||
$genallowed = $permissiontoread;
|
||||
$delallowed = $permissiontoadd;
|
||||
|
||||
print $formfile->showdocuments('massfilesarea_accounting', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
}
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@@ -235,8 +235,8 @@ if ($action == 'export' && $user->hasRight('accounting', 'mouvements', 'lire'))
|
||||
|
||||
if ($exportType === 'csv') {
|
||||
$sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV');
|
||||
$filename = 'balance';
|
||||
$type_export = 'balance';
|
||||
$filename = 'balance'; // Used by the tpl
|
||||
$type_export = 'balance'; // Used by the tpl
|
||||
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
foreach ($object->lines as $line) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
@@ -34,9 +34,12 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeepingtemplate.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeepingtemplateline.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
@@ -312,14 +315,79 @@ if (empty($reshook)) {
|
||||
|
||||
$action = 'create';
|
||||
} else {
|
||||
$reshook = $hookmanager->executeHooks('afterCreateBookkeeping', $parameters, $object, $action);
|
||||
// Transaction created successfully
|
||||
$piece_num = $object->piece_num;
|
||||
|
||||
if ($mode != '_tmp') {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
// Check if a template was selected
|
||||
$template_id = GETPOSTINT('template_id');
|
||||
|
||||
if ($template_id > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeepingtemplate.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeepingtemplateline.class.php';
|
||||
|
||||
$template = new BookkeepingTemplate($db);
|
||||
$result_template = $template->fetch($template_id);
|
||||
|
||||
if ($result_template > 0 && !empty($template->lines)) {
|
||||
$db->begin();
|
||||
$error_template = 0;
|
||||
|
||||
foreach ($template->lines as $templateline) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
|
||||
// Set common fields from the form
|
||||
$bookkeeping->doc_date = $date_start;
|
||||
$bookkeeping->doc_type = GETPOST('doctype', 'alpha');
|
||||
$bookkeeping->piece_num = $piece_num;
|
||||
$bookkeeping->doc_ref = GETPOST('docref', 'alpha');
|
||||
$bookkeeping->code_journal = $journal_code;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_doc = 0;
|
||||
$bookkeeping->fk_docdet = 0;
|
||||
$bookkeeping->ref = GETPOST('ref', 'alpha') ? GETPOST('ref', 'alpha') : $object->ref;
|
||||
|
||||
// Set fields from template line
|
||||
$bookkeeping->numero_compte = $templateline->general_account;
|
||||
$bookkeeping->label_compte = $templateline->general_label;
|
||||
$bookkeeping->subledger_account = $templateline->subledger_account;
|
||||
$bookkeeping->subledger_label = $templateline->subledger_label;
|
||||
$bookkeeping->label_operation = $templateline->operation_label;
|
||||
$bookkeeping->debit = (float) $templateline->debit;
|
||||
$bookkeeping->credit = (float) $templateline->credit;
|
||||
|
||||
// Backward compatibility
|
||||
if ((float) $bookkeeping->debit != 0.0) {
|
||||
$bookkeeping->montant = $bookkeeping->debit;
|
||||
$bookkeeping->amount = $bookkeeping->debit;
|
||||
$bookkeeping->sens = 'D';
|
||||
}
|
||||
if ((float) $bookkeeping->credit != 0.0) {
|
||||
$bookkeeping->montant = $bookkeeping->credit;
|
||||
$bookkeeping->amount = $bookkeeping->credit;
|
||||
$bookkeeping->sens = 'C';
|
||||
}
|
||||
|
||||
$result_line = $bookkeeping->createStd($user, 0, '_tmp');
|
||||
|
||||
if ($result_line < 0) {
|
||||
$error_template++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error_template) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('TemplateLinesLoaded', count($template->lines)), null, 'mesgs');
|
||||
} else {
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
}
|
||||
$action = '';
|
||||
$id = $object->id;
|
||||
$piece_num = (int) $object->piece_num;
|
||||
|
||||
// Redirect to the transaction
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?piece_num=".$piece_num."&mode=_tmp");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -569,15 +637,47 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("Automatic").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Template
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans("BookkeepingTemplate").'</td>';
|
||||
print '<td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeepingtemplate.class.php';
|
||||
|
||||
$sql = "SELECT rowid, code, label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_transaction_template";
|
||||
$sql .= " WHERE entity IN (".getEntity('accounting').")";
|
||||
$sql .= " ORDER BY code ASC";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$templates = array();
|
||||
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$templates[$obj->rowid] = $obj->code.' - '.$obj->label;
|
||||
$i++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
if (count($templates) > 0) {
|
||||
print '<select class="flat minwidth300" name="template_id" id="template_id">';
|
||||
print '<option value=""></option>';
|
||||
foreach ($templates as $key => $label) {
|
||||
print '<option value="'.$key.'">'.dol_escape_htmltag($label).'</option>';
|
||||
}
|
||||
print '</select>';
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("NoTemplateAvailable").'</span>';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
/*
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Doctype") . '</td>';
|
||||
print '<td><input type="text" class="minwidth200 name="doc_type" value=""/></td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
$reshookAddLine = $hookmanager->executeHooks('bookkeepingAddLine', $parameters, $object, $action);
|
||||
|
||||
print '</table>';
|
||||
@@ -738,7 +838,38 @@ if ($action == 'create') {
|
||||
print '<input type="submit" class="button button-edit smallpaddingimp" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $object->doc_ref;
|
||||
// Get information of an element
|
||||
if ($object->doc_type === 'customer_invoice' && !empty($object->fk_doc)) {
|
||||
$invoicestatic = new Facture($db);
|
||||
$result = $invoicestatic->fetch($object->fk_doc);
|
||||
|
||||
if ($result > 0) {
|
||||
$label_element = $invoicestatic->getNomUrl(1);
|
||||
} else {
|
||||
$label_element = $object->doc_ref;
|
||||
}
|
||||
} elseif ($object->doc_type === 'supplier_invoice' && !empty($object->fk_doc)) {
|
||||
$supplierinvoicestatic = new FactureFournisseur($db);
|
||||
$result = $supplierinvoicestatic->fetch($object->fk_doc);
|
||||
|
||||
if ($result > 0) {
|
||||
$label_element = $supplierinvoicestatic->getNomUrl(1);
|
||||
} else {
|
||||
$label_element = $object->doc_ref;
|
||||
}
|
||||
} elseif ($object->doc_type === 'expense_report' && !empty($object->fk_doc)) {
|
||||
$expensereportstatic = new ExpenseReport($db);
|
||||
$result = $expensereportstatic->fetch($object->fk_doc);
|
||||
|
||||
if ($result > 0) {
|
||||
$label_element = $expensereportstatic->getNomUrl(1);
|
||||
} else {
|
||||
$label_element = $object->doc_ref;
|
||||
}
|
||||
} else {
|
||||
$label_element = $object->doc_ref;
|
||||
}
|
||||
print $label_element;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@@ -804,7 +935,13 @@ if ($action == 'create') {
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
print $object->code_journal;
|
||||
// Get information of a journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch(0, $object->code_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
print $accountingjournalstatic->getNomUrl(1, 1, 1);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2013-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Lionel Vessiller <lvessiller@open-dsi.fr>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
@@ -30,6 +30,13 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
|
||||
@@ -41,14 +48,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
|
||||
/**
|
||||
* @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("accountancy", "compta"));
|
||||
|
||||
@@ -851,15 +850,26 @@ if ($action == 'export_file') {
|
||||
|| getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_FEC
|
||||
|| getDolGlobalString('ACCOUNTING_EXPORT_MODELCSV') == AccountancyExport::$EXPORT_TYPE_FEC2
|
||||
) {
|
||||
$except = array();
|
||||
if (getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_INVOICE_SOURCE_FILE')) {
|
||||
$except[] = $langs->trans('Invoice');
|
||||
}
|
||||
if (getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_EXPENSEREPORT_SOURCE_FILE')) {
|
||||
$except[] = $langs->trans('ExpenseReport');
|
||||
}
|
||||
if (getDolGlobalInt('ACCOUNTING_EXPORT_REMOVE_SUPPLIERINVOICE_SOURCE_FILE')) {
|
||||
$except[] = $langs->trans('SupplierInvoice');
|
||||
}
|
||||
|
||||
$form_question['notifiedexportfull'] = array(
|
||||
'name' => 'notifiedexportfull',
|
||||
'type' => 'checkbox',
|
||||
'label' => $langs->trans('NotifiedExportFull'),
|
||||
'label' => $langs->trans('NotifiedExportFull').(empty($except) ? '' : ' <spanc class="opacitymedium">('.$langs->trans("except").' '.implode(', ', $except).')</span>'),
|
||||
'value' => 'false',
|
||||
);
|
||||
}
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 390, 700);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").'...', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 500, 700);
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
|
||||
@@ -31,6 +31,13 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @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.formfiscalyear.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
@@ -42,14 +49,6 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php';
|
||||
|
||||
/**
|
||||
* @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("accountancy", "categories", "compta", "other"));
|
||||
|
||||
@@ -489,6 +488,7 @@ if (empty($reshook)) {
|
||||
$uploaddir = $conf->societe->dir_output;
|
||||
|
||||
global $error;
|
||||
/** @var int $error */
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if (!$error && $action == 'deletebookkeepingwriting' && $confirm == "yes" && $user->hasRight('accounting', 'mouvements', 'supprimer')) {
|
||||
@@ -1272,17 +1272,19 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Piece number
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
$object->id = $line->id;
|
||||
$object->piece_num = $line->piece_num;
|
||||
$object->ref = $line->ref;
|
||||
print $object->getNomUrl(1, '', 0, '', 1);
|
||||
print '<span class="hideonsmartphone">';
|
||||
if (!empty($line->date_export)) {
|
||||
print img_picto($langs->trans("DateExport").": ".dol_print_date($line->date_export, 'dayhour')." (".$langs->trans("TransactionExportDesc").")", 'fa-file-export', 'class="paddingleft pictofixedwidth opacitymedium"');
|
||||
}
|
||||
if (!empty($line->date_validation)) {
|
||||
print img_picto($langs->trans("DateValidation").": ".dol_print_date($line->date_validation, 'dayhour')." (".$langs->trans("TransactionBlockedLockedDesc").")", 'fa-lock', 'class="paddingleft pictofixedwidth opacitymedium"');
|
||||
}
|
||||
print '</span>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@@ -1420,17 +1420,19 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
// Piece number
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
$object->id = $line->id;
|
||||
$object->piece_num = $line->piece_num;
|
||||
$object->ref = $line->ref;
|
||||
print $object->getNomUrl(1, '', 0, '', 1);
|
||||
print '<span class="hideonsmartphone">';
|
||||
if (!empty($line->date_export)) {
|
||||
print img_picto($langs->trans("DateExport").": ".dol_print_date($line->date_export, 'dayhour')." (".$langs->trans("TransactionExportDesc").")", 'fa-file-export', 'class="paddingleft pictofixedwidth opacitymedium"');
|
||||
}
|
||||
if (!empty($line->date_validation)) {
|
||||
print img_picto($langs->trans("DateValidation").": ".dol_print_date($line->date_validation, 'dayhour')." (".$langs->trans("TransactionBlockedLockedDesc").")", 'fa-lock', 'class="paddingleft pictofixedwidth opacitymedium"');
|
||||
}
|
||||
print '</span>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2016-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2016-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2025 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -906,4 +906,326 @@ class AccountancyCategory // extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// MULTI REPORT METHODS (New system with llx_accounting_category_account)
|
||||
// Requires constant ACCOUNTING_ENABLE_MULTI_REPORT
|
||||
// ====================================================================
|
||||
|
||||
/**
|
||||
* Link an accounting account to this category (multi-report system)
|
||||
*
|
||||
* @param int $fkAccountingAccount ID of the accounting account to link
|
||||
* @return int<-1,1> <0 if KO, 0 if already exists, >0 if OK
|
||||
*/
|
||||
public function addAccountToCategory($fkAccountingAccount)
|
||||
{
|
||||
// Check if relation already exists
|
||||
if ($this->isAccountInCategory($fkAccountingAccount)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " (fk_accounting_category, fk_accounting_account)";
|
||||
$sql .= " VALUES (".((int) $this->id).", ".((int) $fkAccountingAccount).")";
|
||||
|
||||
dol_syslog(get_class($this)."::addAccountToCategory", LOG_DEBUG);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlink an accounting account from this category (multi-report system)
|
||||
*
|
||||
* @param int $fkAccountingAccount ID of the accounting account to unlink
|
||||
* @return int<-1,1> <0 if KO, >0 if OK
|
||||
*/
|
||||
public function deleteAccountFromCategory($fkAccountingAccount)
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " WHERE fk_accounting_category = ".((int) $this->id);
|
||||
$sql .= " AND fk_accounting_account = ".((int) $fkAccountingAccount);
|
||||
|
||||
dol_syslog(get_class($this)."::deleteAccountFromCategory", LOG_DEBUG);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all accounting accounts linked to this category (multi-report system)
|
||||
*
|
||||
* @return array<int,array{id:int,account_number:string,label:string}> Array of accounting accounts indexed by account ID, or empty array if error
|
||||
*/
|
||||
public function getAccountsForCategory()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$accounts = array();
|
||||
|
||||
$sql = "SELECT aca.fk_accounting_account, aa.account_number, aa.label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account as aca";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = aca.fk_accounting_account";
|
||||
$sql .= " WHERE aca.fk_accounting_category = ".((int) $this->id);
|
||||
$sql .= " AND aa.entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY aa.account_number ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::getAccountsForCategory", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$accounts[$obj->fk_accounting_account] = array(
|
||||
'id' => $obj->fk_accounting_account,
|
||||
'account_number' => $obj->account_number,
|
||||
'label' => $obj->label
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return $accounts;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
dol_syslog(get_class($this)."::getAccountsForCategory ".$this->error, LOG_ERR);
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get categories for a specific accounting account (multi-report system)
|
||||
*
|
||||
* @param int $fkAccountingAccount ID of the accounting account
|
||||
* @return array<int,array{id:int,code:string,label:string,fk_report:int}> Array of categories indexed by category ID, or empty array if error
|
||||
*/
|
||||
public function getCategoriesForAccount($fkAccountingAccount)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$categories = array();
|
||||
|
||||
$sql = "SELECT aca.fk_accounting_category, ac.code, ac.label, ac.fk_report";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account as aca";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_accounting_category as ac ON ac.rowid = aca.fk_accounting_category";
|
||||
$sql .= " WHERE aca.fk_accounting_account = ".((int) $fkAccountingAccount);
|
||||
$sql .= " AND ac.entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY ac.position ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::getCategoriesForAccount", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$categories[$obj->fk_accounting_category] = array(
|
||||
'id' => $obj->fk_accounting_category,
|
||||
'code' => $obj->code,
|
||||
'label' => $obj->label,
|
||||
'fk_report' => $obj->fk_report
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return $categories;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
dol_syslog(get_class($this)."::getCategoriesForAccount ".$this->error, LOG_ERR);
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an account belongs to this category (multi-report system)
|
||||
*
|
||||
* @param int $fkAccountingAccount ID of the accounting account
|
||||
* @return bool True if account is in category, false otherwise
|
||||
*/
|
||||
public function isAccountInCategory($fkAccountingAccount)
|
||||
{
|
||||
$sql = "SELECT COUNT(*) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " WHERE fk_accounting_category = ".((int) $this->id);
|
||||
$sql .= " AND fk_accounting_account = ".((int) $fkAccountingAccount);
|
||||
|
||||
dol_syslog(get_class($this)."::isAccountInCategory", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
return ($obj->nb > 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all accounting accounts NOT linked to this category (for selection)
|
||||
*
|
||||
* @return array<array{id:int,account_number:string,label:string}> Array of available accounts, or empty array if error
|
||||
*/
|
||||
public function getAvailableAccountsForCategory()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$accounts = array();
|
||||
|
||||
$pcgverid = getDolGlobalInt('CHARTOFACCOUNTS');
|
||||
$pcgvercode = dol_getIdFromCode($this->db, (string) $pcgverid, 'accounting_system', 'rowid', 'pcg_version');
|
||||
if (empty($pcgvercode)) {
|
||||
$pcgvercode = $pcgverid;
|
||||
}
|
||||
|
||||
$sql = "SELECT aa.rowid, aa.account_number, aa.label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa";
|
||||
$sql .= " WHERE aa.rowid NOT IN (";
|
||||
$sql .= " SELECT fk_accounting_account";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " WHERE fk_accounting_category = ".((int) $this->id);
|
||||
$sql .= " )";
|
||||
$sql .= " AND aa.entity = ".$conf->entity;
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " AND aa.fk_pcg_version = '".$this->db->escape($pcgvercode)."'";
|
||||
$sql .= " ORDER BY aa.account_number ASC";
|
||||
|
||||
dol_syslog(get_class($this)."::getAvailableAccountsForCategory", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$accounts[$obj->rowid] = array(
|
||||
'id' => $obj->rowid,
|
||||
'account_number' => $obj->account_number,
|
||||
'label' => $obj->label
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return $accounts;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
dol_syslog(get_class($this)."::getAvailableAccountsForCategory ".$this->error, LOG_ERR);
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add multiple accounts to this category at once
|
||||
*
|
||||
* @param array<int> $accountIds Array of accounting account IDs
|
||||
* @return int<-1,max> Number of accounts added, -1 if error
|
||||
*/
|
||||
public function addMultipleAccountsToCategory(array $accountIds)
|
||||
{
|
||||
$added = 0;
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
foreach ($accountIds as $accountId) {
|
||||
if (!$this->isAccountInCategory($accountId)) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " (fk_accounting_category, fk_accounting_account)";
|
||||
$sql .= " VALUES (".((int) $this->id).", ".((int) $accountId).")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$added++;
|
||||
} else {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
} else {
|
||||
$this->db->commit();
|
||||
return $added;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all accounts from this category
|
||||
*
|
||||
* @return int<-1,max> Number of deleted relations if OK, -1 if error
|
||||
*/
|
||||
public function removeAllAccountsFromCategory()
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " WHERE fk_accounting_category = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::removeAllAccountsFromCategory", LOG_DEBUG);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$affected = $this->db->affected_rows($resql);
|
||||
$this->db->commit();
|
||||
return $affected;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Count number of accounts linked to this category
|
||||
*
|
||||
* @return int Number of accounts, <0 if error
|
||||
*/
|
||||
public function countAccountsInCategory()
|
||||
{
|
||||
$sql = "SELECT COUNT(*) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_category_account";
|
||||
$sql .= " WHERE fk_accounting_category = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::countAccountsInCategory", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
return (int) $obj->nb;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->error;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* Copyright (C) 2020 Guillaume Alexandre <guillaume@tag-info.fr>
|
||||
* Copyright (C) 2022 Joachim Kueter <jkueter@gmx.de>
|
||||
* Copyright (C) 2022 Progiseize <a.bisotti@progiseize.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 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
|
||||
@@ -230,7 +230,7 @@ class AccountancyExport
|
||||
);
|
||||
|
||||
global $hookmanager;
|
||||
$code = $formatcode[$type];
|
||||
$code = $formatcode[$type] ?? '';
|
||||
$parameters = array('type' => $type);
|
||||
$reshook = $hookmanager->executeHooks('getFormatCode', $parameters, $code);
|
||||
|
||||
@@ -382,12 +382,12 @@ class AccountancyExport
|
||||
*/
|
||||
public function export(&$TData, $formatexportset, $withAttachment = 0, $downloadMode = 1, $outputMode = 1, $noouput = 1)
|
||||
{
|
||||
global $db, $conf, $langs; // The tpl file use $db
|
||||
global $search_date_end; // Used into /accountancy/tpl/export_journal.tpl.php
|
||||
global $db, $conf, $langs; // Used into /accountancy/tpl/export_journal.tpl.php
|
||||
global $search_date_end, $hookmanager; // Used into /accountancy/tpl/export_journal.tpl.php
|
||||
|
||||
// Define name of file to save
|
||||
$filename = 'general_ledger-'.$this->getFormatCode($formatexportset);
|
||||
$type_export = 'general_ledger';
|
||||
$filename = 'general_ledger-'.$this->getFormatCode($formatexportset); // Used into /accountancy/tpl/export_journal.tpl.php
|
||||
$type_export = 'general_ledger'; // Used into /accountancy/tpl/export_journal.tpl.php
|
||||
|
||||
$completefilename = '';
|
||||
$exportFile = null;
|
||||
@@ -422,7 +422,8 @@ class AccountancyExport
|
||||
top_httphead($mimetype, 1);
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php';
|
||||
// Set var $completefilename and add HTTP header.
|
||||
include DOL_DOCUMENT_ROOT.'/accountancy/tpl/export_journal.tpl.php'; // TODO Fix this: A tpl is for rendering data on output. For including common code, we must use .inc.php
|
||||
|
||||
if ($outputMode == 1 || $outputMode == 2) {
|
||||
if ($outputMode == 1) {
|
||||
@@ -902,8 +903,13 @@ class AccountancyExport
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
$conf->cache['archiveFileList_notfound'] = array();
|
||||
|
||||
// We should use dol_now function not time however this is wrong date to transfer in accounting
|
||||
$i = 0;
|
||||
foreach ($objectLines as $line) {
|
||||
$i++;
|
||||
|
||||
// Clean some data
|
||||
$line->doc_ref = dol_string_unaccent($line->doc_ref);
|
||||
|
||||
@@ -1034,12 +1040,14 @@ class AccountancyExport
|
||||
$tab['num_piece3'] = str_pad(substr(self::trunc($line->doc_ref, 20), -10), 10);
|
||||
$tab['reserved'] = str_repeat(' ', 10); // position 159
|
||||
$tab['currency_amount'] = str_repeat(' ', 13); // position 169
|
||||
|
||||
// get document file
|
||||
$attachmentFileName = '';
|
||||
if ($withAttachment == 1) {
|
||||
$attachmentFileKey = trim((string) $line->piece_num);
|
||||
|
||||
if (!isset($archiveFileList[$attachmentFileKey])) {
|
||||
// We complete the $archiveFileList to add the file to the existing list (first entry was filled when function was called, we add here the next one)
|
||||
$objectDirPath = '';
|
||||
$objectFileName = dol_sanitizeFileName($line->doc_ref);
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
@@ -1053,33 +1061,45 @@ class AccountancyExport
|
||||
$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'), '/');
|
||||
}
|
||||
$arrayofinclusion = array();
|
||||
// If it is a supplier invoice, we want to use last uploaded file
|
||||
$arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$';
|
||||
$fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1);
|
||||
if (!empty($fileFoundList)) {
|
||||
$attachmentFileNameTrunc = str_pad(self::trunc((string) $line->piece_num, 8), 8, '0', STR_PAD_LEFT);
|
||||
foreach ($fileFoundList as $fileFound) {
|
||||
if (strstr($fileFound['name'], $objectFileName)) {
|
||||
// skip native invoice pdfs (canelle)
|
||||
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
|
||||
if ($line->doc_type == 'supplier_invoice') {
|
||||
if ($fileFound['name'] === $objectFileName.'.pdf') {
|
||||
|
||||
if ($objectDirPath && empty($conf->cache['archiveFileList_notfound'][$attachmentFileKey])) {
|
||||
$arrayofinclusion = array();
|
||||
// If it is a supplier invoice, we want to use last uploaded file
|
||||
$arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$';
|
||||
|
||||
$fileFoundPath = '';
|
||||
$fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1);
|
||||
|
||||
if (!empty($fileFoundList)) {
|
||||
$attachmentFileNameTrunc = str_pad(self::trunc((string) $line->piece_num, 8), 8, '0', STR_PAD_LEFT);
|
||||
|
||||
foreach ($fileFoundList as $fileFound) {
|
||||
if (strstr($fileFound['name'], $objectFileName)) {
|
||||
// skip native invoice pdfs (canelle)
|
||||
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
|
||||
if ($line->doc_type == 'supplier_invoice') {
|
||||
if ($fileFound['name'] === $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
$fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name'];
|
||||
if (file_exists($fileFoundPath)) {
|
||||
$archiveFileList[$attachmentFileKey] = array(
|
||||
'path' => $fileFoundPath,
|
||||
'name' => $attachmentFileNameTrunc.'.pdf',
|
||||
);
|
||||
break;
|
||||
$fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name'];
|
||||
if (file_exists($fileFoundPath)) {
|
||||
$archiveFileList[$attachmentFileKey] = array(
|
||||
'path' => $fileFoundPath,
|
||||
'name' => $attachmentFileNameTrunc.'.pdf',
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($fileFoundPath)) {
|
||||
// Use also a cache if no file were found
|
||||
$conf->cache['archiveFileList_notfound'][$attachmentFileKey] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,6 +1107,7 @@ class AccountancyExport
|
||||
$attachmentFileName = $archiveFileList[$attachmentFileKey]['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if (dol_strlen((string) $attachmentFileName) == 12) {
|
||||
$tab['attachment'] = $attachmentFileName; // position 182
|
||||
} else {
|
||||
@@ -1370,7 +1391,7 @@ class AccountancyExport
|
||||
$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
|
||||
// Extract the Third party account numbers from the table to provide the correct line for ISTEA
|
||||
$tiers = [];
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->subledger_account && substr($line->subledger_account, 0, 1) == '4') {
|
||||
@@ -1462,11 +1483,16 @@ class AccountancyExport
|
||||
print $output;
|
||||
}
|
||||
|
||||
$conf->cache['archiveFileList_notfound'] = array();
|
||||
|
||||
$i = 0;
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
//var_dump($line->id);
|
||||
//unset($array[$line]);
|
||||
} else {
|
||||
$i++;
|
||||
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
@@ -1475,6 +1501,8 @@ class AccountancyExport
|
||||
|
||||
$refInvoice = '';
|
||||
$invoice = null;
|
||||
// TODO The fetch of invoice is just to get the ->id, ->ref (and ->ref_supplier for supplier invoice) so
|
||||
// may be we can get them into the $objectLines and reuse a generic static objectinstead ?
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Customer invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
@@ -1567,6 +1595,7 @@ class AccountancyExport
|
||||
$attachmentFileKey = trim((string) $line->piece_num);
|
||||
|
||||
if (!isset($archiveFileList[$attachmentFileKey])) {
|
||||
// We complete the $archiveFileList to add the file to the existing list (first entry was filled when function was called, we add here the next one)
|
||||
$objectDirPath = '';
|
||||
$objectFileName = dol_sanitizeFileName($line->doc_ref);
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
@@ -1584,33 +1613,45 @@ class AccountancyExport
|
||||
$objectDirPath .= '/' . rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/');
|
||||
}
|
||||
}
|
||||
$arrayofinclusion = array();
|
||||
// If it is a supplier invoice, we want to use last uploaded file
|
||||
$arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$';
|
||||
$fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1);
|
||||
if (!empty($fileFoundList)) {
|
||||
$attachmentFileNameTrunc = $line->doc_ref;
|
||||
foreach ($fileFoundList as $fileFound) {
|
||||
if (strstr($fileFound['name'], $objectFileName)) {
|
||||
// skip native invoice pdfs (canelle)
|
||||
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
|
||||
if ($line->doc_type == 'supplier_invoice') {
|
||||
if ($fileFound['name'] === $objectFileName.'.pdf') {
|
||||
|
||||
if ($objectDirPath && empty($conf->cache['archiveFileList_notfound'][$attachmentFileKey])) {
|
||||
$arrayofinclusion = array();
|
||||
// If it is a supplier invoice, we want to use last uploaded file
|
||||
$arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$';
|
||||
|
||||
$fileFoundPath = ''; // The path of last file found
|
||||
$fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1);
|
||||
|
||||
if (!empty($fileFoundList)) {
|
||||
$attachmentFileNameTrunc = $line->doc_ref;
|
||||
|
||||
foreach ($fileFoundList as $fileFound) {
|
||||
if (strstr($fileFound['name'], $objectFileName)) {
|
||||
// skip native invoice pdfs (canelle)
|
||||
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
|
||||
if ($line->doc_type == 'supplier_invoice') {
|
||||
if ($fileFound['name'] === $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
$fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name'];
|
||||
if (file_exists($fileFoundPath)) {
|
||||
$archiveFileList[$attachmentFileKey] = array(
|
||||
'path' => $fileFoundPath,
|
||||
'name' => $attachmentFileNameTrunc.'.pdf',
|
||||
);
|
||||
break;
|
||||
$fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name'];
|
||||
if (file_exists($fileFoundPath)) {
|
||||
$archiveFileList[$attachmentFileKey] = array(
|
||||
'path' => $fileFoundPath,
|
||||
'name' => $attachmentFileNameTrunc.'.pdf',
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($fileFoundPath)) {
|
||||
// Use also a cache if no file were found
|
||||
$conf->cache['archiveFileList_notfound'][$attachmentFileKey] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1683,10 +1724,15 @@ class AccountancyExport
|
||||
print $output;
|
||||
}
|
||||
|
||||
$conf->cache['archiveFileList_notfound'] = array();
|
||||
|
||||
$i = 0;
|
||||
foreach ($objectLines as $line) {
|
||||
if ($line->debit == 0 && $line->credit == 0) {
|
||||
//unset($array[$line]);
|
||||
} else {
|
||||
$i++;
|
||||
|
||||
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
|
||||
$date_document = dol_print_date($line->doc_date, '%Y%m%d');
|
||||
$date_lettering = dol_print_date($line->date_lettering, '%Y%m%d');
|
||||
@@ -1695,6 +1741,8 @@ class AccountancyExport
|
||||
|
||||
$refInvoice = '';
|
||||
$invoice = null;
|
||||
// TODO The fetch of invoice is just to get the ->id, ->ref (and ->ref_supplier for supplier invoice) so
|
||||
// may be we can get them into the $objectLines and reuse a generic static objectinstead ?
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Customer invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
@@ -1787,6 +1835,7 @@ class AccountancyExport
|
||||
$attachmentFileKey = trim((string) $line->piece_num);
|
||||
|
||||
if (!isset($archiveFileList[$attachmentFileKey])) {
|
||||
// We complete the $archiveFileList to add the file to the existing list (first entry was filled when function was called, we add here the next one)
|
||||
$objectDirPath = '';
|
||||
$objectFileName = dol_sanitizeFileName($line->doc_ref);
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
@@ -1804,33 +1853,45 @@ class AccountancyExport
|
||||
$objectDirPath .= '/' . rtrim(get_exdir($invoice->id, 2, 0, 0, $invoice, 'invoice_supplier'), '/');
|
||||
}
|
||||
}
|
||||
$arrayofinclusion = array();
|
||||
// If it is a supplier invoice, we want to use last uploaded file
|
||||
$arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$';
|
||||
$fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1);
|
||||
if (!empty($fileFoundList)) {
|
||||
$attachmentFileNameTrunc = $line->doc_ref;
|
||||
foreach ($fileFoundList as $fileFound) {
|
||||
if (strstr($fileFound['name'], $objectFileName)) {
|
||||
// skip native invoice pdfs (canelle)
|
||||
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
|
||||
if ($line->doc_type == 'supplier_invoice') {
|
||||
if ($fileFound['name'] === $objectFileName.'.pdf') {
|
||||
|
||||
if ($objectDirPath && empty($conf->cache['archiveFileList_notfound'][$attachmentFileKey])) {
|
||||
$arrayofinclusion = array();
|
||||
// If it is a supplier invoice, we want to use last uploaded file
|
||||
$arrayofinclusion[] = '^'.preg_quote($objectFileName, '/').(($line->doc_type == 'supplier_invoice') ? '.+' : '').'\.pdf$';
|
||||
|
||||
$fileFoundPath = ''; // The path of last file found
|
||||
$fileFoundList = dol_dir_list($objectDirPath.'/'.$objectFileName, 'files', 0, implode('|', $arrayofinclusion), '(\.meta|_preview.*\.png)$', 'date', SORT_DESC, 0, 1);
|
||||
|
||||
if (!empty($fileFoundList)) {
|
||||
$attachmentFileNameTrunc = $line->doc_ref;
|
||||
|
||||
foreach ($fileFoundList as $fileFound) {
|
||||
if (strstr($fileFound['name'], $objectFileName)) {
|
||||
// skip native invoice pdfs (canelle)
|
||||
// We want to retrieve an attachment representative of the supplier invoice, not a fake document generated by Dolibarr.
|
||||
if ($line->doc_type == 'supplier_invoice') {
|
||||
if ($fileFound['name'] === $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
} elseif ($fileFound['name'] !== $objectFileName.'.pdf') {
|
||||
continue;
|
||||
}
|
||||
$fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name'];
|
||||
if (file_exists($fileFoundPath)) {
|
||||
$archiveFileList[$attachmentFileKey] = array(
|
||||
'path' => $fileFoundPath,
|
||||
'name' => $attachmentFileNameTrunc.'.pdf',
|
||||
);
|
||||
break;
|
||||
$fileFoundPath = $objectDirPath.'/'.$objectFileName.'/'.$fileFound['name'];
|
||||
if (file_exists($fileFoundPath)) {
|
||||
$archiveFileList[$attachmentFileKey] = array(
|
||||
'path' => $fileFoundPath,
|
||||
'name' => $attachmentFileNameTrunc.'.pdf',
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($fileFoundPath)) {
|
||||
// Use also a cache if no file were found
|
||||
$conf->cache['archiveFileList_notfound'][$attachmentFileKey] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2691,7 +2752,7 @@ class AccountancyExport
|
||||
$tab[] = substr($date, 3, 2);
|
||||
$tab[] = substr($date, 0, 2);
|
||||
$tab[] = $line->doc_ref;
|
||||
//Conversion de chaine UTF8 en Latin9
|
||||
// Convert the UTF-8 string in latin9
|
||||
$tab[] = mb_convert_encoding(str_replace(' - Compte auxiliaire', '', $line->label_operation), "Windows-1252", 'UTF-8');
|
||||
|
||||
//Calcul de la longueur des numéros de comptes
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
/* Copyright (C) 2024-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -72,6 +72,11 @@ class AccountingAccount extends CommonObject
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
/**
|
||||
* @var string Ref
|
||||
*/
|
||||
public $ref;
|
||||
|
||||
/**
|
||||
* Date creation record (datec)
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017-2022 OpenDSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.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>
|
||||
@@ -1323,7 +1323,7 @@ class AccountingJournal extends CommonObject
|
||||
$element['blocks'][] = $lines_book;
|
||||
}
|
||||
} else {
|
||||
// si TVA = 0, pousser les 2 lignes view/bookkeeping déjà constituées
|
||||
// When VAT = 0, push the 2 lines view/bookkeeping already prepared
|
||||
if ($type == 'view') {
|
||||
$element['blocks'][] = $lines_view;
|
||||
} elseif ($type == 'bookkeeping') {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2015-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2015-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Jose MARTINEZ <jose.martinez@pichinov.com>
|
||||
* Copyright (C) 2025 Nicolas Barrouillet <nicolas@pragma-tech.fr>
|
||||
* Copyright (C) 2024 Jose MARTINEZ <jose.martinez@pichinov.com>
|
||||
* Copyright (C) 2025 Nicolas Barrouillet <nicolas@pragma-tech.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
|
||||
@@ -1963,7 +1963,7 @@ class BookKeeping extends CommonObject
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT piece_num, ref, doc_date, code_journal, journal_label, doc_ref, doc_type,";
|
||||
$sql = "SELECT piece_num, ref, doc_date, code_journal, journal_label, doc_ref, doc_type, fk_doc,";
|
||||
$sql .= " date_creation, tms as date_modification, date_validated as date_validation, date_lim_reglement, import_key";
|
||||
// In llx_accounting_bookkeeping_tmp, field date_export doesn't exist
|
||||
if ($mode != "_tmp") {
|
||||
@@ -1985,6 +1985,7 @@ class BookKeeping extends CommonObject
|
||||
$this->doc_date = $this->db->jdate($obj->doc_date);
|
||||
$this->doc_ref = $obj->doc_ref;
|
||||
$this->doc_type = $obj->doc_type;
|
||||
$this->fk_doc = $obj->fk_doc;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_modification = $this->db->jdate($obj->date_modification);
|
||||
if ($mode != "_tmp") {
|
||||
@@ -2522,7 +2523,7 @@ class BookKeeping extends CommonObject
|
||||
$alias = !empty($alias) && strpos($alias, '.') === false ? $alias . "." : $alias;
|
||||
|
||||
if (!isset(self::$can_modify_bookkeeping_sql_cached[$alias]) || $force) {
|
||||
$result = $this->loadFiscalPeriods($force, 'active');
|
||||
$result = $this->loadFiscalPeriods($force, 'active'); // This set $conf->cache['active_fiscal_period_cached']
|
||||
if ($result < 0) {
|
||||
return null;
|
||||
}
|
||||
@@ -2533,9 +2534,10 @@ class BookKeeping extends CommonObject
|
||||
foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) {
|
||||
$sql_list[$i] = "(";
|
||||
$sql_list[$i] .= "'".$this->db->idate($fiscal_period['date_start']) . "' <= ".$this->db->sanitize($alias)."doc_date";
|
||||
// @phan-suppress-next-line PhanTypeMismatchDimAssignment
|
||||
if (!empty($fiscal_period['date_end'])) {
|
||||
$sql_list[$i] .= " AND ";
|
||||
$sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate($fiscal_period['date_end'])."'";
|
||||
$sql_list[$i] .= $this->db->sanitize($alias)."doc_date <= '" . $this->db->idate((int) $fiscal_period['date_end'])."'";
|
||||
}
|
||||
$sql_list[$i] .= ")";
|
||||
$i++;
|
||||
@@ -2595,6 +2597,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) {
|
||||
foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) {
|
||||
// @phan-suppress-next-line PhanTypeMismatchDimAssignment
|
||||
if (!empty($fiscal_period['date_start']) && $fiscal_period['date_start'] <= $bookkeeping->doc_date && (empty($fiscal_period['date_end']) || $bookkeeping->doc_date <= $fiscal_period['date_end'])) {
|
||||
return 1;
|
||||
}
|
||||
@@ -2693,6 +2696,7 @@ class BookKeeping extends CommonObject
|
||||
|
||||
if (!empty($conf->cache['active_fiscal_period_cached']) && is_array($conf->cache['active_fiscal_period_cached'])) {
|
||||
foreach ($conf->cache['active_fiscal_period_cached'] as $fiscal_period) {
|
||||
// @phan-suppress-next-line PhanTypeMismatchDimAssignment
|
||||
if (!empty($fiscal_period['date_start']) && $fiscal_period['date_start'] <= $date && (empty($fiscal_period['date_end']) || $date <= $fiscal_period['date_end'])) {
|
||||
return 1;
|
||||
}
|
||||
@@ -2968,11 +2972,13 @@ class BookKeeping extends CommonObject
|
||||
|
||||
// Current fiscal period
|
||||
$fiscal_period_id = max(0, $fiscal_period_id);
|
||||
|
||||
if (empty($fiscal_period_id)) {
|
||||
$langs->load('errors');
|
||||
$this->errors[] = $langs->trans('ErrorBadParameters');
|
||||
return -1;
|
||||
}
|
||||
|
||||
$fiscal_period = new Fiscalyear($this->db);
|
||||
$result = $fiscal_period->fetch($fiscal_period_id);
|
||||
if ($result < 0) {
|
||||
@@ -2989,7 +2995,7 @@ class BookKeeping extends CommonObject
|
||||
$new_fiscal_period_id = max(0, $new_fiscal_period_id);
|
||||
if (empty($new_fiscal_period_id)) {
|
||||
$langs->load('errors');
|
||||
$this->errors[] = $langs->trans('ErrorBadParameters');
|
||||
$this->errors[] = $langs->trans('ErrorBadParameters').' - '.$langs->trans('AccountancyClosureStep3NewFiscalPeriod');
|
||||
return -1;
|
||||
}
|
||||
$new_fiscal_period = new Fiscalyear($this->db);
|
||||
@@ -3146,7 +3152,7 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Insert bookkeeping record for income statement
|
||||
// Insert bookkeeping record for income statement (loss or profit when closing)
|
||||
if (!$error && $income_statement_amount != 0) {
|
||||
$mt = $income_statement_amount;
|
||||
$accountingaccount = new AccountingAccount($this->db);
|
||||
@@ -3164,6 +3170,7 @@ class BookKeeping extends CommonObject
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = '';
|
||||
|
||||
/* $obj->subledger_account is not defined, so all code into if do the same then in else
|
||||
if ($separate_auxiliary_account) {
|
||||
$bookkeeping->subledger_account = $obj->subledger_account;
|
||||
$sql = 'SELECT';
|
||||
@@ -3180,10 +3187,14 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
$objtmp = $this->db->fetch_object($result);
|
||||
$bookkeeping->subledger_label = $objtmp->subledger_label ?? null; // latest subledger label used
|
||||
} else {
|
||||
|
||||
$bookkeeping->subledger_account = null;
|
||||
$bookkeeping->subledger_label = null;
|
||||
}
|
||||
} else {
|
||||
*/
|
||||
$bookkeeping->subledger_account = null;
|
||||
$bookkeeping->subledger_label = null;
|
||||
//}
|
||||
|
||||
$bookkeeping->numero_compte = $accountingaccount->account_number;
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
@@ -3750,7 +3761,7 @@ class BookKeeping extends CommonObject
|
||||
$newBookKeeping->sens = 'D';
|
||||
}
|
||||
|
||||
$newBookKeeping->label_operation = "Extourne " . $bookKeeping->piece_num . " - " . $bookKeeping->numero_compte . " - " . date('d/m/Y', dol_now()) . " - " . $i;
|
||||
$newBookKeeping->label_operation = $langs->trans("ReturnAccount") . " " . $bookKeeping->piece_num . " - " . $bookKeeping->numero_compte . " - " . date('d/m/Y', dol_now()) . " - " . $i;
|
||||
|
||||
$newBookKeeping->numero_compte = $bookKeeping->numero_compte;
|
||||
$newBookKeeping->label_compte = $bookKeeping->label_compte;
|
||||
@@ -3766,14 +3777,14 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
$createResult = $newBookKeeping->create($user);
|
||||
|
||||
if ($createResult > 0) {
|
||||
if ($createResult >= 0) {
|
||||
$newBookKeeping->piece_num = $pieceNumNext;
|
||||
$newBookKeeping->fk_doc = $bookKeeping->fk_doc;
|
||||
$newBookKeeping->fk_docdet = $bookKeeping->fk_docdet;
|
||||
$result = $newBookKeeping->update($user);
|
||||
$newBookKeeping->update($user);
|
||||
setEventMessages($langs->trans("SuccessReturnedAccount", $bookKeeping->piece_num), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorWhileCreating", $newBookKeeping->error), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorWhileCreating", $newBookKeeping->error), $newBookKeeping->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
561
htdocs/accountancy/class/bookkeepingtemplate.class.php
Normal file
561
htdocs/accountancy/class/bookkeepingtemplate.class.php
Normal file
@@ -0,0 +1,561 @@
|
||||
<?php
|
||||
/* Copyright (C) 2024 AWeerWolf
|
||||
* Copyright (C) 2026 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
|
||||
* 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 accountancy/class/bookkeepingtemplate.class.php
|
||||
* \ingroup accountancy
|
||||
* \brief This file is a CRUD class file for BookkeepingTemplate (Create/Read/Update/Delete)
|
||||
*/
|
||||
|
||||
// Put here all includes required by your class file
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeepingtemplateline.class.php';
|
||||
|
||||
/**
|
||||
* Class for BookkeepingTemplate
|
||||
*/
|
||||
class BookkeepingTemplate extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID of module.
|
||||
*/
|
||||
public $module = 'accountancy';
|
||||
|
||||
/**
|
||||
* @var string ID to identify managed object.
|
||||
*/
|
||||
public $element = 'accounting_transaction_template';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored. This is also the key used for extrafields management.
|
||||
*/
|
||||
public $table_element = 'accounting_transaction_template';
|
||||
|
||||
/**
|
||||
* @var int<0,1>|string 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
*/
|
||||
public $ismultientitymanaged = 1;
|
||||
|
||||
/**
|
||||
* @var int<0,1> Does object support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 1;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for bookkeepingtemplate. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'bookkeepingtemplate@accountancy' if picto is file 'img/object_bookkeepingtemplate.png'.
|
||||
*/
|
||||
public $picto = 'fa-list';
|
||||
|
||||
/**
|
||||
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'langfile' the key of the language file for translation.
|
||||
* 'enabled' is a condition when the field must be managed.
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'default' is a default value for creation (can still be overwritten by the Setup of Default Values if the field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||
* 'help' is a string visible as a tooltip on field
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @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>,picto?:string}> 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, 'position' => 1, 'notnull' => 1, "visible" => 0, "noteditable" => 1, "index" => 1, "css" => "left", "comment" => "Id"),
|
||||
"entity" => array("type" => "integer", "label" => "Entity", "enabled" => 1, 'position' => 5, 'notnull' => 1, "visible" => 0, "index" => 1, "default" => '1'),
|
||||
"code" => array("type" => "varchar(128)", "label" => "Code", "enabled" => 1, 'position' => 10, 'notnull' => 1, "visible" => 1, "index" => 2, "searchall" => 1, "css" => "minwidth300", "help" => "UniqueCodeForTemplate"),
|
||||
"label" => array("type" => "varchar(255)", "label" => "Label", "enabled" => 1, 'position' => 20, 'notnull' => 0, "visible" => 1, "css" => "minwidth300"),
|
||||
"date_creation" => array("type" => "datetime", "label" => "DateCreation", "enabled" => 1, 'position' => 500, 'notnull' => 1, "visible" => -2),
|
||||
"tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => 1, 'position' => 501, 'notnull' => 0, "visible" => -2),
|
||||
"fk_user_creat" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserAuthor", "picto" => "user", "enabled" => 1, 'position' => 510, 'notnull' => 1, "visible" => "-2", "csslist" => "tdoverflowmax150"),
|
||||
"fk_user_modif" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserModif", "picto" => "user", "enabled" => 1, 'position' => 511, 'notnull' => -1, "visible" => "-2", "csslist" => "tdoverflowmax150"),
|
||||
"import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => 1, 'position' => 1000, 'notnull' => -1, "visible" => -2),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
/**
|
||||
* @var int Entity
|
||||
*/
|
||||
public $entity;
|
||||
|
||||
/**
|
||||
* @var string Code
|
||||
*/
|
||||
public $code;
|
||||
|
||||
/**
|
||||
* @var string Label
|
||||
*/
|
||||
public $label;
|
||||
|
||||
/**
|
||||
* @var int Unix timestamp of creation date
|
||||
*/
|
||||
public $date_creation;
|
||||
|
||||
/**
|
||||
* @var int Unix timestamp of last modification
|
||||
*/
|
||||
public $tms;
|
||||
|
||||
/**
|
||||
* @var int User ID who created
|
||||
*/
|
||||
public $fk_user_creat;
|
||||
|
||||
/**
|
||||
* @var int|null User ID who modified
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
/**
|
||||
* @var string|null Import key
|
||||
*/
|
||||
public $import_key;
|
||||
|
||||
/**
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'accounting_transaction_template_det';
|
||||
|
||||
/**
|
||||
* @var BookkeepingTemplateLine[] Array of subtable lines
|
||||
*/
|
||||
public $lines = array();
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'], $this->fields['code']) && is_array($this->fields['rowid'])) {
|
||||
$this->fields['rowid']['visible'] = 0;
|
||||
}
|
||||
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
|
||||
$this->fields['entity']['enabled'] = 0;
|
||||
}
|
||||
|
||||
// Unset fields that are disabled
|
||||
foreach ($this->fields as $key => $val) {
|
||||
if (isset($val['enabled']) && empty($val['enabled'])) {
|
||||
unset($this->fields[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Translate some data of arrayofkeyval
|
||||
if (is_object($langs)) {
|
||||
foreach ($this->fields as $key => $val) {
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
foreach ($val['arrayofkeyval'] as $key2 => $val2) {
|
||||
$this->fields[$key]['arrayofkeyval'][$key2] = (string) $langs->trans($val2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create object into database
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int Return integer <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = 0)
|
||||
{
|
||||
$resultcreate = $this->createCommon($user, $notrigger);
|
||||
return $resultcreate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone an object into another one
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return mixed New object created, <0 if KO
|
||||
*/
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
global $langs, $extrafields;
|
||||
$error = 0;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$object = new self($this->db);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
$result = $object->fetchCommon($fromid);
|
||||
if ($result > 0 && !empty($object->table_element_line)) {
|
||||
$object->fetchLines();
|
||||
}
|
||||
|
||||
// Reset some properties
|
||||
unset($object->id);
|
||||
unset($object->fk_user_creat);
|
||||
|
||||
// Clear fields
|
||||
$object->code = "COPY_" . $object->code;
|
||||
$object->label = $langs->trans("CopyOf") . " " . $object->label;
|
||||
$object->date_creation = dol_now();
|
||||
|
||||
// Create clone
|
||||
$object->context['createfromclone'] = 'createfromclone';
|
||||
$result = $object->createCommon($user);
|
||||
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->setErrorsFromObject($object);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Copy Attached Lines
|
||||
$this->getLinesArray();
|
||||
foreach ($this->lines as $linetoclone) {
|
||||
// Clear some info
|
||||
unset($linetoclone->id);
|
||||
unset($linetoclone->fk_user_creat);
|
||||
$linetoclone->fk_transaction_template = $object->id;
|
||||
|
||||
// Save in DB
|
||||
$linetoclone->createCommon($user);
|
||||
}
|
||||
}
|
||||
|
||||
unset($object->context['createfromclone']);
|
||||
|
||||
// End
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return $object;
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $code Code
|
||||
* @param int $noextrafields 0=Default to load extrafields, 1=No extrafields
|
||||
* @param int $nolines 0=Default to load lines, 1=No lines
|
||||
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $code = null, $noextrafields = 0, $nolines = 0)
|
||||
{
|
||||
$result = $this->fetchCommon($id, $code, '', $noextrafields);
|
||||
if ($result > 0 && !empty($this->table_element_line) && empty($nolines)) {
|
||||
$this->fetchLines($noextrafields);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load object lines in memory from the database
|
||||
*
|
||||
* @param int $noextrafields 0=Default to load extrafields, 1=No extrafields
|
||||
* @return BookkeepingTemplateLine[]|int Array of line objects if OK, <0 if KO
|
||||
*/
|
||||
public function fetchLines($noextrafields = 0)
|
||||
{
|
||||
$this->lines = array();
|
||||
|
||||
$objectline = new BookkeepingTemplateLine($this->db);
|
||||
$result = $objectline->fetchAll('ASC', 'rowid', 0, 0, array('customsql' => 'fk_transaction_template = ' . ((int) $this->id)));
|
||||
|
||||
if (is_numeric($result)) {
|
||||
$this->setErrorsFromObject($objectline);
|
||||
return $result;
|
||||
} else {
|
||||
$this->lines = $result;
|
||||
return $this->lines;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update object into database
|
||||
*
|
||||
* @param User $user User that modifies
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
return $this->updateCommon($user, $notrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that deletes
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Delete the Lines first
|
||||
$obj_line = new BookkeepingTemplateLine($this->db);
|
||||
|
||||
$sql = "DELETE FROM ".$this->db->prefix().$obj_line->table_element;
|
||||
$sql .= " WHERE fk_transaction_template = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error deleting lines: ".$this->db->lasterror(), LOG_ERR);
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
// Call trigger
|
||||
if (!$notrigger) {
|
||||
$result = $this->call_trigger(strtoupper(get_class($this)).'_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
// Delete main object
|
||||
$sql = "DELETE FROM ".$this->db->prefix().$this->table_element;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$this->error = $this->db->lasterror();
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error deleting main object: ".$this->db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if (empty($error)) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
$this->error = implode(', ', $this->errors);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a line of object in database
|
||||
*
|
||||
* @param User $user User that delete
|
||||
* @param int $idline Id of line to delete
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function deleteLine(User $user, $idline, $notrigger = 0)
|
||||
{
|
||||
$tmpline = new BookkeepingTemplateLine($this->db);
|
||||
if ($tmpline->fetch($idline) > 0) {
|
||||
return $tmpline->delete($user);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an array of lines
|
||||
*
|
||||
* @return BookkeepingTemplateLine[]|int array of BookkeepingTemplateLine objects if OK, <0 if KO
|
||||
*/
|
||||
public function getLinesArray()
|
||||
{
|
||||
$this->lines = array();
|
||||
|
||||
$objectline = new BookkeepingTemplateLine($this->db);
|
||||
$result = $objectline->fetchAll('ASC', 'rowid', 0, 0, array('customsql' => 'fk_transaction_template = ' . ((int) $this->id)));
|
||||
|
||||
if (is_numeric($result)) {
|
||||
$this->setErrorsFromObject($objectline);
|
||||
return $result;
|
||||
} else {
|
||||
$this->lines = $result;
|
||||
return $this->lines;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the reference to the following non used object depending on the active numbering module.
|
||||
*
|
||||
* @return string Object free reference
|
||||
*/
|
||||
public function getNextNumRef()
|
||||
{
|
||||
global $langs, $conf;
|
||||
$langs->load("accountancy");
|
||||
|
||||
// Standard numbering - Generate a code based on timestamp
|
||||
$code = 'TPL' . dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a link to the object card (with optionally the picto)
|
||||
*
|
||||
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
|
||||
* @param string $option On what the link point to ('nolink', ...)
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
if (!empty($conf->dol_no_mouse_hover)) {
|
||||
$notooltip = 1;
|
||||
}
|
||||
|
||||
$result = '';
|
||||
|
||||
$label = img_picto('', $this->picto) . ' <u>' . $langs->trans("BookkeepingTemplate") . '</u>';
|
||||
if (isset($this->code)) {
|
||||
$label .= '<br><b>' . $langs->trans('Code') . ':</b> ' . $this->code;
|
||||
}
|
||||
if (isset($this->label)) {
|
||||
$label .= '<br><b>' . $langs->trans('Label') . ':</b> ' . $this->label;
|
||||
}
|
||||
|
||||
$url = DOL_URL_ROOT . '/accountancy/admin/template/card.php?id=' . $this->id;
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// 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';
|
||||
}
|
||||
}
|
||||
|
||||
$linkclose = '';
|
||||
if (empty($notooltip)) {
|
||||
if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$label = $langs->trans("ShowBookkeepingTemplate");
|
||||
$linkclose .= ' alt="' . dol_escape_htmltag($label, 1) . '"';
|
||||
}
|
||||
$linkclose .= ' title="' . dol_escape_htmltag($label, 1) . '"';
|
||||
$linkclose .= ' class="classfortooltip' . ($morecss ? ' ' . $morecss : '') . '"';
|
||||
} else {
|
||||
$linkclose = ($morecss ? ' class="' . $morecss . '"' : '');
|
||||
}
|
||||
|
||||
if ($option == 'nolink') {
|
||||
$linkstart = '<span';
|
||||
} else {
|
||||
$linkstart = '<a href="' . $url . '"';
|
||||
}
|
||||
$linkstart .= $linkclose . '>';
|
||||
if ($option == 'nolink') {
|
||||
$linkend = '</span>';
|
||||
} else {
|
||||
$linkend = '</a>';
|
||||
}
|
||||
|
||||
$result .= $linkstart;
|
||||
|
||||
if ($withpicto) {
|
||||
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="' . (($withpicto != 2) ? 'paddingright ' : '') . 'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
||||
}
|
||||
|
||||
if ($withpicto != 2) {
|
||||
$result .= $this->code;
|
||||
}
|
||||
|
||||
$result .= $linkend;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return label of status
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->LibStatut(1, $mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
/**
|
||||
* Return label of a given status
|
||||
*
|
||||
* @param int $status Status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
368
htdocs/accountancy/class/bookkeepingtemplateline.class.php
Normal file
368
htdocs/accountancy/class/bookkeepingtemplateline.class.php
Normal file
@@ -0,0 +1,368 @@
|
||||
<?php
|
||||
/* Copyright (C) 2024 AWeerWolf
|
||||
* Copyright (C) 2026 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
|
||||
* 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 accountancy/class/bookkeepingtemplateline.class.php
|
||||
* \ingroup accountancy
|
||||
* \brief This file is a CRUD class file for BookkeepingTemplateLine (Create/Read/Update/Delete)
|
||||
*/
|
||||
|
||||
// Put here all includes required by your class file
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
|
||||
/**
|
||||
* Class for BookkeepingTemplateLine
|
||||
*/
|
||||
class BookkeepingTemplateLine extends CommonObject
|
||||
{
|
||||
/**
|
||||
* @var string ID of module.
|
||||
*/
|
||||
public $module = 'accountancy';
|
||||
|
||||
/**
|
||||
* @var string ID to identify managed object.
|
||||
*/
|
||||
public $element = 'accounting_transaction_template_det';
|
||||
|
||||
/**
|
||||
* @var string Name of table without prefix where object is stored. This is also the key used for extrafields management.
|
||||
*/
|
||||
public $table_element = 'accounting_transaction_template_det';
|
||||
|
||||
/**
|
||||
* @var int<0,1>|string 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
*/
|
||||
public $ismultientitymanaged = 0;
|
||||
|
||||
/**
|
||||
* @var int<0,1> Does object support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 0;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for bookkeepingtemplateline. Must be a 'fa-xxx' fontawesome code (or 'fa-xxx_fa_color_size') or 'bookkeepingtemplateline@accountancy' if picto is file 'img/object_bookkeepingtemplateline.png'.
|
||||
*/
|
||||
public $picto = 'fa-file';
|
||||
|
||||
/**
|
||||
* 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'langfile' the key of the language file for translation.
|
||||
* 'enabled' is a condition when the field must be managed.
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'default' is a default value for creation (can still be overwritten by the Setup of Default Values if the field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
|
||||
* 'css' is the CSS style to use on field. For example: 'maxwidth200'
|
||||
* 'help' is a string visible as a tooltip on field
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arrayofkeyval' to set list of value if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel")
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
*
|
||||
* Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor.
|
||||
*/
|
||||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @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, 'position'=>1, 'notnull'=>1, "visible"=>0, "noteditable"=>1, "index"=>1, "css"=>"left", "comment"=>"Id"),
|
||||
"fk_transaction_template" => array("type"=>"integer", "label"=>"Template", "enabled"=>1, 'position'=>5, 'notnull'=>1, "visible"=>0, "noteditable"=>1, "foreignkey"=>"accounting_transaction_template.rowid"),
|
||||
"general_account" => array("type"=>"varchar(32)", "label"=>"AccountNumber", "enabled"=>1, 'position'=>10, 'notnull'=>1, "visible"=>1, "css"=>"minwidth100"),
|
||||
"general_label" => array("type"=>"varchar(255)", "label"=>"AccountLabel", "enabled"=>1, 'position'=>20, 'notnull'=>1, "visible"=>1, "css"=>"minwidth200"),
|
||||
"subledger_account" => array("type"=>"varchar(32)", "label"=>"SubledgerAccount", "enabled"=>1, 'position'=>30, 'notnull'=>0, "visible"=>1, "css"=>"minwidth100"),
|
||||
"subledger_label" => array("type"=>"varchar(255)", "label"=>"SubledgerLabel", "enabled"=>1, 'position'=>40, 'notnull'=>0, "visible"=>1, "css"=>"minwidth200"),
|
||||
"operation_label" => array("type"=>"varchar(255)", "label"=>"OperationLabel", "enabled"=>1, 'position'=>50, 'notnull'=>0, "visible"=>1, "css"=>"minwidth200"),
|
||||
"debit" => array("type"=>"double(24,8)", "label"=>"Debit", "enabled"=>1, 'position'=>60, 'notnull'=>0, "visible"=>1, "css"=>"maxwidth75 right"),
|
||||
"credit" => array("type"=>"double(24,8)", "label"=>"Credit", "enabled"=>1, 'position'=>70, 'notnull'=>0, "visible"=>1, "css"=>"maxwidth75 right"),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $rowid;
|
||||
|
||||
/**
|
||||
* @var int Foreign key to accounting transaction template
|
||||
*/
|
||||
public $fk_transaction_template;
|
||||
|
||||
/**
|
||||
* @var string General account number
|
||||
*/
|
||||
public $general_account;
|
||||
|
||||
/**
|
||||
* @var string|null General account label/description
|
||||
*/
|
||||
public $general_label;
|
||||
|
||||
/**
|
||||
* @var string|null Subledger account number (auxiliary account)
|
||||
*/
|
||||
public $subledger_account;
|
||||
|
||||
/**
|
||||
* @var string|null Subledger account label/description
|
||||
*/
|
||||
public $subledger_label;
|
||||
|
||||
/**
|
||||
* @var string Debit amount (stored as string for precision)
|
||||
*/
|
||||
public $debit;
|
||||
|
||||
/**
|
||||
* @var string Credit amount (stored as string for precision)
|
||||
*/
|
||||
public $credit;
|
||||
|
||||
/**
|
||||
* @var string|null Sense/direction (D for debit, C for credit)
|
||||
*/
|
||||
public $sens;
|
||||
|
||||
/**
|
||||
* @var int|null Line position/order
|
||||
*/
|
||||
public $position;
|
||||
|
||||
/**
|
||||
* @var integer|''|null Creation date
|
||||
*/
|
||||
public $date_creation;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
public $tms;
|
||||
|
||||
/**
|
||||
* @var int|null User ID who created this line
|
||||
*/
|
||||
public $fk_user_creat;
|
||||
|
||||
/**
|
||||
* @var int|null User ID who last modified this line
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDb $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
if (!getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid'])) {
|
||||
$this->fields['rowid']['visible'] = 0;
|
||||
}
|
||||
|
||||
// Unset fields that are disabled
|
||||
foreach ($this->fields as $key => $val) {
|
||||
if (isset($val['enabled']) && empty($val['enabled'])) {
|
||||
unset($this->fields[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Translate some data of arrayofkeyval
|
||||
if (is_object($langs)) {
|
||||
foreach ($this->fields as $key => $val) {
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
foreach ($val['arrayofkeyval'] as $key2 => $val2) {
|
||||
$this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create object into database
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int Return integer <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = 0)
|
||||
{
|
||||
$resultcreate = $this->createCommon($user, $notrigger);
|
||||
return $resultcreate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param int $noextrafields 0=Default to load extrafields, 1=No extrafields
|
||||
* @return int Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $noextrafields = 0)
|
||||
{
|
||||
$result = $this->fetchCommon($id, '', '', $noextrafields);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load list of objects in memory from the database.
|
||||
*
|
||||
* @param string $sortorder Sort Order
|
||||
* @param string $sortfield Sort field
|
||||
* @param int $limit limit
|
||||
* @param int $offset Offset
|
||||
* @param array<string,mixed> $filter Filter array. Example array('mystringfield'=>'value', 'myintfield'=>4, 'customsql'=>...)
|
||||
* @param string $filtermode Filter mode (AND or OR)
|
||||
* @return BookkeepingTemplateLine[]|int Array of BookkeepingTemplateLine objects if OK, <0 if KO
|
||||
*/
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$records = array();
|
||||
|
||||
$sql = "SELECT ";
|
||||
$sql .= $this->getFieldList('t');
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
if (isset($this->isextrafieldmanaged) && $this->isextrafieldmanaged == 1) {
|
||||
$sql .= " LEFT JOIN ".$this->db->prefix().$this->table_element."_extrafields as te ON te.fk_object = t.rowid";
|
||||
}
|
||||
$sql .= " WHERE 1 = 1";
|
||||
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
foreach ($filter as $key => $value) {
|
||||
if ($key === 'customsql') {
|
||||
// Never use 'customsql' with a value from user input since it is injected as is. The value must be hard coded.
|
||||
$sqlwhere[] = $value;
|
||||
continue;
|
||||
}
|
||||
|
||||
$columnName = preg_replace('/^t\./', '', $key);
|
||||
|
||||
if (isset($this->fields[$columnName])) {
|
||||
$type = $this->fields[$columnName]['type'];
|
||||
if (preg_match('/^integer/', $type)) {
|
||||
if (is_int($value)) {
|
||||
// single value
|
||||
$sqlwhere[] = $key . " = " . intval($value);
|
||||
} elseif (is_array($value)) {
|
||||
if (empty($value)) {
|
||||
continue;
|
||||
}
|
||||
$sqlwhere[] = $key . ' IN (' . $this->db->sanitize(implode(',', array_map('intval', $value))) . ')';
|
||||
}
|
||||
continue;
|
||||
} elseif (in_array($type, array('date', 'datetime', 'timestamp'))) {
|
||||
$sqlwhere[] = $key . " = '" . $this->db->idate($value) . "'";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// when the $key doesn't fall into the previously handled categories, we do as if the column were a varchar/text
|
||||
if (is_array($value) && count($value)) {
|
||||
$escapedValues = array();
|
||||
foreach ($value as $v) {
|
||||
$escapedValues[] = $this->db->escape($v);
|
||||
}
|
||||
$value = implode(',', $escapedValues);
|
||||
$sqlwhere[] = $key . ' IN (' . $this->db->sanitize($value, 1) . ')';
|
||||
} elseif (is_scalar($value)) {
|
||||
if (strpos($value, '%') === false) {
|
||||
$sqlwhere[] = $key . " = '" . $this->db->sanitize($this->db->escape($value)) . "'";
|
||||
} else {
|
||||
$sqlwhere[] = $key . " LIKE '%" . $this->db->escape($this->db->escapeforlike($value)) . "%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($sqlwhere) > 0) {
|
||||
$sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")";
|
||||
}
|
||||
|
||||
if (!empty($sortfield)) {
|
||||
$sql .= $this->db->order($sortfield, $sortorder);
|
||||
}
|
||||
if (!empty($limit)) {
|
||||
$sql .= $this->db->plimit($limit, $offset);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < ($limit ? min($limit, $num) : $num)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$record = new self($this->db);
|
||||
$record->setVarsFromFetchObj($obj);
|
||||
|
||||
$records[$record->id] = $record;
|
||||
|
||||
$i++;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
return $records;
|
||||
} else {
|
||||
$this->errors[] = 'Error '.$this->db->lasterror();
|
||||
dol_syslog(__METHOD__.' '.implode(',', $this->errors), LOG_ERR);
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update object into database
|
||||
*
|
||||
* @param User $user User that modifies
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = 0)
|
||||
{
|
||||
return $this->updateCommon($user, $notrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete object in database
|
||||
*
|
||||
* @param User $user User that deletes
|
||||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = 0)
|
||||
{
|
||||
return $this->deleteCommon($user, $notrigger);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018-2026 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
|
||||
@@ -824,7 +824,7 @@ class Lettering extends BookKeeping
|
||||
*
|
||||
* @param int[] $document_ids List of document id
|
||||
* @param string $doc_type Type of document ('customer_invoice' or 'supplier_invoice', ...)
|
||||
* @return array<int,array<int,int>>|int<-1,-1> Return integer <0 if error otherwise all linked document ids by group and type [ [ 'doc_type' => [ doc_id, ... ], ... ], ... ]
|
||||
* @return array<int,array<int,int>>|int<-1,-1> Return integer <0 if error otherwise all linked document ids by group and type [ [ 'doc_type' => [ doc_id, ... ], ... ], ... ]
|
||||
*/
|
||||
public function getLinkedDocumentByGroup($document_ids, $doc_type)
|
||||
{
|
||||
@@ -889,12 +889,12 @@ class Lettering extends BookKeeping
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$current_document_ids[$obj->fk_doc] = $obj->fk_doc;
|
||||
|
||||
$link_key = $linked_info['prefix'] . $obj->fk_link;
|
||||
$link_key = (string) $linked_info['prefix'] . (string) $obj->fk_link;
|
||||
$element_by_link[$link_key][$obj->fk_doc] = $obj->fk_doc;
|
||||
$link_by_element[$obj->fk_doc][$link_key] = $link_key;
|
||||
$link_by_element[(int) $obj->fk_doc][$link_key] = $link_key;
|
||||
if ($is_fk_link_is_also_fk_doc) {
|
||||
$element_by_link[$link_key][$obj->fk_link] = $obj->fk_link;
|
||||
$link_by_element[$obj->fk_link][$link_key] = $link_key;
|
||||
$link_by_element[(int) $obj->fk_link][$link_key] = $link_key;
|
||||
}
|
||||
}
|
||||
$this->db->free($resql);
|
||||
@@ -910,11 +910,11 @@ class Lettering extends BookKeeping
|
||||
/**
|
||||
* Get element ids grouped by link or element in common
|
||||
*
|
||||
* @param array<array<string,int>> $link_by_element List of payment ids by link key
|
||||
* @param array<int,array<string,int|string>> $link_by_element List of payment ids by link key
|
||||
* @param array<string,array<int,int>> $element_by_link List of element ids by link key
|
||||
* @param string $link_key Link key (used for recursive function)
|
||||
* @param array<int,int> $current_group Current group (used for recursive function)
|
||||
* @return array<int,array<int,int>> List of element ids grouped by link or element in common
|
||||
* @param string $link_key Link key (used for recursive function)
|
||||
* @param array<int,int> $current_group Current group (used for recursive function)
|
||||
* @return array<int,array<int,int>> List of element ids grouped by link or element in common
|
||||
*/
|
||||
public function getGroupElements(&$link_by_element, &$element_by_link, $link_key = '', &$current_group = array())
|
||||
{
|
||||
|
||||
@@ -26,12 +26,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
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.'/core/class/fiscalyear.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -39,6 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
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.'/core/class/fiscalyear.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("accountancy", "bills", "compta", "exports", "other"));
|
||||
@@ -241,7 +240,7 @@ if (isset($current_fiscal_period)) {
|
||||
$form_question,
|
||||
'',
|
||||
1,
|
||||
300,
|
||||
340,
|
||||
600
|
||||
);
|
||||
} elseif ($action == 'step_2') {
|
||||
@@ -279,7 +278,7 @@ if (isset($current_fiscal_period)) {
|
||||
$form_question,
|
||||
'',
|
||||
1,
|
||||
300,
|
||||
340,
|
||||
600
|
||||
);
|
||||
} elseif ($action == 'step_3') {
|
||||
@@ -323,7 +322,7 @@ if (isset($current_fiscal_period)) {
|
||||
$form_question,
|
||||
'',
|
||||
1,
|
||||
300,
|
||||
340,
|
||||
600
|
||||
);
|
||||
}
|
||||
@@ -343,11 +342,13 @@ print $formconfirm;
|
||||
|
||||
$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'].' (' . 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') . ' - ' . ($current_fiscal_period['date_end'] ? dol_print_date($current_fiscal_period['date_end'], 'day') : '?'). ')';
|
||||
}
|
||||
$fiscal_period_nav_text .= ' ';
|
||||
$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 .= ' ';
|
||||
$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>';
|
||||
|
||||
print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy');
|
||||
|
||||
@@ -362,7 +363,7 @@ if (empty($current_fiscal_period)) {
|
||||
$head[0][2] = 'step1';
|
||||
print dol_get_fiche_head($head, 'step1', '', -1, '');
|
||||
|
||||
print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>';
|
||||
//print '<span class="opacitymedium">' . $langs->trans("AccountancyClosureStep1Desc") . '</span><br>';
|
||||
|
||||
$count_by_month = $object->getCountByMonthForFiscalPeriod((int) $current_fiscal_period['date_start'], (int) $current_fiscal_period['date_end']);
|
||||
|
||||
@@ -391,7 +392,7 @@ if (empty($current_fiscal_period)) {
|
||||
print '<td class="right"><b>' . $langs->trans("Total") . '</b></td>';
|
||||
print '</tr>';
|
||||
|
||||
if (is_array($count_by_month['list'])) {
|
||||
if (is_array($count_by_month['list']) && count($count_by_month['list']) > 0) {
|
||||
foreach ($count_by_month['list'] as $info) {
|
||||
print '<tr class="oddeven">';
|
||||
if ($nb_years > 1) {
|
||||
@@ -400,8 +401,15 @@ if (empty($current_fiscal_period)) {
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="right">' . ((int) $info['count'][$i]) . '</td>';
|
||||
}
|
||||
print '<td class="right"><b>' . $info['total'] . '</b></td></tr>';
|
||||
print '<td class="right"><b>' . $info['total'] . '</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr class="oddeven"><td colspan="' . (12 + ($nb_years > 1 ? 1 : 0) + 1) . '">';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans("None");
|
||||
print '</span>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
@@ -132,12 +132,14 @@ if (isModEnabled('accounting')) {
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), empty($resultboxes['selectboxlist']) ? '' : $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial);
|
||||
|
||||
/*
|
||||
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) {
|
||||
$messagewarning = $langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices");
|
||||
$messagewarning .= ' '.$langs->trans("WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode", 'https://partners.dolibarr.org');
|
||||
print info_admin($messagewarning);
|
||||
print "<br>";
|
||||
}
|
||||
*/
|
||||
|
||||
if (!$helpisexpanded && empty($resultboxes['boxlista']) && empty($resultboxes['boxlistb'])) {
|
||||
print '<div class="opacitymedium idfaq2"><br>'.$langs->trans("ClickOnUseTutorialForHelp", $langs->transnoentities("ShowTutorial"))."</div>\n";
|
||||
|
||||
@@ -310,7 +310,7 @@ if ($result) {
|
||||
}
|
||||
|
||||
// VAT Reverse charge
|
||||
if (($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) && $obj->vat_reverse_charge == 1 && in_array($obj->country_code, $country_code_in_EEC)) {
|
||||
if (($mysoc->country_code == 'FR' || getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) && $obj->vat_reverse_charge == 1 && (in_array($obj->country_code, $country_code_in_EEC) || getDolGlobalString('ACCOUNTING_REVERSE_CHARGE_ALSO_NON_EEC'))) {
|
||||
$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);
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// $formatexportset must be defined
|
||||
// $downloadMode =0 for direct download or =1 to download after writing files or =-1 not to download files
|
||||
|
||||
'
|
||||
@phan-var-force int $formatexportset
|
||||
@phan-var-force string $type_export
|
||||
@@ -34,10 +31,13 @@
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
*
|
||||
* @var string $action
|
||||
* @var int $formatexportset
|
||||
* @var string $type_export
|
||||
* @var string $filename
|
||||
* @var int<-1,1> $downloadMode
|
||||
* @var string $search_date_end
|
||||
* @var int<-1,1> $downloadMode Value =0 for direct download or =1 to download after writing files or =-1 not to download files
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
@@ -53,13 +53,10 @@ $nodateexport = getDolGlobalInt('ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME');
|
||||
$siren = getDolGlobalString('MAIN_INFO_SIREN');
|
||||
|
||||
$date_export = "_".dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||
$startaccountingperiod = '';
|
||||
$endaccountingperiod = dol_print_date(dol_now(), '%Y%m%d');
|
||||
|
||||
|
||||
if (empty($downloadMode)) {
|
||||
header('Content-Type: text/csv');
|
||||
}
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
|
||||
@@ -102,7 +99,7 @@ if (is_object($hookmanager)) {
|
||||
'code' => $code ?? '',
|
||||
'prefix' => $prefix ?? '',
|
||||
'filename' => $filename ?? '',
|
||||
'period_start' => $startaccountingperiod ?? '',
|
||||
'period_start' => $startaccountingperiod,
|
||||
'period_end' => $endaccountingperiod ?? '',
|
||||
'siren' => $siren ?? '',
|
||||
'ndate_in_filename' => $nodateexport ?? 0,
|
||||
@@ -123,5 +120,6 @@ if (is_object($hookmanager)) {
|
||||
}
|
||||
|
||||
if (empty($downloadMode)) {
|
||||
header('Content-Type: text/csv');
|
||||
header('Content-Disposition: attachment;filename=' . $completefilename);
|
||||
}
|
||||
|
||||
@@ -35,10 +35,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
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
|
||||
* @var DoliDB $db
|
||||
@@ -48,9 +44,12 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
*
|
||||
* @var array<string,array{name:string,paper-size:string|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:int,custom_x:float,custom_y:float}> $_Avery_Labels
|
||||
*/
|
||||
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';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "members"));
|
||||
$langs->loadLangs(array("admin", "members", "other"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
@@ -302,7 +301,7 @@ $head = member_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user');
|
||||
|
||||
$dirModMember = array_merge(array('/core/modules/member/'), $conf->modules_parts['member']);
|
||||
$dirModMember = array_merge(array('/core/modules/member/'), (array) $conf->modules_parts['member']);
|
||||
foreach ($conf->modules_parts['models'] as $mo) {
|
||||
//Add more models
|
||||
$dirModMember[] = $mo.'core/modules/member/';
|
||||
|
||||
@@ -61,6 +61,7 @@ if (GETPOSTISARRAY('actioncode')) {
|
||||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
$search_complete = GETPOST('search_complete');
|
||||
$search_filtert = GETPOSTINT('search_filtert');
|
||||
$search_dateevent_start = GETPOSTDATE('dateevent_start');
|
||||
$search_dateevent_end = GETPOSTDATE('dateevent_end');
|
||||
|
||||
@@ -129,6 +130,7 @@ if (empty($reshook)) {
|
||||
$search_rowid = '';
|
||||
$search_agenda_label = '';
|
||||
$search_complete = '';
|
||||
$search_filtert = '';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,8 +251,9 @@ if ($object->id > 0) {
|
||||
$filters['search_agenda_label'] = $search_agenda_label;
|
||||
$filters['search_rowid'] = $search_rowid;
|
||||
$filters['search_complete'] = $search_complete; // Can be 'na', '0', '100', '50'
|
||||
$filters['search_filtert'] = $search_filtert;
|
||||
|
||||
// TODO Replace this with same code than into list.php
|
||||
// TODO Replace this with the same code than into list.php
|
||||
show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ if (empty($reshook)) {
|
||||
$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
|
||||
|
||||
// Change values
|
||||
$object->civility_id = trim(GETPOST("civility_id", 'alphanohtml'));
|
||||
$object->civility_code = trim(GETPOST("civility_code", 'alphanohtml'));
|
||||
$object->firstname = trim(GETPOST("firstname", 'alphanohtml'));
|
||||
$object->lastname = trim(GETPOST("lastname", 'alphanohtml'));
|
||||
$object->gender = trim(GETPOST("gender", 'alphanohtml'));
|
||||
@@ -513,7 +513,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
$typeid = GETPOSTINT("typeid");
|
||||
$civility_id = GETPOST("civility_id", 'alphanohtml');
|
||||
$civility_code = GETPOST("civility_code", 'alphanohtml');
|
||||
$lastname = GETPOST("lastname", 'alphanohtml');
|
||||
$firstname = GETPOST("firstname", 'alphanohtml');
|
||||
$gender = GETPOST("gender", 'alphanohtml');
|
||||
@@ -539,7 +539,7 @@ if (empty($reshook)) {
|
||||
$socid = GETPOSTINT("socid");
|
||||
$default_lang = GETPOST('default_lang', 'alpha');
|
||||
|
||||
$object->civility_id = $civility_id;
|
||||
$object->civility_code = $civility_code;
|
||||
$object->firstname = $firstname;
|
||||
$object->lastname = $lastname;
|
||||
$object->gender = $gender;
|
||||
@@ -1076,7 +1076,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
$generated_password = getRandomPassword(false);
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Password").'</span></td><td>';
|
||||
print '<input type="text" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag($generated_password).'">';
|
||||
print '<input type="password" class="minwidth300" maxlength="50" name="password" value="'.dol_escape_htmltag(GETPOST('password') ? GETPOST('password') : $generated_password).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@@ -1190,7 +1190,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
print $formcompany->select_civility(GETPOSTINT('civility_id') ? GETPOSTINT('civility_id') : $object->civility_id, 'civility_id', 'maxwidth150', 1).'</td>';
|
||||
print $formcompany->select_civility(GETPOSTISSET('civility_code') ? GETPOST('civility_code') : $object->civility_code, 'civility_code', 'maxwidth150', 1).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
@@ -1424,7 +1424,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
print $formcompany->select_civility(GETPOSTISSET("civility_id") ? GETPOST("civility_id", 'alpha') : $object->civility_id, 'civility_id', 'maxwidth150', 1);
|
||||
print $formcompany->select_civility(GETPOSTISSET("civility_code") ? GETPOST("civility_code", 'alpha') : $object->civility_code, 'civility_code', 'maxwidth150', 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ class Adherent extends CommonObject
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MemberNature', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 55),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'MemberType', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => 1, 'position' => 65, 'showoncombobox' => 2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'LinkedToDolibarrThirdParty', 'enabled' => 1, 'visible' => 1, 'position' => 70),
|
||||
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
|
||||
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85),
|
||||
@@ -2191,7 +2191,7 @@ class Adherent extends CommonObject
|
||||
$now = dol_now();
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == self::STATUS_VALIDATED) {
|
||||
if ($this->status == self::STATUS_VALIDATED) {
|
||||
dol_syslog(get_class($this)."::validate statut of member does not allow this", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
@@ -2208,6 +2208,7 @@ class Adherent extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->statut = self::STATUS_VALIDATED;
|
||||
$this->status = self::STATUS_VALIDATED;
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MEMBER_VALIDATE', $user);
|
||||
@@ -2231,7 +2232,7 @@ class Adherent extends CommonObject
|
||||
|
||||
|
||||
/**
|
||||
* Fonction qui resilie un adherent
|
||||
* Function that terminates a member
|
||||
*
|
||||
* @param User $user User making change
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
@@ -2243,7 +2244,7 @@ class Adherent extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == self::STATUS_RESILIATED) {
|
||||
if ($this->status == self::STATUS_RESILIATED) {
|
||||
dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
@@ -2258,6 +2259,7 @@ class Adherent extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->statut = self::STATUS_RESILIATED;
|
||||
$this->status = self::STATUS_RESILIATED;
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MEMBER_RESILIATE', $user);
|
||||
@@ -2291,7 +2293,7 @@ class Adherent extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == self::STATUS_EXCLUDED) {
|
||||
if ($this->status == self::STATUS_EXCLUDED) {
|
||||
dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING);
|
||||
return 0;
|
||||
}
|
||||
@@ -2306,6 +2308,7 @@ class Adherent extends CommonObject
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$this->statut = self::STATUS_EXCLUDED;
|
||||
$this->status = self::STATUS_EXCLUDED;
|
||||
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('MEMBER_EXCLUDE', $user);
|
||||
@@ -2515,7 +2518,7 @@ class Adherent extends CommonObject
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param int $addlinktonotes 1=Add link to notes
|
||||
* @return string Chaine avec URL
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1, $notooltip = 0, $addlinktonotes = 0)
|
||||
{
|
||||
@@ -2746,7 +2749,7 @@ class Adherent extends CommonObject
|
||||
global $conf, $langs;
|
||||
|
||||
if ($user->socid) {
|
||||
return -1; // protection pour eviter appel par utilisateur externe
|
||||
return -1; // Protection to prevent calls by external users
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
@@ -2921,7 +2924,7 @@ class Adherent extends CommonObject
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
* Returns the complete DN (Distinguished Name) string in the LDAP directory for the object
|
||||
*
|
||||
* @param array<string,mixed> $info Info array loaded by _load_ldap_info
|
||||
* @param int<0,2> $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
|
||||
@@ -3147,7 +3150,7 @@ class Adherent extends CommonObject
|
||||
$sql = "SELECT count(mc.email) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
|
||||
$sql .= " WHERE mc.email = '".$this->db->escape($this->email)."'";
|
||||
$sql .= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec success
|
||||
$sql .= " AND mc.statut NOT IN (-1,0)"; // -1 error, 0 not sent, 1 sent with success
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2018-2019 Thibault Foucart <support@ptibogxiv.net>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 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
|
||||
@@ -111,8 +111,10 @@ class AdherentType extends CommonObject
|
||||
"rowid" => array("type" => "integer", "label" => "Ref", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "1",),
|
||||
"libelle" => array("type" => "varchar(50)", "label" => "Label", "enabled" => "1", 'position' => 30, 'notnull' => 1, "visible" => "1", "showoncombobox" => 1),
|
||||
"subscription" => array("type" => "varchar(3)", "label" => "Subscription", "enabled" => "1", 'position' => 35, 'notnull' => 1, "visible" => "1",),
|
||||
"amount" => array("type" => "double(24,8)", "label" => "Amount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "1",),
|
||||
"caneditamount" => array("type" => "integer", "label" => "Caneditamount", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "1",),
|
||||
"caneditamount" => array("type" => "integer", "label" => "Caneditamount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "1",),
|
||||
"minimumamount" => array("type" => "double(24,8)", "label" => "MinimumAmount", "enabled" => "1", 'position' => 42, 'notnull' => 0, "visible" => "1",),
|
||||
"amount" => array("type" => "double(24,8)", "label" => "Amount", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "1",),
|
||||
"amountformuladescription" => array("type" => "longtext", "label" => "AmountFormulaDescription", "enabled" => "1", 'position' => 46, 'notnull' => 0, "visible" => "1",),
|
||||
"vote" => array("type" => "varchar(3)", "label" => "Vote", "enabled" => "1", 'position' => 50, 'notnull' => 1, "visible" => "-1",),
|
||||
"mail_valid" => array("type" => "longtext", "label" => "MailValidation", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "-3",),
|
||||
"morphy" => array("type" => "varchar(3)", "label" => "MembersNature", "enabled" => "1", 'position' => 65, 'notnull' => 0, "visible" => "1",),
|
||||
@@ -160,15 +162,25 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public $subscription;
|
||||
|
||||
/**
|
||||
* @var int Amount can be chosen by the visitor during subscription (0 or 1)
|
||||
*/
|
||||
public $caneditamount;
|
||||
|
||||
/**
|
||||
* @var float|string Minimum Amount for subscription (null or '' means not defined)
|
||||
*/
|
||||
public $minimumamount;
|
||||
|
||||
/**
|
||||
* @var float|string Amount for subscription (null or '' means not defined)
|
||||
*/
|
||||
public $amount;
|
||||
|
||||
/**
|
||||
* @var int Amount can be chosen by the visitor during subscription (0 or 1)
|
||||
* @var string Describe the subscription amount formula to follow
|
||||
*/
|
||||
public $caneditamount;
|
||||
public $amountformuladescription;
|
||||
|
||||
/**
|
||||
* @var string Public note
|
||||
@@ -273,7 +285,7 @@ class AdherentType extends CommonObject
|
||||
if ($result) {
|
||||
while ($obj = $this->db->fetch_object($result)) {
|
||||
//print 'lang='.$obj->lang.' current='.$current_lang.'<br>';
|
||||
if ($obj->lang == $current_lang) { // si on a les traduct. dans la langue courante on les charge en infos principales.
|
||||
if ($obj->lang == $current_lang) { // if we have the translations in the current language, we load them as main information.
|
||||
$this->label = $obj->label;
|
||||
$this->description = $obj->description;
|
||||
$this->email = $obj->email;
|
||||
@@ -495,8 +507,10 @@ class AdherentType extends CommonObject
|
||||
$sql .= "libelle = '".$this->db->escape($this->label)."',";
|
||||
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
|
||||
$sql .= "subscription = '".$this->db->escape((string) $this->subscription)."',";
|
||||
$sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? "null" : ((float) $this->amount)).",";
|
||||
$sql .= "caneditamount = ".((int) $this->caneditamount).",";
|
||||
$sql .= "minimumamount = ".((empty($this->minimumamount) && $this->minimumamount == '') ? "null" : ((float) $this->minimumamount)).",";
|
||||
$sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? "null" : ((float) $this->amount)).",";
|
||||
$sql .= "amountformuladescription = '".$this->db->escape($this->amountformuladescription)."',";
|
||||
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
|
||||
$sql .= "note = '".$this->db->escape($this->note_public)."',";
|
||||
$sql .= "vote = ".(int) $this->db->escape((string) $this->vote).",";
|
||||
@@ -586,7 +600,7 @@ class AdherentType extends CommonObject
|
||||
*/
|
||||
public function fetch($rowid)
|
||||
{
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut as status, d.duration, d.subscription, d.amount, d.caneditamount, d.mail_valid, d.note as note_public, d.vote";
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut as status, d.duration, d.subscription, d.caneditamount, d.minimumamount, d.amount, d.amountformuladescription, d.mail_valid, d.note as note_public, d.vote";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
$sql .= " WHERE d.rowid = ".(int) $rowid;
|
||||
|
||||
@@ -606,8 +620,10 @@ class AdherentType extends CommonObject
|
||||
$this->duration_value = (int) substr($obj->duration, 0, dol_strlen($obj->duration) - 1);
|
||||
$this->duration_unit = substr($obj->duration, -1);
|
||||
$this->subscription = $obj->subscription;
|
||||
$this->amount = $obj->amount;
|
||||
$this->caneditamount = $obj->caneditamount;
|
||||
$this->minimumamount = $obj->minimumamount;
|
||||
$this->amount = $obj->amount;
|
||||
$this->amountformuladescription = $obj->amountformuladescription;
|
||||
$this->mail_valid = $obj->mail_valid;
|
||||
$this->note = $obj->note_public; // deprecated
|
||||
$this->note_public = $obj->note_public;
|
||||
@@ -782,6 +798,80 @@ class AdherentType extends CommonObject
|
||||
return $caneditamountbytype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the array of all minimum amounts per membership type id
|
||||
*
|
||||
* @param int $status Filter on status of type
|
||||
* @return array<int,float> Array of membership type
|
||||
*/
|
||||
public function minimumAmountByType($status = null)
|
||||
{
|
||||
$minimumamountbytype = array();
|
||||
|
||||
$sql = "SELECT rowid, minimumamount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql .= " WHERE entity IN (".getEntity('member_type').")";
|
||||
if ($status !== null) {
|
||||
$sql .= " AND statut = ".((int) $status);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$nump = $this->db->num_rows($resql);
|
||||
|
||||
if ($nump) {
|
||||
$i = 0;
|
||||
while ($i < $nump) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$minimumamountbytype[$obj->rowid] = (float) $obj->minimumamount;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
return $minimumamountbytype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the array of all amount formula's descriptions per membership type id
|
||||
*
|
||||
* @param int $status Filter on status of type
|
||||
* @return array<int,float> Array of membership type
|
||||
*/
|
||||
public function amountFormulaDescriptionByType($status = null)
|
||||
{
|
||||
$amountformuladescriptionbytype = array();
|
||||
|
||||
$sql = "SELECT rowid, amountformuladescription";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql .= " WHERE entity IN (".getEntity('member_type').")";
|
||||
if ($status !== null) {
|
||||
$sql .= " AND statut = ".((int) $status);
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$nump = $this->db->num_rows($resql);
|
||||
|
||||
if ($nump) {
|
||||
$i = 0;
|
||||
while ($i < $nump) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$amountformuladescriptionbytype[$obj->rowid] = $obj->amountformuladescription;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
print $this->db->error();
|
||||
}
|
||||
|
||||
return $amountformuladescriptionbytype;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of Member objects for member type this->id (or all if this->id not defined)
|
||||
*
|
||||
@@ -1002,7 +1092,7 @@ class AdherentType extends CommonObject
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||
* Returns full DN description in LDAP directory format for the object
|
||||
*
|
||||
* @param array<string,mixed> $info Info array loaded by _load_ldap_info
|
||||
* @param int<0,2> $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
|
||||
@@ -1183,7 +1273,7 @@ class AdherentType extends CommonObject
|
||||
//$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
|
||||
if ($user->hasRight('adherent', 'configurer')) {
|
||||
$return .= '<span class="right paddingleft"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.urlencode($this->ref).'">'.img_edit().'</a></span>';
|
||||
$return .= '<span class="right paddingleft"><a class="editfielda showonhover" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.urlencode($this->ref).'">'.img_edit().'</a></span>';
|
||||
} else {
|
||||
$return .= '<span class="right"> </span>';
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ class Subscription extends CommonObject
|
||||
* @param string $option Page for link ('', 'nolink', ...)
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2018-2024 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
@@ -169,7 +169,7 @@ $arrayfields = array(
|
||||
'd.lastname' => array('label' => "Lastname", 'checked' => 1),
|
||||
'd.firstname' => array('label' => "Firstname", 'checked' => 1),
|
||||
'd.gender' => array('label' => "Gender", 'checked' => 0),
|
||||
'd.company' => array('label' => "Company", 'checked' => 1, 'position' => 70),
|
||||
'd.societe' => array('label' => "Company", 'checked' => 1, 'position' => 70),
|
||||
'd.login' => array('label' => "Login", 'checked' => 1),
|
||||
'd.morphy' => array('label' => "MemberNature", 'checked' => 1),
|
||||
't.libelle' => array('label' => "MemberType", 'checked' => 1, 'position' => 55),
|
||||
@@ -503,7 +503,7 @@ if ($search_filter == 'outofdate') {
|
||||
$sql .= " AND (datefin < '".$db->idate($now)."')";
|
||||
}
|
||||
if ($search_status != '') {
|
||||
// Peut valoir un nombre ou liste de nombre separates par virgules
|
||||
// Can be a number or comma separated list of numbers
|
||||
$sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")";
|
||||
}
|
||||
if ($search_morphy != '' && $search_morphy != '-1') {
|
||||
@@ -931,7 +931,7 @@ if (!empty($arrayfields['d.gender']['checked'])) {
|
||||
}
|
||||
|
||||
// Company
|
||||
if (!empty($arrayfields['d.company']['checked'])) {
|
||||
if (!empty($arrayfields['d.societe']['checked'])) {
|
||||
print '<td class="liste_titre left">';
|
||||
print '<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
|
||||
}
|
||||
@@ -1131,8 +1131,8 @@ if (!empty($arrayfields['d.gender']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', '', $param, '', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.company']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['d.societe']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.societe']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.login']['checked'])) {
|
||||
@@ -1364,7 +1364,7 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
}
|
||||
// Company
|
||||
if (!empty($arrayfields['d.company']['checked'])) {
|
||||
if (!empty($arrayfields['d.societe']['checked'])) {
|
||||
print '<td class="tdoverflowmax125" title="'.dolPrintHTMLForAttribute((string) $companyname).'">';
|
||||
print $companynametoshow;
|
||||
print "</td>\n";
|
||||
|
||||
@@ -50,10 +50,12 @@ $langs->loadLangs(array('agenda', 'bills', 'companies', 'orders', 'propal'));
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'useragenda';
|
||||
|
||||
if (GETPOST('actioncode', 'array')) {
|
||||
$actioncode = GETPOST('actioncode', 'array', 3);
|
||||
if (GETPOSTISARRAY('actioncode')) {
|
||||
$actioncode = GETPOST('actioncode', 'array:alpha', 3);
|
||||
if (!count($actioncode)) {
|
||||
$actioncode = '0';
|
||||
} else {
|
||||
$actioncode = implode(',', $actioncode);
|
||||
}
|
||||
} else {
|
||||
$actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT'));
|
||||
|
||||
@@ -149,7 +149,9 @@ if (empty($reshook) && $action == 'confirm_create_thirdparty' && $confirm == 'ye
|
||||
$langs->load("errors");
|
||||
setEventMessages($company->error, $company->errors, 'errors');
|
||||
} else {
|
||||
$action = 'addsubscription';
|
||||
$object->socid = $result;
|
||||
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
@@ -248,14 +250,14 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac
|
||||
$langs->load("errors");
|
||||
$errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateSubscription"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
if (GETPOST('end') && !$datesubend) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$errmsg = $langs->trans("ErrorBadDateFormat", $langs->transnoentitiesnoconv("DateEndSubscription"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
if (!$datesubend) {
|
||||
$datesubend = dol_time_plus_duree(dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit), -1, 'd');
|
||||
@@ -264,7 +266,7 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac
|
||||
$error++;
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
|
||||
// Check if a payment is mandatory or not
|
||||
@@ -274,7 +276,7 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
} else {
|
||||
// If an amount has been provided, we check also fields that becomes mandatory when amount is not null.
|
||||
if (isModEnabled('bank') && GETPOST("paymentsave") != 'none') {
|
||||
@@ -283,26 +285,26 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOSTINT("accountid") > 0)) {
|
||||
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
} else {
|
||||
if (GETPOSTINT("accountid")) {
|
||||
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -335,7 +337,7 @@ if (empty($reshook) && $user->hasRight('adherent', 'cotisation', 'creer') && $ac
|
||||
$db->commit();
|
||||
} else {
|
||||
$db->rollback();
|
||||
$action = 'addsubscription';
|
||||
$action = 'createsubscription';
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
@@ -695,11 +697,11 @@ print dol_get_fiche_end();
|
||||
|
||||
// Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2)
|
||||
if ($user->hasRight('adherent', 'cotisation', 'creer')) {
|
||||
if ($action != 'addsubscription' && $action != 'create_thirdparty') {
|
||||
if ($action != 'createsubscription' && $action != 'create_thirdparty') {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($object->status > 0) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=addsubscription&token='.newToken().'">'.$langs->trans("AddSubscription")."</a></div>";
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$rowid.'&action=createsubscription">'.$langs->trans("AddSubscription")."</a></div>";
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("AddSubscription").'</a></div>';
|
||||
}
|
||||
@@ -711,7 +713,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer')) {
|
||||
/*
|
||||
* List of subscriptions
|
||||
*/
|
||||
if ($action != 'addsubscription' && $action != 'create_thirdparty') {
|
||||
if ($action != 'createsubscription' && $action != 'create_thirdparty') {
|
||||
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.societe, d.fk_adherent_type as type,";
|
||||
$sql .= " c.rowid as crowid, c.subscription,";
|
||||
$sql .= " c.datec, c.fk_type as cfk_type,";
|
||||
@@ -820,7 +822,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') {
|
||||
}
|
||||
|
||||
|
||||
if (($action != 'addsubscription' && $action != 'create_thirdparty')) {
|
||||
if (($action != 'createsubscription' && $action != 'create_thirdparty')) {
|
||||
// Show online payment link
|
||||
// The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods()
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
@@ -839,7 +841,7 @@ if (($action != 'addsubscription' && $action != 'create_thirdparty')) {
|
||||
/*
|
||||
* Add new subscription form
|
||||
*/
|
||||
if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->hasRight('adherent', 'cotisation', 'creer')) {
|
||||
if (($action == 'createsubscription' || $action == 'create_thirdparty') && $user->hasRight('adherent', 'cotisation', 'creer')) {
|
||||
print '<br>';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewCotisation"));
|
||||
@@ -932,7 +934,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h
|
||||
// If customer code was forced to "required", we ask it at creation to avoid error later
|
||||
if (getDolGlobalString('MAIN_COMPANY_CODE_ALWAYS_REQUIRED')) {
|
||||
$tmpcompany = new Societe($db);
|
||||
$tmpcompany->name = $companyname;
|
||||
$tmpcompany->name = (string) $companyname;
|
||||
$tmpcompany->get_codeclient($tmpcompany, 0);
|
||||
$customercode = $tmpcompany->code_client;
|
||||
$formquestion[] = array(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2007-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2026 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
|
||||
@@ -344,7 +345,7 @@ if ($rowid && $action != 'edit') {
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td class="valeur"><span class="amount">'.price($object->amount).'</span></td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur sensiblehtmlcontent">'.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_public)).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur sensiblehtmlcontent">'.dol_string_onlythesehtmltags(dol_htmlentitiesbr((string) $object->note_public)).'</td></tr>';
|
||||
|
||||
// Bank line
|
||||
if (isModEnabled("bank") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) {
|
||||
|
||||
@@ -40,7 +40,6 @@ require '../main.inc.php';
|
||||
* @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';
|
||||
@@ -92,13 +91,15 @@ $label = GETPOST("label", "alpha");
|
||||
$morphy = GETPOST("morphy", "alpha");
|
||||
$status = GETPOST("status", "intcomma");
|
||||
$subscription = GETPOSTINT("subscription");
|
||||
$caneditamount = GETPOSTINT("caneditamount");
|
||||
$minimumamount = GETPOST('minimumamount', 'alpha');
|
||||
$amount = GETPOST('amount', 'alpha');
|
||||
$amountformuladescription = GETPOST("amountformuladescription", 'restricthtml');
|
||||
$duration_value = GETPOSTINT('duration_value');
|
||||
$duration_unit = GETPOST('duration_unit', 'alpha');
|
||||
$vote = GETPOSTINT("vote");
|
||||
$comment = GETPOST("comment", 'restricthtml');
|
||||
$mail_valid = GETPOST("mail_valid", 'restricthtml');
|
||||
$caneditamount = GETPOSTINT("caneditamount");
|
||||
|
||||
// Initialize a technical object
|
||||
$object = new AdherentType($db);
|
||||
@@ -173,8 +174,10 @@ if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
|
||||
$object->morphy = trim($morphy);
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (string) (int) $subscription;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->caneditamount = $caneditamount;
|
||||
$object->minimumamount = ($minimumamount == '' ? '' : price2num($minimumamount, 'MT'));
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->amountformuladescription = trim($amountformuladescription);
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note_public = trim($comment);
|
||||
@@ -234,8 +237,10 @@ if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
|
||||
$object->morphy = trim($morphy);
|
||||
$object->status = (int) $status;
|
||||
$object->subscription = (string) (int) $subscription;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->caneditamount = $caneditamount;
|
||||
$object->minimumamount = $minimumamount;
|
||||
$object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
|
||||
$object->amountformuladescription = trim($amountformuladescription);
|
||||
$object->duration_value = $duration_value;
|
||||
$object->duration_unit = $duration_unit;
|
||||
$object->note_public = trim($comment);
|
||||
@@ -297,7 +302,7 @@ $totalarray = [
|
||||
if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
//print dol_get_fiche_head([]);
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote,";
|
||||
$sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.caneditamount, d.minimumamount, d.amount, d.amountformuladescription, d.vote,";
|
||||
$sql .= " d.statut as status, d.morphy, d.duration,";
|
||||
$sql .= " d.tms";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
|
||||
@@ -381,12 +386,20 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.minimumamount']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("MinimumAmountShort").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("Amount").'</th>';
|
||||
print '<th class="center">'.$langs->trans("RecommendedAmount").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
|
||||
if (!empty($arrayfields['t.amountformuladescription']['checked'])) {
|
||||
print '<th class="center">'.$langs->trans("AmountFormulaDescription").'</th>';
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['t.vote']['checked'])) {
|
||||
@@ -424,8 +437,10 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
$membertype->label = $objp->rowid;
|
||||
$membertype->status = $objp->status;
|
||||
$membertype->subscription = $objp->subscription;
|
||||
$membertype->amount = $objp->amount;
|
||||
$membertype->caneditamount = $objp->caneditamount;
|
||||
$membertype->minimumamount = $objp->minimumamount;
|
||||
$membertype->amount = $objp->amount;
|
||||
$membertype->amountformuladescription = $objp->amountformuladescription;
|
||||
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
@@ -484,17 +499,27 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
||||
if (!empty($arrayfields['t.subscription']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.minimumamount']['checked'])) {
|
||||
print '<td class="center">'.price($objp->minimumamount).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.amount']['checked'])) {
|
||||
print '<td class="center">';
|
||||
$amount = (is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount));
|
||||
$minimumamount = (is_null($objp->minimumamount) || $objp->minimumamount === '' ? '' : price($objp->minimumamount));
|
||||
print '<span class="amount">'.$amount.'</span>';
|
||||
if ($amount && $amount < (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")) {
|
||||
print img_warning('Amount lower than minimum of '.price(getDolGlobalInt("MEMBER_MIN_AMOUNT")).' defined in setup');
|
||||
}
|
||||
if ($amount && $minimumamount && $amount < $minimumamount) {
|
||||
print img_warning('Amount lower than minimum of '.price($minimumamount).' defined in setup');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.caneditamount']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->caneditamount).'</td>';
|
||||
if (!empty($arrayfields['t.amountformuladescription']['checked'])) {
|
||||
print '<td class="center">'.dol_escape_htmltag($objp->amountformuladescription).'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['t.vote']['checked'])) {
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
@@ -553,7 +578,7 @@ if ($action == 'create') {
|
||||
print '<table class="border centpercent">';
|
||||
print '<tbody>';
|
||||
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" value= "'. $label. '" autofocus="autofocus"></td></tr>';
|
||||
print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth300" name="label" value= "'. $label. '" autofocus="autofocus"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||
@@ -566,27 +591,36 @@ if ($action == 'create') {
|
||||
"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 $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy', 0, 0, 0, '', 0, 0, 0, '', 'minwidth300');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("SubscriptionRequired"), $langs->trans("SubscriptionRequiredDesc")).'</td><td>';
|
||||
print $form->selectyesno("subscription", 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
print '<input name="amount" size="5" value="'.(GETPOSTISSET('amount') ? GETPOST('amount') : price($amount)).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
|
||||
print $form->selectyesno("caneditamount", GETPOSTISSET('caneditamount') ? GETPOST('caneditamount') : 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MinimumAmountShort").'</td><td>';
|
||||
print '<input name="minimumamount" size="5" value="'.(GETPOSTISSET('minimumamount') ? GETPOST('minimumamount') : price($minimumamount)).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RecommendedAmount").'</td><td>';
|
||||
print '<input name="amount" size="5" value="'.(GETPOSTISSET('amount') ? GETPOST('amount') : '').'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="tdtop">'.$langs->trans("AmountFormulaDescription").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('amountformuladescription', (GETPOSTISSET('amountformuladescription') ? GETPOST('amountformuladescription', 'restricthtml') : $object->amountformuladescription), '', 100, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), 15, '90%');
|
||||
$doleditor->Create();
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print $form->selectyesno("vote", GETPOSTISSET("vote") ? GETPOST('vote', 'aZ09') : 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
|
||||
print '<input name="duration_value" size="5" value="'. $duration_value .'"> ';
|
||||
print '<input name="duration_value" size="5" value="'. ($duration_value ? $duration_value : 1) .'"> ';
|
||||
print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -650,17 +684,29 @@ if ($rowid > 0) {
|
||||
print '</tr>';
|
||||
|
||||
// Amount
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
|
||||
print yn($object->caneditamount);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("MinimumAmountShort").'</td><td>';
|
||||
$minimumamount = ((is_null($object->minimumamount) || $object->minimumamount === '') ? '' : price($object->minimumamount));
|
||||
print $minimumamount;
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("RecommendedAmount").'</td><td>';
|
||||
$amount = ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '<span class="amount">'.$amount.'</span>';
|
||||
if ($amount && $amount < (float) getDolGlobalInt("MEMBER_MIN_AMOUNT")) {
|
||||
print ' '.img_warning('Amount lower than minimum of '.price(getDolGlobalInt("MEMBER_MIN_AMOUNT")).' defined in setup');
|
||||
}
|
||||
if ($amount && $minimumamount && $amount < $minimumamount) {
|
||||
print ' '.img_warning('Amount lower than minimum of '.price($minimumamount).' defined in setup');
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
|
||||
print yn($object->caneditamount);
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="tdtop">'.$langs->trans("AmountFormulaDescription").'</td><td><div class="longmessagecut">';
|
||||
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->amountformuladescription));
|
||||
print "</div></td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
print yn($object->vote);
|
||||
@@ -682,7 +728,7 @@ if ($rowid > 0) {
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td><div class="longmessagecut">';
|
||||
print dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_public));
|
||||
print dol_string_onlythesehtmltags(dol_htmlentitiesbr((string) $object->note_public));
|
||||
print "</div></td></tr>";
|
||||
|
||||
// Welcome email content
|
||||
@@ -1097,15 +1143,28 @@ if ($rowid > 0) {
|
||||
print $form->selectyesno("subscription", $object->subscription, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Amount").'</td><td>';
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmountDetail")).'</td><td>';
|
||||
print $form->selectyesno("caneditamount", $object->caneditamount, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("MinimumAmountShort").'</td><td>';
|
||||
$minimumamount = ((is_null($object->minimumamount) || $object->minimumamount === '') ? '' : price($object->minimumamount));
|
||||
print '<input name="minimumamount" size="5" value="';
|
||||
print $minimumamount;
|
||||
print '">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("RecommendedAmount").'</td><td>';
|
||||
$amount = ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
|
||||
print '<input name="amount" size="5" value="';
|
||||
print $amount;
|
||||
print '">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmountDetail")).'</td><td>';
|
||||
print $form->selectyesno("caneditamount", $object->caneditamount, 1);
|
||||
print '<tr><td class="tdtop">'.$langs->trans("AmountFormulaDescription").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('amountformuladescription', $object->amountformuladescription, '', 220, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), 15, '90%');
|
||||
$doleditor->Create();
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -282,6 +282,7 @@ if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') && isModEnabled('product')) {
|
||||
dol_include_once($dirroot.$file.'.php');
|
||||
} catch (Exception $e) {
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
continue;
|
||||
}
|
||||
|
||||
$modBarCode = new $file();
|
||||
@@ -349,6 +350,7 @@ if (getDolGlobalString('BARCODE_USE_ON_THIRDPARTY') && isModEnabled('societe'))
|
||||
dol_include_once($dirroot.$file.'.php');
|
||||
} catch (Exception $e) {
|
||||
dol_syslog($e->getMessage(), LOG_ERR);
|
||||
continue;
|
||||
}
|
||||
|
||||
$modBarCode = new $file();
|
||||
@@ -428,9 +430,9 @@ if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_
|
||||
print dol_escape_htmltag($obj->label);
|
||||
print "</td><td>\n";
|
||||
print $langs->trans('BarcodeDesc'.$obj->encoding);
|
||||
//print "L'EAN se compose de 8 characters, 7 chiffres plus une cle de verification.<br>";
|
||||
//print "L'utilisation des symbologies EAN8 impose la souscription et l'abonnement aupres d'organismes comme GENCOD.<br>";
|
||||
//print "Codes numeriques utilises exclusivement a l'identification des produits susceptibles d'etre vendus au grand public.";
|
||||
// print "The EAN consists of 8 characters, 7 digits plus a control digit.";
|
||||
// print "The use of EAN8 symbols requires subscription to organizations such as GENCOD.";
|
||||
// print "Numeric codes are used exclusively for the identification of products that are likely to be sold to the general public.";
|
||||
print '</td>';
|
||||
|
||||
// Show example
|
||||
@@ -518,7 +520,7 @@ if (getDolGlobalString('BARCODE_USE_ON_PRODUCT') || getDolGlobalString('BARCODE_
|
||||
print '<td>'.$langs->trans("GenbarcodeLocation").'</td>';
|
||||
print '<td width="60" class="center">';
|
||||
print '<input type="text" size="40" name="GENBARCODE_LOCATION" value="'.getDolGlobalString('GENBARCODE_LOCATION').'">';
|
||||
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
|
||||
if (getDolGlobalString('GENBARCODE_LOCATION') && !@file_exists(getDolGlobalString('GENBARCODE_LOCATION'))) {
|
||||
$langs->load("errors");
|
||||
print '<br><span class="error">'.$langs->trans("ErrorFileNotFound", getDolGlobalString('GENBARCODE_LOCATION')).'</span>';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2026 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
|
||||
@@ -29,6 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
@@ -151,27 +153,27 @@ if ($action == 'updateMask') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$bomsearch = GETPOST('activate_BOM_USE_SEARCH_TO_SELECT', 'alpha');
|
||||
$res = dolibarr_set_const($db, "BOM_USE_SEARCH_TO_SELECT", $bomsearch, 'chaine', 0, '', $conf->entity);
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$freetext = GETPOST("BOM_FREE_TEXT", 'restricthtml'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "BOM_FREE_TEXT", $freetext, '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 == '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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -486,9 +488,6 @@ 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>';
|
||||
@@ -496,15 +495,13 @@ if (!$conf->use_javascript_ajax) {
|
||||
print $langs->trans("NotAvailableWhenAjaxDisabled");
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td class="right">';
|
||||
print '<td>';
|
||||
$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>';
|
||||
@@ -538,17 +535,13 @@ print '<input class="flat minwidth200" type="text" name="BOM_DRAFT_WATERMARK" va
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></center>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@@ -459,7 +459,9 @@ print '<td class="liste_titre"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Activate FileCache (so content of file boxes are stored into a cache file int boxes/temp for 3600 seconds)
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("EnableFileCache").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("EnableFileCache");
|
||||
print ' <span class="opacitymedium">('.getDolGlobalInt('MAIN_ACTIVATE_FILECACHE_DELAY', 900)." ".$langs->trans("seconds").")</span>";
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_ACTIVATE_FILECACHE', array(), null, 0, 0, 0, 2, 0, 1);
|
||||
} else {
|
||||
|
||||
@@ -24,9 +24,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -37,6 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
|
||||
*
|
||||
* @var string $dolibarr_main_url_root
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "other", "agenda"));
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* Copyright (C) 2011-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2019-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019-2026 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020-2022 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024-2025 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
@@ -1053,7 +1053,7 @@ if (empty($reshook)) {
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET ";
|
||||
// Modifie valeur des champs
|
||||
// Update fields value
|
||||
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
|
||||
$sql .= $tabrowid[$id]."=";
|
||||
$sql .= "'".$db->escape($rowid)."', ";
|
||||
@@ -1378,6 +1378,7 @@ if (empty($reshook)) {
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$title = $langs->trans("DictionarySetup");
|
||||
|
||||
@@ -1478,7 +1479,11 @@ if ($id > 0) {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
if ($search_country_id > 0) {
|
||||
$sql .= " AND c.rowid = ".((int) $search_country_id);
|
||||
if ($id == DICT_HRM_PUBLIC_HOLIDAY || $id == DICT_HOLIDAY_TYPES) {
|
||||
$sql .= " AND (c.rowid IS NULL OR c.rowid = 0 OR c.rowid = ".((int) $search_country_id).")";
|
||||
} else {
|
||||
$sql .= " AND c.rowid = ".((int) $search_country_id);
|
||||
}
|
||||
}
|
||||
if ($search_code != '') {
|
||||
$sql .= natural_search($tablecode, $search_code);
|
||||
@@ -2621,6 +2626,8 @@ if ($id > 0) {
|
||||
$valuetoshow = price2num($valuetoshow);
|
||||
} elseif ($value == 'type' && $id == DICT_ACTIONCOMM && !empty($obj->module)) {
|
||||
$titletoshow = $langs->trans("Module").' '.$obj->module;
|
||||
} elseif ($value == 'color') {
|
||||
$valuetoshow = $formother->showColor($obj->{$value}, '');
|
||||
}
|
||||
|
||||
|
||||
@@ -2825,14 +2832,13 @@ $db->close();
|
||||
function dictFieldList($fieldlist, $obj = null, $tabname = '', $context = '')
|
||||
{
|
||||
global $langs, $db, $mysoc;
|
||||
global $form;
|
||||
global $form, $formother;
|
||||
global $region_id;
|
||||
global $elementList, $sourceList, $localtax_typeList, $type_vatList;
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$formother = new FormOther($db);
|
||||
|
||||
$withentity = '';
|
||||
|
||||
|
||||
@@ -662,6 +662,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
'cc' => array('label' => 'Cc', 'data-placeholder' => $langs->trans('SearchString')),
|
||||
'bcc' => array('label' => 'Bcc', 'data-placeholder' => $langs->trans('SearchString')),
|
||||
'replyto' => array('label' => 'ReplyTo', 'data-placeholder' => $langs->trans('SearchString')),
|
||||
'excludeemail' => array('label' => 'EmailCollectorExcludeEmails', 'data-placeholder' => $langs->trans('EmailCollectorExcludeEmailsPlaceholder')),
|
||||
'excludedomain' => array('label' => 'EmailCollectorExcludeDomains', 'data-placeholder' => $langs->trans('EmailCollectorExcludeDomainsPlaceholder')),
|
||||
'subject' => array('label' => 'Subject', 'data-placeholder' => $langs->trans('SearchString')),
|
||||
'body' => array('label' => 'Body', 'data-placeholder' => $langs->trans('SearchString')),
|
||||
// disabled because PHP imap_search is not compatible IMAPv4, only IMAPv2
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||
@@ -36,14 +43,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/emailcollector/class/emailcollector.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var HookManager $hookmanager
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
|
||||
// Load translation files required by page
|
||||
$langs->loadLangs(array("admin", "other"));
|
||||
|
||||
@@ -53,7 +52,7 @@ $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk act
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'emailcollectorlist'; // To manage different context of search
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : getDolDefaultContextPage(__FILE__); // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$mode = GETPOST('mode', 'aZ');
|
||||
@@ -125,12 +124,13 @@ foreach ($object->fields as $key => $val) {
|
||||
}
|
||||
|
||||
// Definition of array of fields for columns
|
||||
$tableprefix = 't';
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval((string) $val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
$arrayfields[$tableprefix.'.'.$key] = array(
|
||||
'label' => $val['label'],
|
||||
'checked' => (($visible < 0) ? '0' : '1'),
|
||||
'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
|
||||
@@ -257,25 +257,42 @@ foreach ($search as $key => $val) {
|
||||
if ($key == 'status' && $search[$key] == -1) {
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
|
||||
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
|
||||
$field_spec = $object->fields[$key];
|
||||
// @phpstan-ignore-next-line PHPStan thinks that $field_spec is never null
|
||||
if ($field_spec === null) {
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($field_spec) || $object->isFloat($field_spec)) ? 1 : 0);
|
||||
if ((strpos($field_spec['type'], 'integer:') === 0) || (strpos($field_spec['type'], 'sellist:') === 0) || !empty($field_spec['arrayofkeyval'])) {
|
||||
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($field_spec['arrayofkeyval']) || !array_key_exists('0', $field_spec['arrayofkeyval'])))) {
|
||||
$search[$key] = '';
|
||||
}
|
||||
$mode_search = 2;
|
||||
}
|
||||
if ($search[$key] != '') {
|
||||
$sql .= natural_search("t.".$db->sanitize($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
if ($field_spec['type'] === 'boolean') {
|
||||
$mode_search = 1;
|
||||
if ($search[$key] == '-1') {
|
||||
$search[$key] = '';
|
||||
}
|
||||
}
|
||||
if (empty($field_spec['searchmulti'])) {
|
||||
if (!is_array($search[$key]) && $search[$key] != '') {
|
||||
$sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
} else {
|
||||
if (is_array($search[$key]) && !empty($search[$key])) {
|
||||
$sql .= natural_search("t.".$db->escape($key), implode(',', $search[$key]), (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
||||
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
|
||||
if (preg_match('/_dtstart$/', $key)) {
|
||||
$sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
|
||||
$sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
if (preg_match('/_dtend$/', $key)) {
|
||||
$sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
|
||||
$sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -364,7 +381,7 @@ $param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
if (!empty($contextpage) && $contextpage != getDolDefaultContextPage(__FILE__)) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
@@ -383,17 +400,18 @@ foreach ($search as $key => $val) {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
|
||||
$param .= '&search_'.$key.'month='.GETPOSTINT('search_'.$key.'month');
|
||||
$param .= '&search_'.$key.'day='.GETPOSTINT('search_'.$key.'day');
|
||||
$param .= '&search_'.$key.'year='.GETPOSTINT('search_'.$key.'year');
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$parameters = array('param' => &$param);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
@@ -402,7 +420,7 @@ $arrayofmassactions = array(
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
@@ -421,6 +439,8 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', 'emailcollector_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
||||
@@ -446,6 +466,9 @@ if (empty($reshook)) {
|
||||
} else {
|
||||
$moreforfilter = $hookmanager->resPrint;
|
||||
}
|
||||
$parameters = array(
|
||||
'arrayfields' => &$arrayfields,
|
||||
);
|
||||
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
@@ -484,11 +507,15 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
if (empty($val['searchmulti'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||
} else {
|
||||
print $form->multiselectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : array()), 0, 0, 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||
}
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth125', 1);
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
@@ -499,9 +526,11 @@ foreach ($object->fields as $key => $val) {
|
||||
} elseif ($key == 'lang') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
$formadmin = new FormAdmin($db);
|
||||
print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
|
||||
print $formadmin->select_language((isset($search[$key]) ? $search[$key] : ''), 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
|
||||
} elseif ($val['type'] === 'boolean') {
|
||||
print $form->selectyesno('search_' . $key, $search[$key] ?? '', 1, false, 1);
|
||||
} else {
|
||||
print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
print '<input type="text" class="flat maxwidth'.(in_array($val['type'], array('integer', 'price')) ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@@ -561,7 +590,6 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
$totalarray['nbfield']++;
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@@ -760,7 +788,7 @@ if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_IMAP_USE_PHPIMAP');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_IMAP_USE_PHPIMAP", $arrval, $conf->global->MAIN_IMAP_USE_PHPIMAP);
|
||||
print $form->selectarray("MAIN_IMAP_USE_PHPIMAP", $arrval, getDolGlobalString("MAIN_IMAP_USE_PHPIMAP"));
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -398,13 +398,13 @@ foreach ($dirmodels as $reldir) {
|
||||
// Active
|
||||
if (in_array($name, $def)) {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
print '</a>';
|
||||
print "</td>";
|
||||
} else {
|
||||
print '<td class="center">'."\n";
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
print "</td>";
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -61,7 +61,7 @@ if (!$user->admin) {
|
||||
*/
|
||||
$error = 0;
|
||||
|
||||
// positionne la variable pour le nombre de rss externes
|
||||
// Set the variable for the number of external RSS
|
||||
$sql = "SELECT ".$db->decrypt('name')." as name FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql .= " WHERE ".$db->decrypt('name')." LIKE 'EXTERNAL_RSS_URLRSS_%'";
|
||||
//print $sql;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -193,7 +193,8 @@ if ($action == 'updatesocialnetwork') {
|
||||
$paramsKey = GETPOST('paramsKey', 'array');
|
||||
$paramsVal = GETPOST('paramsVal', 'array');
|
||||
|
||||
$result = dolibarr_get_const($db, "SOCIAL_NETWORKS_DATA_".$name, $conf->entity);
|
||||
$result = getDolGlobalString("SOCIAL_NETWORKS_DATA_".$name);
|
||||
|
||||
$socialNetworkData = json_decode($result, true);
|
||||
|
||||
foreach ($paramsKey as $index => $key) {
|
||||
@@ -244,7 +245,9 @@ if ($action == 'editsocialnetwork' && GETPOST('confirm') == 'yes') {
|
||||
$paramKey = GETPOST('paramkey', 'alpha');
|
||||
$key = GETPOST('key', 'alpha');
|
||||
$name = GETPOST('name');
|
||||
$result = dolibarr_get_const($db, "SOCIAL_NETWORKS_DATA_".$name, $conf->entity);
|
||||
|
||||
$result = getDolGlobalString("SOCIAL_NETWORKS_DATA_".$name);
|
||||
|
||||
$socialNetworkData = json_decode($result, true);
|
||||
|
||||
unset($socialNetworkData[$paramKey]);
|
||||
@@ -349,7 +352,7 @@ foreach ($oauthservices as $key => $value) {
|
||||
|
||||
/** @phan-var-force array<string, array{label:string, data-html:string, disable?:int, css?:string}> $oauthservices */
|
||||
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
|
||||
print $form->selectarray('OAUTH_SERVICE_SOCIAL_NETWORK', $oauthservicesStringKeys, (string) $conf->global->OAUTH_SERVICE_SOCIAL_NETWORK);
|
||||
print $form->selectarray('OAUTH_SERVICE_SOCIAL_NETWORK', $oauthservicesStringKeys, (string) getDolGlobalString("OAUTH_SERVICE_SOCIAL_NETWORK"));
|
||||
} else {
|
||||
$selectedKey = (string) getDolGlobalString('OAUTH_SERVICE_SOCIAL_NETWORK');
|
||||
$text = isset($oauthservicesStringKeys[$selectedKey]) ? $oauthservicesStringKeys[$selectedKey]['label'] : '';
|
||||
@@ -387,17 +390,17 @@ print '<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
function toggleOAuthServiceDisplay() {
|
||||
if ($("#radio_oauth").is(":checked")) {
|
||||
$("#oauth_service_div").show(); // Afficher le sélecteur OAuth
|
||||
$("#oauth_service_div").show(); // Show the OAuth selector
|
||||
} else {
|
||||
$("#oauth_service_div").hide(); // Cacher le sélecteur OAuth
|
||||
$("#oauth_service_div").hide(); // Hide the OAuth selector
|
||||
}
|
||||
}
|
||||
|
||||
function toggleAddParamRow() {
|
||||
if ($("#radio_oauth").is(":checked")) {
|
||||
$("#add_param_row").hide(); // Cacher toute la ligne
|
||||
$("#add_param_row").hide(); // Hide the entire line
|
||||
} else {
|
||||
$("#add_param_row").show(); // Afficher toute la ligne
|
||||
$("#add_param_row").show(); // Show the entire line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ $langs->loadLangs(array("admin", "errors"));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
if (!isset($conf->global->GEOIP_VERSION)) {
|
||||
if (!getDolGlobalString("GEOIP_VERSION")) {
|
||||
$conf->global->GEOIP_VERSION = '2';
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ if ($action == 'set') {
|
||||
if ($diroffile) {
|
||||
$dirforterms = $diroffile.'/';
|
||||
$original_file = $_FILES[$varname]["name"];
|
||||
// @phan-suppress-next-line PhanTypeInvalidDimOffset
|
||||
$result = dol_move_uploaded_file($_FILES[$varname]["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES[$varname]['error']);
|
||||
if ((int) $result > 0) {
|
||||
dolibarr_set_const($db, $varname, $original_file, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
@@ -27,11 +27,6 @@
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
@@ -40,9 +35,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||
* @var Translate $langs
|
||||
* @var User $user
|
||||
*/
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "errors", "holiday"));
|
||||
$langs->loadLangs(array("admin", "errors", "holiday", "other"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
@@ -199,7 +198,7 @@ print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Example").'</td>';
|
||||
print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
|
||||
print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
|
||||
print "</tr>\n";
|
||||
print '</tr>'."\n";
|
||||
|
||||
clearstatcache();
|
||||
|
||||
@@ -228,7 +227,7 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
|
||||
if ($module->isEnabled()) {
|
||||
print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
|
||||
print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
|
||||
print $module->info($langs);
|
||||
print '</td>';
|
||||
|
||||
@@ -448,6 +447,32 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Type of leaves
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("LeaveType"), '', '');
|
||||
|
||||
print '<div class="urllink">';
|
||||
print img_picto('', 'url', 'class="pictofixedwidth"').' <a href="'.DOL_URL_ROOT.'/admin/dict.php?id=28&search_country_id='.($conf->entity).'">'.$langs->trans("ClickHereToGoToDictionary", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionary"), $langs->transnoentitiesnoconv("LeaveType")).'</a>';
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
/*
|
||||
* Type of leaves
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("DictionaryPublicHolidays"), '', '');
|
||||
|
||||
print '<div class="urllink">';
|
||||
print img_picto('', 'url', 'class="pictofixedwidth"').' <a href="'.DOL_URL_ROOT.'/admin/dict.php?id=32&search_country_id='.($conf->entity).'">'.$langs->trans("ClickHereToGoToDictionary", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionary"), $langs->transnoentitiesnoconv("DictionaryPublicHolidays")).'</a>';
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
|
||||
/*
|
||||
* Other options
|
||||
*/
|
||||
|
||||
@@ -300,7 +300,7 @@ if ($action == 'update') {
|
||||
$dirforimage = $conf->mycompany->dir_output . '/logos/';
|
||||
if ($_FILES[$varforimage]["tmp_name"]) {
|
||||
$reg = array();
|
||||
if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) {
|
||||
if (preg_match('/([^\\/:]+)$/i', (string) $_FILES[$varforimage]["name"], $reg)) {
|
||||
$original_file = $reg[1];
|
||||
|
||||
$isimage = image_format_supported($original_file);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user