Compare commits
1853 Commits
5.0.1
...
6.0.0-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cf862f033 | ||
|
|
660faac0f3 | ||
|
|
2a6c21bd03 | ||
|
|
9e33baf0d6 | ||
|
|
87c8659e72 | ||
|
|
6ec038d005 | ||
|
|
9a30e8edc6 | ||
|
|
605dbd61f2 | ||
|
|
c2b171dd73 | ||
|
|
def6403828 | ||
|
|
58a407d9f1 | ||
|
|
884c6c674d | ||
|
|
0458b7d38f | ||
|
|
3347316d3c | ||
|
|
c1f3a168cd | ||
|
|
0f80ee757f | ||
|
|
def784a5fe | ||
|
|
55120d5e6d | ||
|
|
24eebfeb61 | ||
|
|
1af74b4c42 | ||
|
|
985a9ed8d3 | ||
|
|
1935de03c7 | ||
|
|
41586b76c0 | ||
|
|
62933e9a26 | ||
|
|
02781b41ca | ||
|
|
b92980c6ff | ||
|
|
bec6ad9fb3 | ||
|
|
929946ad47 | ||
|
|
d6ba16d357 | ||
|
|
d326f161ef | ||
|
|
a63050bf46 | ||
|
|
811b0d9af4 | ||
|
|
75624376a5 | ||
|
|
b441c62e1d | ||
|
|
b1f93ccb0c | ||
|
|
e027528545 | ||
|
|
543630e487 | ||
|
|
3e51d2f537 | ||
|
|
a1144e1f66 | ||
|
|
9c4a2594b1 | ||
|
|
57f3d0910e | ||
|
|
ee8bc24348 | ||
|
|
20fb12bc7d | ||
|
|
832e288814 | ||
|
|
50769f2f41 | ||
|
|
7587a3d592 | ||
|
|
cfe9d02bc3 | ||
|
|
97f9d8a87e | ||
|
|
8e4fe53968 | ||
|
|
3827903afb | ||
|
|
5e3a2e06d4 | ||
|
|
b183c6e7ac | ||
|
|
2b36135641 | ||
|
|
1820649175 | ||
|
|
a0295821ba | ||
|
|
3427413255 | ||
|
|
0805c693ae | ||
|
|
a96049d0e6 | ||
|
|
c041fe2165 | ||
|
|
bfd6116e5b | ||
|
|
bb37c2f980 | ||
|
|
707a9e40c0 | ||
|
|
07caf6aeba | ||
|
|
6a82d9e656 | ||
|
|
4bda7fcafc | ||
|
|
0486a18972 | ||
|
|
7b0e0858ca | ||
|
|
03df365eea | ||
|
|
63920930bf | ||
|
|
eb45333685 | ||
|
|
4b6bd2b6eb | ||
|
|
7ed0643b52 | ||
|
|
02b5d9e6f7 | ||
|
|
2f59525967 | ||
|
|
c50006c91b | ||
|
|
79a0b959d1 | ||
|
|
2510ec7015 | ||
|
|
36a72de080 | ||
|
|
b66da3d148 | ||
|
|
ca5fd6ac4c | ||
|
|
6e83e899e2 | ||
|
|
22efbabfa6 | ||
|
|
e547aa8aee | ||
|
|
2281850abf | ||
|
|
806d25ae41 | ||
|
|
a0b4f8b004 | ||
|
|
6787d717f9 | ||
|
|
74710827b2 | ||
|
|
a25facef7c | ||
|
|
0eadef9a7a | ||
|
|
2df33d1df3 | ||
|
|
ef9275d031 | ||
|
|
90c1a38486 | ||
|
|
344263f53c | ||
|
|
504ea85334 | ||
|
|
7f18dfee0d | ||
|
|
3555bd2bd7 | ||
|
|
d9794f942d | ||
|
|
37a261587e | ||
|
|
75a01cbe7e | ||
|
|
6f5103a772 | ||
|
|
af01e544d5 | ||
|
|
4e397107e1 | ||
|
|
832e9ed15a | ||
|
|
f0ff2b3085 | ||
|
|
98586f3b2d | ||
|
|
1f451bf240 | ||
|
|
7e4bce67ba | ||
|
|
af584bc9c0 | ||
|
|
58f315e8d1 | ||
|
|
04349d2e12 | ||
|
|
b789246e8d | ||
|
|
e1b19b831a | ||
|
|
111087dfdc | ||
|
|
66420d0e80 | ||
|
|
70a188c042 | ||
|
|
5e29817910 | ||
|
|
9e629bdb02 | ||
|
|
bfa50b8d1d | ||
|
|
1761df2bc2 | ||
|
|
b0f2db7aaa | ||
|
|
447db1b324 | ||
|
|
c59d216cf5 | ||
|
|
64cd1e0923 | ||
|
|
df883a601b | ||
|
|
bebf2b33ea | ||
|
|
5c58ed8ca7 | ||
|
|
976c8e0752 | ||
|
|
b4f1df03de | ||
|
|
dd2d9f533a | ||
|
|
76e1438fe6 | ||
|
|
31aa8bdf05 | ||
|
|
9b4c929d79 | ||
|
|
fb252706f9 | ||
|
|
f4cdb6b254 | ||
|
|
7ad92c3a4d | ||
|
|
733d1caac6 | ||
|
|
bb5a49eca4 | ||
|
|
07a6bb5664 | ||
|
|
77df19009d | ||
|
|
0e175ba373 | ||
|
|
40dd6fc61c | ||
|
|
fa3cd267f4 | ||
|
|
ab99c178e1 | ||
|
|
9d83746935 | ||
|
|
417f71a8be | ||
|
|
c70beaa56b | ||
|
|
dc9d9b47b4 | ||
|
|
40334dbe14 | ||
|
|
a49174313f | ||
|
|
98ddb38c00 | ||
|
|
6837312041 | ||
|
|
6c7179d281 | ||
|
|
d5f83d6bbe | ||
|
|
d55cc58b8b | ||
|
|
d70c14a411 | ||
|
|
d7d8e51ab1 | ||
|
|
f829ccc11b | ||
|
|
7c29e286f8 | ||
|
|
82ddf293b6 | ||
|
|
7139a2dd9d | ||
|
|
c9a09adf79 | ||
|
|
e41541ab79 | ||
|
|
b2779e2c08 | ||
|
|
10ac53077e | ||
|
|
145cb628cd | ||
|
|
292571688b | ||
|
|
21183f91a3 | ||
|
|
c39ca4cff8 | ||
|
|
48a6e9e038 | ||
|
|
5d115bcf69 | ||
|
|
aa780ea33b | ||
|
|
5c5663c5ae | ||
|
|
510b1aedcf | ||
|
|
200f4010d8 | ||
|
|
6b7c4cbbe1 | ||
|
|
c66695bd56 | ||
|
|
10975112ee | ||
|
|
a0de94ae09 | ||
|
|
fa6bc03765 | ||
|
|
d9cdad6a77 | ||
|
|
11f58c7bda | ||
|
|
bd891ea56a | ||
|
|
ef83a0c15e | ||
|
|
8edce66c08 | ||
|
|
eea6461369 | ||
|
|
a057cfec91 | ||
|
|
f21ec76bc0 | ||
|
|
df729d8889 | ||
|
|
d56cd44ebc | ||
|
|
f563746310 | ||
|
|
ad656e6d35 | ||
|
|
59ab9a4421 | ||
|
|
400b3320aa | ||
|
|
c71488e58b | ||
|
|
ae6c58fb57 | ||
|
|
d8c5ec2aef | ||
|
|
96b8339d21 | ||
|
|
d2813eabbc | ||
|
|
19b8918caf | ||
|
|
4824942369 | ||
|
|
85e0ded573 | ||
|
|
c26e072694 | ||
|
|
7066ec7dab | ||
|
|
6f723490c2 | ||
|
|
3bd3387664 | ||
|
|
b74a0dd5fd | ||
|
|
3bf38d663f | ||
|
|
3402718425 | ||
|
|
478349174c | ||
|
|
d7cecef0f2 | ||
|
|
cce05a4070 | ||
|
|
ab5545d02d | ||
|
|
395d361d66 | ||
|
|
30bc8b9a32 | ||
|
|
18799c3a7f | ||
|
|
85c3880479 | ||
|
|
0c5bf21f3a | ||
|
|
f363845cbe | ||
|
|
3f5cf0ee18 | ||
|
|
452579150d | ||
|
|
e667d72547 | ||
|
|
4c382f94e1 | ||
|
|
05a537dfb6 | ||
|
|
38b97c5a3c | ||
|
|
e4a2e42caf | ||
|
|
ea13e18f9e | ||
|
|
16456cf19f | ||
|
|
d0e1b30670 | ||
|
|
b22817c237 | ||
|
|
425192ef84 | ||
|
|
f265e7d86a | ||
|
|
dc246fa44c | ||
|
|
1da648402d | ||
|
|
4a330af4bf | ||
|
|
aa0a369f06 | ||
|
|
d526fcc091 | ||
|
|
5ff85a6586 | ||
|
|
de1db57a9d | ||
|
|
b7b2184fb6 | ||
|
|
d19a8929df | ||
|
|
4474fc8014 | ||
|
|
70636cc59f | ||
|
|
0d3c5bcfa8 | ||
|
|
dad1abd55b | ||
|
|
84a3cbb97a | ||
|
|
d0f01085d8 | ||
|
|
d03d179fa3 | ||
|
|
b0f2e95c7b | ||
|
|
095545e8d9 | ||
|
|
c4f09b8894 | ||
|
|
48477e00fd | ||
|
|
c651f1da45 | ||
|
|
570f9aaa9e | ||
|
|
783cec0d6d | ||
|
|
1711107420 | ||
|
|
db9e068500 | ||
|
|
ee2019ae37 | ||
|
|
f8fead4b90 | ||
|
|
e4f7f2a0b2 | ||
|
|
95b2b1bd17 | ||
|
|
7a1480d362 | ||
|
|
1f3a8b507e | ||
|
|
ca08f814c1 | ||
|
|
9dfc8a9dc8 | ||
|
|
74e9b9bf0a | ||
|
|
954670731d | ||
|
|
18886849eb | ||
|
|
b0bac770e5 | ||
|
|
db6d7d9e21 | ||
|
|
e89c4e9f41 | ||
|
|
e4f5d45c45 | ||
|
|
1f079fac9d | ||
|
|
fea60e2675 | ||
|
|
a086b82f84 | ||
|
|
ba7e754174 | ||
|
|
e5fe629a0e | ||
|
|
3782bc4458 | ||
|
|
659436f1ed | ||
|
|
339d9dbfdf | ||
|
|
55121c5e05 | ||
|
|
160eb194ea | ||
|
|
f011197e00 | ||
|
|
aef9ef2d75 | ||
|
|
6eeb82ec70 | ||
|
|
6d4c5e4b4a | ||
|
|
a3d8da0a73 | ||
|
|
3898cfe02f | ||
|
|
c98f0ba457 | ||
|
|
67b3e3da99 | ||
|
|
cea98ce5cb | ||
|
|
80ce8da7a3 | ||
|
|
3e37185b74 | ||
|
|
5ebe711665 | ||
|
|
71bd69a804 | ||
|
|
8781a19e0e | ||
|
|
2da50f1eca | ||
|
|
0cd030d856 | ||
|
|
2b9f654b8c | ||
|
|
1a8884bbbe | ||
|
|
82560b9126 | ||
|
|
f5e29d6c86 | ||
|
|
8301e24261 | ||
|
|
f72ac3cf45 | ||
|
|
9bc60b8aa5 | ||
|
|
7520a55498 | ||
|
|
dd5976066a | ||
|
|
a3eef35ce6 | ||
|
|
ecce1c2037 | ||
|
|
ef9cf6ef52 | ||
|
|
090a7028d7 | ||
|
|
246fa9748b | ||
|
|
6052d2d8ed | ||
|
|
e85f31f456 | ||
|
|
4a085a8cc0 | ||
|
|
3e381aa5a2 | ||
|
|
ff35229be5 | ||
|
|
6e31de731b | ||
|
|
965e23b711 | ||
|
|
5cb38ece19 | ||
|
|
6aa6ef1f9f | ||
|
|
d834cbf7ba | ||
|
|
52b5a8ece7 | ||
|
|
5992175b68 | ||
|
|
b3dc73e611 | ||
|
|
86cbf7e35f | ||
|
|
2a9c6d9387 | ||
|
|
2dd2ab1003 | ||
|
|
a53fb25cfa | ||
|
|
7e25cc0475 | ||
|
|
0e6ab01a79 | ||
|
|
eb5bab36ca | ||
|
|
80cbc28385 | ||
|
|
2021758403 | ||
|
|
864dc0d989 | ||
|
|
e340a53f7c | ||
|
|
54f9990467 | ||
|
|
876257c312 | ||
|
|
66f6224321 | ||
|
|
1fe17a6918 | ||
|
|
ef3dc8cd61 | ||
|
|
9355f28d6c | ||
|
|
601f3ea75e | ||
|
|
df05980c3a | ||
|
|
1da0959a3a | ||
|
|
4ff9607011 | ||
|
|
035cae656f | ||
|
|
06b37d0e82 | ||
|
|
ba5fb700ba | ||
|
|
e4ec5aa9a9 | ||
|
|
807c77f754 | ||
|
|
bb2a9f9d0e | ||
|
|
c30dcf78cb | ||
|
|
d1c4439a0f | ||
|
|
330b9e7038 | ||
|
|
b35b40e2bf | ||
|
|
f65b29c135 | ||
|
|
2a0a0f12f3 | ||
|
|
470165615f | ||
|
|
30cedd154e | ||
|
|
4e7353f8a0 | ||
|
|
aec4cef5de | ||
|
|
2382a0a4ee | ||
|
|
a2764bc4c2 | ||
|
|
7b784a1dcb | ||
|
|
ff2a268831 | ||
|
|
a28f8c84e4 | ||
|
|
e43e37a14f | ||
|
|
88fc7dbc3e | ||
|
|
353b7a4792 | ||
|
|
c18c401960 | ||
|
|
ef575166c0 | ||
|
|
932d3aab9d | ||
|
|
59517a1fa0 | ||
|
|
51fa6cfb19 | ||
|
|
0b0dbd9649 | ||
|
|
2f72edca6c | ||
|
|
d4fd222251 | ||
|
|
f75e43dcda | ||
|
|
6fd0eef89d | ||
|
|
92d7b907be | ||
|
|
7dbe3b1da9 | ||
|
|
82cac745e3 | ||
|
|
5a79d11389 | ||
|
|
dff7d00d2b | ||
|
|
eaa4b650f8 | ||
|
|
4a46480ef5 | ||
|
|
a36a9fab2f | ||
|
|
0b52c43e05 | ||
|
|
1a1b27d68c | ||
|
|
240371b59d | ||
|
|
ec25869ec6 | ||
|
|
fbb3406c5d | ||
|
|
682f6f838e | ||
|
|
545e41b858 | ||
|
|
94ca528860 | ||
|
|
368fb314fe | ||
|
|
2bf1f848d6 | ||
|
|
ff5d682d49 | ||
|
|
58f789659d | ||
|
|
f3838ee8f2 | ||
|
|
169859b708 | ||
|
|
c224e2b4f6 | ||
|
|
1d6b4cb28a | ||
|
|
a8afa547f0 | ||
|
|
56989ae5af | ||
|
|
e2a7b0943f | ||
|
|
1f1d92d858 | ||
|
|
d86b42b024 | ||
|
|
1a98886aa3 | ||
|
|
7931c548c7 | ||
|
|
b29f325fcf | ||
|
|
b0f0285137 | ||
|
|
3890c67210 | ||
|
|
d110292a1b | ||
|
|
9870cafea3 | ||
|
|
194ed505f4 | ||
|
|
68e333879f | ||
|
|
99cc67d123 | ||
|
|
cc16bb0bef | ||
|
|
c9738aa7ea | ||
|
|
cc95e046e5 | ||
|
|
ab444ce730 | ||
|
|
ce84990414 | ||
|
|
bdb2f85103 | ||
|
|
3da7b9543d | ||
|
|
f10b77f190 | ||
|
|
789fbb6dc3 | ||
|
|
f2aa0ea488 | ||
|
|
b3245fb455 | ||
|
|
d120a391f9 | ||
|
|
4d9016c49f | ||
|
|
becd023032 | ||
|
|
b29d0385e6 | ||
|
|
4dc7d5cd8d | ||
|
|
93554b7e30 | ||
|
|
cedf5fb0ed | ||
|
|
caae7e4171 | ||
|
|
998254d9c6 | ||
|
|
8e68aa86ac | ||
|
|
9b550ae178 | ||
|
|
143c019905 | ||
|
|
9e4e72baee | ||
|
|
169e63d49a | ||
|
|
0ed4b607b2 | ||
|
|
8dcec30d89 | ||
|
|
955c9f4217 | ||
|
|
1d0e9b0a59 | ||
|
|
3c87399fac | ||
|
|
57ba598b15 | ||
|
|
5729bdb2c9 | ||
|
|
592bd6857b | ||
|
|
b568877f22 | ||
|
|
4221bdcc97 | ||
|
|
dec602a27b | ||
|
|
4343f93c00 | ||
|
|
e0abba5cf2 | ||
|
|
553f5b990c | ||
|
|
70b73c73f7 | ||
|
|
1e825e9f1e | ||
|
|
71833f5987 | ||
|
|
b5b97816c8 | ||
|
|
54088f38fb | ||
|
|
6f9e67b1fb | ||
|
|
f7e042d7b8 | ||
|
|
f8403d5020 | ||
|
|
f6dcb2860a | ||
|
|
8fc285c8b3 | ||
|
|
1a016524e0 | ||
|
|
fa290c34fa | ||
|
|
a534f79668 | ||
|
|
0d11fce834 | ||
|
|
88e7d54915 | ||
|
|
b81de35703 | ||
|
|
419c15ee8e | ||
|
|
5581e5da72 | ||
|
|
245ef7a188 | ||
|
|
80b0d91154 | ||
|
|
74af1223de | ||
|
|
bccfa3dbed | ||
|
|
849fe880cd | ||
|
|
b09300ab61 | ||
|
|
b092b6861a | ||
|
|
d3917b6065 | ||
|
|
eb4cfc11cb | ||
|
|
0e4a209dd8 | ||
|
|
17f37cc9e1 | ||
|
|
26df028efe | ||
|
|
be6be3e533 | ||
|
|
449869c37b | ||
|
|
f231864b3f | ||
|
|
c2f76522eb | ||
|
|
8ae05a9651 | ||
|
|
cd72c50356 | ||
|
|
30cf3f2bda | ||
|
|
922fa088b4 | ||
|
|
ef5fd503cd | ||
|
|
b2e9d4cc21 | ||
|
|
2da0a129d1 | ||
|
|
d7b142beb7 | ||
|
|
d19d733f95 | ||
|
|
0734b99d3a | ||
|
|
94353deb75 | ||
|
|
164f3954ee | ||
|
|
2b64cf0ebe | ||
|
|
ab019cac8d | ||
|
|
d855f4b202 | ||
|
|
2ad4dbdae2 | ||
|
|
61a4382bd8 | ||
|
|
cf361e1ed2 | ||
|
|
7ab151dc0d | ||
|
|
2199c525bc | ||
|
|
1c7d9b9d9a | ||
|
|
23af50ad2a | ||
|
|
7ff35f57b4 | ||
|
|
ec4e416a6c | ||
|
|
33e93e9294 | ||
|
|
d410a320d7 | ||
|
|
5a96ae54b9 | ||
|
|
823e5b48e3 | ||
|
|
52de60c49b | ||
|
|
d570df5089 | ||
|
|
002bebd837 | ||
|
|
e48ba06730 | ||
|
|
fe8d34c73b | ||
|
|
b7b16dc632 | ||
|
|
bba8f972a1 | ||
|
|
70de54e97d | ||
|
|
984531411d | ||
|
|
8781f6bcf2 | ||
|
|
199b4dfeb5 | ||
|
|
ec03d1705b | ||
|
|
0156e99894 | ||
|
|
5a31d2c95a | ||
|
|
5e54567558 | ||
|
|
578eb98b33 | ||
|
|
9b4b096e86 | ||
|
|
fe053c8603 | ||
|
|
8e25155fc9 | ||
|
|
3e0fcf5ec2 | ||
|
|
383dfc0c96 | ||
|
|
c4722e3694 | ||
|
|
5c33c1773f | ||
|
|
09f6fe5a52 | ||
|
|
0ea69e2e94 | ||
|
|
267e66abfa | ||
|
|
ecf3b6ab33 | ||
|
|
e5c898e0d6 | ||
|
|
2fc64b8e11 | ||
|
|
b157398da4 | ||
|
|
ae57395562 | ||
|
|
b8b91db007 | ||
|
|
39b4549813 | ||
|
|
6d01bd712d | ||
|
|
667e3c2876 | ||
|
|
0b97ee42cf | ||
|
|
1748f1d451 | ||
|
|
fb561bae1b | ||
|
|
c88656edb4 | ||
|
|
8272408b6e | ||
|
|
651ea92657 | ||
|
|
6cac627117 | ||
|
|
dbcb60433b | ||
|
|
2b7dcfa56d | ||
|
|
081d0e7ec2 | ||
|
|
cf04e5a6e0 | ||
|
|
63259295c6 | ||
|
|
9fe28c9b2c | ||
|
|
05d6c2cd75 | ||
|
|
c26d24e97d | ||
|
|
1371af5f66 | ||
|
|
dd71fdc82f | ||
|
|
d7d212bbe1 | ||
|
|
fd6518182b | ||
|
|
b05d2c50e8 | ||
|
|
16a41242d3 | ||
|
|
a3602ff6b4 | ||
|
|
dd97bbdc82 | ||
|
|
8c75fc0e52 | ||
|
|
46ff62fc87 | ||
|
|
f4447f9c87 | ||
|
|
910a925167 | ||
|
|
d948447600 | ||
|
|
ab8dcbd366 | ||
|
|
880e2d0f72 | ||
|
|
c4475ca946 | ||
|
|
a9bb2eb24c | ||
|
|
a7e9dc1ce4 | ||
|
|
44bdf91715 | ||
|
|
fe50dabf42 | ||
|
|
55feea5d98 | ||
|
|
7c4b47f20d | ||
|
|
8113e6c2f2 | ||
|
|
68aaef2f66 | ||
|
|
a4defb8102 | ||
|
|
e8c60642e6 | ||
|
|
9b90e7aa09 | ||
|
|
56140ae572 | ||
|
|
cea835744c | ||
|
|
5e6b2897ad | ||
|
|
0fbf27895a | ||
|
|
e28dff19ee | ||
|
|
d53654e64f | ||
|
|
d93552c8c5 | ||
|
|
fb58dfa898 | ||
|
|
2e5c32eb62 | ||
|
|
d7e10085b8 | ||
|
|
806157ae40 | ||
|
|
57e540af53 | ||
|
|
15d20497c8 | ||
|
|
a8292ce990 | ||
|
|
4b42a5fd86 | ||
|
|
dc9cbed866 | ||
|
|
fc5f4007a1 | ||
|
|
885a636351 | ||
|
|
11b1a2adac | ||
|
|
b7f7683e5a | ||
|
|
91c505c9c9 | ||
|
|
dfa81bc806 | ||
|
|
eb2124bfc8 | ||
|
|
2120b9af85 | ||
|
|
e830ea6714 | ||
|
|
8a37eeea74 | ||
|
|
919d5b2ef3 | ||
|
|
a1ac3b470b | ||
|
|
d60e98a797 | ||
|
|
0bffac6dc4 | ||
|
|
90542d119a | ||
|
|
884b261df5 | ||
|
|
38a4845c0e | ||
|
|
de356a3185 | ||
|
|
e6ad3ea7d4 | ||
|
|
65e03ca3ba | ||
|
|
68b63927e0 | ||
|
|
043a26eeb5 | ||
|
|
0a1ec514d2 | ||
|
|
8f5fa1d810 | ||
|
|
5f507dd6ed | ||
|
|
938d33941d | ||
|
|
9785e9b298 | ||
|
|
9f9bceb208 | ||
|
|
ef0d395a1a | ||
|
|
4b8cda2070 | ||
|
|
bd8e4cf6aa | ||
|
|
db8c4a5ac4 | ||
|
|
382fcb53fa | ||
|
|
fecf5efa5b | ||
|
|
f069ef9844 | ||
|
|
f32d19fb73 | ||
|
|
a1e9246794 | ||
|
|
24a2fb57ea | ||
|
|
b5b79bc36b | ||
|
|
ffe4e48304 | ||
|
|
0c9f268f99 | ||
|
|
089b882033 | ||
|
|
aa8aa5672b | ||
|
|
82c8cee1ff | ||
|
|
626c0d6d5e | ||
|
|
768df56c07 | ||
|
|
39d9a0f979 | ||
|
|
bf616cbe05 | ||
|
|
2de335e2dc | ||
|
|
ce05c74e47 | ||
|
|
ea58fb0b50 | ||
|
|
b8d63ae6c0 | ||
|
|
9958fcaa6f | ||
|
|
944cd40ef4 | ||
|
|
01188e4bc0 | ||
|
|
c196e79bf4 | ||
|
|
4c2f3aeeac | ||
|
|
a19268c0a3 | ||
|
|
0c76db7973 | ||
|
|
7d5b5cf86a | ||
|
|
88917afa08 | ||
|
|
c7d736376f | ||
|
|
1a6c118a5d | ||
|
|
e096974b2c | ||
|
|
7ec46b3bd6 | ||
|
|
f543461e9b | ||
|
|
8318ebc109 | ||
|
|
270c3db32e | ||
|
|
81d696300c | ||
|
|
8009370f04 | ||
|
|
1096177cce | ||
|
|
ee039c69a8 | ||
|
|
322cca8032 | ||
|
|
6fb8876e5a | ||
|
|
3871da0324 | ||
|
|
4adfe6de70 | ||
|
|
f70ee73747 | ||
|
|
694efca32a | ||
|
|
85bf4b742b | ||
|
|
76f2cc3f1e | ||
|
|
29bede28f0 | ||
|
|
909b489d1f | ||
|
|
421843e693 | ||
|
|
b93df2d6b5 | ||
|
|
f63f28c7fe | ||
|
|
98b2e83bfb | ||
|
|
da4d179d36 | ||
|
|
d1a443f0f0 | ||
|
|
428e16341c | ||
|
|
3917bdfc79 | ||
|
|
a115d4877b | ||
|
|
b8f5e93ab0 | ||
|
|
0bc46facd7 | ||
|
|
c673d283e0 | ||
|
|
12e91f1c1b | ||
|
|
6138d197e4 | ||
|
|
ad095d7fb2 | ||
|
|
7ae405a254 | ||
|
|
6e7fddee7d | ||
|
|
166f2d262d | ||
|
|
31d99bbfe6 | ||
|
|
9641a240ea | ||
|
|
4dc409fc8b | ||
|
|
fa4bb4e80a | ||
|
|
e1e2481e37 | ||
|
|
102deccba7 | ||
|
|
94b69844f2 | ||
|
|
e58d2f428b | ||
|
|
8730add15f | ||
|
|
6e1f825190 | ||
|
|
5af5c23a98 | ||
|
|
d658a833c9 | ||
|
|
cbd0598611 | ||
|
|
6afd0d642a | ||
|
|
1dd462d947 | ||
|
|
e11254a9bf | ||
|
|
1e3384a842 | ||
|
|
072eb740c7 | ||
|
|
58e2b49b1c | ||
|
|
7c2b3b8df0 | ||
|
|
fed1b152d9 | ||
|
|
a9eeb823bd | ||
|
|
60951cf307 | ||
|
|
865c8140d1 | ||
|
|
b57bf6460b | ||
|
|
4993a43025 | ||
|
|
92b5f8d85e | ||
|
|
f5bdfc426f | ||
|
|
fd72977505 | ||
|
|
bb47c69283 | ||
|
|
a8c775dcbd | ||
|
|
50d65e3a9f | ||
|
|
ff0f40ab37 | ||
|
|
cc8e66d079 | ||
|
|
04c05efafe | ||
|
|
afc5ab0242 | ||
|
|
c9bfb6e945 | ||
|
|
04b1535b12 | ||
|
|
983c72c918 | ||
|
|
8ec44615cd | ||
|
|
faddcb28ac | ||
|
|
ce62736e6b | ||
|
|
d73374cc5b | ||
|
|
586ea54bfc | ||
|
|
47089a4d55 | ||
|
|
05fe0d7fcd | ||
|
|
2e6d865c7d | ||
|
|
058b43f342 | ||
|
|
8219ff84c8 | ||
|
|
88515c306f | ||
|
|
676ff84a4e | ||
|
|
defce63a24 | ||
|
|
c722286bcb | ||
|
|
0ba6433a61 | ||
|
|
18981ab0c9 | ||
|
|
853c8a8e07 | ||
|
|
b87eb07b08 | ||
|
|
cfde27820e | ||
|
|
5e856e6923 | ||
|
|
4c5e78a2ce | ||
|
|
2f23b36ca1 | ||
|
|
1758b83604 | ||
|
|
9c2ce0202d | ||
|
|
1a98c4a3ff | ||
|
|
e97fae0c43 | ||
|
|
23e2cbb7f9 | ||
|
|
d390acc888 | ||
|
|
95788c9699 | ||
|
|
508109d5b1 | ||
|
|
c69a1205c0 | ||
|
|
56e749df9f | ||
|
|
1c20bbb287 | ||
|
|
aa4b967e17 | ||
|
|
4ab5674ffb | ||
|
|
84e774ff32 | ||
|
|
e2dbcb2b5a | ||
|
|
113d4d1665 | ||
|
|
0c7cfdb037 | ||
|
|
d9cdaeb851 | ||
|
|
8f97177dae | ||
|
|
a2287fd183 | ||
|
|
587f5a76e6 | ||
|
|
cd099bf3b1 | ||
|
|
86338d1781 | ||
|
|
10e2b128d1 | ||
|
|
65fec95458 | ||
|
|
af56c85057 | ||
|
|
ec59f08e41 | ||
|
|
0080821dc5 | ||
|
|
215ef30abe | ||
|
|
fbdfbed02c | ||
|
|
3b626b75c4 | ||
|
|
c3fe1c963a | ||
|
|
54256773c5 | ||
|
|
1792ff2d3b | ||
|
|
635894cf10 | ||
|
|
b7f1e74f6f | ||
|
|
78a886c206 | ||
|
|
a19627956b | ||
|
|
4e2f4fd48b | ||
|
|
2e4e3737e8 | ||
|
|
236afacfed | ||
|
|
213e0d2870 | ||
|
|
10541e0c53 | ||
|
|
88f771a7f1 | ||
|
|
a88d6425d7 | ||
|
|
c18e7e8816 | ||
|
|
529ae1fa92 | ||
|
|
cfc31e91e8 | ||
|
|
50210d0dd6 | ||
|
|
d89a89f8ea | ||
|
|
8bb7f858d9 | ||
|
|
433b9e6fe1 | ||
|
|
4efb1ba23a | ||
|
|
a52db08cd6 | ||
|
|
04e119d7a6 | ||
|
|
d0e27f67e7 | ||
|
|
3da0aea168 | ||
|
|
9456f7091e | ||
|
|
82f9555c6b | ||
|
|
0994622bf8 | ||
|
|
fed6d71d8a | ||
|
|
e97e202deb | ||
|
|
1fd359d52d | ||
|
|
9bbfeed1bc | ||
|
|
e1ea6e2b53 | ||
|
|
e23a44bcdf | ||
|
|
3a8608db19 | ||
|
|
c8b0921c51 | ||
|
|
3308775c06 | ||
|
|
f000ca23c3 | ||
|
|
f059ab0042 | ||
|
|
2413c728a8 | ||
|
|
2fb96c8817 | ||
|
|
00390bc8e4 | ||
|
|
006ad4cef8 | ||
|
|
4c056d68d8 | ||
|
|
ac884ec463 | ||
|
|
d2173c1fa4 | ||
|
|
7fe66581f1 | ||
|
|
72ff353e9f | ||
|
|
2e759d5156 | ||
|
|
086fa4385f | ||
|
|
f68c408dbc | ||
|
|
4490477cfb | ||
|
|
7354cb148a | ||
|
|
d99de641e8 | ||
|
|
1e4dd5d095 | ||
|
|
b0442aa56a | ||
|
|
cbc6684ea7 | ||
|
|
e2c31b5f23 | ||
|
|
436f60a784 | ||
|
|
8c07f514c8 | ||
|
|
db73eeba5c | ||
|
|
12ca11e2fa | ||
|
|
402924f6d7 | ||
|
|
6c5b329dd1 | ||
|
|
c7160ad2b9 | ||
|
|
62394abb8b | ||
|
|
aef3592698 | ||
|
|
5931bc4068 | ||
|
|
846204bdb4 | ||
|
|
c52f4644e1 | ||
|
|
aabfc2f0db | ||
|
|
4818b1ba44 | ||
|
|
e6e9b65594 | ||
|
|
2496286374 | ||
|
|
e6b20840a3 | ||
|
|
4e021c123b | ||
|
|
39ebaec064 | ||
|
|
a73d72f243 | ||
|
|
8b0c123aca | ||
|
|
196156a21e | ||
|
|
1d546462dd | ||
|
|
6c069e9a1a | ||
|
|
db23a5222b | ||
|
|
5e4697b62d | ||
|
|
1cffa8c9fc | ||
|
|
3e9ccc186a | ||
|
|
e67ae3665e | ||
|
|
deb309ab7e | ||
|
|
edaa3ae672 | ||
|
|
6f4ce8dc2f | ||
|
|
a6b05bb4da | ||
|
|
d74baea1d3 | ||
|
|
77dfb05647 | ||
|
|
d78f3923ee | ||
|
|
26a9999fbf | ||
|
|
396ea54894 | ||
|
|
b0f2d2310b | ||
|
|
4eaa1d4f46 | ||
|
|
8e33c8090d | ||
|
|
423ffefbf3 | ||
|
|
551d79f1e2 | ||
|
|
c3387cb4e6 | ||
|
|
06c91cdaf2 | ||
|
|
4d31759ff9 | ||
|
|
8a373b25ba | ||
|
|
2446cb5431 | ||
|
|
2af3f010bf | ||
|
|
30d58f77db | ||
|
|
e68ad408af | ||
|
|
0417eb3862 | ||
|
|
17da4f64a7 | ||
|
|
4d72165288 | ||
|
|
a7ccb175e5 | ||
|
|
5ae1b5457b | ||
|
|
fc735eaa4f | ||
|
|
eb4236011b | ||
|
|
50dbe39cda | ||
|
|
cd90dcb1e1 | ||
|
|
e08b92d913 | ||
|
|
550687e084 | ||
|
|
b2b1dcc574 | ||
|
|
81020cea77 | ||
|
|
d4de81ed6d | ||
|
|
9447b2a38b | ||
|
|
5cbad450f3 | ||
|
|
3907c30ee3 | ||
|
|
e357aed3e1 | ||
|
|
abf87a6946 | ||
|
|
f5f062936e | ||
|
|
a6b7c812f2 | ||
|
|
6aa56ce0fa | ||
|
|
0de77fa460 | ||
|
|
3749a7a1d1 | ||
|
|
759315aef5 | ||
|
|
37939e7cbd | ||
|
|
d15792bdf4 | ||
|
|
9b45776941 | ||
|
|
20202871eb | ||
|
|
06f9c1989b | ||
|
|
f1ae0eb7c6 | ||
|
|
f427c8441a | ||
|
|
e335b757fd | ||
|
|
199067e4b8 | ||
|
|
c82ee862af | ||
|
|
f460d2e705 | ||
|
|
996b5e9f87 | ||
|
|
12df7b6ab9 | ||
|
|
59fa5c2fe6 | ||
|
|
2057613ad9 | ||
|
|
2d83efc7e3 | ||
|
|
b054ca8267 | ||
|
|
da0af36086 | ||
|
|
0a47245ba5 | ||
|
|
411d276ed2 | ||
|
|
a8da077613 | ||
|
|
74f0ae5bbb | ||
|
|
ddd101757e | ||
|
|
52c86cb3f5 | ||
|
|
e4ed626912 | ||
|
|
a0a9c8fa0c | ||
|
|
54780ff205 | ||
|
|
feebd4252a | ||
|
|
ff75077b34 | ||
|
|
bb7c164752 | ||
|
|
76af83ce06 | ||
|
|
56a4b7a1fd | ||
|
|
7f7ba6279a | ||
|
|
31f580ad93 | ||
|
|
669a04e304 | ||
|
|
a0e75d0af0 | ||
|
|
1ab3086fca | ||
|
|
be439f6252 | ||
|
|
e76a00845d | ||
|
|
a1c1aa054f | ||
|
|
3715fcdd5f | ||
|
|
d892a89f45 | ||
|
|
8154521a22 | ||
|
|
60a54041c2 | ||
|
|
d3719a01a2 | ||
|
|
aa47575b13 | ||
|
|
919633b2be | ||
|
|
a6ec22d7fe | ||
|
|
5ab8704aee | ||
|
|
ea44e14b60 | ||
|
|
7668702806 | ||
|
|
248150dd41 | ||
|
|
12375be14a | ||
|
|
216bce608d | ||
|
|
915a74a85f | ||
|
|
a99a4be9e0 | ||
|
|
07bbf1a32b | ||
|
|
87368908f6 | ||
|
|
a61543dedc | ||
|
|
f598bf8bef | ||
|
|
8363bee234 | ||
|
|
fe4f71296f | ||
|
|
e2ea5945dd | ||
|
|
5d099d24ee | ||
|
|
8cb28b7bfa | ||
|
|
44302f1aea | ||
|
|
6b2d8a3c34 | ||
|
|
18fc5bec9b | ||
|
|
337eac30c1 | ||
|
|
ca72e5e19f | ||
|
|
dae0828543 | ||
|
|
ae2e40e5e7 | ||
|
|
dc14268ac6 | ||
|
|
e2b96abd0b | ||
|
|
22503da8b4 | ||
|
|
ac7b95df31 | ||
|
|
736800dd66 | ||
|
|
1dc2cae3a5 | ||
|
|
a6c60e4a9a | ||
|
|
7c868888a5 | ||
|
|
13333ffd73 | ||
|
|
ef7a334414 | ||
|
|
4f292d1247 | ||
|
|
01d69e4b58 | ||
|
|
c4d4856997 | ||
|
|
89716a86a5 | ||
|
|
9df4bac202 | ||
|
|
422bdd1ef6 | ||
|
|
761ece3125 | ||
|
|
5b5380659e | ||
|
|
17bd393965 | ||
|
|
e8767122b0 | ||
|
|
d99b0461c7 | ||
|
|
9678c2128e | ||
|
|
00d485b2c5 | ||
|
|
4902df7e3f | ||
|
|
4d7b059eb3 | ||
|
|
ed89852807 | ||
|
|
17a1874e36 | ||
|
|
d975e7f442 | ||
|
|
e221c48997 | ||
|
|
65be3107c3 | ||
|
|
00a1fc7996 | ||
|
|
7254b54a04 | ||
|
|
d49d264bec | ||
|
|
2164d93f36 | ||
|
|
67cf3a1e67 | ||
|
|
7b0c6ea940 | ||
|
|
93687997c9 | ||
|
|
0bf6356d9c | ||
|
|
7056edf509 | ||
|
|
88017f5707 | ||
|
|
b6a8507f57 | ||
|
|
2903518fb1 | ||
|
|
6d81f29835 | ||
|
|
9d193924bd | ||
|
|
ee86b7bcef | ||
|
|
43e59772e4 | ||
|
|
cab944a1a1 | ||
|
|
536afb44c7 | ||
|
|
7bcd4d74ef | ||
|
|
01a74a8d23 | ||
|
|
d01ba54cb5 | ||
|
|
979bcd3a9b | ||
|
|
da1427ef54 | ||
|
|
18e1e5b780 | ||
|
|
8e70c4a0b7 | ||
|
|
cd5b074a48 | ||
|
|
2448b9ee55 | ||
|
|
6bd112db5e | ||
|
|
aca1c1944d | ||
|
|
78cc976e9f | ||
|
|
1489847a74 | ||
|
|
4df8dcf980 | ||
|
|
a76ddc8b3f | ||
|
|
527fa27fb7 | ||
|
|
e3d3d32b4a | ||
|
|
54b03a3552 | ||
|
|
4fa5448aab | ||
|
|
06c2f04927 | ||
|
|
e416ea275e | ||
|
|
e8e7732820 | ||
|
|
fe1b1ede0f | ||
|
|
c3e8a5be62 | ||
|
|
466b6518b2 | ||
|
|
31bde1ae74 | ||
|
|
5decbde79b | ||
|
|
df170769c9 | ||
|
|
80715ec61b | ||
|
|
70743e1f68 | ||
|
|
a663c248f0 | ||
|
|
2f439fed85 | ||
|
|
997bc35d5f | ||
|
|
6bf61c677f | ||
|
|
41063e7cf2 | ||
|
|
75a86cd8e5 | ||
|
|
b5b0eba470 | ||
|
|
d788dc3aee | ||
|
|
3740137e31 | ||
|
|
4354820689 | ||
|
|
fc2b9a858b | ||
|
|
219bcb0d54 | ||
|
|
aa924bf010 | ||
|
|
6ee1c79f6f | ||
|
|
17e5279907 | ||
|
|
262d1d5f8c | ||
|
|
0838953ef7 | ||
|
|
f843f8a93d | ||
|
|
ed27b44f62 | ||
|
|
ae2ab3276d | ||
|
|
9f0328ab7f | ||
|
|
95fbe0147d | ||
|
|
e38ad37ce3 | ||
|
|
6e133e5bf6 | ||
|
|
ca3a39b71e | ||
|
|
8d6819c664 | ||
|
|
afefb47598 | ||
|
|
f4a7217f20 | ||
|
|
68656dd29c | ||
|
|
ce58ba5c2f | ||
|
|
ba59c27754 | ||
|
|
9a85e5ef00 | ||
|
|
dfb24a13d9 | ||
|
|
09f645fc9f | ||
|
|
5b97736bb0 | ||
|
|
edf28b59d6 | ||
|
|
8c2b70c4a7 | ||
|
|
acfdc96121 | ||
|
|
76b95aeec0 | ||
|
|
21e30e43d9 | ||
|
|
4197254209 | ||
|
|
aa5ff36a04 | ||
|
|
2fc74b4962 | ||
|
|
4012aeff90 | ||
|
|
cb576e6c99 | ||
|
|
fce8e08b51 | ||
|
|
e3afa06cf3 | ||
|
|
ae33e40dc8 | ||
|
|
3c9d336148 | ||
|
|
447607ecd9 | ||
|
|
1cc8671433 | ||
|
|
7dd2a3b130 | ||
|
|
ec3402a04b | ||
|
|
656875acb5 | ||
|
|
a1db02cc08 | ||
|
|
269645dfc7 | ||
|
|
cf68039c36 | ||
|
|
2e6ab393df | ||
|
|
106d19a8af | ||
|
|
2f4a4f493e | ||
|
|
df59a595de | ||
|
|
aa9d991923 | ||
|
|
de832d90a9 | ||
|
|
292bcae592 | ||
|
|
720a820ee4 | ||
|
|
db76a05d0c | ||
|
|
6b33a755ba | ||
|
|
3aff053828 | ||
|
|
94a1fc19fa | ||
|
|
278bbf184c | ||
|
|
df17de9d48 | ||
|
|
6f3231745e | ||
|
|
71378028f4 | ||
|
|
f05dfdbc81 | ||
|
|
2b1c29316f | ||
|
|
d1a988a0be | ||
|
|
edc2d39702 | ||
|
|
cdb1de7596 | ||
|
|
f8ae4325a0 | ||
|
|
80f78e66bb | ||
|
|
38660418b4 | ||
|
|
664380d304 | ||
|
|
22b4d0c276 | ||
|
|
cb0eb26faa | ||
|
|
f241bfefd0 | ||
|
|
eb145faffd | ||
|
|
d1c29bf698 | ||
|
|
3cc312d485 | ||
|
|
4bc2864a6f | ||
|
|
53a04703d6 | ||
|
|
22247271f6 | ||
|
|
e72f0076ed | ||
|
|
3adb43c6e5 | ||
|
|
fec3a89aa5 | ||
|
|
996cb9d3f1 | ||
|
|
0a35d17207 | ||
|
|
9b42177bd5 | ||
|
|
917ef1e01e | ||
|
|
8199ac9f89 | ||
|
|
7999cb9a46 | ||
|
|
acdfd6ab9e | ||
|
|
0775f7bae0 | ||
|
|
9a13dc92ab | ||
|
|
559232a4d7 | ||
|
|
b0a75da2ac | ||
|
|
e7a45a7f6a | ||
|
|
a0fe79a113 | ||
|
|
b5e646daa0 | ||
|
|
a5c11dc840 | ||
|
|
68257283e4 | ||
|
|
95da2f5d54 | ||
|
|
aa71710a74 | ||
|
|
0e997c973f | ||
|
|
5b4bb56012 | ||
|
|
9abe0940e7 | ||
|
|
5231fbf1e3 | ||
|
|
75da1bac69 | ||
|
|
d9abe553cf | ||
|
|
2bc7f10cd6 | ||
|
|
1b0b4c9609 | ||
|
|
b9a9997688 | ||
|
|
47e325cc66 | ||
|
|
db35db127c | ||
|
|
6d5578a876 | ||
|
|
e85206dee5 | ||
|
|
b09398a68e | ||
|
|
75d73b188c | ||
|
|
b169f93abc | ||
|
|
4831fb4dcb | ||
|
|
36f279837f | ||
|
|
e07f934185 | ||
|
|
504e1e1ec8 | ||
|
|
0e910616b6 | ||
|
|
49624c7b68 | ||
|
|
b9d6122c53 | ||
|
|
a05ebb6c65 | ||
|
|
8328c04624 | ||
|
|
16b12b33fc | ||
|
|
42898cd4cc | ||
|
|
7662ddc2fc | ||
|
|
35b79818b7 | ||
|
|
dba6d99686 | ||
|
|
4e1799b2be | ||
|
|
4c0ff38020 | ||
|
|
e6d8b3c4db | ||
|
|
888675016d | ||
|
|
0721e6af42 | ||
|
|
688073dc18 | ||
|
|
76db6c9f18 | ||
|
|
7f8c4d7d0f | ||
|
|
ccbcd2b339 | ||
|
|
6c392fad9f | ||
|
|
ec7d48931e | ||
|
|
78c3a1a3a1 | ||
|
|
fc5d96b84b | ||
|
|
75a7122667 | ||
|
|
ebe552ead5 | ||
|
|
d951114c18 | ||
|
|
70db9400ad | ||
|
|
67189fa683 | ||
|
|
5c8ead4b62 | ||
|
|
e0449cf17f | ||
|
|
3ab7bac511 | ||
|
|
192a825de8 | ||
|
|
14ed67499e | ||
|
|
ca80c58853 | ||
|
|
b8b32ae2e3 | ||
|
|
520bdac510 | ||
|
|
e8a1f0ba46 | ||
|
|
c6c07bf9f4 | ||
|
|
7103d7921e | ||
|
|
696100b9e7 | ||
|
|
d1fe6a408c | ||
|
|
4ca634b41c | ||
|
|
c7713a8839 | ||
|
|
4bf0e31299 | ||
|
|
47dd53abbe | ||
|
|
2054ce0aab | ||
|
|
21189048e7 | ||
|
|
106d74184c | ||
|
|
5033c6ea99 | ||
|
|
618c27d63c | ||
|
|
57c2971175 | ||
|
|
c72e7c1057 | ||
|
|
fd3837e1d5 | ||
|
|
a796a321cc | ||
|
|
e5fc1583c7 | ||
|
|
6484fb2a38 | ||
|
|
4b63834868 | ||
|
|
1d31603ad2 | ||
|
|
3dce431da2 | ||
|
|
46eedeafe8 | ||
|
|
80702e4c0a | ||
|
|
b3d27521cb | ||
|
|
e44234a47f | ||
|
|
c962daabac | ||
|
|
d241adc201 | ||
|
|
b520c0ab6b | ||
|
|
4a7e3fb387 | ||
|
|
76e55fcdb1 | ||
|
|
184d52525a | ||
|
|
fd0a46c5cf | ||
|
|
6ce8aa7d6f | ||
|
|
8ac1aab45a | ||
|
|
bf8d510541 | ||
|
|
b378279440 | ||
|
|
fc63008485 | ||
|
|
46c329848b | ||
|
|
4e4045d18a | ||
|
|
5f79b2d0c6 | ||
|
|
f410ffb0b5 | ||
|
|
52a4863ed8 | ||
|
|
2a1060c0fc | ||
|
|
c2298c2e6b | ||
|
|
5d18aad15f | ||
|
|
00758e515a | ||
|
|
c3d4df2b72 | ||
|
|
0b69d0143b | ||
|
|
28ad50e059 | ||
|
|
0a0797e797 | ||
|
|
afc0cb93b3 | ||
|
|
8cd0956b30 | ||
|
|
07c828d38f | ||
|
|
cff9fa0e6b | ||
|
|
29cb5dd545 | ||
|
|
abeba95de9 | ||
|
|
227daee2de | ||
|
|
d3a80795ce | ||
|
|
02d9a41e77 | ||
|
|
83622c62be | ||
|
|
d202003e29 | ||
|
|
a371b27564 | ||
|
|
706dd838c9 | ||
|
|
0f11a42fe4 | ||
|
|
c2c69620eb | ||
|
|
5c2ed0f19f | ||
|
|
58229907d4 | ||
|
|
940b56ee3e | ||
|
|
372cb40cf9 | ||
|
|
9648f20a2e | ||
|
|
40b412728f | ||
|
|
d936898308 | ||
|
|
9928f943a7 | ||
|
|
0f22beb774 | ||
|
|
05e50e1027 | ||
|
|
821324868a | ||
|
|
d9ba06e224 | ||
|
|
3b85a41991 | ||
|
|
d12caab69a | ||
|
|
74e8fb9c19 | ||
|
|
43f3e46aac | ||
|
|
04044df36a | ||
|
|
4f24613de0 | ||
|
|
170ad1a265 | ||
|
|
b7d715f03f | ||
|
|
3aaf9dae11 | ||
|
|
320da17c78 | ||
|
|
bf591f5f91 | ||
|
|
63bee0c2d0 | ||
|
|
29578a38bd | ||
|
|
7ee6dc7fa6 | ||
|
|
7559437d8b | ||
|
|
bc41b6dfe2 | ||
|
|
d0ee8c0e2d | ||
|
|
1ef899dacc | ||
|
|
4804cc47bd | ||
|
|
47ea9b57e8 | ||
|
|
559478048c | ||
|
|
f75af2af37 | ||
|
|
baa1f3ed2b | ||
|
|
a2611e31fe | ||
|
|
fb88eaf2a4 | ||
|
|
7673aff3ba | ||
|
|
0ada82baa0 | ||
|
|
49d0deea39 | ||
|
|
fbecb1b2d8 | ||
|
|
d7e1a6e4f0 | ||
|
|
1e45e64a9a | ||
|
|
b66ba6c57c | ||
|
|
64721d73b6 | ||
|
|
bab4f5c185 | ||
|
|
92d9eb3c5d | ||
|
|
55070ab907 | ||
|
|
299551f851 | ||
|
|
24c2675705 | ||
|
|
485bbe3336 | ||
|
|
a0fb53d5b1 | ||
|
|
3f3b82ed64 | ||
|
|
942b58efaf | ||
|
|
86c399db70 | ||
|
|
d5bb208957 | ||
|
|
1681445427 | ||
|
|
c8de648924 | ||
|
|
19e60f03b9 | ||
|
|
7ab600781d | ||
|
|
992f292a05 | ||
|
|
eef3824f8c | ||
|
|
1401e9267b | ||
|
|
4a97864d23 | ||
|
|
07d6bbf835 | ||
|
|
842859c394 | ||
|
|
26b8112d4e | ||
|
|
2dbae7b808 | ||
|
|
fd111cb1c6 | ||
|
|
951ea51285 | ||
|
|
4ec664029d | ||
|
|
fc0abe659a | ||
|
|
49afc83a7f | ||
|
|
1f156c1716 | ||
|
|
f7e1927b43 | ||
|
|
4521a5d7e0 | ||
|
|
4836fa8f76 | ||
|
|
87cbbadeed | ||
|
|
8d03f86f45 | ||
|
|
10ccb91515 | ||
|
|
e4ede5aef3 | ||
|
|
b94312162e | ||
|
|
90770a1f23 | ||
|
|
0e5cd3c257 | ||
|
|
24d2e22ceb | ||
|
|
0bc73cfb3f | ||
|
|
498473715e | ||
|
|
ec962f13fa | ||
|
|
afa5ef2913 | ||
|
|
c3d78bf1b4 | ||
|
|
a1ba4aa941 | ||
|
|
c06aedc54d | ||
|
|
3803330701 | ||
|
|
a98e5b7290 | ||
|
|
5ec01b3175 | ||
|
|
a26081d352 | ||
|
|
e61da5d833 | ||
|
|
692dd0b5db | ||
|
|
a12a094172 | ||
|
|
eb70d6eea1 | ||
|
|
977c18513d | ||
|
|
5de0d81dff | ||
|
|
89c80a45c2 | ||
|
|
4a19c14034 | ||
|
|
7ba87d39fb | ||
|
|
868f2e5473 | ||
|
|
cda301f6b7 | ||
|
|
d4fd9bd71e | ||
|
|
1dca3471db | ||
|
|
b11f71386d | ||
|
|
658330b971 | ||
|
|
38ab06984f | ||
|
|
953f737134 | ||
|
|
a8c5ba2983 | ||
|
|
2801c6e009 | ||
|
|
5233b8c87f | ||
|
|
05c9f57fd4 | ||
|
|
f34e0b1bdb | ||
|
|
3fa19f84e3 | ||
|
|
4723eac227 | ||
|
|
f5569ee890 | ||
|
|
d72e5a3646 | ||
|
|
4230b075c2 | ||
|
|
97eebe164c | ||
|
|
44ab6ad9b7 | ||
|
|
4fb4bc6f6c | ||
|
|
2184eabe2f | ||
|
|
579d350599 | ||
|
|
7dddba3e39 | ||
|
|
fa527ff4eb | ||
|
|
488d68113d | ||
|
|
6f3f0a826f | ||
|
|
56d7fe1bf6 | ||
|
|
767e842c68 | ||
|
|
fbe0b13706 | ||
|
|
febe95cd2e | ||
|
|
f8a6d60fe5 | ||
|
|
2418754d71 | ||
|
|
a8c5661cb7 | ||
|
|
e053308c6f | ||
|
|
5a7c20e897 | ||
|
|
8d00297509 | ||
|
|
5d94c8ddac | ||
|
|
8ba544fba5 | ||
|
|
ad361d6d45 | ||
|
|
4d16540207 | ||
|
|
88e2ee8492 | ||
|
|
439bda053d | ||
|
|
a042c30b28 | ||
|
|
22b85b3aba | ||
|
|
596c092ec8 | ||
|
|
f4e64685e8 | ||
|
|
072fa9987b | ||
|
|
6fef6ac2fb | ||
|
|
c45b40075d | ||
|
|
d5b10a18b7 | ||
|
|
ae3ace7e94 | ||
|
|
e1a6e6e4ab | ||
|
|
b24f244f67 | ||
|
|
b611c5ca53 | ||
|
|
b250485efd | ||
|
|
31c3398b7f | ||
|
|
775cd8ca7d | ||
|
|
c4b95e6509 | ||
|
|
49e6192e62 | ||
|
|
7fcf598c78 | ||
|
|
4126dcff03 | ||
|
|
e4fc52497e | ||
|
|
9a141f8556 | ||
|
|
6b20bad847 | ||
|
|
0f421dc2b4 | ||
|
|
e58743ea5b | ||
|
|
aa573b6dba | ||
|
|
ce067f9130 | ||
|
|
fcbc12ce31 | ||
|
|
aa1c14e508 | ||
|
|
b3e6b95714 | ||
|
|
8f52a34e71 | ||
|
|
a4bbcd866b | ||
|
|
d230883638 | ||
|
|
74992ee53f | ||
|
|
9220a638b5 | ||
|
|
a673afe601 | ||
|
|
f9c510f4fb | ||
|
|
6450154553 | ||
|
|
f75bd1ac44 | ||
|
|
62a0c5be73 | ||
|
|
2dfced366e | ||
|
|
a94a951a89 | ||
|
|
d03f804025 | ||
|
|
7f6ab748c5 | ||
|
|
6d3e43ddaf | ||
|
|
10353d1e1a | ||
|
|
3a649590f1 | ||
|
|
ffedf1fd57 | ||
|
|
1dd62c7daf | ||
|
|
e232a5a444 | ||
|
|
bda915c63a | ||
|
|
a0251a262a | ||
|
|
bd812a0bef | ||
|
|
bc43a052f4 | ||
|
|
3f236b1ebf | ||
|
|
53661e1e4f | ||
|
|
9d3c774163 | ||
|
|
3dea950c24 | ||
|
|
dccddf5c7e | ||
|
|
bdca134e99 | ||
|
|
a42ad74a37 | ||
|
|
b4c97e2279 | ||
|
|
f815d1bed3 | ||
|
|
ac20a1a874 | ||
|
|
d06fb423c0 | ||
|
|
f2fdee0ed2 | ||
|
|
64da0e77d5 | ||
|
|
cd6f5fb8cb | ||
|
|
13f37b2cb9 | ||
|
|
672e81d466 | ||
|
|
9d797f59a1 | ||
|
|
4e43a815d1 | ||
|
|
f15295d4bc | ||
|
|
c3fb559d3b | ||
|
|
d945a0de92 | ||
|
|
2ce4ba99fe | ||
|
|
772d862766 | ||
|
|
d84e50d15c | ||
|
|
373f918543 | ||
|
|
218e49298a | ||
|
|
aea6a8f9ec | ||
|
|
4cec071af5 | ||
|
|
e73c60b526 | ||
|
|
399aea179f | ||
|
|
e1e2c49d93 | ||
|
|
8e9a9637a0 | ||
|
|
a8ffc2fd9a | ||
|
|
58d77a14af | ||
|
|
ccad6d6dde | ||
|
|
56d75c552d | ||
|
|
055a00a338 | ||
|
|
cb6209de31 | ||
|
|
10bacda820 | ||
|
|
fcfea4e6d1 | ||
|
|
68711184b3 | ||
|
|
8d9639cd09 | ||
|
|
87a74e78b6 | ||
|
|
f919f70096 | ||
|
|
c48400331f | ||
|
|
119d0c3938 | ||
|
|
29df2c9115 | ||
|
|
70091eceed | ||
|
|
9f1959ffc8 | ||
|
|
105a53b333 | ||
|
|
14c31b451c | ||
|
|
3c86507ce6 | ||
|
|
3321d865d7 | ||
|
|
b3901e059d | ||
|
|
053afe21dd | ||
|
|
c39fcce9f1 | ||
|
|
e73a132ed9 | ||
|
|
77cb9032a5 | ||
|
|
32441d9ee3 | ||
|
|
13917cebdc | ||
|
|
06d9f99d05 | ||
|
|
dbae39b7b9 | ||
|
|
94b42021bd | ||
|
|
d076ffe73b | ||
|
|
f591e2b1b1 | ||
|
|
6011c98515 | ||
|
|
39a92df647 | ||
|
|
1878647d26 | ||
|
|
d714a52f95 | ||
|
|
7622d3b2fb | ||
|
|
00ead9d262 | ||
|
|
7d7f1bf9ed | ||
|
|
daf40ed573 | ||
|
|
5fd8b1efcb | ||
|
|
39151d7a74 | ||
|
|
8b116259f9 | ||
|
|
5362d10c0d | ||
|
|
3ab4782d93 | ||
|
|
4abbbd963e | ||
|
|
9a5670787f | ||
|
|
809e3ce4d5 | ||
|
|
b602e04fc8 | ||
|
|
ea97491a8f | ||
|
|
02c4c21c0a | ||
|
|
06abcbd4e9 | ||
|
|
bf0b5c0666 | ||
|
|
a250ba5f56 | ||
|
|
d7edcdd03c | ||
|
|
2374aa351e | ||
|
|
e66aabea85 | ||
|
|
5b8ff63981 | ||
|
|
6780b20968 | ||
|
|
94249b7926 | ||
|
|
412be59f78 | ||
|
|
ddbd6c371d | ||
|
|
4d8df737f3 | ||
|
|
9270b2c54c | ||
|
|
32653c1b94 | ||
|
|
227b616ca3 | ||
|
|
ed98227303 | ||
|
|
562bdbc9f5 | ||
|
|
f2d361d29b | ||
|
|
acb2c57f47 | ||
|
|
47c37855b1 | ||
|
|
d4413d370e | ||
|
|
2566df8252 | ||
|
|
9be75ed019 | ||
|
|
c6bd1a7d7d | ||
|
|
49fc8129ac | ||
|
|
73852beb4e | ||
|
|
160f8c3085 | ||
|
|
caba4836b3 | ||
|
|
819dc44533 | ||
|
|
22a815a1b4 | ||
|
|
8225b06018 | ||
|
|
0f6cb52376 | ||
|
|
e0cbcadd98 | ||
|
|
6dbb3efc89 | ||
|
|
2525a6e3a4 | ||
|
|
c0a8752ef4 | ||
|
|
e701ea0b2f | ||
|
|
9674bdef54 | ||
|
|
e232c1c408 | ||
|
|
da64d4d398 | ||
|
|
fafe71ec52 | ||
|
|
1b1bab94ca | ||
|
|
81d76f8600 | ||
|
|
41f6d70eaf | ||
|
|
f43b3ebda4 | ||
|
|
6a79a80320 | ||
|
|
6bfd534a36 | ||
|
|
9d72f1df62 | ||
|
|
94a180a775 | ||
|
|
9c1895a03a | ||
|
|
846e827e09 | ||
|
|
0bac99028e | ||
|
|
d95ac3bbdd | ||
|
|
4ecd657f34 | ||
|
|
7bccaff28a | ||
|
|
58c25a68a8 | ||
|
|
79714f7ede | ||
|
|
d5120ae7cc | ||
|
|
d09a3628c5 | ||
|
|
d18c8e3a14 | ||
|
|
3a40d5a4f1 | ||
|
|
6cc3ef0c99 | ||
|
|
6014314610 | ||
|
|
c3e5e0dd3f | ||
|
|
751aa2a2aa | ||
|
|
972a31ebe9 | ||
|
|
4349eac7ea | ||
|
|
9671810d13 | ||
|
|
2c6672d17a | ||
|
|
b28ba7a5ff | ||
|
|
32a3f74ea1 | ||
|
|
4d134a4a4e | ||
|
|
25dcb10c1d | ||
|
|
0548e9cc4e | ||
|
|
64b932f78c | ||
|
|
97f71d33ce | ||
|
|
29a8c8105e | ||
|
|
14fb01da11 | ||
|
|
9154843c1b | ||
|
|
dcae6e644d | ||
|
|
0f89fa2b11 | ||
|
|
5c233a41b3 | ||
|
|
93ab224614 | ||
|
|
c4ff1f983c | ||
|
|
232cacab80 | ||
|
|
635abe58be | ||
|
|
65b956b011 | ||
|
|
8b4a43ec77 | ||
|
|
c9cce66d98 | ||
|
|
52666ea971 | ||
|
|
fd008f88b1 | ||
|
|
2248429eda | ||
|
|
3e77fed815 | ||
|
|
8e615a83e5 | ||
|
|
785b2d46b3 | ||
|
|
163ee094ec | ||
|
|
5446ff667a | ||
|
|
df9121d6fa | ||
|
|
1b3af1df07 | ||
|
|
f00f3101d9 | ||
|
|
51b9802de4 | ||
|
|
4c4aeba855 | ||
|
|
d23aa8ef3c | ||
|
|
e9853f3cd7 | ||
|
|
1d291ee0e8 | ||
|
|
b813144edb | ||
|
|
c8c78dc9cf | ||
|
|
c4f0433805 | ||
|
|
e57f834434 | ||
|
|
370be70e46 | ||
|
|
4907f9581f | ||
|
|
27c056d377 | ||
|
|
febd23fe41 | ||
|
|
728dd3f7b3 | ||
|
|
7aad6683fa | ||
|
|
c27a1c1705 | ||
|
|
598e559563 | ||
|
|
afe5c6b296 | ||
|
|
c04c62e62c | ||
|
|
f023d6485f | ||
|
|
67c513a9c1 | ||
|
|
522fb4cf7a | ||
|
|
d3176ec0ed | ||
|
|
1f2f03c287 | ||
|
|
70f70c884c | ||
|
|
088a948e5a | ||
|
|
2c4e8926f8 | ||
|
|
f46ce68d08 | ||
|
|
f1961b0207 | ||
|
|
154425e2bc | ||
|
|
47a444b2ab | ||
|
|
4705a87548 | ||
|
|
8a24f2fc91 | ||
|
|
c21300f0fa | ||
|
|
e11db44b6d | ||
|
|
1338237d7c | ||
|
|
b5c815367c | ||
|
|
5669f734b8 | ||
|
|
e71f216f16 | ||
|
|
191f69ec79 | ||
|
|
76999cf41e | ||
|
|
3557e4eb37 | ||
|
|
337897e0a1 | ||
|
|
ed5ac9c617 | ||
|
|
ac92e23b59 | ||
|
|
cfde9e2ec5 | ||
|
|
ba7ca3da6e | ||
|
|
6544175cf2 | ||
|
|
26098082d0 | ||
|
|
ed0ffd6f5a | ||
|
|
08449a2d4f | ||
|
|
6653e2dbe7 | ||
|
|
a736f3782c | ||
|
|
78bf209119 | ||
|
|
f0ea610401 | ||
|
|
41ddaf5d9b | ||
|
|
79867a85d0 | ||
|
|
4d375bcf95 | ||
|
|
e91c2c6e77 | ||
|
|
e65ae08e5c | ||
|
|
b7a6a71dff | ||
|
|
1596760d21 | ||
|
|
7a6fcc744a | ||
|
|
9f6f874655 | ||
|
|
81b01cd055 | ||
|
|
703b8708e3 | ||
|
|
a463759ba3 | ||
|
|
565bcf2332 | ||
|
|
a636d27ccb | ||
|
|
a99ac7fb6b | ||
|
|
2f138c0c37 | ||
|
|
efc22a4cd8 | ||
|
|
baf1acb4fd | ||
|
|
902169cb66 | ||
|
|
e1a5a90f0a | ||
|
|
dfb9ae234c | ||
|
|
cdfbed5d08 | ||
|
|
51eb3726dc | ||
|
|
bfb628dab6 | ||
|
|
b8284447fd | ||
|
|
e26cb0f238 | ||
|
|
a7813c37a1 | ||
|
|
1db907e2af | ||
|
|
f5bffeb535 | ||
|
|
b7af046147 | ||
|
|
300c91fd7f | ||
|
|
7c7626e445 | ||
|
|
ba8deb29c9 | ||
|
|
cbfb7df05e | ||
|
|
ef721bebc6 | ||
|
|
a797c45e3b | ||
|
|
101afeeb73 | ||
|
|
1e39805945 | ||
|
|
e48d65120d | ||
|
|
3396dfc7f6 | ||
|
|
d86503cb66 | ||
|
|
7ab7149e64 | ||
|
|
c1652169f2 | ||
|
|
d8aa572ad7 | ||
|
|
34a123759f | ||
|
|
9a1309256d | ||
|
|
3f6f1ac86f | ||
|
|
91be05932e | ||
|
|
cf0ee36150 | ||
|
|
792e12e6c5 | ||
|
|
c433829d27 | ||
|
|
480b08bd0b | ||
|
|
1ca40c0d9d | ||
|
|
b631db1d60 | ||
|
|
66693c5268 | ||
|
|
9bb60e8d2c | ||
|
|
5a8b844c49 | ||
|
|
d5fe7b8b9c | ||
|
|
6ebafe1a87 | ||
|
|
9f28795159 | ||
|
|
5c46095fa3 | ||
|
|
636fbb476c | ||
|
|
f96fd895e3 | ||
|
|
86d195fa81 | ||
|
|
056b76a831 | ||
|
|
71cff4032c | ||
|
|
44aa601848 | ||
|
|
ff734bb5d9 | ||
|
|
afd17feffe | ||
|
|
a251f0df51 | ||
|
|
f97bab6fb8 | ||
|
|
081be37787 | ||
|
|
1c15cfa722 | ||
|
|
286095f5cd | ||
|
|
05728075d6 | ||
|
|
8ceb494569 | ||
|
|
b1c552ee9d | ||
|
|
c082505021 | ||
|
|
d9a1be48cf | ||
|
|
cfaf4902f2 | ||
|
|
64d4a08dc6 | ||
|
|
43897d913e | ||
|
|
3ffbb800d2 | ||
|
|
8353e1d462 | ||
|
|
2999d0b37a | ||
|
|
0fe39d4e4b | ||
|
|
134f13c63f | ||
|
|
1dfb0cac4e |
2
.github/CONTRIBUTING.md
vendored
@@ -6,7 +6,7 @@ Bug reports and feature requests
|
||||
|
||||
<a name="not-a-support-forum"></a>*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum).
|
||||
|
||||
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/Issues).
|
||||
Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues).
|
||||
|
||||
1. Please [use the search engine](https://help.github.com/articles/searching-issues) to check if nobody's already reported your problem.
|
||||
2. [Create an issue](https://help.github.com/articles/creating-an-issue). Choose an appropriate title. Prepend appropriately with Bug or Feature Request.
|
||||
|
||||
@@ -292,6 +292,9 @@ script:
|
||||
php upgrade.php 4.0.0 5.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade400500.log
|
||||
php upgrade2.php 4.0.0 5.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade400500-2.log
|
||||
php step5.php 4.0.0 5.0.0 > $TRAVIS_BUILD_DIR/upgrade400500-3.log
|
||||
php upgrade.php 5.0.0 6.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade500600.log
|
||||
php upgrade2.php 5.0.0 6.0.0 MAIN_MODULE_API,MAIN_MODULE_SUPPLIERPROPOSAL > $TRAVIS_BUILD_DIR/upgrade500600-2.log
|
||||
php step5.php 5.0.0 6.0.0 > $TRAVIS_BUILD_DIR/upgrade500600-3.log
|
||||
cd -
|
||||
set +e
|
||||
echo
|
||||
|
||||
30
.tx/config
@@ -224,6 +224,18 @@ source_file = htdocs/langs/en_US/members.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.modulebuilder]
|
||||
file_filter = htdocs/langs/<lang>/modulebuilder.lang
|
||||
source_file = htdocs/langs/en_US/modulebuilder.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.multicurrency]
|
||||
file_filter = htdocs/langs/<lang>/multicurrency.lang
|
||||
source_file = htdocs/langs/en_US/multicurrency.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.oauth]
|
||||
file_filter = htdocs/langs/<lang>/oauth.lang
|
||||
source_file = htdocs/langs/en_US/oauth.lang
|
||||
@@ -326,6 +338,12 @@ source_file = htdocs/langs/en_US/stocks.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.stripe]
|
||||
file_filter = htdocs/langs/<lang>/stripe.lang
|
||||
source_file = htdocs/langs/en_US/stripe.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.suppliers]
|
||||
file_filter = htdocs/langs/<lang>/suppliers.lang
|
||||
source_file = htdocs/langs/en_US/suppliers.lang
|
||||
@@ -350,18 +368,18 @@ source_file = htdocs/langs/en_US/users.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.withdrawals]
|
||||
file_filter = htdocs/langs/<lang>/withdrawals.lang
|
||||
source_file = htdocs/langs/en_US/withdrawals.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.website]
|
||||
file_filter = htdocs/langs/<lang>/website.lang
|
||||
source_file = htdocs/langs/en_US/website.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.withdrawals]
|
||||
file_filter = htdocs/langs/<lang>/withdrawals.lang
|
||||
source_file = htdocs/langs/en_US/withdrawals.lang
|
||||
source_lang = en_US
|
||||
type = MOZILLAPROPERTIES
|
||||
|
||||
[dolibarr.workflow]
|
||||
file_filter = htdocs/langs/<lang>/workflow.lang
|
||||
source_file = htdocs/langs/en_US/workflow.lang
|
||||
|
||||
148
COPYRIGHT
@@ -14,23 +14,24 @@ Component Version License GPL Compatible
|
||||
PHP libraries:
|
||||
AdoDb-Date 0.36 Modified BSD License Yes Date convertion (not into rpm package)
|
||||
ChromePHP 4.1.0 Apache Software License 2.0 Yes Return server log to chrome browser console
|
||||
CKEditor 4.5.8 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
CKEditor 4.6.2 LGPL-2.1+ Yes Editor WYSIWYG
|
||||
EvalMath 1.0 BSD Yes Safe math expressions evaluation
|
||||
Escpos-php MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers
|
||||
FPDI 1.5.2 Apache Software License 2.0 Yes PDF templates management
|
||||
GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package)
|
||||
Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers
|
||||
NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package)
|
||||
PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency
|
||||
odtPHP 1.0.1 GPL-2+ b Yes Library to build/edit ODT files
|
||||
odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files
|
||||
ParseDown 1.6 MIT License Yes Markdown parser
|
||||
PHPExcel 1.8.1 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
|
||||
php-iban 1.4.7 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
|
||||
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service
|
||||
PHPPrintIPP 1.3 GPL-2+ Yes Library to send print IPP requests
|
||||
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services
|
||||
Restler 3.0.0RC6 LGPL-3+ Yes Library to develop REST Web services (+ swagger-ui js lib into dir explorer)
|
||||
TCPDF 6.2.12 LGPL-3+ Yes PDF generation
|
||||
TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes FPDI replacement
|
||||
Swift Mailer 5.4.2-DEV MIT license Yes Comprehensive mailing tools for PHP
|
||||
Stripe 4.7.0 MIT licence Yes Library for Stripe module
|
||||
|
||||
JS libraries:
|
||||
jQuery 1.11.3 MIT License Yes JS library
|
||||
@@ -44,147 +45,20 @@ jQuery JCrop 0.9.8 GPL and MIT License Yes
|
||||
jQuery Jeditable 1.7.1 GPL and MIT License Yes JS library plugin jeditable (to edit in place)
|
||||
jQuery jNotify 1.1.00 Apache Software License 2.0 Yes JS library plugin jNotify (to use ajax popups)
|
||||
jQuery jPicker 1.1.6 GPL and MIT License Yes JS library for color picker with not defined list of colors
|
||||
jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for color picker with not defined list of colors
|
||||
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for color picker with not defined list of colors
|
||||
jQuery Layout 1.4.3 GPL and MIT License Yes JS library plugin Layout
|
||||
jQuery Mobile 1.3.0 GPL and MIT License Yes JS library for smartphone (not used)
|
||||
jQuery jqueryFileTree 1.0.1 GPL and MIT License Yes JS library for filetree
|
||||
jQuery jquerytreeview 1.4.1 MIT License Yes JS library for filetree
|
||||
jQuery TableDnD 0.6 GPL and MIT License Yes JS library plugin TableDnD (to reorder table rows)
|
||||
jQuery Timepicker 1.1.0 GPL and MIT License Yes JS library Timepicker addon for Datepicker
|
||||
jQuery Tiptip 1.3 GPL and MIT License Yes JS library for tooltips
|
||||
jsGanttImproved 1.7.5.2 BSD License Yes JS library (to build Gantt reports)
|
||||
JsTimezoneDetect 1.0.6 MIT License Yes JS library to detect user timezone
|
||||
SwaggerUI 2.0.24 GPL-2+ Yes JS library to offer the REST API explorer
|
||||
|
||||
For licenses compatibility informations:
|
||||
http://www.gnu.org/licenses/licenses.en.html
|
||||
|
||||
|
||||
Copyright
|
||||
---------
|
||||
|
||||
Copyright (C) 2016
|
||||
|
||||
Copyright (C) 2015
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Marcos García <marcosgdf@gmail.com>
|
||||
- Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
- Frederic France <frederic.france@free.fr>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
|
||||
Copyright (C) 2014
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
- Jean-François Ferry <jfefe@aternatik.fr>
|
||||
- Marcos García <marcosgdf@gmail.com>
|
||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||
- Florian Henry <florian.henry@open-concept.pro>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Maxime Kohlhaas <mko@atm-consulting.fr>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
- Frederic France <frederic.france@free.fr>
|
||||
|
||||
Copyright (C) 2013
|
||||
- Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Jean-François Ferry <jfefe@aternatik.fr>
|
||||
- Marcos García <marcosgdf@gmail.com>
|
||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||
- Florian Henry <florian.henry@open-concept.pro>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Maxime Kohlhaas <mko@atm-consulting.fr>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- Adolfo Segura <adolfo.segura@gmail.com>
|
||||
- Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
|
||||
Copyright (C) 2012
|
||||
- Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Jean-François Ferry <jfefe@aternatik.fr>
|
||||
- Marcos García <marcosgdf@gmail.com>
|
||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||
- Jean Heimburger <jean@tiaris.info>
|
||||
- Florian Henry <florian.henry@open-concept.pro>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Maxime Kohlhaas <mko@atm-consulting.fr>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- Nicolas Péré <nicolas@amarok2.net>
|
||||
- Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
|
||||
Copyright (C) 2011
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- Philippe Grand <philippe.grand@atoo-net.com>
|
||||
- Jean Heimburger <jean@tiaris.info>
|
||||
|
||||
Copyright (C) 2010
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
- r2gnl
|
||||
- meos
|
||||
|
||||
Copyright (C) 2009
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Juanjo Menent <jmenent@2byte.es>
|
||||
|
||||
Copyright (C) 2008
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
|
||||
Copyright (C) 2007
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Auguria SARL <info@auguria.org>
|
||||
- Jean Heimburger <jean@tiaris.info>
|
||||
- Jeremie Ollivier <jeremie.o@laposte.net>
|
||||
|
||||
Copyright (C) 2006
|
||||
- Auguria SARL <info@auguria.org>
|
||||
- Marc Barilley/Ocebo <marc@ocebo.com>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
- Andre Cianfarani <acianfa@free.fr>
|
||||
- Yannick Warnier <ywarnier@beeznest.org>
|
||||
- Jean Heimburger <jean@tiaris.info>
|
||||
|
||||
Copyright (C) 2005
|
||||
- Brice Davoleau <brice.davoleau@gmail.com>
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Benoit Mortier <benoit.mortier@opensides.be>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Eric Seigne <erics@rycks.com>
|
||||
- Matthieu Valleton <mv@seeschloss.org>
|
||||
- Regis Houssin <regis.houssin@capnetworks.com>
|
||||
|
||||
Copyright (C) 2004
|
||||
- Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Eric Seigne <erics@rycks.com>
|
||||
- Benoit Mortier <benoit.mortier@opensides.be>
|
||||
- Christophe Combelles <ccomb@free.fr>
|
||||
- Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
|
||||
Copyright (C) 2003
|
||||
- Jean-Louis Bergamo <jlb@j1b.org>
|
||||
- Xavier Dutoit <doli@sydesy.com>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
- Emmanuel Raviart <eraviart@entrouvert.com>
|
||||
- Eric Seigne <erics@rycks.com>
|
||||
|
||||
Copyright (C) 2002
|
||||
- Jean-Louis Bergamo <jlb@j1b.org>
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
|
||||
Copyright (C) 2001
|
||||
- Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
|
||||
|
||||
|
||||
|
||||
Copyright / Authors
|
||||
-------------------
|
||||
|
||||
See page https://github.com/Dolibarr/dolibarr/graphs/contributors
|
||||
|
||||
147
ChangeLog
@@ -2,6 +2,93 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
||||
|
||||
For developers:
|
||||
NEW: Add a lot of API REST: dictionaryevents, memberstypes, ...
|
||||
NEW: Big refactorization of multicompany transverse mode.
|
||||
NEW: getEntity function use true $shared value by default.
|
||||
|
||||
WARNING:
|
||||
|
||||
Following changes may create regression for some external modules, but were necessary to make Dolibarr better:
|
||||
* The hook getNodeList has been replaced by a normalized 'addreplace' hook getDirList.
|
||||
* The trigger USER_SETINGROUP and USER_REMOVEFROMGROUP has been replaced with trigger USER_MODIFY.
|
||||
* The page societe/soc.php was renamed into societe/card.php to match page naming conventions.
|
||||
* The page compta/facture.php was renamed into compta/facture/card.php to match page naming conventions.
|
||||
* The signature of method ->delete() of class Product and PriceExpression was changed from
|
||||
->delete(id, notrigger) to ->delete(User, notrigger) to match standard dev rules.
|
||||
* The signature of method ->delete() of class Adherent was changed from
|
||||
->delete(id) to ->delete(id, User, notrigger) to match standard dev rules.
|
||||
* Removed CommonObject::displayMarginInfos (was deprecated in 3.8). Use same method into
|
||||
html.formmargin.class.php
|
||||
* Removed Societe::set_commnucation_level (was deprecated in 4.0). Was not used.
|
||||
* Removed the trigger file of PAYPAL module that stored data that was not used by Dolibarr. The trigger event still
|
||||
exists, but if an external module need action on it, it must provides itself its trigger file.
|
||||
* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode
|
||||
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
||||
|
||||
***** ChangeLog for 5.0.3 compared to 5.0.2 *****
|
||||
FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty
|
||||
FIX: #6813
|
||||
FIX: 6863
|
||||
FIX: #6877
|
||||
FIX: #6881
|
||||
FIX: Better sanitizing of search all parameter.
|
||||
FIX: Correction with author and validator user on orders
|
||||
FIX: dialog window with md theme must not be hidden by left menu part.
|
||||
FIX: doactions hook missing in invoice model page
|
||||
FIX: Fullname when member is a moral entity with no name.
|
||||
FIX: Link to files on bank account tab broken with multicompany FIX: Link to preview on thirdparty broken with multicompany
|
||||
FIX: New vat code not correctly implemented if "1 price per customer".
|
||||
FIX: Pagination of invoices
|
||||
FIX: pagination on resources
|
||||
FIX: REST API not possible to add agendaevents
|
||||
FIX: situation invoice broken due to the all percent application form inside addline form
|
||||
FIX: SQL injection on user/index.php parameter search_statut.
|
||||
FIX: XSS
|
||||
|
||||
***** ChangeLog for 5.0.2 compared to 5.0.1 *****
|
||||
FIX: #6468 + Fix missing translation
|
||||
FIX: #6517 #6525 Autocompletion of thirdparty after n chars not implemented
|
||||
FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key
|
||||
FIX: #6614
|
||||
FIX: #6619 Template invoices list do not respect restricted thirdparty user rights
|
||||
FIX: #6621 Documents tab shows greyed out upload form even if the option to show actions not available is disabled
|
||||
FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users
|
||||
FIX: #6636 Complete fix
|
||||
FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry
|
||||
FIX: #6671 Cannot remove thirdparty type with "#" in its name
|
||||
FIX: #6673 Missing "nature" table header in thirdparty list
|
||||
FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list
|
||||
FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode
|
||||
FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it
|
||||
FIX: #6718 Bug: Discount amount is not locally formatted in CommonObject View
|
||||
FIX: #6767 serious critical error, no login possible with postgresql and ipv6.
|
||||
FIX: #6795 #6796
|
||||
FIX: Add option MAIN_MAIL_USE_MULTI_PART to include text content into HTML email and add option MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS to restore the inline images feature.
|
||||
FIX: ajax autocomplete on clone
|
||||
FIX: A non admin user can not download files attached to user.
|
||||
FIX: Can't download delivery receipts (function dol_check_secure_access_document)
|
||||
FIX: complete hourly rate when not defined into table of time spent
|
||||
FIX: dont get empty "Incoterms : - " string if no incoterm
|
||||
FIX: dont lose supplier ref if no supplier price in database
|
||||
FIX: Enter a direct bank transaction
|
||||
FIX: extrafield css for boolean type
|
||||
FIX: forgotten parameter for right multicompany use
|
||||
FIX: Found duplicate line when it is not.
|
||||
FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden
|
||||
FIX: Journal code of bank must be visible of accountaing module on.
|
||||
FIX: length_accounta return variable name
|
||||
FIX: limit+1 dosn't show Total line
|
||||
FIX: No filter on company when showing the link to elements.
|
||||
FIX: overwrapping of weight/volume on rouget template
|
||||
FIX: Several bugs in accounting module.
|
||||
FIX: shared bank account with multicompany not visible in invoice setup
|
||||
FIX: spaces not allowed into vat code
|
||||
FIX: supplier default condition not retrieved on create
|
||||
FIX: supplier order line were always created with rang = 0
|
||||
|
||||
***** ChangeLog for 5.0.1 compared to 5.0.0 *****
|
||||
FIX: #6503: SQL error in "Last pending payment invoices"
|
||||
FIX: #6505 Project elements page shows greyed-out links even if the option to show actions not available is disabled
|
||||
@@ -173,9 +260,67 @@ Dolibarr better:
|
||||
- Method commande->set_availability(user, availability_id) removed from commande class, use method commande->availability(availability_id, notrigger).
|
||||
|
||||
Dolibarr 5.0 was frozen before PHP 7.1 was released. Unit tests are successful on PHP 7.1 but we don't have enough
|
||||
feedback to confirm all application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||
feedback to confirm whole application is compatible. Current officiel supported PHP versions are PHP 5.3 to 7.0.
|
||||
|
||||
|
||||
***** ChangeLog for 4.0.6 to 4.0.5 *****
|
||||
FIX: #6613 Default subject for Supplier proposal emails is filled with a non-existing key
|
||||
FIX: #6623 User card shows "Return to list" link even if the user has no rights to list users
|
||||
FIX: #6636 Complete fix
|
||||
FIX: #6669 User with no permission to edit customer invoices can see a edit button in project entry
|
||||
FIX: #6671 Cannot remove thirdparty type with "#" in its name
|
||||
FIX: #6673 Missing "nature" table header in thirdparty list
|
||||
FIX: #6675 Restricted user with no agenda permissions can see a button to create appointment in thirdparty contact list
|
||||
FIX: #6677 Expired contracts dashboard box does not show the name of the thirdparty
|
||||
FIX: #6679 User with restricted supplier invoice permissions can edit project, payment conditions, payment mode
|
||||
FIX: #6680 User with restricted supplier invoice permissions sees "reopen" button even if he has no permission to do it
|
||||
FIX: #6813
|
||||
FIX: Correction with author and validator user on orders
|
||||
FIX: doactions hook missing in invoice model page
|
||||
FIX: dont get empty "Incoterms : - " string if no incoterm
|
||||
FIX: dont lose supplier ref if no supplier price in database
|
||||
FIX: forgotten parameter for right multicompany use
|
||||
FIX: global $dateSelector isn't the good one, then date selector on objectline_create tpl was hidden
|
||||
FIX: limit+1 dosn't show Total line
|
||||
FIX: supplier order line were always created with rang = 0
|
||||
|
||||
|
||||
***** ChangeLog for 4.0.5 to 4.0.4 *****
|
||||
FIX: #6234
|
||||
FIX: #6259
|
||||
FIX: #6330
|
||||
FIX: #6360
|
||||
FIX: #6411
|
||||
FIX: #6443
|
||||
FIX: #6444
|
||||
FIX: #6453
|
||||
FIX: #6503: SQL error in "Last pending payment invoices"
|
||||
FIX: #6505 Project elements page shows greyed-out links even if the option to show actions not available is disabled
|
||||
FIX: #6507: Statistics counter show wrong total Contract numbers when the user does not have full access
|
||||
FIX: #6533 #6590
|
||||
FIX: #6619 Template invoices list do not respect restricted thirdparty user rights
|
||||
FIX: #6621 Documents tab shows greyed out upload form even if the option to show actions not available is disabled
|
||||
FIX: add entity param to document link
|
||||
FIX: Can use quote into supplier ref on order line add
|
||||
FIX: Change the customer code only if error on duplicate
|
||||
FIX: Creation of credit note on invoice with deposit stole the discount.
|
||||
FIX: delete bank class lines when we delete bank_categ
|
||||
FIX: deletion of bank tag
|
||||
FIX: detail of deposit and credit not was not visible into final invoice
|
||||
FIX: Error management during bank account creation
|
||||
FIX: error management in bank account deletion.
|
||||
FIX: event status is not modified when assign an user
|
||||
FIX: forgotten fk_facture_fourn attribute on supplierinvoice line object
|
||||
FIX: If bank module on, field must be required to register payment of expense report.
|
||||
FIX: load multicurrency informations on supplier order and bill lines fetch
|
||||
FIX: Missing total on project overview.
|
||||
FIX: multicurrency_subprice
|
||||
FIX: param billed when we change page
|
||||
FIX: protection against infinite loop on hierarchy
|
||||
FIX: Supplier Order list filter by project
|
||||
FIX: the dolCopyDir fails if target dir does not exists.
|
||||
FIX: use param for http links
|
||||
|
||||
***** ChangeLog for 4.0.4 to 4.0.3 *****
|
||||
FIX: #6227 Document models table header "Unit" is shown in 2 lines in Spanish
|
||||
FIX: #6230
|
||||
|
||||
10
README.md
@@ -26,6 +26,16 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git
|
||||
|
||||
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||
|
||||
### Install from composer
|
||||
If you do not already have Composer installed, you may do so by following the instructions at getcomposer.org. On Linux and Mac OS X, you'll run the following commands:
|
||||
|
||||
curl -sS https://getcomposer.org/installer | php
|
||||
mv composer.phar /usr/local/bin/composer
|
||||
|
||||
On Windows, you'll download and run https://getcomposer.org/Composer-Setup.exe
|
||||
|
||||
composer create-project dolibarr/dolibarr erp
|
||||
|
||||
### Simple setup
|
||||
|
||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM in few clicks, you can use one of the packaged versions:
|
||||
|
||||
@@ -152,7 +152,7 @@ tag 729538 -moreinfo
|
||||
|
||||
|
||||
|
||||
##### Testing a package into unstable env
|
||||
##### Testing a package into a chroot environment
|
||||
|
||||
Check you have a mysql server available from another interface than "localhost".
|
||||
Set line in /etc/mysql/my.cnf if required and restart mysql
|
||||
@@ -160,9 +160,11 @@ Set line in /etc/mysql/my.cnf if required and restart mysql
|
||||
[mysqld]
|
||||
bind-address = *
|
||||
|
||||
Create a chroot called "unstable-amd64-sbuild".
|
||||
Create a chroot called "jessie" or "unstable".
|
||||
Chroot env is stored into /srv/chroot directory.
|
||||
> sudo sbuild-createchroot --keyring=unstable /srv/chroot/unstable http://ftp.uk.debian.org/debian
|
||||
or
|
||||
> sudo sbuild-createchroot jessie /srv/chroot/jessie http://ftp.uk.debian.org/debian
|
||||
|
||||
Pour lister les env chroot
|
||||
> schroot -l
|
||||
@@ -170,8 +172,9 @@ or
|
||||
> ls /srv/chroot
|
||||
|
||||
Puis pour se connecter et préparer l'environnement
|
||||
> schroot -c name_of_chroot
|
||||
> schroot -c name_of_chroot (exemple schroot -c unstable-amd64-sbuild)
|
||||
> cat /etc/debian_chroot to check which debian branch we are into
|
||||
> apt-get install vi dialog
|
||||
> vi /usr/sbin/policy-rc.d and replace return code 101 (not allowed) into 0 (ok)
|
||||
> apt-get update
|
||||
> apt-get upgrade
|
||||
@@ -320,8 +323,8 @@ x.y.z+dfsgw
|
||||
Note: If there was errors solved manually after get-orig-sources.sh, you may need to make a git commit
|
||||
|
||||
* Update/fix debian/* files used to build package.
|
||||
At least, add an entry into debian/changelog
|
||||
> dch -v x.y.z+dfsgw-v "My comment" will add entry.
|
||||
At least, add an entry into debian/changelog with command
|
||||
> dch -v x.y.z+dfsgw-1 "My comment"
|
||||
For example: dch -v x.y.z+dfsgw-1 "New upstream release." for a new version (x.y.z = version, w start from 1 and increased for each new import)
|
||||
Then check/modify changelog to replace "version" or "unstable" with "UNRELEASED".
|
||||
Then check/modify also the user/date signature:
|
||||
@@ -332,23 +335,27 @@ Then check/modify also the user/date signature:
|
||||
To update dolibarr debian package when only files into debian has changed:
|
||||
|
||||
* Change files and commit.
|
||||
* Add a tag debian/x.y.z+dfsgw-2 (increase the last 1 into 2, 3...)
|
||||
* Add a line into changelog for version debian/x.y.z+dfsgw-v (increase the last v into 2, 3...)
|
||||
> dch -v x.y.z+dfsgw-v "My comment"
|
||||
* git tag will be added when package is pushed.
|
||||
|
||||
|
||||
To update dolibarr debian package when only files not into debian has changed:
|
||||
|
||||
* Manually, add patches into debian/patches and update file debian/series, or do the 2 steps with "quilt import filepatch.patch"
|
||||
* Checkout the branch you want to work on: master of debian/...
|
||||
* Manually, add patches into debian/patches and update the file debian/series, or do the 2 steps with "quilt import filepatch.patch"
|
||||
* You can test patching of serie with "quilt push" (autant de fois que de patch). Avec "quilt pop -a", on revient a l'état du upstream sans les patch.
|
||||
* Update the debian/changelog to add entry of change.
|
||||
|
||||
Once files has been prepared, it's time to test:
|
||||
|
||||
* Try to build package
|
||||
> rm -fr ../build-area;
|
||||
> git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-3.5.x|3.5.5]
|
||||
> git-buildpackage -us -uc --git-debian-branch=[master|jessie] --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
|
||||
ou
|
||||
> git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-3.5.x|3.5.5]
|
||||
> git-buildpackage -us -uc --git-ignore-branch --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
|
||||
|
||||
Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-3.5.x]
|
||||
Note: To build an old version, do: git checkout oldtagname -b newbranchname; git-buildpackage -us -uc --git-debian-branch=newbranchname --git-upstream-branch=[upstream|upstream-jessie|upstream-3.5.x|3.5.5]
|
||||
Note: You can use git-buildpackage -us -uc --git-ignore-new if you want to test build with uncommited file
|
||||
Note: You can use git-buildpackage -us -uc -d if you want to test build when dependencies does not match
|
||||
Note: Package is built into directory ../build-area
|
||||
@@ -381,13 +388,14 @@ http://packages.qa.debian.org
|
||||
* Package will be into release when test will be moved as stable.
|
||||
|
||||
|
||||
##### Send an unblock request
|
||||
|
||||
##### Send an unblock request to make a full update of a stable package
|
||||
|
||||
Use this to move from unstable to testing.
|
||||
|
||||
reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls
|
||||
Choose package "release.debian.org"
|
||||
Then "unblock"
|
||||
Then usertag "unblock"
|
||||
Then name of package "dolibarr"
|
||||
Fill message, for example:
|
||||
"Please unblock package dolibarr
|
||||
@@ -397,11 +405,11 @@ so it is a better solution to validate this maintenance release than applying a
|
||||
After discussion with ..., it appears that security holes are enough to request this unblock request."
|
||||
|
||||
|
||||
Use this to request an update of a stable package
|
||||
Use this to request an full update of a stable package
|
||||
|
||||
reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls
|
||||
Choose package "release.debian.org"
|
||||
Then "unblock"
|
||||
Then usertag "unblock"
|
||||
Then name of package "dolibarr"
|
||||
Fill message, for example:
|
||||
"
|
||||
@@ -413,11 +421,27 @@ Pro are:
|
||||
- It fixes also stability bugs
|
||||
- Patches were already tested because deployed and used by several thousands of users.
|
||||
- It is easier for package maintener to include this official set of fixes than applying one patch after one patch for each debian report or backported each patch into a dedicated version.
|
||||
- Debian maintenance version matches with official project maintenance version (better when all fixes are not related to the way the software is packaged)
|
||||
- Debian maintenance version is inline with official project maintenance version (better when all fixes are not related to the way the software is packaged)
|
||||
Cons are:
|
||||
- The patch include more than the only one security reported fxes
|
||||
- The patch include more than the only one security reported fixes
|
||||
|
||||
So I just need to know if it's ok to push such a version 3.5.7 (fixes for 3.5.* branch) instead of only one fix for only the few (the only) reported debian bugs,
|
||||
since it provides more stability and is for me a more secured process.
|
||||
"
|
||||
|
||||
##### Send an request to ask a simple fix of a stable package
|
||||
|
||||
Use this to ask to apply patches on a stable version.
|
||||
|
||||
reportbug -B debian --smtphost=smtp.gmail.com:587 --smtpuser=xxxx --smtppasswd=yyyy --tls
|
||||
Choose package "release.debian.org"
|
||||
Then usertag "jessie-pu" (if tags is not available in list, choose another one, and change it later into email content text)
|
||||
Then name of package "dolibarr"
|
||||
Fill message, for example:
|
||||
"Please unblock package dolibarr
|
||||
A security error CVE-2015-3935 was reported and is fixed into package 3.5.7.
|
||||
Note that package 3.5.7 contains not only fixed for bugs reported to debian. It includes other fixes, but they are all related to stability or security,
|
||||
so it is a better solution to validate this maintenance release than applying a patch of the only CVE-2015-3935.
|
||||
After discussion with ..., it appears that security holes are enough to request this unblock request."
|
||||
|
||||
Note: If there is a response to ask more information, don't forget to remove the tag during answer.
|
||||
|
||||
@@ -10,12 +10,13 @@ Build-Depends: debhelper (>= 9), po-debconf
|
||||
|
||||
Package: dolibarr
|
||||
Architecture: all
|
||||
Depends: libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php,
|
||||
php-cli,
|
||||
# For debian 7 or 8 or 9
|
||||
Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5 | libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php,
|
||||
php5-cli | php-cli,
|
||||
# Required PHP extensions
|
||||
php-mysql | php-mysqli, php-curl, php-gd, php-ldap,
|
||||
php5-mysql | php5-mysqli | php-mysql | php-mysqli, php5-curl | php-curl, php5-gd | php-gd, php5-ldap | php-gd,
|
||||
# Required PHP libraries
|
||||
php-pear, php-mail-mime, php-xml, php-mbstring,
|
||||
php-pear, php-mail-mime,
|
||||
# php-tcpdf,
|
||||
# libfpdf-tpl-php, php-fpdf,
|
||||
# libphp-adodb,
|
||||
@@ -30,7 +31,9 @@ Depends: libapache2-mod-php | libapache2-mod-phpfilter | php-cgi | php-fpm | php
|
||||
${misc:Depends},
|
||||
${perl:Depends}
|
||||
Recommends: apache2 | lighttpd | httpd,
|
||||
mariadb-server | virtual-mysql-server
|
||||
mariadb-server | virtual-mysql-server,
|
||||
# Required PHP extensions for debian 9 but we can't add them into a Depends, it does not exists on debian 7 and 8
|
||||
php-xml, php-mbstring
|
||||
Suggests: www-browser, php5-geoip
|
||||
Description: Web based software to manage a company or foundation
|
||||
Dolibarr ERP & CRM is an easy to use open source/free software package for
|
||||
|
||||
@@ -61,7 +61,7 @@ apache_install() {
|
||||
# Enable dolibarr conf
|
||||
if which a2enconf >/dev/null 2>&1 ;then
|
||||
# a2enconf exists for ubuntu only
|
||||
echo "Enable link for Apache config file with a3enconf"
|
||||
echo "Enable link for Apache config file with a2enconf"
|
||||
a2enconf dolibarr
|
||||
else
|
||||
if [ -d /etc/$webserver/conf.d ] && [ ! -e /etc/$webserver/conf.d/dolibarr.conf ]; then
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
$force_install_packager='deb';
|
||||
$force_install_noedit=2;
|
||||
$force_install_noedit=1;
|
||||
$force_install_message='KeepDefaultValuesDeb';
|
||||
#$force_install_main_data_root='/usr/share/dolibarr/documents';
|
||||
$force_install_main_data_root='/var/lib/dolibarr/documents';
|
||||
|
||||
@@ -4,7 +4,12 @@ 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/jsgantt/jsgantt.js *
|
||||
source-is-missing htdocs/includes/jquery/plugins/colorpicker/jquery.colorpicker.js *
|
||||
source-is-missing htdocs/includes/jquery/plugins/select2/select2.js *
|
||||
source-is-missing htdocs/includes/jquery/plugins/select2/select2_locale_ar.js *
|
||||
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/includes/mobiledetect/mobiledetectlib/Mobile_Detect.json
|
||||
source-is-missing htdocs/includes/restler/framework/Luracast/Restler/explorer/lib/*.js
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -40,55 +40,117 @@ require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php");
|
||||
* Main
|
||||
*/
|
||||
|
||||
if (empty($argv[1]))
|
||||
{
|
||||
print "Usage: ".$script_file." release=x.y.z\n";
|
||||
exit -1;
|
||||
}
|
||||
parse_str($argv[1]);
|
||||
$includecustom=0;
|
||||
$includeconstants=array();
|
||||
|
||||
if ($release != DOL_VERSION)
|
||||
if (empty($argv[1]))
|
||||
{
|
||||
print 'Error: release is not version declared into filefunc.in.php.'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||
exit -1;
|
||||
}
|
||||
$i=0;
|
||||
while ($i < $argc)
|
||||
{
|
||||
if (! empty($argv[$i])) parse_str($argv[$i]);
|
||||
if (preg_match('/includeconstant=/',$argv[$i]))
|
||||
{
|
||||
$tmp=explode(':', $includeconstant, 3);
|
||||
if (count($tmp) != 3)
|
||||
{
|
||||
print "Error: Bad parameter includeconstant ".$includeconstant."\n";
|
||||
exit -1;
|
||||
}
|
||||
$includeconstants[$tmp[0]][$tmp[1]] = $tmp[2];
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
if (empty($includecustom))
|
||||
{
|
||||
if (DOL_VERSION != $release)
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! preg_match('/'.preg_quote(DOL_VERSION,'/').'-/',$release))
|
||||
{
|
||||
print 'Error: When parameter "includecustom" is set, version declared into filefunc.inc.php ('.DOL_VERSION.') must be used with a suffix into "release" parmater (ex: '.DOL_VERSION.'-mydistrib).'."\n";
|
||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||
exit -1;
|
||||
}
|
||||
}
|
||||
|
||||
print "Release : ".$release."\n";
|
||||
print "Include custom in signature : ".$includecustom."\n";
|
||||
print "Include constants in signature : ";
|
||||
foreach ($includeconstants as $countrycode => $tmp)
|
||||
{
|
||||
foreach($tmp as $constname => $constvalue)
|
||||
{
|
||||
print $constname.'='.$constvalue." ";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
|
||||
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
|
||||
$outputdir=dirname(__FILE__).'/../htdocs/install';
|
||||
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist*.xml',0,1,1);
|
||||
print 'Delete current files '.$outputdir.'/filelist-'.$release.'.xml'."\n";
|
||||
dol_delete_file($outputdir.'/filelist-'.$release.'.xml',0,1,1);
|
||||
|
||||
$checksumconcat=array();
|
||||
|
||||
$outputfile=$outputdir.'/filelist-'.$release.'.xml';
|
||||
$fp = fopen($outputfile,'w');
|
||||
fputs($fp, '<?xml version="1.0" encoding="UTF-8" ?>'."\n");
|
||||
fputs($fp, '<checksum_list version="'.$release.'">'."\n");
|
||||
fputs($fp, '<checksum_list version="'.$release.'" date="'.dol_print_date(dol_now(), 'dayhourrfc').'" generator="'.$script_file.'">'."\n");
|
||||
|
||||
fputs($fp, '<dolibarr_htdocs_dir>'."\n");
|
||||
foreach ($includeconstants as $countrycode => $tmp)
|
||||
{
|
||||
fputs($fp, '<dolibarr_constants country="'.$countrycode.'">'."\n");
|
||||
foreach($tmp as $constname => $constvalue)
|
||||
{
|
||||
$valueforchecksum=(empty($constvalue)?'0':$constvalue);
|
||||
$checksumconcat[]=$valueforchecksum;
|
||||
fputs($fp, ' <constant name="'.$constname.'">'.$valueforchecksum.'</constant>'."\n");
|
||||
}
|
||||
fputs($fp, '</dolibarr_constants>'."\n");
|
||||
}
|
||||
|
||||
$checksumconcat=array();
|
||||
fputs($fp, '<dolibarr_htdocs_dir includecustom="'.$includecustom.'">'."\n");
|
||||
|
||||
$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||
/*$dir_iterator1 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../htdocs/');
|
||||
$iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
||||
// need to ignore document custom etc
|
||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
*/
|
||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
|
||||
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir='';
|
||||
$needtoclose=0;
|
||||
foreach ($files as $file) {
|
||||
$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
||||
if ($newdir!=$dir) {
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
//$newdir = str_replace(dirname(__FILE__).'/../htdocs', '', dirname($file));
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
if ($newdir!=$dir) {
|
||||
if ($needtoclose)
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, '<dir name="'.$newdir.'" >'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, ' <dir name="'.$newdir.'" >'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose=1;
|
||||
}
|
||||
if (filetype($file)=="file") {
|
||||
$md5=md5_file($file);
|
||||
$checksumconcat[]=$md5;
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
fputs($fp, ' <md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, '</dolibarr_htdocs_dir>'."\n");
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
@@ -102,28 +164,36 @@ $checksumconcat=array();
|
||||
|
||||
fputs($fp, '<dolibarr_script_dir version="'.$release.'">'."\n");
|
||||
|
||||
$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/');
|
||||
// TODO Replace RecursiveDirectoryIterator with dol_dir_list
|
||||
/*$dir_iterator2 = new RecursiveDirectoryIterator(dirname(__FILE__).'/../scripts/');
|
||||
$iterator2 = new RecursiveIteratorIterator($dir_iterator2);
|
||||
// need to ignore document custom etc
|
||||
$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install|nltechno))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
|
||||
$files = new RegexIterator($iterator2, '#^(?:[A-Z]:)?(?:/(?!(?:custom|documents|conf|install))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||
*/
|
||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||
$regextoexclude='(custom|documents|conf|install)$'; // Exclude dirs
|
||||
$files = dol_dir_list(dirname(__FILE__).'/../scripts/', 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
$dir='';
|
||||
$needtoclose=0;
|
||||
foreach ($files as $file) {
|
||||
$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||
foreach ($files as $filetmp) {
|
||||
$file = $filetmp['fullname'];
|
||||
//$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||
$newdir = str_replace(DOL_DOCUMENT_ROOT, '', dirname($file));
|
||||
$newdir = str_replace(dirname(__FILE__).'/../scripts', '', dirname($file));
|
||||
if ($newdir!=$dir) {
|
||||
if ($needtoclose)
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, '<dir name="'.$newdir.'" >'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, ' <dir name="'.$newdir.'" >'."\n");
|
||||
$dir = $newdir;
|
||||
$needtoclose=1;
|
||||
}
|
||||
if (filetype($file)=="file") {
|
||||
$md5=md5_file($file);
|
||||
$checksumconcat[]=$md5;
|
||||
fputs($fp, '<md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
fputs($fp, ' <md5file name="'.basename($file).'">'.$md5.'</md5file>'."\n");
|
||||
}
|
||||
}
|
||||
fputs($fp, '</dir>'."\n");
|
||||
fputs($fp, ' </dir>'."\n");
|
||||
fputs($fp, '</dolibarr_script_dir>'."\n");
|
||||
|
||||
asort($checksumconcat); // Sort list of checksum
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
use Cwd;
|
||||
|
||||
use Term::ANSIColor;
|
||||
|
||||
# Change this to defined target for option 98 and 99
|
||||
$PROJECT="dolibarr";
|
||||
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
$PUBLISHBETARC="ldestailleur\@asso.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||
$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||
|
||||
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@@ -313,20 +313,6 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
|
||||
print "\n";
|
||||
|
||||
# Build xml check file
|
||||
#-----------------------
|
||||
if ($CHOOSEDTARGET{'-CHKSUM'})
|
||||
{
|
||||
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
|
||||
$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
|
||||
print $ret."\n";
|
||||
# Copy to final dir
|
||||
$NEWDESTI=$DESTI;
|
||||
print "Copy \"$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml\" to $NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml\n";
|
||||
use File::Copy qw(copy);
|
||||
copy "$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml", "$NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml";
|
||||
}
|
||||
|
||||
|
||||
#print join(',',sort keys %CHOOSEDTARGET)."\n";
|
||||
|
||||
@@ -335,7 +321,10 @@ if ($CHOOSEDTARGET{'-CHKSUM'})
|
||||
$nboftargetok=0;
|
||||
$nboftargetneedbuildroot=0;
|
||||
$nbofpublishneedtag=0;
|
||||
$nbofpublishneedchangelog=0;
|
||||
|
||||
foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
if ($target eq '-CHKSUM') { $nbofpublishneedchangelog++; }
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
|
||||
{
|
||||
@@ -345,34 +334,31 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
}
|
||||
foreach my $target (sort keys %CHOOSEDPUBLISH) {
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
if ($target eq 'ASSO') { $nbofpublishneedtag++; }
|
||||
if ($target eq 'SF') { $nbofpublishneedtag++; }
|
||||
if ($target eq 'ASSO') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||
if ($target eq 'SF') { $nbofpublishneedchangelog++; $nbofpublishneedtag++; }
|
||||
$nboftargetok++;
|
||||
}
|
||||
|
||||
|
||||
if ($nboftargetok) {
|
||||
|
||||
# Update GIT tag if required
|
||||
#---------------------------
|
||||
if ($nbofpublishneedtag)
|
||||
# Check Changelog
|
||||
#----------------
|
||||
if ($nbofpublishneedchangelog)
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
|
||||
# Test that the ChangeLog is ok
|
||||
$TMPBUILDTOCHECKCHANGELOG=$BUILD;
|
||||
$TMPBUILDTOCHECKCHANGELOG =~ s/\-rc\d*//;
|
||||
$TMPBUILDTOCHECKCHANGELOG =~ s/\-beta\d*//;
|
||||
print "Check if ChangeLog is ok for version $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG\n";
|
||||
print "\nCheck if ChangeLog is ok for version $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG\n";
|
||||
$ret=`grep "ChangeLog for $MAJOR.$MINOR\.$TMPBUILDTOCHECKCHANGELOG" "$SOURCE/ChangeLog" 2>&1`;
|
||||
if (! $ret)
|
||||
{
|
||||
print "Error: The ChangeLogFile was not updated. Run the following command before building package for $MAJOR.$MINOR.$BUILD:\n";
|
||||
print color("yellow"), "Error: The ChangeLogFile was not updated. Run the following command before building package for $MAJOR.$MINOR.$BUILD:\n", color('reset');
|
||||
}
|
||||
else
|
||||
{
|
||||
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with commande:'\n";
|
||||
print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with command:'\n";
|
||||
}
|
||||
if (! $BUILD || $BUILD eq '0-rc') # For a major version
|
||||
{
|
||||
@@ -385,9 +371,39 @@ if ($nboftargetok) {
|
||||
print "\n";
|
||||
if (! $ret)
|
||||
{
|
||||
exit;
|
||||
print "\nPress F to force and continue anyway (or other key to stop)... ";
|
||||
my $WAITKEY=<STDIN>;
|
||||
chomp($WAITKEY);
|
||||
if ($WAITKEY ne 'F')
|
||||
{
|
||||
print "Canceled.\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Build xml check file
|
||||
#-----------------------
|
||||
if ($CHOOSEDTARGET{'-CHKSUM'})
|
||||
{
|
||||
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n";
|
||||
$ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`;
|
||||
print $ret."\n";
|
||||
# Copy to final dir
|
||||
$NEWDESTI=$DESTI;
|
||||
print "Copy \"$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml\" to $NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml\n";
|
||||
use File::Copy qw(copy);
|
||||
copy "$SOURCE/htdocs/install/filelist-$MAJOR.$MINOR.$BUILD.xml", "$NEWDESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml";
|
||||
}
|
||||
|
||||
# Update GIT tag if required
|
||||
#---------------------------
|
||||
if ($nbofpublishneedtag)
|
||||
{
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
|
||||
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
|
||||
if ($ret =~ /(already exists|existe déjà)/)
|
||||
@@ -509,7 +525,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
||||
|
||||
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/custom/*`; # For custom we want to keep dir
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/ancotec*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/cabinetmed*`;
|
||||
@@ -518,6 +533,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimed*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/dolimod*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/factory*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/forceproject*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/lead*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/management*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/multicompany*`;
|
||||
@@ -532,8 +548,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||
# Removed other test files
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/eldy/*.new`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/api/explorer`; # This is a dev tool
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||
@@ -547,13 +561,12 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extensions/TableTools/swf`; # Source of this flash is not available
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/datatables/extras/TableTools/swf`; # Source of this flash is not available
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
||||
@@ -566,14 +579,19 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/savant`;
|
||||
|
||||
print "Remove subdir of custom dir\n";
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
@@ -892,9 +910,6 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mike42/escpos-php/LICENSE.md`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/mobiledetect/mobiledetectlib/LICENSE.txt`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-20120503/COPYING`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_2.0/COPYING`;
|
||||
# Removed files we don't need
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
|
||||
|
||||
@@ -957,13 +972,12 @@ if ($nboftargetok) {
|
||||
$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/dev/skeletons/modMyModule.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_api_class.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_card.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_class.class.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_list.php`;
|
||||
$ret=`chmod -R 755 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_script.php`;
|
||||
$ret=`chmod -R 644 $BUILDROOT/$PROJECT.tmp/dev/skeletons/skeleton_webservice_server.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/class/myobject_api_class.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/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/myobject.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 {} \\; ";
|
||||
|
||||
@@ -7,20 +7,20 @@
|
||||
</MASTER_PAD_VERSION_INFO>
|
||||
<Company_Info>
|
||||
<Company_Name>Dolibarr team</Company_Name>
|
||||
<Address_1>11 rue raymond Queneau</Address_1>
|
||||
<Address_1>20 rue camponac</Address_1>
|
||||
<Address_2 />
|
||||
<City_Town>Rueil Malmaison</City_Town>
|
||||
<City_Town>Pessac</City_Town>
|
||||
<State_Province />
|
||||
<Zip_Postal_Code>92500</Zip_Postal_Code>
|
||||
<Zip_Postal_Code>33600</Zip_Postal_Code>
|
||||
<Country>FRANCE</Country>
|
||||
<Company_WebSite_URL>http://www.dolibarr.org</Company_WebSite_URL>
|
||||
<Company_WebSite_URL>https://www.dolibarr.org</Company_WebSite_URL>
|
||||
<Contact_Info>
|
||||
<Author_First_Name>Dolibarr team</Author_First_Name>
|
||||
<Author_Last_Name>Dolibarr team</Author_Last_Name>
|
||||
<Author_Email>dolibarr-dev@nongnu.org</Author_Email>
|
||||
<Author_Email>contact@dolibarr.org</Author_Email>
|
||||
<Contact_First_Name>Dolibarr team</Contact_First_Name>
|
||||
<Contact_Last_Name>Dolibarr team</Contact_Last_Name>
|
||||
<Contact_Email>dolibarr-dev@nongnu.org</Contact_Email>
|
||||
<Contact_Email>contact@dolibarr.org</Contact_Email>
|
||||
</Contact_Info>
|
||||
<Support_Info>
|
||||
<Sales_Email>dolibarr-dev@nongnu.org</Sales_Email>
|
||||
@@ -34,10 +34,10 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>3.5</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Version>5.0</Program_Version>
|
||||
<Program_Release_Month>02</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Release_Year>2017</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
@@ -71,8 +71,8 @@
|
||||
<Char_Desc_45>Dolibarr ERP & CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP & CRM, the easy to use open source software to manage your activity</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP & CRM, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs to manage.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP & CRM is a software built by modules addition (you enable only features you need), to manage small or medium companies, freelancers or foundations. We can say Dolibarr is an ERP or CRM. Dolibarr is also available with an auto-installer for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. See DoliWamp software for this.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP & CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. We can say Dolibarr is an ERP or CRM (or both depending on activated modules). It's an OpenSource project base on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems). Dolibarr differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple:
|
||||
<Char_Desc_450>Dolibarr ERP & CRM is a software package built by modules addition (you enable only features you need), to manage small or medium companies, freelancers or foundations. We can say Dolibarr is an ERP or CRM. Dolibarr is also available with an auto-installer for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. See DoliWamp software for this.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP & CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. We can say Dolibarr is an ERP or CRM (or both depending on activated modules). It's an OpenSource project base on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems). Dolibarr differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, Odoo, Neogia, Compiere, etc) because everything was made to be more simple:
|
||||
Simple to install
|
||||
Simple to use
|
||||
Simple to develop
|
||||
@@ -101,14 +101,14 @@ Dolibarr intègre en effet sa propre architecture (design patterns) permettant
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>http://www.dolibarr.org/files/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
<Application_Info_URL>https://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>https://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>https://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>https://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>https://www.dolibarr.org/files/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>http://www.dolibarr.org/files/dolibarr.tgz</Primary_Download_URL>
|
||||
<Primary_Download_URL>https://www.dolibarr.org/files/dolibarr.tgz</Primary_Download_URL>
|
||||
<Secondary_Download_URL>http://www.dolibarr.org/files/dolibarr.tgz</Secondary_Download_URL>
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
|
||||
232
build/pad/pad_dolibarr_nos.xml
Normal file
@@ -0,0 +1,232 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XML_DIZ_INFO>
|
||||
<MASTER_PAD_VERSION_INFO>
|
||||
<MASTER_PAD_VERSION>3.11</MASTER_PAD_VERSION>
|
||||
<MASTER_PAD_EDITOR>PADGen 3.1.1.47 http://www.padgen.org</MASTER_PAD_EDITOR>
|
||||
<MASTER_PAD_INFO>Portable Application Description, or PAD for short, is a data set that is used by shareware authors to disseminate information to anyone interested in their software products. To find out more go to http://pad.asp-software.org</MASTER_PAD_INFO>
|
||||
</MASTER_PAD_VERSION_INFO>
|
||||
<Company_Info>
|
||||
<Company_Name>Dolibarr team</Company_Name>
|
||||
<Address_1>20 rue camponac</Address_1>
|
||||
<Address_2 />
|
||||
<City_Town>Pessac</City_Town>
|
||||
<State_Province />
|
||||
<Zip_Postal_Code>33600</Zip_Postal_Code>
|
||||
<Country>FRANCE</Country>
|
||||
<Company_WebSite_URL>https://www.dolibarr.org</Company_WebSite_URL>
|
||||
<Contact_Info>
|
||||
<Author_First_Name>Dolibarr team</Author_First_Name>
|
||||
<Author_Last_Name>Dolibarr team</Author_Last_Name>
|
||||
<Author_Email>contact@dolibarr.org</Author_Email>
|
||||
<Contact_First_Name>Dolibarr team</Contact_First_Name>
|
||||
<Contact_Last_Name>Dolibarr team</Contact_Last_Name>
|
||||
<Contact_Email>contact@dolibarr.org</Contact_Email>
|
||||
</Contact_Info>
|
||||
<Support_Info>
|
||||
<Sales_Email>dolibarr-dev@nongnu.org</Sales_Email>
|
||||
<Support_Email>dolibarr-dev@nongnu.org</Support_Email>
|
||||
<General_Email>dolibarr-dev@nongnu.org</General_Email>
|
||||
<Sales_Phone />
|
||||
<Support_Phone />
|
||||
<General_Phone />
|
||||
<Fax_Phone />
|
||||
</Support_Info>
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>Dolibarr</Program_Name>
|
||||
<Program_Version>5.0</Program_Version>
|
||||
<Program_Release_Month>02</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2017</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
<Program_Type>Freeware</Program_Type>
|
||||
<Program_Release_Status>Major Update</Program_Release_Status>
|
||||
<Program_Install_Support>No Install Support</Program_Install_Support>
|
||||
<Program_OS_Support>Linux,Mac OS X,Mac Other,Unix,Win2000,Win7 x32,Win7 x64,Win98,WinOther,WinServer,WinVista,WinVista x64,WinXP,Other</Program_OS_Support>
|
||||
<Program_Language>English,Arabic,Catalan,Chinese,Danish,Dutch,Finnish,French,German,Greek,Icelandic,Italian,Norwegian,Polish,Portuguese,Romanian,Russian,Slovenian,Spanish,Swedish,Turkish</Program_Language>
|
||||
<Program_Change_Info>Increase performances, Setup process is easier, Reduce number of clicks required to use software</Program_Change_Info>
|
||||
<Program_Specific_Category>Business</Program_Specific_Category>
|
||||
<Program_Category_Class>Business::Accounting & Finance</Program_Category_Class>
|
||||
<Program_System_Requirements>None</Program_System_Requirements>
|
||||
<File_Info>
|
||||
<File_Size_Bytes>18037439</File_Size_Bytes>
|
||||
<File_Size_K>18037</File_Size_K>
|
||||
<File_Size_MB>18.03</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
<Expire_Count />
|
||||
<Expire_Based_On>Days</Expire_Based_On>
|
||||
<Expire_Other_Info />
|
||||
<Expire_Month />
|
||||
<Expire_Day />
|
||||
<Expire_Year />
|
||||
</Expire_Info>
|
||||
</Program_Info>
|
||||
<Program_Descriptions>
|
||||
<English>
|
||||
<Keywords>dolibarr, erp, crm, invoices, commercial proposals, orders, accounting, stock, products, agenda, bank, business, company, foundation, management, sme, doliwamp</Keywords>
|
||||
<Char_Desc_45>Dolibarr ERP & CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP & CRM, the easy to use open source software to manage your activity</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP & CRM, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs to manage.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP & CRM is a software package built by modules addition (you enable only features you need), to manage small or medium companies, freelancers or foundations. We can say Dolibarr is an ERP or CRM. Dolibarr is also available with an auto-installer for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. See DoliWamp software for this.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP & CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations. We can say Dolibarr is an ERP or CRM (or both depending on activated modules). It's an OpenSource project base on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems). Dolibarr differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple:
|
||||
Simple to install
|
||||
Simple to use
|
||||
Simple to develop
|
||||
Note that Dolibarr is also available with an auto-installer for Windows or Ubuntu users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. This version is called DoliWamp (for Windows) or DoliBuntu (for Ubuntu/Debian).</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
<Keywords>dolibarr, erp, crm, invoices, commercial proposals, orders, accounting, stock, products, agenda, bank, business, company, foundation, management, sme, doliwamp</Keywords>
|
||||
<Char_Desc_45>Dolibarr ERP & CRM</Char_Desc_45>
|
||||
<Char_Desc_80>Dolibarr ERP & CRM, le gestionnaire simple pour gérer votre activité</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr ERP & CRM, le logiciel simple et OpenSource pour gérer votre activité (factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations)</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr ERP & CRM est un logiciel modulaire (on n'active que les fonctions que l'on désire) de gestions de TPE/PME, d'indépendants, d'entrepreneurs ou d'associations. En terme plus techniques, c'est un ERP et CRM. C'est un projet OpenSource qui s'exécute au sein d'un serveur Web et peut donc être accessible depuis n'importe quel lieu disposant d'une connexion Internet (Projet basé sur un serveur WAMP, MAMP ou LAMP: Apache, MySQL, PHP).</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr ERP & CRM est un logiciel modulaire (on n'active que les fonctions que l'on désire) de gestions de TPE/PME, d'indépendants, d'entrepreneurs ou d'associations. En terme plus techniques, c'est un ERP et CRM. C'est un projet OpenSource qui s'exécute au sein d'un serveur Web et peut donc être accessible depuis n'importe quel lieu disposant d'une connexion Internet (Projet basé sur un serveur WAMP, MAMP ou LAMP: Apache, MySQL, PHP). Dolibarr vient compléter les offres déjà nombreuses de logiciels de cette catégorie (comme OpenBravo, OpenERP, SugarCRM, Neogia, Compiere, etc.) mais se démarque par le fait qu'ici tout est fait pour offrir de la simplicité (règle des 3 S):
|
||||
Simple pour l'installation (avec au choix des installeurs clé en main pour ceux qui ignorent comment installer un serveur Web, ou une installation manuelle)
|
||||
Simple pour l'utilisation (fonctions modulaires pour ne pas surcharger les menus, informations claires à la saisie)
|
||||
Simple pour le développement (pas de frameworks lourds).
|
||||
Dolibarr intègre en effet sa propre architecture (design patterns) permettant à tout développeur d'être tout de suite opérationnel sans connaissances particulières autre que le PHP. </Char_Desc_2000>
|
||||
</French>
|
||||
<Italian>
|
||||
<Keywords>erp, crm, gestionale, medie imprese, fondazioni</Keywords>
|
||||
<Char_Desc_45>Gestionale open source e gratuito</Char_Desc_45>
|
||||
<Char_Desc_80>Gestionale open source e gratuito per piccole e medie imprese, fondazioni</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr è un a gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr è un programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr è un programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare. Dolibar è completamente web-based, progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare.</Char_Desc_2000>
|
||||
</Italian>
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>https://www.dolibarr.org</Application_Info_URL>
|
||||
<Application_Order_URL>https://www.dolibarr.org</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>https://www.dolibarr.org/files/pad_dolibarr.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>https://www.dolibarr.org/files/dolibarr.zip</Primary_Download_URL>
|
||||
<Secondary_Download_URL>http://www.dolibarr.org/files/dolibarr.zip</Secondary_Download_URL>
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
</Download_URLs>
|
||||
</Web_Info>
|
||||
<Permissions>
|
||||
<Distribution_Permissions>GNU GPL</Distribution_Permissions>
|
||||
<EULA>GNU GPL</EULA>
|
||||
</Permissions>
|
||||
<Affiliates>
|
||||
<Affiliates_FORM>Y</Affiliates_FORM>
|
||||
<Affiliates_VERSION>1.4</Affiliates_VERSION>
|
||||
<Affiliates_URL>http://pad.asp-software.org/extensions/Affiliates.htm</Affiliates_URL>
|
||||
<Affiliates_Information_Page />
|
||||
<Affiliates_Avangate_Order_Page />
|
||||
<Affiliates_Avangate_Vendor_ID />
|
||||
<Affiliates_Avangate_Product_ID />
|
||||
<Affiliates_Avangate_Maximum_Commission_Rate />
|
||||
<Affiliates_BMTMicro_Order_Page />
|
||||
<Affiliates_BMTMicro_Vendor_ID />
|
||||
<Affiliates_BMTMicro_Product_ID />
|
||||
<Affiliates_BMTMicro_Maximum_Commission_Rate />
|
||||
<Affiliates_Cleverbridge_Order_Page />
|
||||
<Affiliates_Cleverbridge_Vendor_ID />
|
||||
<Affiliates_Cleverbridge_Product_ID />
|
||||
<Affiliates_Cleverbridge_Maximum_Commission_Rate />
|
||||
<Affiliates_clixGalore_Order_Page />
|
||||
<Affiliates_clixGalore_Vendor_ID />
|
||||
<Affiliates_clixGalore_Product_ID />
|
||||
<Affiliates_clixGalore_Maximum_Commission_Rate />
|
||||
<Affiliates_CommissionJunction_Order_Page />
|
||||
<Affiliates_CommissionJunction_Vendor_ID />
|
||||
<Affiliates_CommissionJunction_Product_ID />
|
||||
<Affiliates_CommissionJunction_Maximum_Commission_Rate />
|
||||
<Affiliates_DigiBuy_Order_Page />
|
||||
<Affiliates_DigiBuy_Vendor_ID />
|
||||
<Affiliates_DigiBuy_Product_ID />
|
||||
<Affiliates_DigiBuy_Maximum_Commission_Rate />
|
||||
<Affiliates_DigitalCandle_Order_Page />
|
||||
<Affiliates_DigitalCandle_Vendor_ID />
|
||||
<Affiliates_DigitalCandle_Product_ID />
|
||||
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
|
||||
<Affiliates_Emetrix_Order_Page />
|
||||
<Affiliates_Emetrix_Vendor_ID />
|
||||
<Affiliates_Emetrix_Product_ID />
|
||||
<Affiliates_Emetrix_Maximum_Commission_Rate />
|
||||
<Affiliates_eSellerate_Order_Page />
|
||||
<Affiliates_eSellerate_Vendor_ID />
|
||||
<Affiliates_eSellerate_Product_ID />
|
||||
<Affiliates_eSellerate_Maximum_Commission_Rate />
|
||||
<Affiliates_Kagi_Order_Page />
|
||||
<Affiliates_Kagi_Vendor_ID />
|
||||
<Affiliates_Kagi_Product_ID />
|
||||
<Affiliates_Kagi_Maximum_Commission_Rate />
|
||||
<Affiliates_LinkShare_Order_Page />
|
||||
<Affiliates_LinkShare_Vendor_ID />
|
||||
<Affiliates_LinkShare_Product_ID />
|
||||
<Affiliates_LinkShare_Maximum_Commission_Rate />
|
||||
<Affiliates_NorthStarSol_Order_Page />
|
||||
<Affiliates_NorthStarSol_Vendor_ID />
|
||||
<Affiliates_NorthStarSol_Product_ID />
|
||||
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
|
||||
<Affiliates_OneNetworkDirect_Order_Page />
|
||||
<Affiliates_OneNetworkDirect_Vendor_ID />
|
||||
<Affiliates_OneNetworkDirect_Product_ID />
|
||||
<Affiliates_OneNetworkDirect_Maximum_Commission_Rate />
|
||||
<Affiliates_Order1_Order_Page />
|
||||
<Affiliates_Order1_Vendor_ID />
|
||||
<Affiliates_Order1_Product_ID />
|
||||
<Affiliates_Order1_Maximum_Commission_Rate />
|
||||
<Affiliates_Osolis_Order_Page />
|
||||
<Affiliates_Osolis_Vendor_ID />
|
||||
<Affiliates_Osolis_Product_ID />
|
||||
<Affiliates_Osolis_Maximum_Commission_Rate />
|
||||
<Affiliates_Plimus_Order_Page />
|
||||
<Affiliates_Plimus_Vendor_ID />
|
||||
<Affiliates_Plimus_Product_ID />
|
||||
<Affiliates_Plimus_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnet_Order_Page />
|
||||
<Affiliates_Regnet_Vendor_ID />
|
||||
<Affiliates_Regnet_Product_ID />
|
||||
<Affiliates_Regnet_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnow_Order_Page />
|
||||
<Affiliates_Regnow_Vendor_ID />
|
||||
<Affiliates_Regnow_Product_ID />
|
||||
<Affiliates_Regnow_Maximum_Commission_Rate />
|
||||
<Affiliates_Regsoft_Order_Page />
|
||||
<Affiliates_Regsoft_Vendor_ID />
|
||||
<Affiliates_Regsoft_Product_ID />
|
||||
<Affiliates_Regsoft_Maximum_Commission_Rate />
|
||||
<Affiliates_ShareIt_Order_Page />
|
||||
<Affiliates_ShareIt_Vendor_ID />
|
||||
<Affiliates_ShareIt_Product_ID />
|
||||
<Affiliates_ShareIt_Maximum_Commission_Rate />
|
||||
<Affiliates_Shareasale_Order_Page />
|
||||
<Affiliates_Shareasale_Vendor_ID />
|
||||
<Affiliates_Shareasale_Product_ID />
|
||||
<Affiliates_Shareasale_Maximum_Commission_Rate />
|
||||
<Affiliates_SWReg_Order_Page />
|
||||
<Affiliates_SWReg_Vendor_ID />
|
||||
<Affiliates_SWReg_Product_ID />
|
||||
<Affiliates_SWReg_Maximum_Commission_Rate />
|
||||
<Affiliates_V-Share_Order_Page />
|
||||
<Affiliates_V-Share_Vendor_ID />
|
||||
<Affiliates_V-Share_Product_ID />
|
||||
<Affiliates_V-Share_Maximum_Commission_Rate />
|
||||
<Affiliates_VFree_Order_Page />
|
||||
<Affiliates_VFree_Vendor_ID />
|
||||
<Affiliates_VFree_Product_ID />
|
||||
<Affiliates_VFree_Maximum_Commission_Rate />
|
||||
<Affiliates_Yaskifo_Order_Page />
|
||||
<Affiliates_Yaskifo_Vendor_ID />
|
||||
<Affiliates_Yaskifo_Product_ID />
|
||||
<Affiliates_Yaskifo_Maximum_Commission_Rate />
|
||||
</Affiliates>
|
||||
<ASP>
|
||||
<ASP_FORM>Y</ASP_FORM>
|
||||
<ASP_Member>N</ASP_Member>
|
||||
<ASP_Member_Number />
|
||||
</ASP>
|
||||
</XML_DIZ_INFO>
|
||||
@@ -7,13 +7,13 @@
|
||||
</MASTER_PAD_VERSION_INFO>
|
||||
<Company_Info>
|
||||
<Company_Name>NLTechno</Company_Name>
|
||||
<Address_1>11 Rue raymond Queneau</Address_1>
|
||||
<Address_1>20 Rue Camponac</Address_1>
|
||||
<Address_2 />
|
||||
<City_Town>Rueil Malmaison</City_Town>
|
||||
<City_Town>Pessac</City_Town>
|
||||
<State_Province />
|
||||
<Zip_Postal_Code>92500</Zip_Postal_Code>
|
||||
<Zip_Postal_Code>33600</Zip_Postal_Code>
|
||||
<Country>FRANCE</Country>
|
||||
<Company_WebSite_URL>http://www.nltechno.com</Company_WebSite_URL>
|
||||
<Company_WebSite_URL>https://www.dolibarr.org</Company_WebSite_URL>
|
||||
<Contact_Info>
|
||||
<Author_First_Name>NLTechno</Author_First_Name>
|
||||
<Author_Last_Name>NLTechno</Author_Last_Name>
|
||||
@@ -34,10 +34,10 @@
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>3.5</Program_Version>
|
||||
<Program_Release_Month>01</Program_Release_Month>
|
||||
<Program_Version>5.0</Program_Version>
|
||||
<Program_Release_Month>02</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2014</Program_Release_Year>
|
||||
<Program_Release_Year>2017</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
@@ -53,7 +53,7 @@
|
||||
<File_Info>
|
||||
<File_Size_Bytes>26048004</File_Size_Bytes>
|
||||
<File_Size_K>25437</File_Size_K>
|
||||
<File_Size_MB>24.84</File_Size_MB>
|
||||
<File_Size_MB>45.84</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
@@ -72,7 +72,7 @@
|
||||
<Char_Desc_80>DoliWamp, the easy to use Dolibarr for Windows to manage your company,foundation</Char_Desc_80>
|
||||
<Char_Desc_250>DoliWamp is the Dolibarr ERP/CRM for Windows, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs.</Char_Desc_250>
|
||||
<Char_Desc_450>DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations.</Char_Desc_450>
|
||||
<Char_Desc_2000>DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP & CRM is a software built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop.
|
||||
<Char_Desc_2000>DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP & CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop.
|
||||
DoliWamp is the auto-installer for Windows users with no technical knowledge to install Dolibarr ERP/CRM and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file.</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
@@ -96,12 +96,12 @@ DoliWamp is the auto-installer for Windows users with no technical knowledge to
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.nltechno.com/doliwamp/</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.nltechno.com/doliwamp/</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>http://www.dolibarr.org/files/pad_doliwamp.xml</Application_XML_File_URL>
|
||||
<Application_Screenshot_URL>https://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>https://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>https://www.dolibarr.org/files/pad_doliwamp.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>http://www.dolibarr.org/files/doliwamp.exe</Primary_Download_URL>
|
||||
<Primary_Download_URL>https://www.dolibarr.org/files/doliwamp.exe</Primary_Download_URL>
|
||||
<Secondary_Download_URL>http://www.dolibarr.org/files/doliwamp.exe</Secondary_Download_URL>
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
|
||||
225
build/pad/pad_doliwamp_nos.xml
Normal file
@@ -0,0 +1,225 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XML_DIZ_INFO>
|
||||
<MASTER_PAD_VERSION_INFO>
|
||||
<MASTER_PAD_VERSION>3.11</MASTER_PAD_VERSION>
|
||||
<MASTER_PAD_EDITOR>PADGen 3.1.1.47 http://www.padgen.org</MASTER_PAD_EDITOR>
|
||||
<MASTER_PAD_INFO>Portable Application Description, or PAD for short, is a data set that is used by shareware authors to disseminate information to anyone interested in their software products. To find out more go to http://pad.asp-software.org</MASTER_PAD_INFO>
|
||||
</MASTER_PAD_VERSION_INFO>
|
||||
<Company_Info>
|
||||
<Company_Name>NLTechno</Company_Name>
|
||||
<Address_1>20 Rue Camponac</Address_1>
|
||||
<Address_2 />
|
||||
<City_Town>Pessac</City_Town>
|
||||
<State_Province />
|
||||
<Zip_Postal_Code>33600</Zip_Postal_Code>
|
||||
<Country>FRANCE</Country>
|
||||
<Company_WebSite_URL>https://www.dolibarr.org</Company_WebSite_URL>
|
||||
<Contact_Info>
|
||||
<Author_First_Name>NLTechno</Author_First_Name>
|
||||
<Author_Last_Name>NLTechno</Author_Last_Name>
|
||||
<Author_Email>contact@nltechno.com</Author_Email>
|
||||
<Contact_First_Name>NLTechno</Contact_First_Name>
|
||||
<Contact_Last_Name>NLTechno</Contact_Last_Name>
|
||||
<Contact_Email>contact@nltechno.com</Contact_Email>
|
||||
</Contact_Info>
|
||||
<Support_Info>
|
||||
<Sales_Email>support@nltechno.com</Sales_Email>
|
||||
<Support_Email>support@nltechno.com</Support_Email>
|
||||
<General_Email>support@nltechno.com</General_Email>
|
||||
<Sales_Phone />
|
||||
<Support_Phone />
|
||||
<General_Phone />
|
||||
<Fax_Phone />
|
||||
</Support_Info>
|
||||
</Company_Info>
|
||||
<Program_Info>
|
||||
<Program_Name>DoliWamp</Program_Name>
|
||||
<Program_Version>5.0</Program_Version>
|
||||
<Program_Release_Month>02</Program_Release_Month>
|
||||
<Program_Release_Day>01</Program_Release_Day>
|
||||
<Program_Release_Year>2017</Program_Release_Year>
|
||||
<Program_Cost_Dollars />
|
||||
<Program_Cost_Other_Code />
|
||||
<Program_Cost_Other />
|
||||
<Program_Type>Freeware</Program_Type>
|
||||
<Program_Release_Status>Major Update</Program_Release_Status>
|
||||
<Program_Install_Support>Install and Uninstall</Program_Install_Support>
|
||||
<Program_OS_Support>Win2000,Win7 x32,Win7 x64,Win98,WinOther,WinServer,WinVista,WinVista x64,WinXP,Other</Program_OS_Support>
|
||||
<Program_Language>English,Arabic,Catalan,Chinese,Dutch,Finnish,French,German,Icelandic,Italian,Norwegian,Polish,Portuguese,Romanian,Russian,Slovenian,Spanish,Swedish,Turkish</Program_Language>
|
||||
<Program_Change_Info>Increase performances, Setup process is easier, Reduce number of clicks required to use software</Program_Change_Info>
|
||||
<Program_Specific_Category>Business</Program_Specific_Category>
|
||||
<Program_Category_Class>Business::Accounting & Finance</Program_Category_Class>
|
||||
<Program_System_Requirements>None</Program_System_Requirements>
|
||||
<File_Info>
|
||||
<File_Size_Bytes>26048004</File_Size_Bytes>
|
||||
<File_Size_K>25437</File_Size_K>
|
||||
<File_Size_MB>45.84</File_Size_MB>
|
||||
</File_Info>
|
||||
<Expire_Info>
|
||||
<Has_Expire_Info>N</Has_Expire_Info>
|
||||
<Expire_Count />
|
||||
<Expire_Based_On>Days</Expire_Based_On>
|
||||
<Expire_Other_Info />
|
||||
<Expire_Month />
|
||||
<Expire_Day />
|
||||
<Expire_Year />
|
||||
</Expire_Info>
|
||||
</Program_Info>
|
||||
<Program_Descriptions>
|
||||
<English>
|
||||
<Keywords>doliwamp, dolibarr, erp, crm, invoices, commercial proposals, orders, accounting, stock, products, agenda, bank, business, company, foundation, management</Keywords>
|
||||
<Char_Desc_45>DoliWamp, Dolibarr ERP/CRM for Windows</Char_Desc_45>
|
||||
<Char_Desc_80>DoliWamp, the easy to use Dolibarr for Windows to manage your company,foundation</Char_Desc_80>
|
||||
<Char_Desc_250>DoliWamp is the Dolibarr ERP/CRM for Windows, the easy to use open source software to manage your activity (invoices, customers, suppliers, contracts, agenda, emailings...) and any other things a small or mid-sized business or a foundation needs.</Char_Desc_250>
|
||||
<Char_Desc_450>DoliWamp is the Dolibarr ERP/CRM autoinstaller for Windows users with no technical knowledge to install Dolibarr and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file. Dolibarr ERP/CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations.</Char_Desc_450>
|
||||
<Char_Desc_2000>DoliWamp is the Dolibarr ERP/CRM for Windows. Dolibarr ERP & CRM is a software package built by modules addition (you enable only features you need), to manage small or mid-sized businesses, freelancers or foundations (You can manage or follow contacts, invoices, orders, commercial proposals, products, stock management, agenda, mass emailings, members of a foundation, bank accounts...). Based on a WAMP, MAMP or LAMP server (Apache, Mysql, PHP for all Operating Systems), you can install it as a standalone program or use it from anywhere with any web browser. Dolibarr is an OpenSource project. It differs from other ERP or CRM softwares (like OpenAguila, OpenBravo, OpenERP, Neogia, Compiere, etc) because everything was made to be more simple: Simple to install, Simple to use, Simple to develop.
|
||||
DoliWamp is the auto-installer for Windows users with no technical knowledge to install Dolibarr ERP/CRM and all its prerequisites (Apache, Mysql, PHP) with just one auto-exe file.</Char_Desc_2000>
|
||||
</English>
|
||||
<French>
|
||||
<Keywords>doliwamp, dolibarr, erp, crm, factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations, entreprises, PME, TPE</Keywords>
|
||||
<Char_Desc_45>DoliWamp, Dolibarr ERP/CRM pour Windows</Char_Desc_45>
|
||||
<Char_Desc_80>DoliWamp, la distribution de Dolibarr pour gérer votre entreprise ou association</Char_Desc_80>
|
||||
<Char_Desc_250>DoliWamp est la version spécialisée pour Windows de Dolibarr ERP-CRM, le logiciel simple et OpenSource pour gérer votre activité (factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations)</Char_Desc_250>
|
||||
<Char_Desc_450>DoliWamp est la version spécialisée pour Windows de Dolibarr ERP-CRM, le logiciel simple et OpenSource pour gérer votre activité (factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations)</Char_Desc_450>
|
||||
<Char_Desc_2000>DoliWamp est la version spécialisée pour Windows de Dolibarr ERP-CRM, le logiciel simple et OpenSource pour gérer votre activité (factures, devis, facturation, commandes, compta, trésorerie, stocks, produits, agenda, comptes bancaires, associations)</Char_Desc_2000>
|
||||
</French>
|
||||
<Italian>
|
||||
<Keywords>doliwamp, dolibarr, erp, crm, gestionale, medie imprese, fondazioni</Keywords>
|
||||
<Char_Desc_45>DoliWamp, Dolibarr ERP/CRM per Windows</Char_Desc_45>
|
||||
<Char_Desc_80>Gestionale open source e gratuito per piccole e medie imprese, fondazioni</Char_Desc_80>
|
||||
<Char_Desc_250>Dolibarr è un a gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività.</Char_Desc_250>
|
||||
<Char_Desc_450>Dolibarr è un programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare.</Char_Desc_450>
|
||||
<Char_Desc_2000>Dolibarr è un programma gestionale open source e gratuito per piccole e medie imprese, fondazioni e liberi professionisti. Include varie funzionalità per Enterprise Resource Planning e gestione dei clienti (CRM), ma anche ulteriori attività. Dolibar è progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare. Dolibar è completamente web-based, progettato per poter fornire solo ciò di cui hai bisogno ed essere facile da usare.</Char_Desc_2000>
|
||||
</Italian>
|
||||
</Program_Descriptions>
|
||||
<Web_Info>
|
||||
<Application_URLs>
|
||||
<Application_Info_URL>http://www.nltechno.com/doliwamp/</Application_Info_URL>
|
||||
<Application_Order_URL>http://www.nltechno.com/doliwamp/</Application_Order_URL>
|
||||
<Application_Screenshot_URL>http://www.dolibarr.org/images/dolibarr_screenshot1.png</Application_Screenshot_URL>
|
||||
<Application_Icon_URL>http://www.dolibarr.org/images/dolibarr.gif</Application_Icon_URL>
|
||||
<Application_XML_File_URL>https://www.dolibarr.org/files/pad_doliwamp.xml</Application_XML_File_URL>
|
||||
</Application_URLs>
|
||||
<Download_URLs>
|
||||
<Primary_Download_URL>https://www.dolibarr.org/files/doliwamp.exe</Primary_Download_URL>
|
||||
<Secondary_Download_URL>http://www.dolibarr.org/files/doliwamp.exe</Secondary_Download_URL>
|
||||
<Additional_Download_URL_1 />
|
||||
<Additional_Download_URL_2 />
|
||||
</Download_URLs>
|
||||
</Web_Info>
|
||||
<Permissions>
|
||||
<Distribution_Permissions>GNU GPL</Distribution_Permissions>
|
||||
<EULA>GNU GPL</EULA>
|
||||
</Permissions>
|
||||
<Affiliates>
|
||||
<Affiliates_FORM>Y</Affiliates_FORM>
|
||||
<Affiliates_VERSION>1.4</Affiliates_VERSION>
|
||||
<Affiliates_URL>http://pad.asp-software.org/extensions/Affiliates.htm</Affiliates_URL>
|
||||
<Affiliates_Information_Page />
|
||||
<Affiliates_Avangate_Order_Page />
|
||||
<Affiliates_Avangate_Vendor_ID />
|
||||
<Affiliates_Avangate_Product_ID />
|
||||
<Affiliates_Avangate_Maximum_Commission_Rate />
|
||||
<Affiliates_BMTMicro_Order_Page />
|
||||
<Affiliates_BMTMicro_Vendor_ID />
|
||||
<Affiliates_BMTMicro_Product_ID />
|
||||
<Affiliates_BMTMicro_Maximum_Commission_Rate />
|
||||
<Affiliates_Cleverbridge_Order_Page />
|
||||
<Affiliates_Cleverbridge_Vendor_ID />
|
||||
<Affiliates_Cleverbridge_Product_ID />
|
||||
<Affiliates_Cleverbridge_Maximum_Commission_Rate />
|
||||
<Affiliates_clixGalore_Order_Page />
|
||||
<Affiliates_clixGalore_Vendor_ID />
|
||||
<Affiliates_clixGalore_Product_ID />
|
||||
<Affiliates_clixGalore_Maximum_Commission_Rate />
|
||||
<Affiliates_CommissionJunction_Order_Page />
|
||||
<Affiliates_CommissionJunction_Vendor_ID />
|
||||
<Affiliates_CommissionJunction_Product_ID />
|
||||
<Affiliates_CommissionJunction_Maximum_Commission_Rate />
|
||||
<Affiliates_DigiBuy_Order_Page />
|
||||
<Affiliates_DigiBuy_Vendor_ID />
|
||||
<Affiliates_DigiBuy_Product_ID />
|
||||
<Affiliates_DigiBuy_Maximum_Commission_Rate />
|
||||
<Affiliates_DigitalCandle_Order_Page />
|
||||
<Affiliates_DigitalCandle_Vendor_ID />
|
||||
<Affiliates_DigitalCandle_Product_ID />
|
||||
<Affiliates_DigitalCandle_Maximum_Commission_Rate />
|
||||
<Affiliates_Emetrix_Order_Page />
|
||||
<Affiliates_Emetrix_Vendor_ID />
|
||||
<Affiliates_Emetrix_Product_ID />
|
||||
<Affiliates_Emetrix_Maximum_Commission_Rate />
|
||||
<Affiliates_eSellerate_Order_Page />
|
||||
<Affiliates_eSellerate_Vendor_ID />
|
||||
<Affiliates_eSellerate_Product_ID />
|
||||
<Affiliates_eSellerate_Maximum_Commission_Rate />
|
||||
<Affiliates_Kagi_Order_Page />
|
||||
<Affiliates_Kagi_Vendor_ID />
|
||||
<Affiliates_Kagi_Product_ID />
|
||||
<Affiliates_Kagi_Maximum_Commission_Rate />
|
||||
<Affiliates_LinkShare_Order_Page />
|
||||
<Affiliates_LinkShare_Vendor_ID />
|
||||
<Affiliates_LinkShare_Product_ID />
|
||||
<Affiliates_LinkShare_Maximum_Commission_Rate />
|
||||
<Affiliates_NorthStarSol_Order_Page />
|
||||
<Affiliates_NorthStarSol_Vendor_ID />
|
||||
<Affiliates_NorthStarSol_Product_ID />
|
||||
<Affiliates_NorthStarSol_Maximum_Commission_Rate />
|
||||
<Affiliates_OneNetworkDirect_Order_Page />
|
||||
<Affiliates_OneNetworkDirect_Vendor_ID />
|
||||
<Affiliates_OneNetworkDirect_Product_ID />
|
||||
<Affiliates_OneNetworkDirect_Maximum_Commission_Rate />
|
||||
<Affiliates_Order1_Order_Page />
|
||||
<Affiliates_Order1_Vendor_ID />
|
||||
<Affiliates_Order1_Product_ID />
|
||||
<Affiliates_Order1_Maximum_Commission_Rate />
|
||||
<Affiliates_Osolis_Order_Page />
|
||||
<Affiliates_Osolis_Vendor_ID />
|
||||
<Affiliates_Osolis_Product_ID />
|
||||
<Affiliates_Osolis_Maximum_Commission_Rate />
|
||||
<Affiliates_Plimus_Order_Page />
|
||||
<Affiliates_Plimus_Vendor_ID />
|
||||
<Affiliates_Plimus_Product_ID />
|
||||
<Affiliates_Plimus_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnet_Order_Page />
|
||||
<Affiliates_Regnet_Vendor_ID />
|
||||
<Affiliates_Regnet_Product_ID />
|
||||
<Affiliates_Regnet_Maximum_Commission_Rate />
|
||||
<Affiliates_Regnow_Order_Page />
|
||||
<Affiliates_Regnow_Vendor_ID />
|
||||
<Affiliates_Regnow_Product_ID />
|
||||
<Affiliates_Regnow_Maximum_Commission_Rate />
|
||||
<Affiliates_Regsoft_Order_Page />
|
||||
<Affiliates_Regsoft_Vendor_ID />
|
||||
<Affiliates_Regsoft_Product_ID />
|
||||
<Affiliates_Regsoft_Maximum_Commission_Rate />
|
||||
<Affiliates_ShareIt_Order_Page />
|
||||
<Affiliates_ShareIt_Vendor_ID />
|
||||
<Affiliates_ShareIt_Product_ID />
|
||||
<Affiliates_ShareIt_Maximum_Commission_Rate />
|
||||
<Affiliates_Shareasale_Order_Page />
|
||||
<Affiliates_Shareasale_Vendor_ID />
|
||||
<Affiliates_Shareasale_Product_ID />
|
||||
<Affiliates_Shareasale_Maximum_Commission_Rate />
|
||||
<Affiliates_SWReg_Order_Page />
|
||||
<Affiliates_SWReg_Vendor_ID />
|
||||
<Affiliates_SWReg_Product_ID />
|
||||
<Affiliates_SWReg_Maximum_Commission_Rate />
|
||||
<Affiliates_V-Share_Order_Page />
|
||||
<Affiliates_V-Share_Vendor_ID />
|
||||
<Affiliates_V-Share_Product_ID />
|
||||
<Affiliates_V-Share_Maximum_Commission_Rate />
|
||||
<Affiliates_VFree_Order_Page />
|
||||
<Affiliates_VFree_Vendor_ID />
|
||||
<Affiliates_VFree_Product_ID />
|
||||
<Affiliates_VFree_Maximum_Commission_Rate />
|
||||
<Affiliates_Yaskifo_Order_Page />
|
||||
<Affiliates_Yaskifo_Vendor_ID />
|
||||
<Affiliates_Yaskifo_Product_ID />
|
||||
<Affiliates_Yaskifo_Maximum_Commission_Rate />
|
||||
</Affiliates>
|
||||
<ASP>
|
||||
<ASP_FORM>Y</ASP_FORM>
|
||||
<ASP_Member>N</ASP_Member>
|
||||
<ASP_Member_Number />
|
||||
</ASP>
|
||||
</XML_DIZ_INFO>
|
||||
@@ -18,8 +18,8 @@ License: GPLv3+
|
||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_redhat-fedora/%{name}-%{version}.tgz
|
||||
URL: https://www.dolibarr.org
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_redhat-fedora/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@@ -165,6 +165,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/collab
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
@@ -173,6 +174,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/contrat
|
||||
%_datadir/dolibarr/htdocs/core
|
||||
%_datadir/dolibarr/htdocs/cron
|
||||
%_datadir/dolibarr/htdocs/custom
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
@@ -192,6 +194,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@@ -202,10 +205,12 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
%_datadir/dolibarr/htdocs/resource
|
||||
%_datadir/dolibarr/htdocs/societe
|
||||
%_datadir/dolibarr/htdocs/stripe
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@@ -26,17 +26,17 @@ License: GPL-3.0+
|
||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
URL: https://www.dolibarr.org
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_redhat-fedora/%{name}-%{version}.tgz
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_redhat-fedora/%{name}-%{version}.tgz
|
||||
%else
|
||||
%if 0%{?mdkversion}
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_mandriva/%{name}-%{version}.tgz
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_mandriva/%{name}-%{version}.tgz
|
||||
%else
|
||||
%if 0%{?suse_version}
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_opensuse/%{name}-%{version}.tgz
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_opensuse/%{name}-%{version}.tgz
|
||||
%else
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_generic/%{name}-%{version}.tgz
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_generic/%{name}-%{version}.tgz
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
@@ -245,6 +245,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/collab
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
@@ -253,6 +254,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/contrat
|
||||
%_datadir/dolibarr/htdocs/core
|
||||
%_datadir/dolibarr/htdocs/cron
|
||||
%_datadir/dolibarr/htdocs/custom
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
@@ -272,6 +274,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@@ -282,10 +285,12 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
%_datadir/dolibarr/htdocs/resource
|
||||
%_datadir/dolibarr/htdocs/societe
|
||||
%_datadir/dolibarr/htdocs/stripe
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@@ -18,8 +18,8 @@ License: GPL-3.0+
|
||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_mandriva/%{name}-%{version}.tgz
|
||||
URL: https://www.dolibarr.org
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_mandriva/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@@ -170,6 +170,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/contrat
|
||||
%_datadir/dolibarr/htdocs/core
|
||||
%_datadir/dolibarr/htdocs/cron
|
||||
%_datadir/dolibarr/htdocs/custom
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
@@ -189,6 +190,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@@ -199,10 +201,12 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
%_datadir/dolibarr/htdocs/resource
|
||||
%_datadir/dolibarr/htdocs/societe
|
||||
%_datadir/dolibarr/htdocs/stripe
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@@ -18,8 +18,8 @@ License: GPL-3.0+
|
||||
#Packager: Laurent Destailleur (Eldy) <eldy@users.sourceforge.net>
|
||||
Vendor: Dolibarr dev team
|
||||
|
||||
URL: http://www.dolibarr.org
|
||||
Source0: http://www.dolibarr.org/files/lastbuild/package_rpm_opensuse/%{name}-%{version}.tgz
|
||||
URL: https://www.dolibarr.org
|
||||
Source0: https://www.dolibarr.org/files/lastbuild/package_rpm_opensuse/%{name}-%{version}.tgz
|
||||
Patch0: %{name}-forrpm.patch
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@@ -173,6 +173,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/bookmarks
|
||||
%_datadir/dolibarr/htdocs/cashdesk
|
||||
%_datadir/dolibarr/htdocs/categories
|
||||
%_datadir/dolibarr/htdocs/collab
|
||||
%_datadir/dolibarr/htdocs/comm
|
||||
%_datadir/dolibarr/htdocs/commande
|
||||
%_datadir/dolibarr/htdocs/compta
|
||||
@@ -181,6 +182,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/contrat
|
||||
%_datadir/dolibarr/htdocs/core
|
||||
%_datadir/dolibarr/htdocs/cron
|
||||
%_datadir/dolibarr/htdocs/custom
|
||||
%_datadir/dolibarr/htdocs/don
|
||||
%_datadir/dolibarr/htdocs/ecm
|
||||
%_datadir/dolibarr/htdocs/expedition
|
||||
@@ -200,6 +202,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/loan
|
||||
%_datadir/dolibarr/htdocs/mailmanspip
|
||||
%_datadir/dolibarr/htdocs/margin
|
||||
%_datadir/dolibarr/htdocs/modulebuilder
|
||||
%_datadir/dolibarr/htdocs/multicurrency
|
||||
%_datadir/dolibarr/htdocs/opensurvey
|
||||
%_datadir/dolibarr/htdocs/paybox
|
||||
@@ -210,10 +213,12 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/public
|
||||
%_datadir/dolibarr/htdocs/resource
|
||||
%_datadir/dolibarr/htdocs/societe
|
||||
%_datadir/dolibarr/htdocs/stripe
|
||||
%_datadir/dolibarr/htdocs/supplier_proposal
|
||||
%_datadir/dolibarr/htdocs/support
|
||||
%_datadir/dolibarr/htdocs/theme
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
|
||||
@@ -3,20 +3,18 @@ This file describe changes made on external library after beeing included
|
||||
in Dolibarr root.
|
||||
|
||||
|
||||
|
||||
ALL:
|
||||
----
|
||||
Replace "& new" by "new"
|
||||
Check "DOL_CHANGE"
|
||||
|
||||
|
||||
|
||||
CKEDITOR:
|
||||
---------
|
||||
CKEDITOR (4.6.2):
|
||||
-----------------
|
||||
* In ckeditor/ckeditor/contents.css
|
||||
Replace:
|
||||
margin: 20px;
|
||||
body { ... margin: 20px;
|
||||
With
|
||||
margin: 5px;
|
||||
body { ... margin: 5px;
|
||||
|
||||
|
||||
|
||||
@@ -33,21 +31,6 @@ Replace call to serialize_val with no bugged value
|
||||
|
||||
|
||||
|
||||
FPDI:
|
||||
-----
|
||||
Replace:
|
||||
$this->_readXref($this->_xref, $this->_findXref());
|
||||
with:
|
||||
try {
|
||||
$this->_readXref($this->_xref, $this->_findXref());
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
print $e->getMessage();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
TCPDF:
|
||||
------
|
||||
@@ -56,7 +39,7 @@ define('QR_FIND_FROM_RANDOM', 2);
|
||||
with
|
||||
define('QR_FIND_FROM_RANDOM', false);
|
||||
|
||||
* Removed useless directories (examples, tools)
|
||||
* Removed useless directories ("examples", "tools")
|
||||
|
||||
* Fix
|
||||
// initialize subsetchars
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
#
|
||||
# ldapsearch -h hostname -x
|
||||
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
|
||||
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -W "(objectclass=*)"
|
||||
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -W "(objectclass=*)"
|
||||
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
|
||||
|
||||
|
After Width: | Height: | Size: 48 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
13
dev/resources/iso-normes/sample_FEC_file.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
JOURNALCODE JOURNALLIB ECRITURENUM ECRITUREDATE COMPTENUM COMPTELIB COMPAUXNUM COMPAUXLIB PIECEREF PIECEDATE ECRITURELIB DEBIT CREDIT ECRITURELET DATELET VALIDDATE MONTANTDEVISE IDEVISE
|
||||
Banque Banque 17293 20170109 401PPRO PUBLI-PROV L08 20170109 PPRO domiciliation 1TR 187,20 0,00 20170109
|
||||
Banque Banque 17293 20170109 5121CRA CR AGRICOLE L08 20170109 PPRO domiciliation 1TR 0,00 187,20 20170109
|
||||
Banque Banque 17295 20170109 401ORPA ORANGE PARIS Report 20170109 ORPA adsl par 12 96,00 0,00 20170109
|
||||
Banque Banque 17295 20170109 5121CRA CR AGRICOLE Report 20170109 ORPA adsl par 12 0,00 96,00 20170109
|
||||
Banque Banque 17302 20170105 401ORVI ORANGE VEBRON INTERNET Report 20170105 ORVI adsl veb 12 26,00 0,00 20170109
|
||||
Banque Banque 17302 20170105 5121CRA CR AGRICOLE Report 20170105 ORVI adsl veb 12 0,00 26,00 20170109
|
||||
Fournisseurs Fournisseurs 17305 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
|
||||
Fournisseurs Fournisseurs 17305 20170119 622200 Courtages s/ ventes A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
|
||||
Banque Banque 17306 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170119
|
||||
Banque Banque 17306 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170119
|
||||
Banque Banque 17307 20170119 401ZDAV SANDRA DAVILA A01 20170119 ZDAV courtage s/ ventes 508,00 0,00 20170131
|
||||
Banque Banque 17307 20170119 5121CRA CR AGRICOLE A01 20170119 ZDAV courtage s/ ventes 0,00 508,00 20170131
|
||||
2
dev/skeletons/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
out.*
|
||||
socpeople*
|
||||
@@ -1,34 +0,0 @@
|
||||
README (English)
|
||||
--------------------------------
|
||||
This directory contains PHP script samples that can be used to start a development on Dolibarr.
|
||||
|
||||
|
||||
*** build_class_from_table.php:
|
||||
|
||||
This is the script to use to generate PHP code of a PHP POJO class
|
||||
object, a PHP script that use this POJO. This script use the files
|
||||
skeleton_*.php to build its generated code.
|
||||
|
||||
|
||||
*** modMyModule.class.php:
|
||||
|
||||
Is a sample of module descriptor that you can use if you want to build a new module/plugin for
|
||||
Dolibarr.
|
||||
|
||||
|
||||
*** skeleton_script.php:
|
||||
|
||||
Is a sample you can use as an example if you need to build a script to run on command line
|
||||
|
||||
|
||||
*** skeleton_page.php:
|
||||
|
||||
Is a sample you can use as an example if you need to build an HTML page to include in Dolibarr GUI.
|
||||
|
||||
|
||||
*** skeleton_class.class.php:
|
||||
|
||||
Is a sample you can use as an example if you need to build a class file to access a new table required by a Dolibarr development.
|
||||
However it is better to run the build_class_from_table.php script that accepts a table name as a parameter and will uses the description table within database and the skeleton_class.class.php file to generate full code for your class file.
|
||||
After running this script, the class to access your table (insert a record, update, delete and select) is directly finished and can be used by your module's code.
|
||||
No more coding is needed to get access to table with this script because the file is completely generated once.
|
||||
1
dev/skeletons/README.md
Normal file
@@ -0,0 +1 @@
|
||||
Files and tools were moved into htdocs/modulebuilder/template
|
||||
@@ -1,123 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/skeletons/build_api_class.php
|
||||
* \ingroup core
|
||||
* \brief Create a complete API class file from existant class file
|
||||
*/
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
// After this $db is a defined handler to database.
|
||||
|
||||
// Main
|
||||
$version='1';
|
||||
@set_time_limit(0);
|
||||
$error=0;
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
|
||||
print "***** $script_file ($version) *****\n";
|
||||
|
||||
|
||||
// -------------------- START OF BUILD_API_FROM_CLASS --------------------
|
||||
|
||||
// Check parameters
|
||||
if (! isset($argv[1]) && ! isset($argv[2]))
|
||||
{
|
||||
print "Usage: $script_file phpClassFile phpClassName\n";
|
||||
exit;
|
||||
}
|
||||
// Show parameters
|
||||
print 'Classfile='.$argv[1]."\n";
|
||||
print 'Classname='.$argv[2]."\n";
|
||||
|
||||
$classfile=$argv[1];
|
||||
$classname=$argv[2];
|
||||
$classmin=strtolower($classname);
|
||||
$classnameApi = $classname.'Api';
|
||||
$property=array();
|
||||
$targetcontent='';
|
||||
|
||||
// Load the class and read properties
|
||||
require_once($classfile);
|
||||
|
||||
$property=array();
|
||||
$class = new $classname($db);
|
||||
$values=get_class_vars($classname);
|
||||
|
||||
unset($values['db']);
|
||||
unset($values['error']);
|
||||
unset($values['errors']);
|
||||
unset($values['element']);
|
||||
unset($values['table_element']);
|
||||
unset($values['table_element_line']);
|
||||
unset($values['fk_element']);
|
||||
unset($values['ismultientitymanaged']);
|
||||
|
||||
// Read skeleton_api_class.class.php file
|
||||
$skeletonfile=$path.'skeleton_api_class.class.php';
|
||||
$sourcecontent=file_get_contents($skeletonfile);
|
||||
if (! $sourcecontent)
|
||||
{
|
||||
print "\n";
|
||||
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
|
||||
print "Try to run script from skeletons directory.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define output variables
|
||||
$outfile='out.api_'.$classmin.'.class.php';
|
||||
$targetcontent=$sourcecontent;
|
||||
|
||||
// Substitute class name
|
||||
$targetcontent=preg_replace('/skeleton_api_class\.class\.php/', 'api_'.$classmin.'.class.php', $targetcontent);
|
||||
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
|
||||
//$targetcontent=preg_replace('/\$table_element=\'skeleton\'/', '\$table_element=\''.$tablenoprefix.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/SkeletonApi/', $classnameApi, $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton/', $classname, $targetcontent);
|
||||
|
||||
// Build file
|
||||
$fp=fopen($outfile,"w");
|
||||
if ($fp)
|
||||
{
|
||||
fputs($fp, $targetcontent);
|
||||
fclose($fp);
|
||||
print "\n";
|
||||
print "File '".$outfile."' has been built in current directory.\n";
|
||||
}
|
||||
else $error++;
|
||||
|
||||
|
||||
|
||||
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
print "You can now rename generated files by removing the 'out.' prefix in their name and store them into directory /module/class.\n";
|
||||
return $error;
|
||||
@@ -1,676 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/skeletons/build_class_from_table.php
|
||||
* \ingroup core
|
||||
* \brief Create a complete class file from a table in database
|
||||
*/
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
// After this $db is a defined handler to database.
|
||||
|
||||
// Main
|
||||
$version='3.2';
|
||||
@set_time_limit(0);
|
||||
$error=0;
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
|
||||
print "***** $script_file ($version) *****\n";
|
||||
|
||||
|
||||
// -------------------- START OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
// Check parameters
|
||||
if (! isset($argv[1]) || ! isset($argv[2]) || (isset($argv[3]) && ! isset($argv[7])))
|
||||
{
|
||||
print "Usage: $script_file tablename modulename [server port databasename user pass]\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($argv[3]) && isset($argv[4]) && isset($argv[5]) && isset($argv[6]) && isset($argv[7]))
|
||||
{
|
||||
print 'Use specific database ids'."\n";
|
||||
$db=getDoliDBInstance('mysqli',$argv[3],$argv[6],$argv[7],$argv[5],$argv[4]);
|
||||
}
|
||||
|
||||
if ($db->type != 'mysql' && $db->type != 'mysqli')
|
||||
{
|
||||
print "Error: This script works with mysql or mysqli driver only\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$table=$argv[1];
|
||||
$module=$argv[2];
|
||||
|
||||
// Show parameters
|
||||
print 'Tablename: '.$table."\n";
|
||||
print 'Modulename: '.$module."\n";
|
||||
print "Current dir: ".getcwd()."\n";
|
||||
print "Database name: ".$db->database_name."\n";
|
||||
|
||||
|
||||
// Define array with list of properties
|
||||
$property=array();
|
||||
$foundprimary=0;
|
||||
$resql=$db->DDLDescTable($table);
|
||||
if ($resql)
|
||||
{
|
||||
$i=0;
|
||||
while($obj=$db->fetch_object($resql))
|
||||
{
|
||||
//var_dump($obj);
|
||||
$i++;
|
||||
$property[$i]['field']=$obj->Field;
|
||||
if ($obj->Key == 'PRI')
|
||||
{
|
||||
$property[$i]['primary']=1;
|
||||
$foundprimary=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$property[$i]['primary']=1;
|
||||
}
|
||||
$property[$i]['type'] =$obj->Type;
|
||||
$property[$i]['null'] =$obj->Null;
|
||||
$property[$i]['extra']=$obj->Extra;
|
||||
if ($property[$i]['type'] == 'date'
|
||||
|| $property[$i]['type'] == 'datetime'
|
||||
|| $property[$i]['type'] == 'timestamp')
|
||||
{
|
||||
$property[$i]['istime']=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$property[$i]['istime']=false;
|
||||
}
|
||||
if (preg_match('/varchar/i',$property[$i]['type'])
|
||||
|| preg_match('/text/i',$property[$i]['type']))
|
||||
{
|
||||
$property[$i]['ischar']=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$property[$i]['ischar']=false;
|
||||
}
|
||||
if (preg_match('/int/i',$property[$i]['type']))
|
||||
{
|
||||
$property[$i]['isint']=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$property[$i]['isint']=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print "Error: Failed to get description for table '".$table."'.\n";
|
||||
return false;
|
||||
}
|
||||
//var_dump($property);
|
||||
|
||||
// Define substitute fetch/select parameters
|
||||
$varpropselect="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
$i++;
|
||||
if ($prop['field'] != 'rowid')
|
||||
{
|
||||
$varpropselect.="\t\t\$sql .= \" ";
|
||||
$varpropselect.="t.".$prop['field'];
|
||||
if ($i < count($property)) $varpropselect.=",";
|
||||
$varpropselect.="\";";
|
||||
$varpropselect.="\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//--------------------------------
|
||||
// Build skeleton_class.class.php
|
||||
//--------------------------------
|
||||
|
||||
// Define working variables
|
||||
$table=strtolower($table);
|
||||
$tablenoprefix=preg_replace('/'.preg_quote(MAIN_DB_PREFIX,'/').'/i','',$table);
|
||||
$classname=preg_replace('/_/','',ucfirst($tablenoprefix));
|
||||
$classmin=preg_replace('/_/','',strtolower($classname));
|
||||
|
||||
|
||||
// Read skeleton_class.class.php file
|
||||
$skeletonfile=$path.'skeleton_class.class.php';
|
||||
$sourcecontent=file_get_contents($skeletonfile);
|
||||
if (! $sourcecontent)
|
||||
{
|
||||
print "\n";
|
||||
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
|
||||
print "Try to run script from skeletons directory.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define output variables
|
||||
$outfile=$classmin.'.class.php';
|
||||
$targetcontent=$sourcecontent;
|
||||
|
||||
// Substitute module name
|
||||
$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent);
|
||||
$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent);
|
||||
$targetcontent=preg_replace('/mymodule/', $module, $targetcontent);
|
||||
|
||||
// Substitute class name
|
||||
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element = \''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element = \''.$tablenoprefix.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
|
||||
$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent);
|
||||
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
|
||||
|
||||
// Substitute comments
|
||||
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
|
||||
$targetcontent=preg_replace('/\s*\/\/\.\.\./', '', $targetcontent);
|
||||
$targetcontent=preg_replace('/Put here some comments/','Initialy built by build_class_from_table on '.strftime('%Y-%m-%d %H:%M',mktime()), $targetcontent);
|
||||
|
||||
// Substitute table name
|
||||
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
|
||||
|
||||
// Substitute declaration parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\tpublic \$".$prop['field'];
|
||||
if ($prop['istime']) $varprop.=" = ''";
|
||||
$varprop.=";";
|
||||
if ($prop['comment']) $varprop.="\t// ".$prop['extra'];
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote('public $prop1;','/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote('public $prop2;','/').'/', '', $targetcontent);
|
||||
|
||||
$targetcontent=preg_replace('/\*((\s|\n|\r|\t)*)\@var mixed Sample property 1((\s|\n|\r|\t)*)/', '', $targetcontent);
|
||||
$targetcontent=preg_replace('/\*((\s|\n|\r|\t)*)\@var mixed Sample property 2((\s|\n|\r|\t)*)/', '', $targetcontent);
|
||||
|
||||
// Substitute clean parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="\t\tif (isset(\$this->".$prop['field'].")) {\n\t\t\t \$this->".$prop['field']." = trim(\$this->".$prop['field'].");\n\t\t}";
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/if \(isset\(\$this->prop1\)\) {((\n|\r|\t)*)\$this->prop1 = trim\(\$this->prop1\);((\n|\r|\t)*)}/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/if \(isset\(\$this->prop2\)\) {((\n|\r|\t)*)\$this->prop2 = trim\(\$this->prop2\);((\n|\r|\t)*)}/', '', $targetcontent);
|
||||
|
||||
|
||||
$no_output_field=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] == 'tms') $no_output_field++; // This is a field of type timestamp edited automatically
|
||||
if ($prop['extra'] == 'auto_increment') $no_output_field++;
|
||||
}
|
||||
// Substitute insert into parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
$i++;
|
||||
$addfield=1;
|
||||
if ($prop['field'] == 'tms') $addfield=0; // This is a field of type timestamp edited automatically
|
||||
if ($prop['extra'] == 'auto_increment') $addfield=0;
|
||||
|
||||
if ($addfield)
|
||||
{
|
||||
$varprop.="\t\t\$sql.= '".$prop['field'];
|
||||
if ($i < (count($property)-$no_output_field)) $varprop.=",";
|
||||
$varprop.="';";
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/\$sql \.= \' field1,\';/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql \.= \' field2\';/', '', $targetcontent);
|
||||
|
||||
// Substitute insert values parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
|
||||
//Count nb field to output to manage commat at end SQL instruction
|
||||
|
||||
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
|
||||
$addfield=1;
|
||||
if ($prop['field'] == 'tms') $addfield=0; // This is a field of type timestamp edited automatically
|
||||
if ($prop['extra'] == 'auto_increment') $addfield=0;
|
||||
|
||||
if ($addfield)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$varprop.="\t\t\$sql .= ' ";
|
||||
if ($prop['field']=='datec')
|
||||
{
|
||||
$varprop.='\'."\'".$this->db->idate(dol_now())."\'"';
|
||||
}
|
||||
elseif ($prop['istime'])
|
||||
{
|
||||
$varprop.='\'.(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].')==0?\'NULL\':"\'".$this->db->idate(';
|
||||
$varprop.="\$this->".$prop['field'];
|
||||
$varprop.=").\"'\")";
|
||||
}
|
||||
elseif ($prop['ischar'])
|
||||
{
|
||||
$varprop.="'.(! isset(\$this->".$prop['field'].")?'NULL':\"'\".";
|
||||
$varprop.="\$this->db->escape(\$this->".$prop['field'].")";
|
||||
$varprop.=".\"'\")";
|
||||
}
|
||||
elseif ($prop['field']=='fk_user_mod' || $prop['field']=='fk_user_author')
|
||||
{
|
||||
$varprop.="'.\$user->id";
|
||||
}
|
||||
elseif ($prop['isint'])
|
||||
{
|
||||
$varprop.='\'.(! isset($this->'.$prop['field'].')?\'NULL\':';
|
||||
$varprop.="\$this->".$prop['field'];
|
||||
$varprop.=')';
|
||||
}
|
||||
else
|
||||
{
|
||||
$varprop.='\'.(! isset($this->'.$prop['field'].')?\'NULL\':"\'".';
|
||||
$varprop.="\$this->".$prop['field'];
|
||||
$varprop.='."\'")';
|
||||
}
|
||||
|
||||
if ($i < (count($property)-$no_output_field)) $varprop.=".','";
|
||||
$varprop.=';';
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
|
||||
$patern1='/\$sql \.= \' (.*)\' \. \$this->prop1 \. \'(.*),\';/';
|
||||
$patern2='/\$sql \.= \' (.*)\' \. \$this->prop2 \. \'(.*)\';/';
|
||||
$targetcontent=preg_replace($patern1, $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace($patern2, '', $targetcontent);
|
||||
|
||||
// Substitute update values parameters
|
||||
|
||||
//Count nb field to output to manage commat at end SQL instruction
|
||||
$no_output_field=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['extra'] == 'auto_increment') $no_output_field++;
|
||||
}
|
||||
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
|
||||
$addfield=1;
|
||||
if ($prop['extra'] == 'auto_increment') $addfield=0;
|
||||
|
||||
if ($addfield)
|
||||
{
|
||||
$i++;
|
||||
|
||||
$varprop.="\t\t\$sql .= ' ";
|
||||
$varprop.=$prop['field'].' = ';
|
||||
if ($prop['field']=='tms') {
|
||||
$varprop.='\'.(dol_strlen($this->'.$prop['field'].') != 0 ? "\'".$this->db->idate(';
|
||||
$varprop.='$this->'.$prop['field'];
|
||||
$varprop.=')."\'" : "\'".$this->db->idate(dol_now())."\'")';
|
||||
}
|
||||
elseif ($prop['istime'])
|
||||
{
|
||||
$varprop.='\'.(! isset($this->'.$prop['field'].') || dol_strlen($this->'.$prop['field'].') != 0 ? "\'".$this->db->idate(';
|
||||
$varprop.='$this->'.$prop['field'];
|
||||
$varprop.=')."\'" : \'null\')';
|
||||
}
|
||||
|
||||
elseif ($prop['field']=='fk_user_mod') {
|
||||
$varprop.="'.\$user->id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$varprop.="'.";
|
||||
if ($prop['ischar']) $varprop.='(isset($this->'.$prop['field'].')?"\'".$this->db->escape($this->'.$prop['field'].')."\'":"null")';
|
||||
elseif ($prop['isint']) $varprop.='(isset($this->'.$prop['field'].')?$this->'.$prop['field'].':"null")';
|
||||
else $varprop.='(isset($this->'.$prop['field'].')?$this->'.$prop['field'].':"null")';
|
||||
}
|
||||
|
||||
if ($i < (count($property)-$no_output_field)) $varprop.=".','";
|
||||
$varprop.=';';
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/\$sql \.= " field1=".\(isset\(\$this->field1\)\?"\'".\$this->db->escape\(\$this->field1\)."\'":"null"\).",";/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql \.= " field2=".\(isset\(\$this->field2\)\?"\'".\$this->db->escape\(\$this->field2\)."\'":"null"\)."";/', '', $targetcontent);
|
||||
|
||||
// Substitute fetch/select parameters
|
||||
$targetcontent=preg_replace('/\$sql \.= \' t\.field1,\';/', $varpropselect, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql \.= \' t\.field2\';/', '', $targetcontent);
|
||||
|
||||
// Substitute select set parameters
|
||||
$varprop="\n";
|
||||
$varpropline="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
$i++;
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\t\t\t\t\$this->".$prop['field']." = ";
|
||||
if ($prop['istime']) $varprop.='$this->db->jdate(';
|
||||
$varprop.='$obj->'.$prop['field'];
|
||||
if ($prop['istime']) $varprop.=')';
|
||||
$varprop.=";";
|
||||
$varprop.="\n";
|
||||
|
||||
$varpropline.="\t\t\t\t\$line->".$prop['field']." = ";
|
||||
if ($prop['istime']) $varpropline.='$this->db->jdate(';
|
||||
$varpropline.='$obj->'.$prop['field'];
|
||||
if ($prop['istime']) $varpropline.=')';
|
||||
$varpropline.=";";
|
||||
$varpropline.="\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/\$this->prop1 = \$obj->field1;/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$this->prop2 = \$obj->field2;/', '', $targetcontent);
|
||||
|
||||
//Substirute fetchAll
|
||||
$targetcontent=preg_replace('/\$line->prop1 = \$obj->field1;/', $varpropline, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$line->prop2 = \$obj->field2;/', '', $targetcontent);
|
||||
|
||||
|
||||
// Substitute initasspecimen parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id')
|
||||
{
|
||||
$varprop.="\t\t\$this->".$prop['field']." = '';";
|
||||
$varprop.="\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/\$this->prop1 = \'prop1\';/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$this->prop2 = \'prop2\';/', '', $targetcontent);
|
||||
|
||||
// Build file
|
||||
$fp=fopen($outfile,"w");
|
||||
if ($fp)
|
||||
{
|
||||
fputs($fp, $targetcontent);
|
||||
fclose($fp);
|
||||
print "\n";
|
||||
print "File '".$outfile."' has been built in current directory.\n";
|
||||
}
|
||||
else $error++;
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Build skeleton_script.php, skeleton_list.php and skeleton_card.php
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
$skeletonfiles=array(
|
||||
$path.'skeleton_script.php' => $classmin.'_script.php',
|
||||
$path.'skeleton_list.php' => $classmin.'_list.php',
|
||||
$path.'skeleton_card.php' => $classmin.'_card.php'
|
||||
);
|
||||
|
||||
foreach ($skeletonfiles as $skeletonfile => $outfile)
|
||||
{
|
||||
$sourcecontent=file_get_contents($skeletonfile);
|
||||
if (! $sourcecontent)
|
||||
{
|
||||
print "\n";
|
||||
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
|
||||
print "Try to run script from skeletons directory.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define output variables
|
||||
$targetcontent=$sourcecontent;
|
||||
|
||||
// Substitute module name
|
||||
$targetcontent=preg_replace('/dev\/skeletons/', $module, $targetcontent);
|
||||
$targetcontent=preg_replace('/mymodule othermodule1 othermodule2/', $module, $targetcontent);
|
||||
$targetcontent=preg_replace('/mymodule/', $module, $targetcontent);
|
||||
|
||||
// Substitute class name
|
||||
$targetcontent=preg_replace('/skeleton_class\.class\.php/', $classmin.'.class.php', $targetcontent);
|
||||
$targetcontent=preg_replace('/skeleton_script\.php/', $classmin.'_script.php', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$element = \'skeleton\'/', '\$element=\''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/\$table_element = \'skeleton\'/', '\$table_element=\''.$classmin.'\'', $targetcontent);
|
||||
$targetcontent=preg_replace('/Skeleton_Class/', $classname, $targetcontent);
|
||||
$targetcontent=preg_replace('/skeletons/', $classmin, $targetcontent);
|
||||
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
|
||||
|
||||
// Substitute comments
|
||||
$targetcontent=preg_replace('/This file is an example to create a new class file/', 'Put here description of this class', $targetcontent);
|
||||
$targetcontent=preg_replace('/\s*\/\/\.\.\./', '', $targetcontent);
|
||||
$targetcontent=preg_replace('/Put here some comments/','Initialy built by build_class_from_table on '.strftime('%Y-%m-%d %H:%M',mktime()), $targetcontent);
|
||||
|
||||
// Substitute table name
|
||||
$targetcontent=preg_replace('/MAIN_DB_PREFIX."mytable/', 'MAIN_DB_PREFIX."'.$tablenoprefix, $targetcontent);
|
||||
|
||||
// Substitute GETPOST search_fieldx
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
if ($prop['isint']) $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','int');\n";
|
||||
else $varprop.='$search_'.$prop['field']."=GETPOST('search_".$prop['field']."','alpha');\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote('$search_field1=GETPOST("search_field1");','/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote('$search_field2=GETPOST("search_field2");','/').'/', '', $targetcontent);
|
||||
|
||||
// Substitute GETPOST fieldx
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
if ($prop['isint']) $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','int');\n";
|
||||
else $varprop.="\t\$object->".$prop['field']."=GETPOST('".$prop['field']."','alpha');\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote('$object->prop1=GETPOST("field1");','/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote('$object->prop2=GETPOST("field2");','/').'/', '', $targetcontent);
|
||||
|
||||
// Substitute reset search_field = '';
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.='$search_'.$prop['field']."='';\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote('$search_field1=\'\';','/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote('$search_field2=\'\';','/').'/', '', $targetcontent);
|
||||
|
||||
// Substitute fetch/select parameters
|
||||
$targetcontent=preg_replace('/\$sql\s*\.= " t\.field1,";/', $varpropselect, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$sql\s*\.= " t\.field2";/', '', $targetcontent);
|
||||
|
||||
// Substitute where for search
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.='if ($search_'.$prop['field'].') $sql.= natural_search("'.$prop['field'].'",$search_'.$prop['field'].');'."\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote('if ($search_field1) $sql.= natural_search("field1",$search_field1);','/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote('if ($search_field2) $sql.= natural_search("field2",$search_field2);','/').'/', '', $targetcontent);
|
||||
|
||||
// substitute $params.=
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="if (\$search_".$prop['field']." != '') \$params.= '&search_".$prop['field']."='.urlencode(\$search_".$prop['field'].");\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote("if (\$search_field1 != '') \$params.= '&search_field1='.urlencode(\$search_field1);",'/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote("if (\$search_field2 != '') \$params.= '&search_field2='.urlencode(\$search_field2);",'/').'/', '', $targetcontent);
|
||||
|
||||
// Substitute arrayfields
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="'t.".$prop['field']."'=>array('label'=>\$langs->trans(\"Field".$prop['field']."\"), 'checked'=>1),\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote("'t.field1'=>array('label'=>\$langs->trans(\"Field1\"), 'checked'=>1),",'/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote("'t.field2'=>array('label'=>\$langs->trans(\"Field2\"), 'checked'=>1),",'/').'/', '', $targetcontent);
|
||||
|
||||
// Substitute print_liste_field_titre
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print_liste_field_titre(\$arrayfields['t.".$prop['field']."']['label'],\$_SERVER['PHP_SELF'],'t.".$prop['field']."','',\$params,'',\$sortfield,\$sortorder);\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/LIST_OF_TD_TITLE_FIELDS/', $varprop, $targetcontent);
|
||||
|
||||
// Substitute fields title search
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print '<td class=\"liste_titre\"><input type=\"text\" class=\"flat\" name=\"search_".$prop['field']."\" value=\"'.\$search_".$prop['field'].".'\" size=\"10\"></td>';\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/LIST_OF_TD_TITLE_SEARCH/', $varprop, $targetcontent);
|
||||
|
||||
// Substitute where for <td>.fieldx.</td>
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="if (! empty(\$arrayfields['t.".$prop['field']."']['checked'])) print '<td>'.\$obj->".$prop['field'].".'</td>';\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field1']['checked'])) print '<td>'.\$obj->field1.'</td>';",'/').'/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/'.preg_quote("if (! empty(\$arrayfields['t.field2']['checked'])) print '<td>'.\$obj->field2.'</td>';",'/').'/', '', $targetcontent);
|
||||
|
||||
// LIST_OF_TD_LABEL_FIELDS_CREATE - List of td for card view
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td><input class=\"flat\" type=\"text\" name=\"".$prop['field']."\" value=\"'.GETPOST('".$prop['field']."').'\"></td></tr>';\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_CREATE/', $varprop, $targetcontent);
|
||||
|
||||
// LIST_OF_TD_LABEL_FIELDS_EDIT - List of td for card view
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td><input class=\"flat\" type=\"text\" name=\"".$prop['field']."\" value=\"'.\$object->".$prop['field'].".'\"></td></tr>';\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_EDIT/', $varprop, $targetcontent);
|
||||
|
||||
// LIST_OF_TD_LABEL_FIELDS_VIEW - List of td for card view
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
foreach($property as $key => $prop)
|
||||
{
|
||||
if ($prop['field'] != 'rowid' && $prop['field'] != 'id' && ! $prop['istime'])
|
||||
{
|
||||
$varprop.="print '<tr><td class=\"fieldrequired\">'.\$langs->trans(\"Field".$prop['field']."\").'</td><td>\$object->".$prop['field']."</td></tr>';\n";
|
||||
}
|
||||
}
|
||||
$targetcontent=preg_replace('/LIST_OF_TD_LABEL_FIELDS_VIEW/', $varprop, $targetcontent);
|
||||
|
||||
|
||||
// LIST_OF_TD_FIELDS_LIST
|
||||
|
||||
|
||||
|
||||
// Build file
|
||||
$fp=fopen($outfile,"w");
|
||||
if ($fp)
|
||||
{
|
||||
fputs($fp, $targetcontent);
|
||||
fclose($fp);
|
||||
print "File '".$outfile."' has been built in current directory.\n";
|
||||
}
|
||||
else $error++;
|
||||
}
|
||||
|
||||
|
||||
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
print "You can now move generated files to store them into directory /yourmodule/class (for .class.php file) or /yourmodule.\n";
|
||||
return $error;
|
||||
@@ -1,179 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/* Copyright (C) 2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/skeletons/build_webservice_from_class.php
|
||||
* \ingroup core
|
||||
* \brief Create a complete webservice file from CRUD functions of a PHP class
|
||||
*/
|
||||
|
||||
$sapi_type = php_sapi_name();
|
||||
$script_file = basename(__FILE__);
|
||||
$path=dirname(__FILE__).'/';
|
||||
|
||||
// Test if batch mode
|
||||
if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include Dolibarr environment
|
||||
require_once($path."../../htdocs/master.inc.php");
|
||||
// After this $db is a defined handler to database.
|
||||
|
||||
// Main
|
||||
$version='1.8';
|
||||
@set_time_limit(0);
|
||||
$error=0;
|
||||
|
||||
$langs->load("main");
|
||||
|
||||
|
||||
print "***** $script_file ($version) *****\n";
|
||||
|
||||
|
||||
// -------------------- START OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
// Check parameters
|
||||
if (! isset($argv[1]) && ! isset($argv[2]))
|
||||
{
|
||||
print "Usage: $script_file phpClassFile phpClassName\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Show parameters
|
||||
print 'Classfile='.$argv[1]."\n";
|
||||
print 'Classname='.$argv[2]."\n";
|
||||
|
||||
$classfile=$argv[1];
|
||||
$classname=$argv[2];
|
||||
$classmin=strtolower($classname);
|
||||
$property=array();
|
||||
$targetcontent='';
|
||||
|
||||
// Load the class and read properties
|
||||
require_once($classfile);
|
||||
|
||||
$property=array();
|
||||
$class = new $classname($db);
|
||||
$values=get_class_vars($classname);
|
||||
|
||||
unset($values['db']);
|
||||
unset($values['error']);
|
||||
unset($values['errors']);
|
||||
unset($values['element']);
|
||||
unset($values['table_element']);
|
||||
unset($values['table_element_line']);
|
||||
unset($values['fk_element']);
|
||||
unset($values['ismultientitymanaged']);
|
||||
|
||||
$properties=array_keys($values);
|
||||
|
||||
// Read skeleton_class.class.php file
|
||||
$skeletonfile='skeleton_webservice_server.php';
|
||||
$sourcecontent=file_get_contents($skeletonfile);
|
||||
if (! $sourcecontent)
|
||||
{
|
||||
print "\n";
|
||||
print "Error: Failed to read skeleton sample '".$skeletonfile."'\n";
|
||||
print "Try to run script from skeletons directory.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Define output variables
|
||||
$outfile='out.server_'.$classmin.'.php';
|
||||
$targetcontent=$sourcecontent;
|
||||
|
||||
|
||||
|
||||
// Substitute class name
|
||||
$targetcontent=preg_replace('/Skeleton/', $classname, $targetcontent);
|
||||
$targetcontent=preg_replace('/skeleton/', $classmin, $targetcontent);
|
||||
|
||||
// Substitute declaration parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
|
||||
while($i<count($properties))
|
||||
{
|
||||
$varprop.="'".$properties[$i]."' => array('name'=>'".$properties[$i]."','type'=>'xsd:string')";
|
||||
$i++;
|
||||
|
||||
if ($i == count($properties))
|
||||
$varprop.="\n";
|
||||
else
|
||||
$varprop.=",\n";
|
||||
}
|
||||
|
||||
$targetcontent=preg_replace('/\'prop1\'=>\'xxx\',/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\'prop2\'=>\'xxx\',/', '', $targetcontent);
|
||||
// Substitute get method parameters
|
||||
$varprop="\n";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
|
||||
while($i<count($properties))
|
||||
{
|
||||
$varprop.="'".$properties[$i]."' => $".$classmin."->".$properties[$i];
|
||||
|
||||
$i++;
|
||||
if ($i == count($properties))
|
||||
$varprop.="\n";
|
||||
else
|
||||
$varprop.=",\n";
|
||||
}
|
||||
|
||||
$targetcontent=preg_replace('/\'prop1\'=>\$'.$classmin.'->prop1,/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\'prop2\'=>\$'.$classmin.'->prop2,/', '', $targetcontent);
|
||||
|
||||
// Substitute get method parameters
|
||||
$varprop="\n\t\t";
|
||||
$cleanparam='';
|
||||
$i=0;
|
||||
|
||||
while($i<count($properties))
|
||||
{
|
||||
|
||||
$varprop.='$newobject->'.$properties[$i].'=$'.$classmin.'->'.$properties[$i].';';
|
||||
|
||||
$i++;
|
||||
if ($i == count($properties))
|
||||
$varprop.="\n";
|
||||
else
|
||||
$varprop.="\n\t\t";
|
||||
}
|
||||
$targetcontent=preg_replace('/\$newobject->prop1=\$'.$classmin.'->prop1;/', $varprop, $targetcontent);
|
||||
$targetcontent=preg_replace('/\$newobject->prop2=\$'.$classmin.'->prop2;/', '', $targetcontent);
|
||||
|
||||
|
||||
|
||||
// Build file
|
||||
$fp=fopen($outfile,"w");
|
||||
if ($fp)
|
||||
{
|
||||
fputs($fp, $targetcontent);
|
||||
fclose($fp);
|
||||
print "File '".$outfile."' has been built in current directory.\n";
|
||||
}
|
||||
else $error++;
|
||||
|
||||
// -------------------- END OF BUILD_CLASS_FROM_TABLE SCRIPT --------------------
|
||||
|
||||
print "You must rename files by removing the 'out.' prefix in their name.\n";
|
||||
return $error;
|
||||
@@ -1,351 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file dev/skeletons/skeleton_card.php
|
||||
* \ingroup mymodule othermodule1 othermodule2
|
||||
* \brief This file is an example of a php page
|
||||
* Put here some comments
|
||||
*/
|
||||
|
||||
//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1');
|
||||
//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1');
|
||||
//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
|
||||
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
|
||||
//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); // Do not check anti CSRF attack test
|
||||
//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK','1'); // Do not check style html tag into posted data
|
||||
//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Do not check anti POST attack test
|
||||
//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu
|
||||
//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); // If we don't need to load the html.form.class.php
|
||||
//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
|
||||
//if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||
|
||||
// Change this following line to use the correct relative path (../, ../../, etc)
|
||||
$res=0;
|
||||
if (! $res && file_exists("../main.inc.php")) $res=@include '../main.inc.php'; // to work if your module directory is into dolibarr root htdocs directory
|
||||
if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php'; // to work if your module directory is into a subdir of root htdocs directory
|
||||
if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only
|
||||
if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only
|
||||
if (! $res) die("Include of main fails");
|
||||
// Change this following line to use the correct relative path from htdocs
|
||||
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php');
|
||||
dol_include_once('/mymodule/class/skeleton_class.class.php');
|
||||
|
||||
// Load traductions files requiredby by page
|
||||
$langs->load("mymodule");
|
||||
$langs->load("other");
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id','int');
|
||||
$action = GETPOST('action','alpha');
|
||||
$cancel = GETPOST('cancel');
|
||||
$backtopage = GETPOST('backtopage');
|
||||
$myparam = GETPOST('myparam','alpha');
|
||||
|
||||
$search_field1=GETPOST("search_field1");
|
||||
$search_field2=GETPOST("search_field2");
|
||||
|
||||
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||
|
||||
// Protection if external user
|
||||
if ($user->societe_id > 0)
|
||||
{
|
||||
//accessforbidden();
|
||||
}
|
||||
//$result = restrictedArea($user, 'mymodule', $id);
|
||||
|
||||
|
||||
$object = new Skeleton_Class($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||
|
||||
// Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('skeleton'));
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
* ACTIONS
|
||||
*
|
||||
* Put here all code to do according to value of "action" parameter
|
||||
********************************************************************/
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($cancel)
|
||||
{
|
||||
if ($action != 'addlink')
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
if ($id > 0 || ! empty($ref)) $ret = $object->fetch($id,$ref);
|
||||
$action='';
|
||||
}
|
||||
|
||||
// Action to add record
|
||||
if ($action == 'add')
|
||||
{
|
||||
if (GETPOST('cancel'))
|
||||
{
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
|
||||
$error=0;
|
||||
|
||||
/* object_prop_getpost_prop */
|
||||
$object->prop1=GETPOST("field1");
|
||||
$object->prop2=GETPOST("field2");
|
||||
|
||||
if (empty($object->ref))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result=$object->create($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Creation OK
|
||||
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
{
|
||||
// Creation KO
|
||||
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$action='create';
|
||||
}
|
||||
}
|
||||
|
||||
// Action to update record
|
||||
if ($action == 'update')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
$object->prop1=GETPOST("field1");
|
||||
$object->prop2=GETPOST("field2");
|
||||
|
||||
if (empty($object->ref))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")), null, 'errors');
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$result=$object->update($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
$action='view';
|
||||
}
|
||||
else
|
||||
{
|
||||
// Creation KO
|
||||
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
$action='edit';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$action='edit';
|
||||
}
|
||||
}
|
||||
|
||||
// Action to delete
|
||||
if ($action == 'confirm_delete')
|
||||
{
|
||||
$result=$object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Delete OK
|
||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||
header("Location: ".dol_buildpath('/mymodule/list.php',1));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
|
||||
else setEventMessages($object->error, null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***************************************************
|
||||
* VIEW
|
||||
*
|
||||
* Put here all code to build page
|
||||
****************************************************/
|
||||
|
||||
llxHeader('','MyPageName','');
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
|
||||
// Put here content of your page
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("NewMyModule"));
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
|
||||
// LIST_OF_TD_LABEL_FIELDS_CREATE
|
||||
print '</table>'."\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Part to edit record
|
||||
if (($id || $ref) && $action == 'edit')
|
||||
{
|
||||
print load_fiche_titre($langs->trans("MyModule"));
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input class="flat" type="text" size="36" name="label" value="'.$label.'"></td></tr>';
|
||||
// LIST_OF_TD_LABEL_FIELDS_EDIT
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
|
||||
{
|
||||
$res = $object->fetch_optionals($object->id, $extralabels);
|
||||
|
||||
$head = commande_prepare_head($object);
|
||||
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), 0, 'order');
|
||||
|
||||
print load_fiche_titre($langs->trans("MyModule"));
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
print '<table class="border centpercent">'."\n";
|
||||
// print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
|
||||
// LIST_OF_TD_LABEL_FIELDS_VIEW
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
// Buttons
|
||||
print '<div class="tabsAction">'."\n";
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
if ($user->rights->mymodule->write)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
|
||||
}
|
||||
|
||||
if ($user->rights->mymodule->delete)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
|
||||
}
|
||||
}
|
||||
print '</div>'."\n";
|
||||
|
||||
|
||||
// Example 2 : Adding links to objects
|
||||
// Show links to link elements
|
||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('skeleton'));
|
||||
//$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@@ -1,272 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/webservices/server_skeleton.php
|
||||
* \brief File that is entry point to call Dolibarr WebServices
|
||||
* \version $Id: server_skeleton.php,v 1.7 2010/12/19 11:49:37 eldy Exp $
|
||||
*/
|
||||
|
||||
// This is to make Dolibarr working with Plesk
|
||||
set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
|
||||
|
||||
require_once("../master.inc.php");
|
||||
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/ws.lib.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/skeleton/class/skeleton.class.php");
|
||||
|
||||
|
||||
dol_syslog("Call Skeleton webservices interfaces");
|
||||
|
||||
// Enable and test if module web services is enabled
|
||||
if (empty($conf->global->MAIN_MODULE_WEBSERVICES))
|
||||
{
|
||||
$langs->load("admin");
|
||||
dol_syslog("Call Dolibarr webservices interfaces with module webservices disabled");
|
||||
print $langs->trans("WarningModuleNotActive",'WebServices').'.<br><br>';
|
||||
print $langs->trans("ToActivateModule");
|
||||
exit;
|
||||
}
|
||||
|
||||
// Create the soap Object
|
||||
$server = new nusoap_server();
|
||||
$server->soap_defencoding='UTF-8';
|
||||
$server->decode_utf8=false;
|
||||
$ns='http://www.dolibarr.org/ns/';
|
||||
$server->configureWSDL('WebServicesDolibarrSkeleton',$ns);
|
||||
$server->wsdl->schemaTargetNamespace=$ns;
|
||||
|
||||
|
||||
// Define WSDL Authentication object
|
||||
$server->wsdl->addComplexType(
|
||||
'authentication',
|
||||
'complexType',
|
||||
'struct',
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'dolibarrkey' => array('name'=>'dolibarrkey','type'=>'xsd:string'),
|
||||
'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'),
|
||||
'login' => array('name'=>'login','type'=>'xsd:string'),
|
||||
'password' => array('name'=>'password','type'=>'xsd:string'),
|
||||
'entity' => array('name'=>'entity','type'=>'xsd:string'),
|
||||
)
|
||||
);
|
||||
|
||||
// Define WSDL Return object
|
||||
$server->wsdl->addComplexType(
|
||||
'result',
|
||||
'complexType',
|
||||
'struct',
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'result_code' => array('name'=>'result_code','type'=>'xsd:string'),
|
||||
'result_label' => array('name'=>'result_label','type'=>'xsd:string'),
|
||||
)
|
||||
);
|
||||
|
||||
// Define other specific objects
|
||||
$server->wsdl->addComplexType(
|
||||
'skeleton',
|
||||
'complexType',
|
||||
'struct',
|
||||
'all',
|
||||
'',
|
||||
array(
|
||||
'prop1'=>'xxx',
|
||||
'prop2'=>'xxx',
|
||||
//...
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped
|
||||
// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model.
|
||||
// http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
|
||||
$styledoc='rpc'; // rpc/document (document is an extend into SOAP 1.0 to support unstructured messages)
|
||||
$styleuse='encoded'; // encoded/literal/literal wrapped
|
||||
// Better choice is document/literal wrapped but literal wrapped not supported by nusoap.
|
||||
|
||||
|
||||
// Register WSDL
|
||||
$server->register(
|
||||
'getSkeleton',
|
||||
// Entry values
|
||||
array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'),
|
||||
// Exit values
|
||||
array('result'=>'tns:result','skeleton'=>'tns:skeleton'),
|
||||
$ns,
|
||||
$ns.'#getSkeleton',
|
||||
$styledoc,
|
||||
$styleuse,
|
||||
'WS to get skeleton'
|
||||
);
|
||||
|
||||
// Register WSDL
|
||||
$server->register(
|
||||
'createSkeleton',
|
||||
// Entry values
|
||||
array('authentication'=>'tns:authentication','skeleton'=>'tns:skeleton'),
|
||||
// Exit values
|
||||
array('result'=>'tns:result','id'=>'xsd:string'),
|
||||
$ns,
|
||||
$ns.'#createSkeleton',
|
||||
$styledoc,
|
||||
$styleuse,
|
||||
'WS to create a skeleton'
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Skeleton
|
||||
*
|
||||
* @param array $authentication Array of authentication information
|
||||
* @param int $id Id of object
|
||||
* @param string $ref Ref of object
|
||||
* @param string $ref_ext Ref external of object
|
||||
* @return mixed
|
||||
*/
|
||||
function getSkeleton($authentication,$id,$ref='',$ref_ext='')
|
||||
{
|
||||
global $db,$conf,$langs;
|
||||
|
||||
dol_syslog("Function: getSkeleton login=".$authentication['login']." id=".$id." ref=".$ref." ref_ext=".$ref_ext);
|
||||
|
||||
if ($authentication['entity']) $conf->entity=$authentication['entity'];
|
||||
|
||||
// Init and check authentication
|
||||
$objectresp=array();
|
||||
$errorcode='';$errorlabel='';
|
||||
$error=0;
|
||||
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
|
||||
// Check parameters
|
||||
if (! $error && (($id && $ref) || ($id && $ref_ext) || ($ref && $ref_ext)))
|
||||
{
|
||||
$error++;
|
||||
$errorcode='BAD_PARAMETERS'; $errorlabel="Parameter id, ref and ref_ext can't be both provided. You must choose one or other but not both.";
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$fuser->getrights();
|
||||
|
||||
if ($fuser->rights->skeleton->read)
|
||||
{
|
||||
$skeleton=new Skeleton($db);
|
||||
$result=$skeleton->fetch($id,$ref,$ref_ext);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Create
|
||||
$objectresp = array(
|
||||
'result'=>array('result_code'=>'OK', 'result_label'=>''),
|
||||
'skeleton'=>array(
|
||||
'prop1'=>$skeleton->prop1,
|
||||
'prop2'=>$skeleton->prop2,
|
||||
//...
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorcode='NOT_FOUND'; $errorlabel='Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorcode='PERMISSION_DENIED'; $errorlabel='User does not have permission for this request';
|
||||
}
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
||||
}
|
||||
|
||||
return $objectresp;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create Skeleton
|
||||
*
|
||||
* @param array $authentication Array of authentication information
|
||||
* @param Skeleton $skeleton $skeleton
|
||||
* @return array Array result
|
||||
*/
|
||||
function createSkeleton($authentication,$skeleton)
|
||||
{
|
||||
global $db,$conf,$langs;
|
||||
|
||||
$now=dol_now();
|
||||
|
||||
dol_syslog("Function: createSkeleton login=".$authentication['login']);
|
||||
|
||||
if ($authentication['entity']) $conf->entity=$authentication['entity'];
|
||||
|
||||
// Init and check authentication
|
||||
$objectresp=array();
|
||||
$errorcode='';$errorlabel='';
|
||||
$error=0;
|
||||
$fuser=check_authentication($authentication,$error,$errorcode,$errorlabel);
|
||||
// Check parameters
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$newobject=new Skeleton($db);
|
||||
$newobject->prop1=$skeleton->prop1;
|
||||
$newobject->prop2=$skeleton->prop2;
|
||||
//...
|
||||
|
||||
$db->begin();
|
||||
|
||||
$result=$newobject->create($fuser);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
$objectresp=array('result'=>array('result_code'=>'OK', 'result_label'=>''),'id'=>$newobject->id,'ref'=>$newobject->ref);
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$error++;
|
||||
$errorcode='KO';
|
||||
$errorlabel=$newobject->error;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel));
|
||||
}
|
||||
|
||||
return $objectresp;
|
||||
}
|
||||
|
||||
// Return the results.
|
||||
$server->service(file_get_contents("php://input"));
|
||||
8
dev/tools/github_authors_peryear.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
FROM=2016-01-01
|
||||
TO=2016-12-31
|
||||
|
||||
echo "git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l"
|
||||
git log --since $FROM --before $TO | grep ^Author | sort -u -f -i -b | wc -l
|
||||
|
||||
15
dev/tools/github_commits_perversion.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#/bin/bash
|
||||
Releases=("3.8" "3.9" "4.0" "5.0", "develop")
|
||||
Dates=("2010-01-01", "2011-01-01", "2012-01-01", "2013-01-01", "2014-01-01", "2015-01-01", "2016-07-01")
|
||||
let "counter = 1"
|
||||
|
||||
for i in "${Releases[@]}"
|
||||
do
|
||||
git shortlog -s -n --after=${Dates[counter-1]} --before=${Dates[counter]}
|
||||
echo -n "Total $i: "
|
||||
git log --pretty=oneline --after=${Dates[counter-1]} --before=${Dates[counter]} | wc -l
|
||||
echo "======================="
|
||||
echo
|
||||
let "counter +=1"
|
||||
done
|
||||
|
||||
14
dev/translation/erp_comparison_translation.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
|
||||
Term Dolibarr SAP Odoo ...
|
||||
----------------------------------------------------------------------------
|
||||
Thirdparty Contact partner Partner/Contact (company)
|
||||
Contact/address Contact person Partner/Contact (individual)
|
||||
|
||||
Financial ?? Invoicing
|
||||
|
||||
Income / Expense ?? Profit / Loss
|
||||
Balance Net profit
|
||||
|
||||
|
||||
|
||||
@@ -300,6 +300,8 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
||||
if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0;
|
||||
// install.lang
|
||||
if (preg_match('/^KeepDefaultValues/', $value)) $qualifiedforclean=0;
|
||||
// mail.lang
|
||||
if (preg_match('/MailingModuleDesc/i', $value)) $qualifiedforclean=0;
|
||||
// main.lang
|
||||
if (preg_match('/^Duration/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^FormatDate/', $value)) $qualifiedforclean=0;
|
||||
@@ -308,6 +310,8 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a
|
||||
if (preg_match('/^.*Bytes$/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^NoteSomeFeaturesAreDisabled/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^(DoTest|Under|Limits|Cards|CurrentValue|DateLimit|DateAndHour|NbOfLines|NbOfObjects|NbOfReferes|TotalTTCShort|VATs)/', $value)) $qualifiedforclean=0;
|
||||
// modulebuilder
|
||||
if (preg_match('/^ModuleBuilderDesc/', $value)) $qualifiedforclean=0;
|
||||
// orders
|
||||
if (preg_match('/^OrderSource/', $value)) $qualifiedforclean=0;
|
||||
if (preg_match('/^TypeContact_/', $value)) $qualifiedforclean=0;
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
README (English)
|
||||
# README (English)
|
||||
--------------------------------
|
||||
|
||||
* Most screen captures and icons are Dolibarr contributions, however,
|
||||
some icons are from http://led24.de/iconset/. This is original README file for this source:
|
||||
|
||||
* Screen captures and icons are Dolibarr contributions
|
||||
|
||||
|
||||
* Most logos were created by Dolibarr developers. You may find sources of them on:
|
||||
|
||||
https://github.com/Dolibarr/foundation
|
||||
|
||||
|
||||
* Few icons are from http://led24.de/iconset/. This is original README file for this source:
|
||||
-------------------------------------------------------
|
||||
You can do whatever you want with these icons (use on web or in desktop applications) as long as you don’t pass them off as your own and remove this readme file. A credit statement and a link back to
|
||||
http://led24.de/iconset/ or http://led24.de/ would be appreciated.
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 23 KiB |
BIN
doc/images/dolibarr_logo.png
Normal file → Executable file
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 29 KiB |
BIN
doc/images/dolibarr_screenshot11_1280x800.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
1
htdocs/.gitignore
vendored
@@ -4,6 +4,7 @@
|
||||
/dolimed*
|
||||
/ecommerce*
|
||||
/extensions*
|
||||
/forceproject*
|
||||
/google*
|
||||
/lead
|
||||
/multicompany*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -27,7 +27,6 @@ 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 . '/accountancy/class/html.formventilation.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
@@ -37,10 +36,11 @@ $langs->load("accountancy");
|
||||
$langs->load("salaries");
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$cancel = GETPOST('cancel');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
|
||||
$search_account = GETPOST("search_account");
|
||||
$search_label = GETPOST("search_label");
|
||||
$search_accountparent = GETPOST("search_accountparent");
|
||||
@@ -52,10 +52,9 @@ if ($user->societe_id > 0) accessforbidden();
|
||||
if (! $user->rights->accounting->chartofaccount) accessforbidden();
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
$sortorder = GETPOST("sortorder", 'sortorder');
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$page = GETPOST("page", 'int');
|
||||
if ($page == - 1) {
|
||||
$page = 0;
|
||||
@@ -63,13 +62,23 @@ if ($page == - 1) {
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (! $sortfield)
|
||||
$sortfield = "aa.account_number";
|
||||
if (! $sortorder)
|
||||
$sortorder = "ASC";
|
||||
if (! $sortfield) $sortfield = "aa.account_number";
|
||||
if (! $sortorder) $sortorder = "ASC";
|
||||
|
||||
$arrayfields=array(
|
||||
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
|
||||
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
|
||||
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
|
||||
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>0),
|
||||
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0),
|
||||
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
|
||||
);
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
// Initialize technical object to manage context to save list fields
|
||||
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'accountingaccountlist';
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -95,6 +104,7 @@ if (empty($reshook))
|
||||
$search_accountparent = "";
|
||||
$search_pcgtype = "";
|
||||
$search_pcgsubtype = "";
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
if (GETPOST('change_chart'))
|
||||
@@ -136,6 +146,8 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("ListAccounts"));
|
||||
|
||||
if ($action == 'delete') {
|
||||
@@ -154,21 +166,11 @@ if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_accou
|
||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)";
|
||||
$sql .= " WHERE asy.rowid = " . $pcgver;
|
||||
|
||||
if (strlen(trim($search_account))) {
|
||||
$sql .= natural_search("aa.account_number", $search_account);
|
||||
}
|
||||
if (strlen(trim($search_label))) {
|
||||
$sql .= natural_search("aa.label", $search_label);
|
||||
}
|
||||
if (strlen(trim($search_accountparent))) {
|
||||
$sql .= natural_search("aa.account_parent", $search_accountparent);
|
||||
}
|
||||
if (strlen(trim($search_pcgtype))) {
|
||||
$sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||
}
|
||||
if (strlen(trim($search_pcgsubtype))) {
|
||||
$sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
||||
}
|
||||
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
||||
if (strlen(trim($search_label))) $sql .= natural_search("aa.label", $search_label);
|
||||
if (strlen(trim($search_accountparent))) $sql .= natural_search("aa.account_parent", $search_accountparent);
|
||||
if (strlen(trim($search_pcgtype))) $sql .= natural_search("aa.pcg_type", $search_pcgtype);
|
||||
if (strlen(trim($search_pcgsubtype))) $sql .= natural_search("aa.pcg_subtype", $search_pcgsubtype);
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
@@ -184,39 +186,46 @@ $sql .= $db->plimit($limit + 1, $offset);
|
||||
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql) {
|
||||
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
$params='';
|
||||
if ($search_account != "") $params.= '&search_account='.urlencode($search_account);
|
||||
if ($search_label != "") $params.= '&search_label='.urlencode($search_label);
|
||||
if ($search_accountparent != "") $params.= '&search_accountparent='.urlencode($search_accountparent);
|
||||
if ($search_pcgtype != "") $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||
if ($search_pcgsubtype != "") $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($search_account) $params.= '&search_account='.urlencode($search_account);
|
||||
if ($search_label) $params.= '&search_label='.urlencode($search_label);
|
||||
if ($search_accountparent) $params.= '&search_accountparent='.urlencode($search_accountparent);
|
||||
if ($search_pcgtype) $params.= '&search_pcgtype='.urlencode($search_pcgtype);
|
||||
if ($search_pcgsubtype) $params.= '&search_pcgsubtype='.urlencode($search_pcgsubtype);
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
print '<form method="GET" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['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.'">';
|
||||
|
||||
$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
|
||||
|
||||
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
|
||||
|
||||
// Box to select active chart of account
|
||||
$var = ! $var;
|
||||
print $langs->trans("Selectchartofaccounts") . " : ";
|
||||
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
|
||||
$sql = "SELECT rowid, pcg_version, label, active";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system";
|
||||
$sql .= " WHERE active = 1";
|
||||
dol_syslog('accountancy/admin/index.php:: $sql=' . $sql);
|
||||
dol_syslog('accountancy/admin/account.php:: $sql=' . $sql);
|
||||
$resqlchart = $db->query($sql);
|
||||
$var = true;
|
||||
if ($resqlchart) {
|
||||
$numbis = $db->num_rows($resqlchart);
|
||||
$i = 0;
|
||||
while ( $i < $numbis ) {
|
||||
$var = ! $var;
|
||||
$row = $db->fetch_row($resqlchart);
|
||||
|
||||
print '<option value="' . $row[0] . '"';
|
||||
@@ -231,37 +240,41 @@ if ($resql) {
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountNumber"), $_SERVER["PHP_SELF"], "aa.account_number", "", $params, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "aa.label", "", $params, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Accountparent"), $_SERVER["PHP_SELF"], "aa.account_parent", "", $params, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Pcgtype"), $_SERVER["PHP_SELF"], "aa.pcg_type", "", $params, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Pcgsubtype"), $_SERVER["PHP_SELF"], "aa.pcg_subtype", "", $params, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Activated"), $_SERVER["PHP_SELF"], "aa.active", "", $params, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $params, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print '</tr>';
|
||||
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
|
||||
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// Line for search fields
|
||||
print '<tr class="liste_titre_filter">';
|
||||
if (! empty($arrayfields['aa.account_number']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_account" value="' . $search_account . '"></td>';
|
||||
if (! empty($arrayfields['aa.label']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_label" value="' . $search_label . '"></td>';
|
||||
if (! empty($arrayfields['aa.account_parent']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_accountparent" value="' . $search_accountparent . '"></td>';
|
||||
if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
|
||||
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
|
||||
if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre"> </td>';
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpitco;
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = false;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.account_parent']['checked'])) print_liste_field_titre($arrayfields['aa.account_parent']['label'], $_SERVER["PHP_SELF"],"aa.account_parent", "", $param,'align="left"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.pcg_type']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_type']['label'],$_SERVER["PHP_SELF"],'aa.pcg_type','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print_liste_field_titre($arrayfields['aa.pcg_subtype']['label'],$_SERVER["PHP_SELF"],'aa.pcg_subtype','',$param,'',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['aa.active']['checked'])) print_liste_field_titre($arrayfields['aa.active']['label'],$_SERVER["PHP_SELF"],'aa.active','',$param,'',$sortfield,$sortorder);
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
$accountstatic = new AccountingAccount($db);
|
||||
$accountparent = new AccountingAccount($db);
|
||||
|
||||
$i = 0;
|
||||
while ( $i < min($num, $limit) )
|
||||
|
||||
$i=0;
|
||||
while ($i < min($num, $limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@@ -269,36 +282,82 @@ if ($resql) {
|
||||
$accountstatic->label = $obj->label;
|
||||
$accountstatic->account_number = $obj->account_number;
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<td>' . $accountstatic->getNomUrl(1) . '</td>';
|
||||
print '<td>' . $obj->label . '</td>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
if (! empty($obj->account_parent))
|
||||
{
|
||||
$accountparent->id = $obj->rowid2;
|
||||
$accountparent->label = $obj->label2;
|
||||
$accountparent->account_number = $obj->account_number2;
|
||||
|
||||
print '<td>' . $accountparent->getNomUrl(1) . '</td>';
|
||||
}
|
||||
else
|
||||
// Account number
|
||||
if (! empty($arrayfields['aa.account_number']['checked']))
|
||||
{
|
||||
print '<td> </td>';
|
||||
print "<td>";
|
||||
print $accountstatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
print '<td>' . $obj->pcg_type . '</td>';
|
||||
print '<td>' . $obj->pcg_subtype . '</td>';
|
||||
print '<td>';
|
||||
if (empty($obj->active)) {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
|
||||
// Account label
|
||||
if (! empty($arrayfields['aa.label']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $obj->label;
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Account parent
|
||||
if (! empty($arrayfields['aa.account_parent']['checked']))
|
||||
{
|
||||
if (! empty($obj->account_parent))
|
||||
{
|
||||
$accountparent->id = $obj->rowid2;
|
||||
$accountparent->label = $obj->label2;
|
||||
$accountparent->account_number = $obj->account_number2;
|
||||
|
||||
print "<td>";
|
||||
print $accountparent->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td> </td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Chart of accounts type
|
||||
if (! empty($arrayfields['aa.pcg_type']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $obj->pcg_type;
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Chart of accounts subtype
|
||||
if (! empty($arrayfields['aa.pcg_subtype']['checked']))
|
||||
{
|
||||
print "<td>";
|
||||
print $obj->pcg_subtype;
|
||||
print "</td>\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Activated or not
|
||||
if (! empty($arrayfields['aa.active']['checked']))
|
||||
{
|
||||
print '<td>';
|
||||
if (empty($obj->active)) {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=enable">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $obj->rowid . '&action=disable">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Action
|
||||
print '<td align="center">';
|
||||
if ($user->rights->accounting->chartofaccount) {
|
||||
@@ -311,13 +370,14 @@ if ($resql) {
|
||||
print '</a>';
|
||||
}
|
||||
print '</td>' . "\n";
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
|
||||
print "</tr>\n";
|
||||
$var = ! $var;
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
print '</form>';
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
|
||||
@@ -39,7 +39,7 @@ 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';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
@@ -217,21 +217,6 @@ if ($id == 25)
|
||||
}
|
||||
}
|
||||
|
||||
// Define localtax_typeList (used for dictionary "llx_c_tva")
|
||||
$localtax_typeList = array();
|
||||
if ($id == 10)
|
||||
{
|
||||
$localtax_typeList = array(
|
||||
"0" => $langs->trans("No"),
|
||||
"1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"),
|
||||
"2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"),
|
||||
"3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"),
|
||||
"4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"),
|
||||
"5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"),
|
||||
"6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@@ -736,11 +721,11 @@ if ($id)
|
||||
{
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX.'c_email_templates' && $action == 'edit')
|
||||
{
|
||||
fieldList($fieldlist,$obj,$tabname[$id],'hide');
|
||||
fieldListAccountModel($fieldlist,$obj,$tabname[$id],'hide');
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
||||
fieldListAccountModel($fieldlist,$obj,$tabname[$id],'add');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -757,8 +742,7 @@ if ($id)
|
||||
{
|
||||
print '<tr><td colspan="8">* '.$langs->trans("AvailableVariables").": ";
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail=new FormMail($db);
|
||||
$tmp=$formmail->getAvailableSubstitKey('form');
|
||||
$tmp=FormMail::getAvailableSubstitKey('formemail');
|
||||
print implode(', ', $tmp);
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -901,8 +885,8 @@ if ($id)
|
||||
if ($id == 4) print '<td></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" colspan="2" align="right">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -911,11 +895,9 @@ if ($id)
|
||||
// Lines with values
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = ! $var;
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
//print_r($obj);
|
||||
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||
{
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
@@ -928,7 +910,7 @@ if ($id)
|
||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
|
||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||
if (empty($reshook)) fieldListAccountModel($fieldlist,$obj,$tabname[$id],'edit');
|
||||
|
||||
print '<td colspan="3" align="right"><a name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||
@@ -1078,21 +1060,6 @@ if ($id)
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
|
||||
else if ($fieldlist[$field]=='localtax1_type') {
|
||||
if ($obj->localtax1 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="right";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax2_type') {
|
||||
if ($obj->localtax2 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="right";
|
||||
}
|
||||
else if ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
$align="right";
|
||||
@@ -1198,14 +1165,13 @@ else
|
||||
{
|
||||
if ($showemptyline)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="30%"> </td><td> </td><td> </td></tr>';
|
||||
print '<tr class="oddeven"><td width="30%"> </td><td> </td><td> </td></tr>';
|
||||
$showemptyline=0;
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
|
||||
$value=$tabname[$i];
|
||||
print '<tr '.$bc[$var].'><td width="50%">';
|
||||
print '<tr class="oddeven"><td width="50%">';
|
||||
if (! empty($tabcond[$i]))
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
|
||||
@@ -1252,18 +1218,18 @@ $db->close();
|
||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form;
|
||||
global $region_id;
|
||||
global $elementList,$sourceList,$localtax_typeList;
|
||||
global $elementList,$sourceList;
|
||||
global $bc;
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$formaccountancy = new FormVentilation($db);
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($fieldlist[$field] == 'country')
|
||||
@@ -1380,31 +1346,13 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||
print '<td><input type="text" class="flat" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" size="10" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
elseif ($fieldlist[$field]=='unit') {
|
||||
print '<td>';
|
||||
$units = array(
|
||||
'mm' => $langs->trans('SizeUnitmm'),
|
||||
'cm' => $langs->trans('SizeUnitcm'),
|
||||
'point' => $langs->trans('SizeUnitpoint'),
|
||||
'inch' => $langs->trans('SizeUnitinch')
|
||||
);
|
||||
print $form->selectarray('unit', $units, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 0, 0, 0);
|
||||
print '</td>';
|
||||
}
|
||||
// Le type de taxe locale
|
||||
elseif ($fieldlist[$field] == 'localtax1_type' || $fieldlist[$field] == 'localtax2_type')
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $form->selectarray($fieldlist[$field], $localtax_typeList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'accountancy_code' || $fieldlist[$field] == 'accountancy_code_sell' || $fieldlist[$field] == 'accountancy_code_buy')
|
||||
{
|
||||
print '<td>';
|
||||
if (! empty($conf->accounting->enabled))
|
||||
{
|
||||
$accountancy_account = (! empty($obj->$fieldlist[$field]) ? $obj->$fieldlist[$field] : 0);
|
||||
print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||
print $formaccounting->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Card of accounting account
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ require '../../main.inc.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/accountancysystem.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
@@ -37,7 +36,7 @@ $langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$backtopage = GETPOST('backtopage');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
@@ -59,7 +58,7 @@ if (GETPOST('cancel'))
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
{
|
||||
if (! $cancel) {
|
||||
@@ -86,7 +85,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
} else {
|
||||
$account_parent = GETPOST('account_parent','int');
|
||||
}
|
||||
|
||||
|
||||
$object->fk_pcg_version = $obj->pcg_version;
|
||||
$object->pcg_type = GETPOST('pcg_type');
|
||||
$object->pcg_subtype = GETPOST('pcg_subtype');
|
||||
@@ -95,7 +94,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
$object->account_category = GETPOST('account_category');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
$object->active = 1;
|
||||
|
||||
|
||||
$res = $object->create($user);
|
||||
if ($res == - 3) {
|
||||
$error = 1;
|
||||
@@ -124,9 +123,9 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
} else if ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
||||
if (! $cancel) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
|
||||
dol_syslog('accountancy/admin/card.php:: $sql=' . $sql);
|
||||
$result2 = $db->query($sql);
|
||||
$obj = $db->fetch_object($result2);
|
||||
@@ -156,9 +155,9 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
||||
$object->account_parent = $account_parent;
|
||||
$object->account_category = GETPOST('account_category');
|
||||
$object->label = GETPOST('label', 'alpha');
|
||||
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
|
||||
if ($result > 0) {
|
||||
$urltogo=$backtopage?$backtopage:($_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: " . $urltogo);
|
||||
@@ -196,7 +195,6 @@ $helpurl = '';
|
||||
llxheader('', $title, $helpurl);
|
||||
|
||||
$form = new Form($db);
|
||||
$htmlacc = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
$accountsystem = new AccountancySystem($db);
|
||||
@@ -205,13 +203,13 @@ $accountsystem->fetch($conf->global->CHARTOFACCOUNTS);
|
||||
// Create mode
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans('NewAccountingAccount'));
|
||||
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Chart of account
|
||||
@@ -219,8 +217,7 @@ if ($action == 'create') {
|
||||
print '<td>';
|
||||
print $accountsystem->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
// Account number
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"></td></tr>';
|
||||
@@ -232,7 +229,7 @@ if ($action == 'create') {
|
||||
// Account parent
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($object->account_parent, 'account_parent', 1, null, 0, 0, 'minwidth200');
|
||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1, null, 0, 0, 'minwidth200');
|
||||
print '</td></tr>';
|
||||
|
||||
// Category
|
||||
@@ -245,72 +242,69 @@ if ($action == 'create') {
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type','alpha'):$object->pcg_type).'">';
|
||||
//print $htmlacc->select_pcgtype($object->pcg_type, 'pcg_type', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of acounts subtype
|
||||
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$object->pcg_subtype).'">';
|
||||
//print $htmlacc->select_pcgsubtype($object->pcg_subtype, 'pcg_subtype', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else if ($id) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
|
||||
if ($result > 0) {
|
||||
dol_htmloutput_mesg($mesg);
|
||||
|
||||
|
||||
$head = accounting_prepare_head($object);
|
||||
|
||||
|
||||
// Edit mode
|
||||
if ($action == 'update')
|
||||
{
|
||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
||||
|
||||
|
||||
print '<form name="update" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="edit">';
|
||||
print '<input type="hidden" name="id" value="' . $id . '">';
|
||||
print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Account number
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">' . $langs->trans("AccountNumber") . '</span></td>';
|
||||
print '<td><input name="account_number" size="30" value="' . $object->account_number . '"</td></tr>';
|
||||
|
||||
|
||||
// Label
|
||||
print '<tr><td><span class="fieldrequired">' . $langs->trans("Label") . '</span></td>';
|
||||
print '<td><input name="label" size="70" value="' . $object->label . '"</td></tr>';
|
||||
|
||||
|
||||
// Account parent
|
||||
print '<tr><td>' . $langs->trans("Accountparent") . '</td>';
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($object->account_parent, 'account_parent', 1);
|
||||
print $formaccounting->select_account($object->account_parent, 'account_parent', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Category
|
||||
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
||||
print '<tr><td>'.$langs->trans("AccountingCategory").'</td>';
|
||||
print '<td>';
|
||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1);
|
||||
print '</td></tr>';
|
||||
$formaccounting->select_accounting_category($object->account_category, 'account_category', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Chart of accounts type
|
||||
print '<tr><td>' . $langs->trans("Pcgtype") . '</td>';
|
||||
print '<td>';
|
||||
//print $htmlacc->select_pcgtype($object->pcg_type, 'pcg_type', 1);
|
||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type'])?GETPOST('pcg_type','alpha'):$object->pcg_type).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -318,29 +312,27 @@ if ($action == 'create') {
|
||||
print '<tr><td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="pcg_subtype" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$object->pcg_subtype).'">';
|
||||
//print $htmlacc->select_pcgsubtype($object->pcg_subtype, 'pcg_subtype', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input type="submit" name="cancel" class="button" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
|
||||
// View mode
|
||||
$linkback = '<a href="../admin/account.php">' . $langs->trans("BackToChartofaccounts") . '</a>';
|
||||
|
||||
|
||||
dol_fiche_head($head, 'card', $langs->trans('AccountAccounting'), 0, 'billr');
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Account number
|
||||
print '<tr><td class="titlefield">' . $langs->trans("AccountNumber") . '</td>';
|
||||
print '<td>' . $object->account_number . '</td>';
|
||||
@@ -378,31 +370,30 @@ if ($action == 'create') {
|
||||
} else {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
}*/
|
||||
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
/*
|
||||
* Actions buttons
|
||||
*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
|
||||
if (! empty($user->rights->accounting->chartofaccount)) {
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $id . '">' . $langs->trans('Modify') . '</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('Modify') . '</a>';
|
||||
}
|
||||
|
||||
|
||||
if (! empty($user->rights->accounting->chartofaccount)) {
|
||||
print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused" href="#" title="' . dol_escape_htmltag($langs->trans("NotAllowed")) . '">' . $langs->trans('Delete') . '</a>';
|
||||
}
|
||||
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.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
|
||||
@@ -16,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/categories.php
|
||||
* \file htdocs/accountancy/admin/categories.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page to assign mass categories to accounts
|
||||
* \brief Page to assign mass categories to accounts
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@@ -28,12 +29,14 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action');
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$cat_id = GETPOST('account_category');
|
||||
$selectcpt = GETPOST('cpt_bk', 'array');
|
||||
$cpt_id = GETPOST('cptid');
|
||||
@@ -42,38 +45,34 @@ if ($cat_id == 0) {
|
||||
$cat_id = null;
|
||||
}
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$cancel = GETPOST('cancel');
|
||||
|
||||
// Security check
|
||||
if (! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$AccCat = new AccountancyCategory($db);
|
||||
$accountingcategory = new AccountancyCategory($db);
|
||||
|
||||
// si ajout de comptes
|
||||
if (! empty($selectcpt)) {
|
||||
$cpts = array ();
|
||||
foreach ( $selectcpt as $selectedOption ) {
|
||||
if (! array_key_exists($selectedOption, $cpts))
|
||||
$cpts[$selectedOption] = "'" . $selectedOption . "'";
|
||||
foreach ( $selectcpt as $selectedoption ) {
|
||||
if (! array_key_exists($selectedoption, $cpts))
|
||||
$cpts[$selectedoption] = "'" . $selectedoption . "'";
|
||||
}
|
||||
|
||||
$return= $AccCat->updateAccAcc($cat_id, $cpts);
|
||||
$return= $accountingcategory->updateAccAcc($cat_id, $cpts);
|
||||
|
||||
if ($return<0) {
|
||||
setEventMessages($langs->trans('errors'), $AccCat->errors, 'errors');
|
||||
setEventMessages($langs->trans('errors'), $accountingcategory->errors, 'errors');
|
||||
} else {
|
||||
setEventMessages($langs->trans('Saved'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
if ($action == 'delete') {
|
||||
if ($cpt_id) {
|
||||
if ($AccCat->deleteCptCat($cpt_id)) {
|
||||
setEventMessages($langs->trans('Deleted'), null, 'mesgs');
|
||||
if ($accountingcategory->deleteCptCat($cpt_id)) {
|
||||
setEventMessages($langs->trans('CategoryDeleted'), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans('errors'), null, 'errors');
|
||||
}
|
||||
@@ -84,12 +83,11 @@ if ($action == 'delete') {
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
llxheader('', $langs->trans('AccountAccounting'));
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$form = new Form($db);
|
||||
|
||||
print load_fiche_titre($langs->trans('AccountingCategory'));
|
||||
|
||||
print '<form name="add" action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
@@ -108,18 +106,19 @@ print '</td></tr>';
|
||||
|
||||
if (! empty($cat_id))
|
||||
{
|
||||
$return = $AccCat->getAccountsWithNoCategory($cat_id);
|
||||
$return = $accountingcategory->getAccountsWithNoCategory($cat_id);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
print '<tr><td>' . $langs->trans("AddCompteFromBK") . '</td>';
|
||||
print '<tr><td>' . $langs->trans("AddAccountFromBookKeepingWithNoCategories") . '</td>';
|
||||
print '<td>';
|
||||
if (is_array($AccCat->lines_cptbk) && count($AccCat->lines_cptbk) > 0) {
|
||||
if (is_array($accountingcategory->lines_cptbk) && count($accountingcategory->lines_cptbk) > 0) {
|
||||
print '<select class="flat minwidth200" size="' . count($obj) . '" name="cpt_bk[]" multiple>';
|
||||
foreach ( $AccCat->lines_cptbk as $cpt ) {
|
||||
foreach ( $accountingcategory->lines_cptbk as $cpt ) {
|
||||
print '<option value="' . length_accountg($cpt->numero_compte) . '">' . length_accountg($cpt->numero_compte) . ' (' . $cpt->label_compte . ' ' . $cpt->doc_ref . ')</option>';
|
||||
}
|
||||
print '</select><br><input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("Add") . '"> ';
|
||||
print '</select><br>';
|
||||
print '<input class="button" type="submit" id="" class="action-delete" value="' . $langs->trans("Add") . '"> ';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@@ -133,29 +132,29 @@ print '</form>';
|
||||
|
||||
if ($action == 'display' || $action == 'delete') {
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><th class="liste_titre">' . $langs->trans("AccountAccounting") . '</th><th class="liste_titre">' . $langs->trans("Description") . '</th><th class="liste_titre" width="60" align="center">Action</th></tr>';
|
||||
print "<table class='noborder' width='100%'>\n";
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">'.$langs->trans("AccountAccounting")."</td>";
|
||||
print '<td class="liste_titre" colspan="2">'.$langs->trans("Label")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
if (! empty($cat_id)) {
|
||||
$return = $AccCat->display($cat_id);
|
||||
$return = $accountingcategory->display($cat_id);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
setEventMessages(null, $accountingcategory->errors, 'errors');
|
||||
}
|
||||
$j = 1;
|
||||
if (is_array($AccCat->lines_display) && count($AccCat->lines_display) > 0) {
|
||||
foreach ( $AccCat->lines_display as $cpt ) {
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
|
||||
if (is_array($accountingcategory->lines_display) && count($accountingcategory->lines_display) > 0) {
|
||||
foreach ( $accountingcategory->lines_display as $cpt ) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . length_accountg($cpt->account_number) . '</td>';
|
||||
print '<td>' . $cpt->label . '</td>';
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"] . "?account_category=$cat_id&cptid=" . $cpt->rowid, $langs->trans("DeleteCptCategory"), $langs->trans("ConfirmDeleteCptCategory"), "delete", '', 0, "action-delete" . $j);
|
||||
print '<td>';
|
||||
//print img_delete();
|
||||
print '<input class="button" type="button" id="action-delete' . $j . '" value="' . $langs->trans("Delete") . '">';
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print "<a href= '".$_SERVER['PHP_SELF']."?action=delete&account_category=" . $cat_id . "&cptid=" . $cpt->rowid."'>";
|
||||
print img_delete($langs->trans("DeleteFromCat")).' ';
|
||||
print $langs->trans("DeleteFromCat")."</a>";
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
$j ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ 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.'/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
$langs->load("errors");
|
||||
$langs->load("admin");
|
||||
@@ -168,9 +168,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
{
|
||||
if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
||||
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||
if ($value == 'color' && empty($_POST['color'])) continue;
|
||||
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
||||
if ((! isset($_POST[$value]) || $_POST[$value]=='')
|
||||
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
|
||||
@@ -183,17 +180,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
// We take translate key of field
|
||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
|
||||
if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments';
|
||||
if ($fieldnamekey == 'nbjour') $fieldnamekey='NbOfDays';
|
||||
if ($fieldnamekey == 'decalage') $fieldnamekey='Offset';
|
||||
if ($fieldnamekey == 'module') $fieldnamekey='Module';
|
||||
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
||||
if ($fieldnamekey == 'note') $fieldnamekey = 'Note';
|
||||
if ($fieldnamekey == 'taux') $fieldnamekey = 'Rate';
|
||||
if ($fieldnamekey == 'type') $fieldnamekey = 'Type';
|
||||
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
|
||||
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
|
||||
if ($fieldnamekey == 'deductible') $fieldnamekey = 'Deductible';
|
||||
if ($fieldnamekey == 'sortorder') $fieldnamekey = 'SortOrder';
|
||||
if ($fieldnamekey == 'category_type') $fieldnamekey = 'Calculated';
|
||||
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||
@@ -217,7 +209,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
|
||||
}*/
|
||||
}
|
||||
if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2))
|
||||
if (isset($_POST["country"]) && ($_POST["country"]=='0'))
|
||||
{
|
||||
if (in_array($tablib[$id],array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries
|
||||
{
|
||||
@@ -229,15 +221,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors');
|
||||
}
|
||||
}
|
||||
if ($id == 3 && ! is_numeric($_POST["code"]))
|
||||
{
|
||||
$ok=0;
|
||||
setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors');
|
||||
}
|
||||
|
||||
// Clean some parameters
|
||||
if ((! empty($_POST["localtax1_type"]) || ($_POST['localtax1_type'] == '0')) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
|
||||
if ((! empty($_POST["localtax2_type"]) || ($_POST['localtax2_type'] == '0')) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
|
||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
|
||||
@@ -466,34 +451,12 @@ $formadmin=new FormAdmin($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$titre=$langs->trans("DictionarySetup");
|
||||
$titre=$langs->trans($tablib[$id]);
|
||||
$linkback='';
|
||||
if ($id)
|
||||
{
|
||||
$titre.=' - '.$langs->trans($tablib[$id]);
|
||||
$linkback='<a href="'.$_SERVER['PHP_SELF'].'">'.$langs->trans("BackToDictionaryList").'</a>';
|
||||
}
|
||||
$titlepicto='title_setup';
|
||||
if ($id == 10 && GETPOST('from') == 'accountancy')
|
||||
{
|
||||
$titre=$langs->trans("MenuVatAccounts");
|
||||
$titlepicto='title_accountancy';
|
||||
}
|
||||
if ($id == 7 && GETPOST('from') == 'accountancy')
|
||||
{
|
||||
$titre=$langs->trans("MenuTaxAccounts");
|
||||
$titlepicto='title_accountancy';
|
||||
}
|
||||
|
||||
print load_fiche_titre($titre,$linkback,$titlepicto);
|
||||
|
||||
if (empty($id))
|
||||
{
|
||||
print $langs->trans("DictionaryDesc");
|
||||
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
||||
}
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete')
|
||||
@@ -563,19 +526,6 @@ if ($id)
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='center';
|
||||
}
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $align="center"; }
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $align="center"; }
|
||||
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
|
||||
if ($fieldlist[$field]=='type') {
|
||||
if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,''));
|
||||
else $valuetoshow=$langs->trans("Type");
|
||||
@@ -584,49 +534,20 @@ if ($id)
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
if ($id != 25) $valuetoshow.="*";
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||
if ($fieldlist[$field]=='country') {
|
||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||
$valuetoshow=$langs->trans("Country");
|
||||
}
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||
if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; }
|
||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||
if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
|
||||
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
|
||||
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountparent"); }
|
||||
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
|
||||
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
|
||||
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
||||
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
||||
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
||||
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
||||
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
||||
if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
|
||||
if ($fieldlist[$field]=='paper_size') { $valuetoshow=$langs->trans("PaperSize"); }
|
||||
if ($fieldlist[$field]=='orientation') { $valuetoshow=$langs->trans("Orientation"); }
|
||||
if ($fieldlist[$field]=='leftmargin') { $valuetoshow=$langs->trans("LeftMargin"); }
|
||||
if ($fieldlist[$field]=='topmargin') { $valuetoshow=$langs->trans("TopMargin"); }
|
||||
if ($fieldlist[$field]=='spacex') { $valuetoshow=$langs->trans("SpaceX"); }
|
||||
if ($fieldlist[$field]=='spacey') { $valuetoshow=$langs->trans("SpaceY"); }
|
||||
if ($fieldlist[$field]=='font_size') { $valuetoshow=$langs->trans("FontSize"); }
|
||||
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
||||
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
@@ -639,7 +560,6 @@ if ($id)
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||
}
|
||||
|
||||
if ($id == 4) print '<td></td>';
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '</td>';
|
||||
@@ -649,7 +569,7 @@ if ($id)
|
||||
print '</tr>';
|
||||
|
||||
// Line to enter new values
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
print '<tr class="oddeven nodrag nodrop nohover">';
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
@@ -669,7 +589,7 @@ if ($id)
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
||||
fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'add');
|
||||
}
|
||||
|
||||
print '<td colspan="4" align="right">';
|
||||
@@ -679,15 +599,9 @@ if ($id)
|
||||
|
||||
$colspan=count($fieldlist)+3;
|
||||
|
||||
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
|
||||
{
|
||||
print '<tr><td colspan="'.$colspan.'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'"> </td></tr>'; // Keep to have a line with enough height
|
||||
}
|
||||
|
||||
|
||||
|
||||
// List of available record in database
|
||||
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
@@ -712,101 +626,8 @@ if ($id)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// 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
|
||||
$showfield=1; // By defaut
|
||||
$align="left";
|
||||
$sortable=1;
|
||||
$valuetoshow='';
|
||||
/*
|
||||
$tmparray=getLabelOfField($fieldlist[$field]);
|
||||
$showfield=$tmp['showfield'];
|
||||
$valuetoshow=$tmp['valuetoshow'];
|
||||
$align=$tmp['align'];
|
||||
$sortable=$tmp['sortable'];
|
||||
*/
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='center';
|
||||
}
|
||||
if ($fieldlist[$field]=='localtax1_type') { $valuetoshow=$langs->trans("UseLocalTax")." 2"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax1') { $valuetoshow=$langs->trans("Rate")." 2"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2_type') { $valuetoshow=$langs->trans("UseLocalTax")." 3"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='localtax2') { $valuetoshow=$langs->trans("Rate")." 3"; $align="center"; $sortable=0; }
|
||||
if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); }
|
||||
if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); }
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
if ($id != 25) $valuetoshow.="*";
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle_facture') { $valuetoshow=$langs->trans("LabelOnDocuments")."*"; }
|
||||
if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); }
|
||||
if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $align="center"; }
|
||||
if ($fieldlist[$field]=='nbjour') { $valuetoshow=$langs->trans("NbOfDays"); }
|
||||
if ($fieldlist[$field]=='type_cdr') { $valuetoshow=$langs->trans("AtEndOfMonth"); $align="center"; }
|
||||
if ($fieldlist[$field]=='decalage') { $valuetoshow=$langs->trans("Offset"); }
|
||||
if ($fieldlist[$field]=='width' || $fieldlist[$field]=='nx') { $valuetoshow=$langs->trans("Width"); }
|
||||
if ($fieldlist[$field]=='height' || $fieldlist[$field]=='ny') { $valuetoshow=$langs->trans("Height"); }
|
||||
if ($fieldlist[$field]=='unit' || $fieldlist[$field]=='metric') { $valuetoshow=$langs->trans("MeasuringUnit"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
|
||||
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); }
|
||||
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
|
||||
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
|
||||
if ($fieldlist[$field]=='sortorder') { $valuetoshow=$langs->trans("SortOrder"); }
|
||||
if ($fieldlist[$field]=='short_label') { $valuetoshow=$langs->trans("ShortLabel"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
||||
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
||||
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
||||
if ($fieldlist[$field]=='formula') { $valuetoshow=$langs->trans("Formula"); }
|
||||
if ($fieldlist[$field]=='paper_size') { $valuetoshow=$langs->trans("PaperSize"); }
|
||||
if ($fieldlist[$field]=='orientation') { $valuetoshow=$langs->trans("Orientation"); }
|
||||
if ($fieldlist[$field]=='leftmargin') { $valuetoshow=$langs->trans("LeftMargin"); }
|
||||
if ($fieldlist[$field]=='topmargin') { $valuetoshow=$langs->trans("TopMargin"); }
|
||||
if ($fieldlist[$field]=='spacex') { $valuetoshow=$langs->trans("SpaceX"); }
|
||||
if ($fieldlist[$field]=='spacey') { $valuetoshow=$langs->trans("SpaceY"); }
|
||||
if ($fieldlist[$field]=='font_size') { $valuetoshow=$langs->trans("FontSize"); }
|
||||
if ($fieldlist[$field]=='custom_x') { $valuetoshow=$langs->trans("CustomX"); }
|
||||
if ($fieldlist[$field]=='custom_y') { $valuetoshow=$langs->trans("CustomY"); }
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); }
|
||||
if ($fieldlist[$field]=='percent') { $valuetoshow=$langs->trans("Percentage"); }
|
||||
if ($fieldlist[$field]=='affect') { $valuetoshow=$langs->trans("Info"); }
|
||||
if ($fieldlist[$field]=='delay') { $valuetoshow=$langs->trans("NoticePeriod"); }
|
||||
if ($fieldlist[$field]=='newbymonth') { $valuetoshow=$langs->trans("NewByMonth"); }
|
||||
|
||||
// Affiche nom du champ
|
||||
if ($showfield)
|
||||
{
|
||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
||||
}
|
||||
}
|
||||
// Favorite - Only activated on country dictionary
|
||||
if ($id == 4) print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
||||
|
||||
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print '</tr>';
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre liste_titre_add liste_titre_filter">';
|
||||
$filterfound=0;
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
@@ -829,27 +650,78 @@ if ($id)
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($id == 4) print '<td></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" colspan="3" align="center">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
if ($filterfound)
|
||||
{
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Title of lines
|
||||
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
|
||||
$showfield=1; // By defaut
|
||||
$align="left";
|
||||
$sortable=1;
|
||||
$valuetoshow='';
|
||||
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||
if ($fieldlist[$field]=='taux') {
|
||||
if ($tabname[$id] != MAIN_DB_PREFIX."c_revenuestamp") $valuetoshow=$langs->trans("Rate");
|
||||
else $valuetoshow=$langs->trans("Amount");
|
||||
$align='center';
|
||||
}
|
||||
if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); }
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
if ($id != 25) $valuetoshow.="*";
|
||||
}
|
||||
if ($fieldlist[$field]=='country') { $valuetoshow=$langs->trans("Country"); }
|
||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
|
||||
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
|
||||
if ($fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
|
||||
if ($fieldlist[$field]=='account_parent') { $valuetoshow=$langs->trans("Accountsparent"); }
|
||||
if ($fieldlist[$field]=='pcg_type') { $valuetoshow=$langs->trans("Pcg_type"); }
|
||||
if ($fieldlist[$field]=='pcg_subtype') { $valuetoshow=$langs->trans("Pcg_subtype"); }
|
||||
if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); }
|
||||
if ($fieldlist[$field]=='range_account') { $valuetoshow=$langs->trans("Range"); }
|
||||
if ($fieldlist[$field]=='sens') { $valuetoshow=$langs->trans("Sens"); }
|
||||
if ($fieldlist[$field]=='category_type') { $valuetoshow=$langs->trans("Calculated"); }
|
||||
// Affiche nom du champ
|
||||
if ($showfield)
|
||||
{
|
||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
||||
}
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print '</tr>';
|
||||
|
||||
|
||||
if ($num)
|
||||
{
|
||||
// Lines with values
|
||||
while ($i < $num)
|
||||
{
|
||||
$var = ! $var;
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
//print_r($obj);
|
||||
print '<tr '.$bc[$var].' id="rowid-'.$obj->rowid.'">';
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||
{
|
||||
$tmpaction='edit';
|
||||
@@ -858,9 +730,11 @@ if ($id)
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
|
||||
// Show fields
|
||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||
if (empty($reshook)) fieldListAccountingCategories($fieldlist,$obj,$tabname[$id],'edit');
|
||||
|
||||
print '<td colspan="3" align="center">';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
@@ -910,19 +784,6 @@ if ($id)
|
||||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||
$valuetoshow=yn($valuetoshow);
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='type_cdr') {
|
||||
if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
||||
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
||||
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) {
|
||||
$valuetoshow=price($valuetoshow);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle_facture') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
@@ -1001,9 +862,6 @@ if ($id)
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
else if ($fieldlist[$field]=='unicode') {
|
||||
$valuetoshow = $langs->getCurrencySymbol($obj->code,1);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->load("products");
|
||||
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
|
||||
@@ -1012,32 +870,6 @@ if ($id)
|
||||
$langs->load("products");
|
||||
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
{
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax1_type') {
|
||||
if ($obj->localtax1 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax2_type') {
|
||||
if ($obj->localtax2 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
$align="center";
|
||||
}
|
||||
else if (in_array($fieldlist[$field],array('recuperableonly')))
|
||||
{
|
||||
$align="center";
|
||||
@@ -1055,7 +887,7 @@ if ($id)
|
||||
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
|
||||
if (isset($obj->code) && $id != 10)
|
||||
if (isset($obj->code))
|
||||
{
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
@@ -1071,16 +903,6 @@ if ($id)
|
||||
if ($param) $url .= '&'.$param;
|
||||
$url.='&';
|
||||
|
||||
// Favorite
|
||||
// Only activated on country dictionary
|
||||
if ($id == 4)
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
|
||||
else print $langs->trans("AlwaysActive");
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
@@ -1102,7 +924,7 @@ if ($id)
|
||||
{
|
||||
print '<td align="center">';
|
||||
if ($user->admin) print '<a href="'.$url.'action=delete">'.img_delete().'</a>';
|
||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionnary can be edited by other profile than admin
|
||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||
print '</td>';
|
||||
}
|
||||
else print '<td> </td>';
|
||||
@@ -1145,7 +967,7 @@ $db->close();
|
||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $context='')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form, $mysoc;
|
||||
@@ -1155,7 +977,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccountancy = new FormVentilation($db);
|
||||
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
@@ -1298,7 +1120,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
{
|
||||
$fieldname = $fieldlist[$field];
|
||||
$accountancy_account = (! empty($obj->$fieldname) ? $obj->$fieldname : 0);
|
||||
print $formaccountancy->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||
print $formaccounting->select_account($accountancy_account, $fieldlist[$field], 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ require '../../main.inc.php';
|
||||
// Class
|
||||
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/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
@@ -117,12 +117,11 @@ if ($action == 'update') {
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccountancy = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
$linkback = '';
|
||||
print load_fiche_titre($langs->trans('MenuDefaultAccounts'), $linkback, 'title_accountancy');
|
||||
|
||||
print '<br>';
|
||||
print $langs->trans("DefaultBindingDesc").'<br>';
|
||||
print '<br>';
|
||||
|
||||
@@ -135,15 +134,14 @@ print '<input type="hidden" name="action" value="update">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
foreach ( $list_account as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
print '<tr class="oddeven value">';
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td>' . $label . '</td>';
|
||||
// Value
|
||||
print '<td>'; // Do not force align=right, or it align also the content of the select box
|
||||
print $formaccountancy->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'export', $langs->trans("Configuration"), 0, 'cron');
|
||||
dol_fiche_head($head, 'export', $langs->trans("Configuration"), -1, 'cron');
|
||||
|
||||
$var = true;
|
||||
|
||||
@@ -148,9 +148,8 @@ $var = ! $var;
|
||||
$num = count($main_option);
|
||||
if ($num) {
|
||||
foreach ( $main_option as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
@@ -178,7 +177,7 @@ print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="50%">' . $langs->trans("Selectmodelcsv") . '</td>';
|
||||
if (! $conf->use_javascript_ajax) {
|
||||
print '<td class="nowrap">';
|
||||
@@ -212,7 +211,7 @@ if ($num2) {
|
||||
print '<tr><td colspan="2" bgcolor="red"><b>' . $langs->trans('OptionsDeactivatedForThisExportModel') . '</b></td></tr>';
|
||||
}
|
||||
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="50%">' . $langs->trans("Selectformat") . '</td>';
|
||||
if (! $conf->use_javascript_ajax) {
|
||||
print '<td class="nowrap">';
|
||||
@@ -230,10 +229,8 @@ if ($num2) {
|
||||
}
|
||||
print "</td></tr>";
|
||||
|
||||
foreach ( $model_option as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
foreach ( $model_option as $key ) {
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.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
|
||||
@@ -25,14 +25,14 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
|
||||
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):$conf->liste_limit;
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
$sortorder = GETPOST('sortorder','alpha');
|
||||
$page = GETPOST('page','int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@@ -125,7 +125,7 @@ if ($result) {
|
||||
while ( $i < $num && $i < $max ) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$fiscalyearstatic->id = $obj->rowid;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="fiscalyear_card.php?id=' . $obj->rowid . '">' . img_object($langs->trans("ShowFiscalYear"), "technic") . ' ' . $obj->rowid . '</a></td>';
|
||||
print '<td align="left">' . $obj->label . '</td>';
|
||||
print '<td align="left">' . dol_print_date($db->jdate($obj->date_start), 'day') . '</td>';
|
||||
@@ -136,7 +136,7 @@ if ($result) {
|
||||
$i ++;
|
||||
}
|
||||
} else {
|
||||
print '<tr ' . $bc[$var] . '><td colspan="5" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
|
||||
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">' . $langs->trans("None") . '</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.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
|
||||
@@ -176,13 +176,15 @@ if ($action == 'create')
|
||||
print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend');
|
||||
print '</td></tr>';
|
||||
|
||||
/*
|
||||
// Statut
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">' . $langs->trans("Status") . '</td>';
|
||||
print '<td class="valeur">';
|
||||
print $form->selectarray('statut', $statut2label, GETPOST('statut'));
|
||||
print '</td></tr>';
|
||||
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
@@ -232,7 +234,8 @@ if ($action == 'create')
|
||||
|
||||
// Statut
|
||||
print '<tr><td>' . $langs->trans("Statut") . '</td><td>';
|
||||
print $form->selectarray('statut', $statut2label, $object->statut);
|
||||
// print $form->selectarray('statut', $statut2label, $object->statut);
|
||||
print $object->getLibStatut(4);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@@ -304,7 +307,7 @@ if ($action == 'create')
|
||||
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=edit&id=' . $id . '">' . $langs->trans('Modify') . '</a>';
|
||||
|
||||
print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
|
||||
// print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=delete&id=' . $id . '">' . $langs->trans('Delete') . '</a>';
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
@@ -28,7 +27,7 @@ require '../../main.inc.php';
|
||||
// Class
|
||||
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/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// langs
|
||||
$langs->load("compta");
|
||||
@@ -40,11 +39,11 @@ $langs->load("accountancy");
|
||||
if (! $user->admin)
|
||||
accessforbidden();
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@@ -65,22 +64,22 @@ if ($_POST["action"] == 'import') {
|
||||
if (is_array($to_import) && count($to_import) > 0) {
|
||||
print '<div><font color="red">' . count($to_import) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
|
||||
$sql = 'SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS;
|
||||
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result && ($db->num_rows($result) > 0)) {
|
||||
|
||||
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
$cpt = 0;
|
||||
foreach ( $to_import as $maLigneCochee ) {
|
||||
|
||||
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
|
||||
$monLabel = GETPOST('label' . $maLigneCochee);
|
||||
$monParentAccount = GETPOST('AccountParent' . $maLigneCochee);
|
||||
$monType = GETPOST('pcgType' . $maLigneCochee);
|
||||
$monSubType = GETPOST('pcgSubType' . $maLigneCochee);
|
||||
|
||||
|
||||
$accounting->fk_pcg_version = $obj->pcg_version;
|
||||
$accounting->account_number = $maLigneCochee;
|
||||
$accounting->label = $monLabel;
|
||||
@@ -126,10 +125,10 @@ if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
print_barre_liste($langs->trans("ImportAccount"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">' . "\n";
|
||||
print '<input type="hidden" name="action" value="import">';
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td>' . $langs->trans("AccountAccouting") . '</td>';
|
||||
print '<td>' . $langs->trans("label") . '</td>';
|
||||
@@ -138,45 +137,43 @@ if ($result) {
|
||||
print '<td>' . $langs->trans("Pcgsubtype") . '</td>';
|
||||
print '<td align="center">' . $langs->trans("Import") . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$form = new Form($db);
|
||||
$htmlacc = new FormVentilation($db);
|
||||
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
print '<tr'. $bc[$var].'>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td align="left">';
|
||||
print $objp->accounting;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="left">';
|
||||
print '<input name="label" size="30" value="">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Colonne choix du compte
|
||||
print '<td>';
|
||||
print $htmlacc->select_account($accounting->account_parent, 'AccountParent');
|
||||
print $formaccounting->select_account($accounting->account_parent, 'AccountParent');
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td>';
|
||||
print $htmlacc->select_pcgtype($accounting->pcg_type, 'pcgType');
|
||||
print '<input type="text" name="pcgType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$accounting->pcg_type).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td>';
|
||||
print $htmlacc->select_pcgsubtype($accounting->pcg_subtype, 'pcgSubType');
|
||||
print '<input type="text" name="pcgSubType" value="'.dol_escape_htmltag(isset($_POST['pcg_subtype'])?GETPOST('pcg_subtype','alpha'):$accounting->pcg_subtype).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Colonne choix ligne a ventiler
|
||||
|
||||
$checked = ('label' == 'O') ? ' checked' : '';
|
||||
|
||||
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" name="mesCasesCochees[]" ' . $checked . ' value="' . $objp->accounting . '"/>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '</tr>';
|
||||
$i ++;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.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>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
|
||||
@@ -31,8 +31,6 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
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/html.formventilation.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
@@ -142,18 +140,17 @@ if ($action == 'setmanagezero') {
|
||||
}
|
||||
|
||||
if ($action == 'setdisabledirectinput') {
|
||||
$setdisabledirectinput = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
$setdisabledirectinput = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0)
|
||||
$error ++;
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@@ -161,7 +158,6 @@ if ($action == 'setdisabledirectinput') {
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
$formaccountancy = new FormVentilation($db);
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
||||
@@ -172,7 +168,7 @@ print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Configuration"), 0, 'cron');
|
||||
dol_fiche_head($head, 'general', $langs->trans("Configuration"), -1, 'cron');
|
||||
|
||||
|
||||
// Default mode for calculating turnover (parameter ACCOUNTING_MODE)
|
||||
@@ -215,8 +211,7 @@ print "</tr>\n";
|
||||
if (! empty($user->admin))
|
||||
{
|
||||
// TO DO Mutualize code for yes/no constants
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_TODO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_TODO)) {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsorttodo&value=0">';
|
||||
@@ -229,8 +224,7 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_LIST_SORT_VENTILATION_DONE") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_LIST_SORT_VENTILATION_DONE)) {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setlistsortdone&value=0">';
|
||||
@@ -243,22 +237,20 @@ if (! empty($user->admin))
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var = ! $var;
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
|
||||
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a></td>';
|
||||
} else {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
|
||||
print img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
|
||||
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setmanagezero&value=0">';
|
||||
@@ -276,9 +268,7 @@ if (! empty($user->admin))
|
||||
// Param a user $user->rights->accountancy->chartofaccount can access
|
||||
foreach ($list as $key)
|
||||
{
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
print '<tr class="oddeven value">';
|
||||
|
||||
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) continue;
|
||||
|
||||
@@ -306,7 +296,7 @@ print '<div class="center"><input type="submit" class="button" value="' . $langs
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy"));
|
||||
print '<div class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")).'</div>';
|
||||
|
||||
print '<br>';
|
||||
print '</form>';
|
||||
|
||||
@@ -1,210 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/journal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Setup page to configure accounting expert module
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
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/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("admin");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("salaries");
|
||||
|
||||
// Security check
|
||||
if (empty($user->admin) || ! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
// Other parameters ACCOUNTING_*
|
||||
$list = array (
|
||||
'ACCOUNTING_SELL_JOURNAL',
|
||||
'ACCOUNTING_PURCHASE_JOURNAL',
|
||||
'ACCOUNTING_SOCIAL_JOURNAL',
|
||||
'ACCOUNTING_MISCELLANEOUS_JOURNAL',
|
||||
'ACCOUNTING_EXPENSEREPORT_JOURNAL'
|
||||
);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
// Save vars
|
||||
foreach ($list as $constname)
|
||||
{
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
|
||||
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
|
||||
// Save bank account journals
|
||||
$arrayofbankaccount = GETPOST('bank_account', 'array');
|
||||
foreach($arrayofbankaccount as $key => $code)
|
||||
{
|
||||
$bankaccount = new Account($db);
|
||||
$res = $bankaccount->fetch($key);
|
||||
if ($res > 0)
|
||||
{
|
||||
$bankaccount->accountancy_journal = $code;
|
||||
$bankaccount->update($user);
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
||||
|
||||
$head = admin_accounting_prepare_head(null);
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron');
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">' . $langs->trans('Journaux') . '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ( $list as $key ) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td width="50%"><label for="' . $key . '">' . $label . '</label></td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . $conf->global->$key . '">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">' . $langs->trans('JournalFinancial') . ' ('.$langs->trans('Opened').')</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Bank account
|
||||
$sql = "SELECT rowid, ref, label, number, account_number, accountancy_journal";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "bank_account";
|
||||
$sql .= " WHERE entity = " . $conf->entity;
|
||||
$sql .= " AND clos = 0";
|
||||
$sql .= " ORDER BY label";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$numr = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($numr > 0)
|
||||
|
||||
$bankaccountstatic = new Account($db);
|
||||
|
||||
while ( $i < $numr ) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$var = ! $var;
|
||||
|
||||
$bankaccountstatic->rowid = $objp->rowid;
|
||||
$bankaccountstatic->id = $objp->rowid;
|
||||
$bankaccountstatic->ref = $objp->ref;
|
||||
$bankaccountstatic->label = $objp->label;
|
||||
$bankaccountstatic->number = $objp->number;
|
||||
$bankaccountstatic->account_number = $objp->account_number;
|
||||
$bankaccountstatic->accountancy_journal = $objp->accountancy_journal;
|
||||
|
||||
print '<tr ' . $bc[$var] . ' class="value">';
|
||||
|
||||
// Param
|
||||
print '<td width="50%"><label for="' . $objp->rowid . '">' . $langs->trans("Journal");
|
||||
print ' - '.$bankaccountstatic->getNomUrl(1);
|
||||
print '</label></td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
print '<input type="text" size="20" id="' . $objp->rowid . '" name="bank_account['.$objp->rowid.']" value="' . $objp->accountancy_journal . '">';
|
||||
print '</td></tr>';
|
||||
|
||||
$i ++;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans('Modify') . '" name="button"></div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
752
htdocs/accountancy/admin/journals_list.php
Normal file
@@ -0,0 +1,752 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.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 <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/admin/journals_list.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Setup page to configure journals
|
||||
*/
|
||||
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.'/accountancy/class/accountingjournal.class.php';
|
||||
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
|
||||
$confirm=GETPOST('confirm','alpha');
|
||||
$id=GETPOST('id','int');
|
||||
$rowid=GETPOST('rowid','alpha');
|
||||
|
||||
// Security access
|
||||
if (! empty($user->rights->accountancy->chartofaccount))
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$acts[0] = "activate";
|
||||
$acts[1] = "disable";
|
||||
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||
|
||||
$listoffset=GETPOST('listoffset');
|
||||
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
|
||||
$active = 1;
|
||||
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0 ; }
|
||||
$offset = $listlimit * $page ;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
if (empty($sortfield)) $sortfield='code';
|
||||
if (empty($sortorder)) $sortorder='ASC';
|
||||
|
||||
$error = 0;
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('admin'));
|
||||
|
||||
// This page is a generic page to edit dictionaries
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder=array(35);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname=array();
|
||||
$tabname[35]= MAIN_DB_PREFIX."accounting_journal";
|
||||
|
||||
// Dictionary labels
|
||||
$tablib=array();
|
||||
$tablib[35]= "DictionaryAccountancyJournal";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql=array();
|
||||
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort=array();
|
||||
$tabsqlsort[35]="code ASC";
|
||||
|
||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
||||
$tabfield=array();
|
||||
$tabfield[35]= "code,label,nature";
|
||||
|
||||
// Nom des champs d'edition pour modification d'un enregistrement
|
||||
$tabfieldvalue=array();
|
||||
$tabfieldvalue[35]= "code,label,nature";
|
||||
|
||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||
$tabfieldinsert=array();
|
||||
$tabfieldinsert[35]= "code,label,nature";
|
||||
|
||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
||||
$tabrowid=array();
|
||||
$tabrowid[35]= "";
|
||||
|
||||
// Condition to show dictionary in setup page
|
||||
$tabcond=array();
|
||||
$tabcond[35]= ! empty($conf->accounting->enabled);
|
||||
|
||||
// List of help for fields
|
||||
$tabhelp=array();
|
||||
$tabhelp[35] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
|
||||
// List of check for fields (NOT USED YET)
|
||||
$tabfieldcheck=array();
|
||||
$tabfieldcheck[35] = array();
|
||||
|
||||
// Complete all arrays with entries found into modules
|
||||
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
||||
|
||||
|
||||
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
||||
$elementList = array();
|
||||
// Must match ids defined into eldy.lib.php
|
||||
$sourceList = array(
|
||||
'1' => $langs->trans('AccountingJournalType1'),
|
||||
'2' => $langs->trans('AccountingJournalType2'),
|
||||
'3' => $langs->trans('AccountingJournalType3'),
|
||||
'4' => $langs->trans('AccountingJournalType4'),
|
||||
'9' => $langs->trans('AccountingJournalType9')
|
||||
);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('button_removefilter') || GETPOST('button_removefilter.x') || GETPOST('button_removefilter_x'))
|
||||
{
|
||||
$search_country_id = '';
|
||||
}
|
||||
|
||||
// Actions add or modify an entry into a dictionary
|
||||
if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
{
|
||||
$listfield=explode(',', str_replace(' ', '',$tabfield[$id]));
|
||||
$listfieldinsert=explode(',',$tabfieldinsert[$id]);
|
||||
$listfieldmodify=explode(',',$tabfieldinsert[$id]);
|
||||
$listfieldvalue=explode(',',$tabfieldvalue[$id]);
|
||||
|
||||
// Check that all fields are filled
|
||||
$ok=1;
|
||||
foreach ($listfield as $f => $value)
|
||||
{
|
||||
if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label';
|
||||
if ($fieldnamekey == 'code') $fieldnamekey = 'Code';
|
||||
if ($fieldnamekey == 'nature') $fieldnamekey = 'Nature';
|
||||
}
|
||||
// Other checks
|
||||
if (isset($_POST["code"]))
|
||||
{
|
||||
if ($_POST["code"]=='0')
|
||||
{
|
||||
$ok=0;
|
||||
setEventMessages($langs->transnoentities('ErrorCodeCantContainZero'), null, 'errors');
|
||||
}
|
||||
/*if (!is_numeric($_POST['code'])) // disabled, code may not be in numeric base
|
||||
{
|
||||
$ok = 0;
|
||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br />';
|
||||
}*/
|
||||
}
|
||||
|
||||
// Clean some parameters
|
||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"]=''; // If empty, we force to null
|
||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null
|
||||
|
||||
// Si verif ok et action add, on ajoute la ligne
|
||||
if ($ok && GETPOST('actionadd'))
|
||||
{
|
||||
if ($tabrowid[$id])
|
||||
{
|
||||
// Recupere id libre pour insertion
|
||||
$newid=0;
|
||||
$sql = "SELECT max(".$tabrowid[$id].") newid from ".$tabname[$id];
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
$newid=($obj->newid + 1);
|
||||
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// Add new entry
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
// List of fields
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||
$sql.= $tabrowid[$id].",";
|
||||
$sql.= $tabfieldinsert[$id];
|
||||
$sql.=",active)";
|
||||
$sql.= " VALUES(";
|
||||
|
||||
// List of values
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert))
|
||||
$sql.= $newid.",";
|
||||
$i=0;
|
||||
foreach ($listfieldinsert as $f => $value)
|
||||
{
|
||||
if ($value == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
|
||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||
$i++;
|
||||
}
|
||||
$sql.=",1)";
|
||||
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) // Add is ok
|
||||
{
|
||||
setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs');
|
||||
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
setEventMessages($langs->transnoentities("ErrorRecordAlreadyExists"), null, 'errors');
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Si verif ok et action modify, on modifie la ligne
|
||||
if ($ok && GETPOST('actionmodify'))
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
// Modify entry
|
||||
$sql = "UPDATE ".$tabname[$id]." SET ";
|
||||
// Modifie valeur des champs
|
||||
if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify))
|
||||
{
|
||||
$sql.= $tabrowid[$id]."=";
|
||||
$sql.= "'".$db->escape($rowid)."', ";
|
||||
}
|
||||
$i = 0;
|
||||
foreach ($listfieldmodify as $field)
|
||||
{
|
||||
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||
}
|
||||
else if ($field == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
$sql.= $field."=";
|
||||
if ($_POST[$listfieldvalue[$i]] == '' && ! ($listfieldvalue[$i] == 'code' && $id == 10)) $sql.="null"; // For vat, we want/accept code = ''
|
||||
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
|
||||
$i++;
|
||||
}
|
||||
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
|
||||
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
//print $sql;
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql)
|
||||
{
|
||||
setEventMessages($db->error(), null, 'errors');
|
||||
}
|
||||
}
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
|
||||
if (GETPOST('actioncancel'))
|
||||
{
|
||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||
}
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'";
|
||||
|
||||
dol_syslog("delete", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if (! $result)
|
||||
{
|
||||
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
|
||||
{
|
||||
setEventMessages($langs->transnoentities("ErrorRecordIsUsedByChild"), null, 'errors');
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// activate
|
||||
if ($action == $acts[0])
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'";
|
||||
}
|
||||
elseif ($_GET["code"]) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".$_GET["code"]."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
// disable
|
||||
if ($action == $acts[1])
|
||||
{
|
||||
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
|
||||
else { $rowidcol="rowid"; }
|
||||
|
||||
if ($rowid) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'";
|
||||
}
|
||||
elseif ($_GET["code"]) {
|
||||
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".$_GET["code"]."'";
|
||||
}
|
||||
|
||||
$result = $db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formadmin=new FormAdmin($db);
|
||||
|
||||
llxHeader();
|
||||
|
||||
$titre=$langs->trans("DictionarySetup");
|
||||
$linkback='';
|
||||
if ($id)
|
||||
{
|
||||
$titre.=' - '.$langs->trans($tablib[$id]);
|
||||
$titlepicto='title_accountancy';
|
||||
}
|
||||
|
||||
print load_fiche_titre($titre,$linkback,$titlepicto);
|
||||
|
||||
if (empty($id))
|
||||
{
|
||||
print $langs->trans("DictionaryDesc");
|
||||
print " ".$langs->trans("OnlyActiveElementsAreShown")."<br>\n";
|
||||
}
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
// Confirmation de la suppression de la ligne
|
||||
if ($action == 'delete')
|
||||
{
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
|
||||
}
|
||||
//var_dump($elementList);
|
||||
|
||||
/*
|
||||
* Show a dictionary
|
||||
*/
|
||||
if ($id)
|
||||
{
|
||||
// Complete requete recherche valeurs avec critere de tri
|
||||
$sql=$tabsql[$id];
|
||||
|
||||
if ($search_country_id > 0)
|
||||
{
|
||||
if (preg_match('/ WHERE /',$sql)) $sql.= " AND ";
|
||||
else $sql.=" WHERE ";
|
||||
$sql.= " c.rowid = ".$search_country_id;
|
||||
}
|
||||
|
||||
if ($sortfield)
|
||||
{
|
||||
// If sort order is "country", we use country_code instead
|
||||
if ($sortfield == 'country') $sortfield='country_code';
|
||||
$sql.= " ORDER BY ".$sortfield;
|
||||
if ($sortorder)
|
||||
{
|
||||
$sql.=" ".strtoupper($sortorder);
|
||||
}
|
||||
$sql.=", ";
|
||||
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
|
||||
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
|
||||
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
|
||||
}
|
||||
else {
|
||||
$sql.=" ORDER BY ";
|
||||
}
|
||||
$sql.=$tabsqlsort[$id];
|
||||
$sql.=$db->plimit($listlimit+1,$offset);
|
||||
//print $sql;
|
||||
|
||||
$fieldlist=explode(',',$tabfield[$id]);
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="from" value="'.dol_escape_htmltag(GETPOST('from','alpha')).'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused=0;
|
||||
$var=false;
|
||||
|
||||
$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
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
$align="left";
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label')
|
||||
{
|
||||
$valuetoshow=$langs->trans("Label");
|
||||
}
|
||||
if ($fieldlist[$field]=='nature') { $valuetoshow=$langs->trans("Nature"); }
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]);
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
print '</td>';
|
||||
print '<td style="min-width: 26px;"></td>';
|
||||
print '<td style="min-width: 26px;"></td>';
|
||||
print '<td style="min-width: 26px;"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Line to enter new values
|
||||
print '<tr class="oddeven nodrag nodrap nohover">';
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
if (GETPOST('actionadd'))
|
||||
{
|
||||
foreach ($fieldlist as $key=>$val)
|
||||
{
|
||||
if (GETPOST($val) != '')
|
||||
$obj->$val=GETPOST($val);
|
||||
}
|
||||
}
|
||||
|
||||
$tmpaction = 'create';
|
||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
fieldList($fieldlist,$obj,$tabname[$id],'add');
|
||||
}
|
||||
|
||||
print '<td colspan="4" align="right">';
|
||||
print '<input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'">';
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
|
||||
print '<tr><td colspan="7"> </td></tr>'; // Keep to have a line with enough height
|
||||
}
|
||||
|
||||
|
||||
|
||||
// List of available record in database
|
||||
dol_syslog("htdocs/admin/dict", LOG_DEBUG);
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$var=true;
|
||||
|
||||
$param = '&id='.$id;
|
||||
if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id;
|
||||
$paramwithsearch = $param;
|
||||
if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder;
|
||||
if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield;
|
||||
if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha');
|
||||
|
||||
// There is several pages
|
||||
if ($num > $listlimit)
|
||||
{
|
||||
print '<tr class="none"><td align="right" colspan="'.(3+count($fieldlist)).'">';
|
||||
print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page+1).'</span></li>');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// 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
|
||||
$showfield=1; // By defaut
|
||||
$align="left";
|
||||
$sortable=1;
|
||||
$valuetoshow='';
|
||||
/*
|
||||
$tmparray=getLabelOfField($fieldlist[$field]);
|
||||
$showfield=$tmp['showfield'];
|
||||
$valuetoshow=$tmp['valuetoshow'];
|
||||
$align=$tmp['align'];
|
||||
$sortable=$tmp['sortable'];
|
||||
*/
|
||||
$valuetoshow=ucfirst($fieldlist[$field]); // By defaut
|
||||
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||
if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); }
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); }
|
||||
if ($fieldlist[$field]=='nature') { $valuetoshow=$langs->trans("Nature"); }
|
||||
|
||||
// Affiche nom du champ
|
||||
if ($showfield)
|
||||
{
|
||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
||||
}
|
||||
}
|
||||
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print getTitleFieldOfList('');
|
||||
print '</tr>';
|
||||
|
||||
// Title line with search boxes
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
if ($filterfound)
|
||||
{
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($num)
|
||||
{
|
||||
// Lines with values
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
//print_r($obj);
|
||||
print '<tr class="oddeven" id="rowid-'.$obj->rowid.'">';
|
||||
if ($action == 'edit' && ($rowid == (! empty($obj->rowid)?$obj->rowid:$obj->code)))
|
||||
{
|
||||
$tmpaction='edit';
|
||||
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
|
||||
// Show fields
|
||||
if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
|
||||
|
||||
print '<td align="center" colspan="4">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
|
||||
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmpaction = 'view';
|
||||
$parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||
|
||||
if (empty($reshook))
|
||||
{
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
|
||||
$showfield=1;
|
||||
$align="left";
|
||||
$valuetoshow=$obj->{$fieldlist[$field]};
|
||||
if ($valuetoshow=='all') {
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
$langs->load("accountancy");
|
||||
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
|
||||
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
|
||||
$class='tddict';
|
||||
// Show value for field
|
||||
if ($showfield) print '<!-- '.$fieldlist[$field].' --><td align="'.$align.'" class="'.$class.'">'.$valuetoshow.'</td>';
|
||||
}
|
||||
}
|
||||
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
|
||||
if (isset($obj->code) && $id != 10)
|
||||
{
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||
}
|
||||
|
||||
$canbemodified=$iserasable;
|
||||
|
||||
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
|
||||
if ($param) $url .= '&'.$param;
|
||||
$url.='&';
|
||||
|
||||
// Active
|
||||
print '<td align="center" class="nowrap">';
|
||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
else
|
||||
{
|
||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
|
||||
else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
||||
else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
|
||||
else print $langs->trans("AlwaysActive");
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Modify link
|
||||
if ($canbemodified) print '<td align="center"><a class="reposition" href="'.$url.'action=edit">'.img_edit().'</a></td>';
|
||||
else print '<td> </td>';
|
||||
|
||||
// Delete link
|
||||
if ($iserasable)
|
||||
{
|
||||
print '<td align="center">';
|
||||
if ($user->admin) print '<a href="'.$url.'action=delete">'.img_delete().'</a>';
|
||||
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
|
||||
print '</td>';
|
||||
}
|
||||
else print '<td> </td>';
|
||||
|
||||
print '<td></td>';
|
||||
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
||||
|
||||
/**
|
||||
* Show fields in insert/edit mode
|
||||
*
|
||||
* @param array $fieldlist Array of fields
|
||||
* @param Object $obj If we show a particular record, obj is filled with record fields
|
||||
* @param string $tabname Name of SQL table
|
||||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form, $mysoc;
|
||||
global $region_id;
|
||||
global $elementList,$sourceList,$localtax_typeList;
|
||||
global $bc;
|
||||
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
if ($fieldlist[$field] == 'nature')
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('nature', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''));
|
||||
print '</td>';
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) {
|
||||
print '<td><input type="text" class="flat minwidth100" value="'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'"></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td>';
|
||||
$size=''; $class='';
|
||||
if ($fieldlist[$field]=='code') $class='maxwidth100';
|
||||
if ($fieldlist[$field]=='label') $class='quatrevingtpercent';
|
||||
if ($fieldlist[$field]=='sortorder' || $fieldlist[$field]=='sens' || $fieldlist[$field]=='category_type') $size='size="2" ';
|
||||
print '<input type="text" '.$size.'class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.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 . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
@@ -70,11 +70,11 @@ $accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
|
||||
$btn_changeaccount = GETPOST('changeaccount');
|
||||
$btn_changetype = GETPOST('changetype');
|
||||
|
||||
$limit = GETPOST("limit")?GETPOST("limit","int"):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST("sortfield",'alpha');
|
||||
$sortorder = GETPOST("sortorder",'alpha');
|
||||
$page = GETPOST("page",'int');
|
||||
if ($page == -1) { $page = 0; }
|
||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@@ -184,7 +184,7 @@ if ($action == 'update') {
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new FormVentilation($db);
|
||||
$form = new FormAccounting($db);
|
||||
|
||||
// Defaut AccountingAccount RowId Product / Service
|
||||
// at this time ACCOUNTING_SERVICE_SOLD_ACCOUNT & ACCOUNTING_PRODUCT_SOLD_ACCOUNT are account number not accountingacount rowid
|
||||
@@ -218,7 +218,7 @@ else
|
||||
{
|
||||
$sql.=" p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $pcgvercode . "'";
|
||||
}
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity('product', 1).')';
|
||||
$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
if (strlen(trim($search_current_account))) {
|
||||
$sql .= natural_search("p.accountancy_code_buy",$search_current_account);
|
||||
@@ -279,6 +279,7 @@ if ($result)
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
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 load_fiche_titre($langs->trans("ProductsBinding"), '', 'title_accountancy');
|
||||
print '<br>';
|
||||
@@ -312,22 +313,8 @@ if ($result)
|
||||
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '', 0, '', '', $limit);
|
||||
|
||||
print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("OnSell"), $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("OnBuy"), $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
$fieldtosortaccount="p.accountancy_code_buy";
|
||||
}
|
||||
else $fieldtosortaccount="p.accountancy_code_sell";
|
||||
print_liste_field_titre($langs->trans("CurrentDedicatedAccountingAccount"), $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AssignDedicatedAccountingAccount"));
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print '<td class="liste_titre"><input type="text" class="flat" size="20" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
@@ -342,12 +329,28 @@ if ($result)
|
||||
print ' '.$langs->trans("or").' '.$form->selectarray('search_current_account_valid', $listofvals, $search_current_account_valid, 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(1, 'checkforselect', 1);
|
||||
print $searchpitco;
|
||||
print '<td align="center" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "p.ref", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
if (! empty($conf->global->ACCOUNTANCY_SHOW_PROD_DESC)) print_liste_field_titre($langs->trans("Description"), $_SERVER["PHP_SELF"], "p.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("OnSell"), $_SERVER["PHP_SELF"], "p.tosell", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("OnBuy"), $_SERVER["PHP_SELF"], "p.tobuy", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
if ($accounting_product_mode == 'ACCOUNTANCY_BUY') {
|
||||
$fieldtosortaccount="p.accountancy_code_buy";
|
||||
}
|
||||
else $fieldtosortaccount="p.accountancy_code_sell";
|
||||
print_liste_field_titre($langs->trans("CurrentDedicatedAccountingAccount"), $_SERVER["PHP_SELF"], $fieldtosortaccount, "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AssignDedicatedAccountingAccount"));
|
||||
$clickpitco=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($clickpitco, '', '', '', '', 'align="center"');
|
||||
print '</tr>';
|
||||
|
||||
$product_static = new Product($db);
|
||||
|
||||
$var = true;
|
||||
@@ -381,8 +384,7 @@ if ($result)
|
||||
$compta_prodbuy_id = $aarowid_servbuy;
|
||||
}
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $product_static->getNomUrl(1);
|
||||
@@ -440,7 +442,7 @@ if ($result)
|
||||
}
|
||||
|
||||
// Checkbox select
|
||||
print '<td align="right">';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" class="checkforselect" name="chk_prod[]" value="' . $obj->rowid . '"/></td>';
|
||||
print "</tr>";
|
||||
$i ++;
|
||||
|
||||
@@ -28,8 +28,8 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
@@ -55,13 +55,13 @@ if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv")) {
|
||||
$action = 'export_csv';
|
||||
}
|
||||
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
|
||||
$offset = $limit * $page;
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$formother = new FormOther($db);
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -98,7 +98,7 @@ if (! empty($search_accountancy_code_end)) {
|
||||
* Action
|
||||
*/
|
||||
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_accountancy_code_start = '';
|
||||
$search_accountancy_code_end = '';
|
||||
@@ -137,7 +137,7 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
|
||||
else {
|
||||
$title_page = $langs->trans("AccountBalance") . ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end);
|
||||
$title_page = $langs->trans("AccountBalance") . (($search_date_start || $search_date_end) ? ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end) : '');
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
@@ -160,7 +160,7 @@ else {
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
$button = '<input type="submit" name="button_export_csv" class="butAction" value="' . $langs->trans("Export") . '" />';
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, 0, 'title_accountancy', 0, $button);
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $result, 'title_accountancy', 0, $button);
|
||||
|
||||
|
||||
$moreforfilter = '';
|
||||
@@ -182,6 +182,22 @@ else {
|
||||
}
|
||||
|
||||
print '<table class="liste ' . ($moreforfilter ? "listwithfilterbefore" : "") . '">';
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre" colspan="5">';
|
||||
print $langs->trans('From');
|
||||
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
||||
print ' ';
|
||||
print $langs->trans('to');
|
||||
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccounting"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $options, "", $sortfield, $sortorder);
|
||||
@@ -191,28 +207,6 @@ else {
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" colspan="2">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, '');
|
||||
print '<br>';
|
||||
print $langs->trans('to');
|
||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$var = True;
|
||||
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
$sous_total_debit = 0;
|
||||
@@ -220,7 +214,6 @@ else {
|
||||
$displayed_account = "";
|
||||
|
||||
foreach ($object->lines as $line) {
|
||||
$var = ! $var;
|
||||
$link = '';
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
@@ -229,7 +222,7 @@ else {
|
||||
if (empty($description)) {
|
||||
$link = '<a href="../admin/card.php?action=create&compte=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Permet d'afficher le compte comptable
|
||||
if ($root_account_description != $displayed_account) {
|
||||
|
||||
@@ -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-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.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
|
||||
@@ -18,19 +18,23 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/bookkeeping/card.php
|
||||
* \file htdocs/accountancy/bookkeeping/card.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page to show book-entry
|
||||
* \brief Page to show book-entry
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
$langs->load("bank");
|
||||
$langs->load("bills");
|
||||
$langs->load("trips");
|
||||
|
||||
// Security check
|
||||
$id = GETPOST('id', 'int');
|
||||
@@ -38,7 +42,7 @@ if ($user->societe_id > 0) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$piece_num = GETPOST("piece_num");
|
||||
|
||||
$mesg = '';
|
||||
@@ -210,7 +214,7 @@ else if ($action == "confirm_create") {
|
||||
llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccountancy = new FormAccounting($db);
|
||||
|
||||
/*
|
||||
* Confirmation to delete the command
|
||||
@@ -223,26 +227,6 @@ if ($action == 'delete') {
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("CreateMvts"));
|
||||
|
||||
$code_journal_array = array (
|
||||
$conf->global->ACCOUNTING_SELL_JOURNAL => $conf->global->ACCOUNTING_SELL_JOURNAL,
|
||||
$conf->global->ACCOUNTING_PURCHASE_JOURNAL => $conf->global->ACCOUNTING_PURCHASE_JOURNAL,
|
||||
$conf->global->ACCOUNTING_SOCIAL_JOURNAL => $conf->global->ACCOUNTING_SOCIAL_JOURNAL,
|
||||
$conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL => $conf->global->ACCOUNTING_MISCELLANEOUS_JOURNAL,
|
||||
$conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL => $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL
|
||||
);
|
||||
|
||||
$sql = 'SELECT DISTINCT accountancy_journal FROM ' . MAIN_DB_PREFIX . 'bank_account WHERE clos=0';
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) {
|
||||
setEventMessages($db->lasterror, null, 'errors');
|
||||
} else {
|
||||
while ( $obj_bank = $db->fetch_object($resql) ) {
|
||||
if (! empty($obj_bank->accountancy_journal)) {
|
||||
$code_journal_array[$obj_bank->accountancy_journal] = $obj_bank->accountancy_journal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$book = new BookKeeping($db);
|
||||
$next_num_mvt = $book->getNextNumMvt();
|
||||
if (empty($next_num_mvt))
|
||||
@@ -270,9 +254,10 @@ if ($action == 'create') {
|
||||
print '</tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="fieldrequired">' . $langs->trans("Codejournal") . '</td>';
|
||||
print '<td>' . $html->selectarray('code_journal', $code_journal_array) . '</td>';
|
||||
print '</tr>';
|
||||
print '<td class="fieldrequired">'.$langs->trans("AccountancyJournal").'</td>';
|
||||
print '<td>';
|
||||
print $formaccountancy->select_journal('', 'code_journal', '', 0, '', 1, 1, 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr>';
|
||||
print '<td>' . $langs->trans("Docref") . '</td>';
|
||||
@@ -305,29 +290,54 @@ if ($action == 'create') {
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr class="pair">';
|
||||
print '<td class="titlefield">' . $langs->trans("NumMvts") . '</td>';
|
||||
print '<td>' . $book->piece_num . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<td>' . $langs->trans("Docdate") . '</td>';
|
||||
print '<td>' . dol_print_date($book->doc_date, 'daytextshort') . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="pair">';
|
||||
print '<td>' . $langs->trans("Codejournal") . '</td>';
|
||||
print '<td>' . $book->code_journal . '</td>';
|
||||
print '</tr>';
|
||||
print '<td>';
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch('',$book->code_journal);
|
||||
print $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="impair">';
|
||||
print '<td>' . $langs->trans("Docref") . '</td>';
|
||||
print '<td>' . $book->doc_ref . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$typelabel = $book->doc_type;
|
||||
if ($typelabel == 'bank') {
|
||||
$typelabel = $langs->trans('Bank');
|
||||
}
|
||||
if ($typelabel == 'customer_invoice') {
|
||||
$typelabel = $langs->trans('CustomerInvoice');
|
||||
}
|
||||
if ($typelabel == 'supplier_invoice') {
|
||||
$typelabel = $langs->trans('SupplierInvoice');
|
||||
}
|
||||
if ($typelabel == 'expense_report') {
|
||||
$typelabel = $langs->trans('ExpenseReport');
|
||||
}
|
||||
print '<tr class="pair">';
|
||||
print '<td>' . $langs->trans("Doctype") . '</td>';
|
||||
print '<td>' . $book->doc_type . '</td>';
|
||||
print '<td>' . $typelabel . '</td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
@@ -369,8 +379,7 @@ if ($action == 'create') {
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($book->linesmvt as $line) {
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
@@ -378,10 +387,10 @@ if ($action == 'create') {
|
||||
if ($action == 'update' && $line->id == $id) {
|
||||
|
||||
print '<td>';
|
||||
print $formventilation->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($line->numero_compte, 'account_number', 0, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_auxaccount($line->code_tiers, 'code_tiers', 1);
|
||||
print $formaccounting->select_auxaccount($line->code_tiers, 'code_tiers', 1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $line->label_compte . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="debit" value="' . price($line->debit) . '"/></td>';
|
||||
@@ -420,17 +429,16 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $formventilation->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($account_number, 'account_number', 0, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $formventilation->select_auxaccount($code_tiers, 'code_tiers', 1);
|
||||
print $formaccounting->select_auxaccount($code_tiers, 'code_tiers', 1);
|
||||
print '</td>';
|
||||
print '<td><input type="text" size="15" name="label_compte" value="' . $label_compte . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="debit" value="' . price($debit) . '"/></td>';
|
||||
print '<td align="right"><input type="text" size="6" name="credit" value="' . price($credit) . '"/></td>';
|
||||
print '<td align="right"><input type="text" class="right maxwidth50" name="debit" value="' . price($debit) . '"/></td>';
|
||||
print '<td align="right"><input type="text" class="right maxwidth50" name="credit" value="' . price($credit) . '"/></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -28,9 +28,10 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@@ -79,7 +80,7 @@ $search_direction = GETPOST('search_direction', 'alpha');
|
||||
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page','int');
|
||||
@@ -93,7 +94,7 @@ if ($sortfield == "") $sortfield = "t.rowid";
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$formother = new FormOther($db);
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -291,7 +292,6 @@ $title_page = $langs->trans("Bookkeeping");
|
||||
llxHeader('', $title_page);
|
||||
|
||||
// List
|
||||
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$nbtotalofrecords = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter);
|
||||
@@ -321,8 +321,8 @@ if ($action == 'delbookkeepingyear') {
|
||||
if (empty($delyear)) {
|
||||
$delyear = dol_print_date(dol_now(), '%Y');
|
||||
}
|
||||
$year_array = $formventilation->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
||||
$journal_array = $formventilation->selectjournal_accountancy_bookkepping($deljournal, 'deljournal', 0, 'array');
|
||||
$year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
||||
$journal_array = $formaccounting->selectjournal($deljournal, 'deljournal', '', 1, 'array', 1, 1);
|
||||
|
||||
$form_question['delyear'] = array (
|
||||
'name' => 'delyear',
|
||||
@@ -354,13 +354,14 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" 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.'">';
|
||||
|
||||
$button = '<a class="butAction" name="button_export_csv" href="'.$_SERVER["PHP_SELF"].'?action=export_csv'.($param?'&'.$param:'').'">';
|
||||
if (count($filter)) $button.= $langs->trans("ExportFilteredList");
|
||||
else $button.= $langs->trans("ExportList");
|
||||
$button.= '</a>';
|
||||
|
||||
$groupby = ' <a href="./listbyaccount.php">' . $langs->trans("GroupByAccountAccounting") . '</a>';
|
||||
$groupby = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php"">' . $langs->trans("GroupByAccountAccounting") . '</a>';
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, $groupby, '', $limit);
|
||||
|
||||
@@ -371,20 +372,8 @@ print '<div class="inline-block divButAction"><a class="butActionDelete" name="b
|
||||
print '</div>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" name="search_mvt_num" size="6" value="' . dol_escape_htmltag($search_mvt_num) . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
print $langs->trans('From') . ': ';
|
||||
@@ -396,17 +385,17 @@ print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" name="search_doc_ref" size="8" value="' . dol_escape_htmltag($search_doc_ref) . '"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '');
|
||||
print '<br>';
|
||||
print $langs->trans('to');
|
||||
print $formventilation->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array (), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $langs->trans('From');
|
||||
print $formventilation->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_start, 'search_accountancy_aux_code_start', 1);
|
||||
print '<br>';
|
||||
print $langs->trans('to');
|
||||
print $formventilation->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
|
||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', 1);
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" size="7" class="flat" name="search_mvt_label" value="' . $search_mvt_label . '"/>';
|
||||
@@ -415,12 +404,26 @@ print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre center"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$var = True;
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Code_tiers"), $_SERVER['PHP_SELF'], "t.code_tiers", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"), $_SERVER['PHP_SELF'], "t.label_compte", "", $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$total_debit = 0;
|
||||
$total_credit = 0;
|
||||
@@ -431,17 +434,21 @@ foreach ($object->lines as $line ) {
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td><a href="./card.php?piece_num=' . $line->piece_num . '">' . $line->piece_num . '</a></td>';
|
||||
print '<td align="center">' . dol_print_date($line->doc_date, 'day') . '</td>';
|
||||
print '<td>' . $line->doc_ref . '</td>';
|
||||
print '<td class="nowrap">' . $line->doc_ref . '</td>';
|
||||
print '<td>' . length_accountg($line->numero_compte) . '</td>';
|
||||
print '<td>' . length_accounta($line->code_tiers) . '</td>';
|
||||
print '<td>' . $line->label_compte . '</td>';
|
||||
print '<td align="right">' . price($line->debit) . '</td>';
|
||||
print '<td align="right">' . price($line->credit) . '</td>';
|
||||
print '<td align="center">' . $line->code_journal . '</td>';
|
||||
|
||||
$accountingjournal = new AccountingJournal($db);
|
||||
$accountingjournal->fetch('',$line->code_journal);
|
||||
print '<td align="center">' . $accountingjournal->getNomUrl(0,0,0,'',0) . '</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<a href="./card.php?piece_num=' . $line->piece_num . '">' . img_edit() . '</a> ';
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?action=delmouv&mvt_num=' . $line->piece_num . $param . '&page=' . $page . '">' . img_delete() . '</a>';
|
||||
@@ -456,10 +463,10 @@ print '</td>';
|
||||
print '<td align="right">';
|
||||
print price($total_debit);
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print '<td align="right">';
|
||||
print price($total_credit);
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td colspan="2"></td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table>";
|
||||
|
||||
@@ -29,8 +29,8 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||
|
||||
// Langs
|
||||
@@ -59,7 +59,7 @@ $search_direction = GETPOST('search_direction', 'alpha');
|
||||
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page','int');
|
||||
@@ -75,7 +75,7 @@ if (empty($search_date_end)) $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$formother = new FormOther($db);
|
||||
$form = new Form($db);
|
||||
|
||||
@@ -188,7 +188,7 @@ if ($action == 'delbookkeepingyear') {
|
||||
if (empty($delyear)) {
|
||||
$delyear = dol_print_date(dol_now(), '%Y');
|
||||
}
|
||||
$year_array = $formventilation->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
||||
$year_array = $formaccounting->selectyear_accountancy_bookkepping($delyear, 'delyear', 0, 'array');
|
||||
|
||||
$form_question['delyear'] = array (
|
||||
'name' => 'delyear',
|
||||
@@ -207,7 +207,7 @@ if ($action == 'delbookkeepingyear') {
|
||||
|
||||
print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
|
||||
|
||||
$viewflat = ' <a href="./list.php">' . $langs->trans("ViewFlatList") . '</a>';
|
||||
$viewflat = ' <a class="nohover" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">' . $langs->trans("ViewFlatList") . '</a>';
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, '', $result, $nbtotalofrecords,'title_accountancy',0,$viewflat,'',$limit);
|
||||
|
||||
@@ -222,17 +222,6 @@ print '<div class="inline-block divButAction"><a class="butAction" href="./card.
|
||||
print '</div>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans("AccountAccounting") . '</td>';
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("SuppliersInvoices") . ' / ' . $langs->trans("CustomersInvoices"));
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre">' . $object->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array (), 1, 1, '') . '</td>';
|
||||
@@ -250,10 +239,22 @@ print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" name="search_ledger_code" size="3" value="' . $search_ledger_code . '"></td>';
|
||||
print '<td class="liste_titre" align="right" colspan="2">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpitco;
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("AccountAccountingShort"), $_SERVER['PHP_SELF']);
|
||||
print_liste_field_titre($langs->trans("TransactionNumShort"), $_SERVER['PHP_SELF'], "t.piece_num", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docdate"), $_SERVER['PHP_SELF'], "t.doc_date", "", $options, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Docref"), $_SERVER['PHP_SELF'], "t.doc_ref", "", $options, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Label"));
|
||||
print_liste_field_titre($langs->trans("Debit"), $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Credit"), $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Codejournal"), $_SERVER['PHP_SELF'], "t.code_journal", "", $options, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
|
||||
print "</tr>\n";
|
||||
|
||||
print '</tr>';
|
||||
|
||||
$var = True;
|
||||
@@ -265,7 +266,6 @@ $sous_total_credit = 0;
|
||||
$displayed_account_number = null; // Start with undefined to be able to distinguish with empty
|
||||
|
||||
foreach ( $object->lines as $line ) {
|
||||
$var = ! $var;
|
||||
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
@@ -278,9 +278,10 @@ foreach ( $object->lines as $line ) {
|
||||
|
||||
// Affiche un Sous-Total par compte comptable
|
||||
if (isset($displayed_account_number)) {
|
||||
print '<tr class="liste_total"><td align="right" colspan="4">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
print '<tr class="liste_total"><td align="right" colspan="5">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Show the break account
|
||||
@@ -298,19 +299,20 @@ foreach ( $object->lines as $line ) {
|
||||
$sous_total_credit = 0;
|
||||
}
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td> </td>';
|
||||
print '<td align="right">'.$line->piece_num.'</td>';
|
||||
print '<td align="right"><a href="./card.php?piece_num=' . $line->piece_num . '">'.$line->piece_num.'</a></td>';
|
||||
print '<td align="center">' . dol_print_date($line->doc_date, 'day') . '</td>';
|
||||
print '<td><a href="./card.php?piece_num=' . $line->piece_num . '">' . $line->doc_ref . '</a></td>';
|
||||
|
||||
// TODO Add a link according to doc_type and fk_doc
|
||||
print '<td class="nowrap">';
|
||||
//if ($line->doc_type == 'supplier_invoice')
|
||||
//if ($line->doc_type == 'customer_invoice')
|
||||
print $line->doc_ref;
|
||||
print '</td>';
|
||||
|
||||
// Affiche un lien vers la facture client/fournisseur
|
||||
$doc_ref = preg_replace('/\(.*\)/', '', $line->doc_ref);
|
||||
if ($line->doc_type == 'supplier_invoice')
|
||||
print strlen(length_accounta($line->code_tiers)) == 0 ? '<td><a href="/fourn/facture/list.php?search_ref_supplier=' . $doc_ref . '">' . $line->label_compte . '</a></td>' : '<td><a href="/fourn/facture/list.php?search_ref_supplier=' . $doc_ref . '">' . $line->label_compte . '</a><br /><span style="font-size:0.8em">(' . length_accounta($line->code_tiers) . ')</span></td>';
|
||||
elseif ($line->doc_type == 'customer_invoice')
|
||||
print strlen(length_accounta($line->code_tiers)) == 0 ? '<td><a href="/compta/facture/list.php?search_ref=' . $doc_ref . '">' . $line->label_compte . '</a></td>' : '<td><a href="/compta/facture/list.php?search_ref=' . $doc_ref . '">' . $line->label_compte . '</a><br /><span style="font-size:0.8em">(' . length_accounta($line->code_tiers) . ')</span></td>';
|
||||
else
|
||||
print strlen(length_accounta($line->code_tiers)) == 0 ? '<td>' . $line->label_compte . '</td>' : '<td>' . $line->label_compte . '<br /><span style="font-size:0.8em">(' . length_accounta($line->code_tiers) . ')</span></td>';
|
||||
|
||||
|
||||
@@ -333,6 +335,7 @@ foreach ( $object->lines as $line ) {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td align="right" colspan="5">'.$langs->trans("SubTotal").':</td><td class="nowrap" align="right">'.price($sous_total_debit).'</td><td class="nowrap" align="right">'.price($sous_total_credit).'</td>';
|
||||
print "<td> </td>\n";
|
||||
print "<td> </td>\n";
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("accountancy");
|
||||
@@ -37,7 +37,7 @@ $langs->load("accountancy");
|
||||
$page = GETPOST("page");
|
||||
$sortorder = GETPOST("sortorder");
|
||||
$sortfield = GETPOST("sortfield");
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
|
||||
$search_doc_type = GETPOST('search_doc_type', 'alpha');
|
||||
@@ -67,7 +67,7 @@ $search_code_journal = GETPOST('search_code_journal', 'alpha');
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
$form = new Form($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
// Filter
|
||||
if (empty($search_date_start)) {
|
||||
@@ -182,15 +182,15 @@ print $form->select_date($search_date_end, 'date_end');
|
||||
print '</div>';
|
||||
print '<div class="liste_titre">';
|
||||
print $langs->trans('From') . ' ' . $langs->trans('AccountAccounting') . ': ';
|
||||
print $formventilation->select_account($search_numero_compte_start, 'search_numero_compte_start', 1, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($search_numero_compte_start, 'search_numero_compte_start', 1, array (), 1, 1, '');
|
||||
print $langs->trans('To') . ' ' . $langs->trans('AccountAccounting') . ': ';
|
||||
print $formventilation->select_account($search_numero_compte_end, 'search_numero_compte_end', 1, array (), 1, 1, '');
|
||||
print $formaccounting->select_account($search_numero_compte_end, 'search_numero_compte_end', 1, array (), 1, 1, '');
|
||||
print '</div>';
|
||||
print '<div class="liste_titre">';
|
||||
print $langs->trans('From') . ' ' . $langs->trans('ThirdPartyAccount') . ': ';
|
||||
print $formventilation->select_auxaccount($search_code_tiers_start, 'search_code_tiers_start', 1);
|
||||
print $formaccounting->select_auxaccount($search_code_tiers_start, 'search_code_tiers_start', 1);
|
||||
print $langs->trans('To') . ' ' . $langs->trans('ThirdPartyAccount') . ': ';
|
||||
print $formventilation->select_auxaccount($search_code_tiers_end, 'searchcode_tiers_end', 1);
|
||||
print $formaccounting->select_auxaccount($search_code_tiers_end, 'searchcode_tiers_end', 1);
|
||||
print '</div>';
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
@@ -267,9 +267,8 @@ print "</tr>\n";
|
||||
$var = True;
|
||||
|
||||
foreach ( $object->lines as $line ) {
|
||||
$var = ! $var;
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $line->piece_num . '</td>' . "\n";
|
||||
print '<td>' . $line->doc_type . '</td>' . "\n";
|
||||
print '<td align="center">' . dol_print_date($line->doc_date) . '</td>';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
|
||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.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
|
||||
@@ -17,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountancycategory.class.php
|
||||
* \file htdocs/accountancy/class/accountancycategory.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief File of class to manage categories of an accounting category_type
|
||||
* \brief File of class to manage categories of an accounting category_type
|
||||
*/
|
||||
|
||||
// Class
|
||||
@@ -72,7 +72,6 @@ class AccountancyCategory
|
||||
$this->lines_display[] = $obj;
|
||||
}
|
||||
}
|
||||
|
||||
return $num;
|
||||
} else {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
|
||||
@@ -47,6 +47,7 @@ class AccountancyExport
|
||||
public static $EXPORT_TYPE_QUADRATUS = 6;
|
||||
public static $EXPORT_TYPE_EBP = 7;
|
||||
public static $EXPORT_TYPE_COGILOG = 8;
|
||||
public static $EXPORT_TYPE_AGIRIS = 9;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -96,6 +97,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_QUADRATUS => $langs->trans('Modelcsv_quadratus'),
|
||||
self::$EXPORT_TYPE_EBP => $langs->trans('Modelcsv_ebp'),
|
||||
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
||||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -145,6 +147,9 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_COGILOG :
|
||||
$this->exportCogilog($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_AGIRIS :
|
||||
$this->exportAgiris($TData);
|
||||
break;
|
||||
default:
|
||||
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
||||
break;
|
||||
@@ -382,7 +387,7 @@ class AccountancyExport
|
||||
|
||||
|
||||
/**
|
||||
* Export format : Normal
|
||||
* Export format : EBP
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
@@ -412,6 +417,47 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Export format : Agiris
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportAgiris($objectLines) {
|
||||
|
||||
$this->separator = ';';
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
|
||||
print $line->id . $this->separator;
|
||||
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
|
||||
print $date . $this->separator;
|
||||
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
|
||||
|
||||
if (empty($line->code_tiers)) {
|
||||
print length_accountg($line->numero_compte) . $this->separator;
|
||||
} else {
|
||||
if (substr($line->numero_compte, 0, 1) == 'C' || substr($line->numero_compte, 0, 1) == '9') {
|
||||
print '411' . substr(str_replace(" ", "", $line->code_tiers), 0, 5) . $this->separator;
|
||||
}
|
||||
if (substr($line->numero_compte, 0, 1) == 'F' || substr($line->numero_compte, 0, 1) == '0') {
|
||||
print '401' . substr(str_replace(" ", "", $line->code_tiers), 0, 5) . $this->separator;
|
||||
}
|
||||
}
|
||||
|
||||
print length_accounta($line->code_tiers) . $this->separator;
|
||||
print price($line->debit) . $this->separator;
|
||||
print price($line->credit) . $this->separator;
|
||||
print price($line->montant).$this->separator;
|
||||
print $line->sens.$this->separator;
|
||||
print $line->code_journal . $this->separator;
|
||||
print $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -251,12 +251,12 @@ class AccountingAccount extends CommonObject
|
||||
$sql .= " SET fk_pcg_version = " . ($this->fk_pcg_version ? "'" . $this->db->escape($this->fk_pcg_version) . "'" : "null");
|
||||
$sql .= " , pcg_type = " . ($this->pcg_type ? "'" . $this->db->escape($this->pcg_type) . "'" : "null");
|
||||
$sql .= " , pcg_subtype = " . ($this->pcg_subtype ? "'" . $this->db->escape($this->pcg_subtype) . "'" : "null");
|
||||
$sql .= " , account_number = '" . $this->account_number . "'";
|
||||
$sql .= " , account_parent = '" . $this->account_parent . "'";
|
||||
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
|
||||
$sql .= " , account_parent = '" . $this->db->escape($this->account_parent) . "'";
|
||||
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "null");
|
||||
$sql .= " , fk_accounting_category = '" . $this->account_category . "'";
|
||||
$sql .= " , fk_accounting_category = '" . $this->db->escape($this->account_category) . "'";
|
||||
$sql .= " , fk_user_modif = " . $user->id;
|
||||
$sql .= " , active = '" . $this->active . "'";
|
||||
$sql .= " , active = " . $this->active;
|
||||
$sql .= " WHERE rowid = " . $this->id;
|
||||
|
||||
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
|
||||
@@ -364,27 +364,63 @@ class AccountingAccount extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @return string Chaine avec URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $withlabel 0=No label, 1=Include label of account
|
||||
* @param int $nourl 1=Disable url
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto = 0) {
|
||||
global $langs;
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result = '';
|
||||
|
||||
$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id . '">';
|
||||
$linkend = '</a>';
|
||||
|
||||
|
||||
$url = DOL_URL_ROOT . '/accountancy/admin/card.php?id=' . $this->id;
|
||||
|
||||
$picto = 'billr';
|
||||
|
||||
$label = $langs->trans("Show") . ': ' . $this->account_number . ' - ' . $this->label;
|
||||
|
||||
if ($withpicto)
|
||||
$result .= ($link . img_object($label, $picto) . $linkend);
|
||||
if ($withpicto && $withpicto != 2)
|
||||
$result .= ' ';
|
||||
if ($withpicto != 2)
|
||||
$result .= $link . $this->account_number . $linkend;
|
||||
$label='';
|
||||
|
||||
$label = '<u>' . $langs->trans("ShowAccountingAccount") . '</u>';
|
||||
if (! empty($this->account_number))
|
||||
$label .= '<br><b>'.$langs->trans('AccountAccounting') . ':</b> ' . length_accountg($this->account_number);
|
||||
if (! empty($this->label))
|
||||
$label .= '<br><b>'.$langs->trans('Label') . ':</b> ' . $this->label;
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowAccoutingAccount");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart='<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($nourl)
|
||||
{
|
||||
$linkstart = '';
|
||||
$linkclose = '';
|
||||
$linkend = '';
|
||||
}
|
||||
|
||||
$label_link = length_accountg($this->account_number);
|
||||
if ($withlabel) $label_link .= ' - ' . $this->label;
|
||||
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result .= ' ';
|
||||
if ($withpicto != 2) $result.=$linkstart . $label_link . $linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
204
htdocs/accountancy/class/accountingjournal.class.php
Normal file
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/accountingjournal.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief File of class to manage accounting journals
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class to manage accounting accounts
|
||||
*/
|
||||
class AccountingJournal extends CommonObject
|
||||
{
|
||||
public $element='accounting_journal';
|
||||
public $table_element='accounting_journal';
|
||||
public $fk_element = '';
|
||||
protected $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
|
||||
var $rowid;
|
||||
|
||||
var $code;
|
||||
var $label;
|
||||
var $nature; // 0:various operations, 1:sale, 2:purchase, 3:bank, 9: has-new
|
||||
var $active;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handle
|
||||
*/
|
||||
function __construct($db) {
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an object from database
|
||||
*
|
||||
* @param int $rowid Id of record to load
|
||||
* @param string $journal_code Journal code
|
||||
* @return int <0 if KO, Id of record if OK and found
|
||||
*/
|
||||
function fetch($rowid = null, $journal_code = null)
|
||||
{
|
||||
if ($rowid || $journal_code)
|
||||
{
|
||||
$sql = "SELECT rowid, code, label, nature, active";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_journal";
|
||||
$sql .= " WHERE";
|
||||
if ($rowid) {
|
||||
$sql .= " rowid = '" . $rowid . "'";
|
||||
} elseif ($journal_code) {
|
||||
$sql .= " code = '" . $journal_code . "'";
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch sql=" . $sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$obj = $this->db->fetch_object($result);
|
||||
|
||||
if ($obj) {
|
||||
$this->id = $obj->rowid;
|
||||
$this->rowid = $obj->rowid;
|
||||
|
||||
$this->code = $obj->code;
|
||||
$this->ref = $obj->code;
|
||||
$this->label = $obj->label;
|
||||
$this->nature = $obj->nature;
|
||||
$this->active = $obj->active;
|
||||
|
||||
return $this->id;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
$this->errors[] = "Error " . $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $withlabel 0=No label, 1=Include label of journal
|
||||
* @param int $nourl 1=Disable url
|
||||
* @param string $moretitle Add more text to title tooltip
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
|
||||
|
||||
$result = '';
|
||||
|
||||
$url = DOL_URL_ROOT . '/accountancy/admin/journals_list.php?id=35';
|
||||
|
||||
$picto = 'billr';
|
||||
$label='';
|
||||
|
||||
$label = '<u>' . $langs->trans("ShowAccountingJournal") . '</u>';
|
||||
if (! empty($this->code))
|
||||
$label .= '<br><b>'.$langs->trans('Code') . ':</b> ' . $this->code;
|
||||
if (! empty($this->label))
|
||||
$label .= '<br><b>'.$langs->trans('Label') . ':</b> ' . $this->label;
|
||||
if ($moretitle) $label.=' - '.$moretitle;
|
||||
|
||||
$linkclose='';
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowAccoutingJournal");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.=' class="classfortooltip"';
|
||||
}
|
||||
|
||||
$linkstart='<a href="'.$url.'"';
|
||||
$linkstart.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
if ($nourl)
|
||||
{
|
||||
$linkstart = '';
|
||||
$linkclose = '';
|
||||
$linkend = '';
|
||||
}
|
||||
|
||||
$label_link = $this->code;
|
||||
if ($withlabel) $label_link .= ' - ' . $this->label;
|
||||
|
||||
if ($withpicto) $result.=($linkstart.img_object(($notooltip?'':$label), $picto, ($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result .= ' ';
|
||||
if ($withpicto != 2) $result.=$linkstart . $label_link . $linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le libelle du statut d'un user (actif, inactif)
|
||||
*
|
||||
* @param int $mode 0=libelle long, 1=libelle court
|
||||
* @return string Label of type
|
||||
*/
|
||||
function getLibType($mode=0)
|
||||
{
|
||||
return $this->LibType($this->nature,$mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return type of an accounting journal
|
||||
*
|
||||
* @param int $nature Id type
|
||||
* @param int $mode 0=libelle long, 1=libelle court
|
||||
* @return string Label of type
|
||||
*/
|
||||
function LibType($nature,$mode=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$langs->load("accountancy");
|
||||
|
||||
if ($mode == 0)
|
||||
{
|
||||
$prefix='';
|
||||
if ($nature == 9) return $langs->trans('AccountingJournalType9');
|
||||
if ($nature == 4) return $langs->trans('AccountingJournalType4');
|
||||
if ($nature == 3) return $langs->trans('AccountingJournalType3');
|
||||
if ($nature == 2) return $langs->trans('AccountingJournalType2');
|
||||
if ($nature == 1) return $langs->trans('AccountingJournalType1');
|
||||
}
|
||||
if ($mode == 1)
|
||||
{
|
||||
if ($nature == 9) return $langs->trans('AccountingJournalType9');
|
||||
if ($nature == 4) return $langs->trans('AccountingJournalType4');
|
||||
if ($nature == 3) return $langs->trans('AccountingJournalType3');
|
||||
if ($nature == 2) return $langs->trans('AccountingJournalType2');
|
||||
if ($nature == 1) return $langs->trans('AccountingJournalType1');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,381 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/class/html.formventilation.class.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief File of class with all html predefined components
|
||||
*/
|
||||
|
||||
/**
|
||||
* Class to manage generation of HTML components for bank module
|
||||
*/
|
||||
class FormVentilation extends Form
|
||||
{
|
||||
|
||||
private $options_cache = array();
|
||||
|
||||
|
||||
/**
|
||||
* Return select filter with date of transaction
|
||||
*
|
||||
* @param string $htmlname Name of select field
|
||||
* @param string $selectedkey Value
|
||||
* @return string HTML edit field
|
||||
*/
|
||||
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') {
|
||||
$options = array();
|
||||
|
||||
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
|
||||
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql .= ' ORDER BY import_key DESC';
|
||||
|
||||
dol_syslog(get_class($this) . "::select_bookkeeping_importkey", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_bookkeeping_importkey " . $this->error, LOG_ERR);
|
||||
return - 1;
|
||||
}
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$options[$obj->import_key] = dol_print_date($obj->import_key, 'dayhourtext');
|
||||
}
|
||||
|
||||
return Form::selectarray($htmlname, $options, $selectedkey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of accounts with label by chart of accounts
|
||||
*
|
||||
* @param string $selectid Preselected id or code of accounting accounts (depends on $select_in)
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
* @param int $select_in 0=selectid value is a aa.rowid (default) or 1=selectid is aa.account_number
|
||||
* @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number
|
||||
* @param string $morecss More css non HTML object
|
||||
* @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache.
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
$options = array();
|
||||
if ($usecache && ! empty($this->options_cache[$usecache]))
|
||||
{
|
||||
$options = $this->options_cache[$usecache];
|
||||
$selected=$selectid;
|
||||
}
|
||||
else
|
||||
{
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT') ? $conf->global->ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT : 50;
|
||||
|
||||
$sql = "SELECT DISTINCT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " AND aa.active = 1";
|
||||
$sql .= " ORDER BY aa.account_number";
|
||||
|
||||
dol_syslog(get_class($this) . "::select_account", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->error = "Error " . $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . "::select_account " . $this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$out = ajax_combobox($htmlname, $event);
|
||||
|
||||
$selected = 0;
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
$label = length_accountg($obj->account_number) . ' - ' . $obj->label;
|
||||
$label = dol_trunc($label, $trunclength);
|
||||
|
||||
$select_value_in = $obj->rowid;
|
||||
$select_value_out = $obj->rowid;
|
||||
|
||||
// Try to guess if we have found default value
|
||||
if ($select_in == 1) {
|
||||
$select_value_in = $obj->account_number;
|
||||
}
|
||||
if ($select_out == 1) {
|
||||
$select_value_out = $obj->account_number;
|
||||
}
|
||||
// Remember guy's we store in database llx_facturedet the rowid of accounting_account and not the account_number
|
||||
// Because same account_number can be share between different accounting_system and do have the same meaning
|
||||
if ($selectid != '' && $selectid == $select_value_in) {
|
||||
//var_dump("Found ".$selectid." ".$select_value_in);
|
||||
$selected = $select_value_out;
|
||||
}
|
||||
|
||||
$options[$select_value_out] = $label;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if ($usecache)
|
||||
{
|
||||
$this->options_cache[$usecache] = $options;
|
||||
}
|
||||
}
|
||||
|
||||
$out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1);
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of accounts with label by class of accounts
|
||||
*
|
||||
* @param string $selectid Preselected pcg_type
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_pcgtype($selectid, $htmlname = 'pcg_type', $showempty = 0, $event = array()) {
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT DISTINCT pcg_type ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " ORDER BY pcg_type";
|
||||
|
||||
dol_syslog(get_class($this) . "::select_pcgtype", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::select_pcgtype ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$options = array();
|
||||
$out = ajax_combobox($htmlname, $event);
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
if ($obj->pcg_type != '-1')
|
||||
{
|
||||
$options[$obj->pcg_type] = $obj->pcg_type;
|
||||
}
|
||||
}
|
||||
|
||||
$out .= Form::selectarray($htmlname, $options, $selectid, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||
|
||||
$this->db->free($resql);
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of accounts with label by sub_class of accounts
|
||||
*
|
||||
* @param string $selectid Preselected pcg_type
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_pcgsubtype($selectid, $htmlname = 'pcg_subtype', $showempty = 0, $event = array())
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT DISTINCT pcg_subtype ";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
||||
$sql .= " AND asy.rowid = " . $conf->global->CHARTOFACCOUNTS;
|
||||
$sql .= " ORDER BY pcg_subtype";
|
||||
|
||||
dol_syslog(get_class($this) . "::select_pcgsubtype", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::select_pcgsubtype ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$options = array();
|
||||
$out = ajax_combobox($htmlname, $event);
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
if ($obj->pcg_type != '-1')
|
||||
{
|
||||
$options[$obj->pcg_subtype] = $obj->pcg_subtype;
|
||||
}
|
||||
}
|
||||
|
||||
$out .= Form::selectarray($htmlname, $options, $selectid, $showempty, 0, 0, '', 0, 0, 0, '', 'minwidth200');
|
||||
|
||||
$this->db->free($resql);
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return list of auxilary thirdparty accounts
|
||||
*
|
||||
* @param string $selectid Preselected pcg_type
|
||||
* @param string $htmlname Name of field in html form
|
||||
* @param int $showempty Add an empty field
|
||||
* @param array $event Event options
|
||||
*
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $event = array()) {
|
||||
|
||||
$aux_account = array();
|
||||
|
||||
// Auxiliary customer account
|
||||
$sql = "SELECT DISTINCT code_compta, nom ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe";
|
||||
$sql .= " WHERE entity IN (" . getEntity("societe", 1) . ")";
|
||||
$sql .= " ORDER BY code_compta";
|
||||
dol_syslog(get_class($this)."::select_auxaccount", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if (!empty($obj->code_compta)) {
|
||||
$aux_account[$obj->code_compta] = $obj->code_compta.' ('.$obj->nom.')';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::select_pcgsubtype ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
// Auxiliary supplier account
|
||||
$sql = "SELECT DISTINCT code_compta_fournisseur, nom ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe";
|
||||
$sql .= " WHERE entity IN (" . getEntity("societe", 1) . ")";
|
||||
$sql .= " ORDER BY code_compta_fournisseur";
|
||||
dol_syslog(get_class($this)."::select_auxaccount", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if (!empty($obj->code_compta_fournisseur)) {
|
||||
$aux_account[$obj->code_compta_fournisseur] = $obj->code_compta_fournisseur.' ('.$obj->nom.')';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::select_pcgsubtype ".$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
// Build select
|
||||
$out = ajax_combobox($htmlname, $event);
|
||||
$out .= Form::selectarray($htmlname, $aux_account, $selectid, $showempty, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTML combo list of years existing into book keepping
|
||||
*
|
||||
* @param string $selected Preselected value
|
||||
* @param string $htmlname Name of HTML select object
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @param string $output_format (html/opton (for option html only)/array (to return options arrays
|
||||
* @return string/array
|
||||
*/
|
||||
function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$out_array = array();
|
||||
|
||||
$sql = "SELECT DISTINCT date_format(doc_date,'%Y') as dtyear";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql .= " ORDER BY date_format(doc_date,'%Y')";
|
||||
dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::".__METHOD__.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$out_array[$obj->dtyear] = $obj->dtyear;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if ($output_format == 'html') {
|
||||
return Form::selectarray($htmlname, $out_array, $selected, $useempty, 0, 0, 'placeholder="aa"');
|
||||
} else {
|
||||
return $out_array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return HTML combo list of years existing into book keepping
|
||||
*
|
||||
* @param string $selected Preselected value
|
||||
* @param string $htmlname Name of HTML select object
|
||||
* @param int $useempty Affiche valeur vide dans liste
|
||||
* @param string $output_format Html/option (for option html only)/array (to return options arrays
|
||||
* @return string/array
|
||||
*/
|
||||
function selectjournal_accountancy_bookkepping($selected = '', $htmlname = 'journalid', $useempty = 0, $output_format = 'html')
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
$out_array = array();
|
||||
|
||||
$sql = "SELECT DISTINCT code_journal";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " WHERE entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql .= " ORDER BY code_journal";
|
||||
dol_syslog(get_class($this)."::".__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if (!$resql) {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(get_class($this)."::".__METHOD__.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$out_array[$obj->code_journal] = $obj->code_journal?$obj->code_journal:$langs->trans("NotDefined"); // TODO Not defined is accepted ? We should avoid this, shouldn't we ?
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
if ($output_format == 'html') {
|
||||
return Form::selectarray($htmlname, $out_array, $selected, $useempty, 0, 0, 'placeholder="aa"');
|
||||
} else {
|
||||
return $out_array;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,7 +26,7 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
@@ -39,9 +39,7 @@ $id = GETPOST('id');
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -84,7 +82,7 @@ if ($cancel == $langs->trans("Cancel")) {
|
||||
*/
|
||||
$form = new Form($db);
|
||||
$facture_static = new Facture($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
if (! empty($id)) {
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price,";
|
||||
@@ -95,51 +93,51 @@ if (! empty($id)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = l.fk_facture";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog("/accounting/customer/card.php sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
||||
|
||||
if ($result) {
|
||||
$num_lines = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
|
||||
if ($num_lines) {
|
||||
|
||||
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans('CustomersVentilation'), '', 'title_setup');
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// Ref facture
|
||||
print '<tr><td>' . $langs->trans("Invoice") . '</td>';
|
||||
$facture_static->ref = $objp->facnumber;
|
||||
$facture_static->id = $objp->facid;
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr><td width="20%">' . $langs->trans("Line") . '</td>';
|
||||
print '<td>' . nl2br($objp->description) . '</td></tr>';
|
||||
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
|
||||
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||
print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print "Error";
|
||||
|
||||
@@ -141,7 +141,7 @@ if ($action == 'validatehistory') {
|
||||
$sql1.= " WHERE fd.fk_facture IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND f.entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.=")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
@@ -187,7 +187,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -228,7 +228,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_factu
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
@@ -244,8 +244,7 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -285,7 +284,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_factu
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
@@ -301,8 +300,7 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -343,7 +341,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
@@ -389,7 +387,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.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 . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
@@ -43,6 +43,7 @@ $langs->load("productbatch");
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
// Search Getpost
|
||||
$search_lineid = GETPOST('search_lineid', 'int');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
@@ -54,7 +55,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
||||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page', 'int');
|
||||
@@ -76,7 +77,7 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
|
||||
/*
|
||||
@@ -86,6 +87,7 @@ $formventilation = new FormVentilation($db);
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
@@ -151,7 +153,7 @@ print '<script type="text/javascript">
|
||||
* Customer Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
||||
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.total_ttc,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||
$sql .= " fd.situation_percent, co.label as country, s.tva_intra";
|
||||
@@ -162,13 +164,16 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_factu
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql .= " WHERE fd.fk_code_ventilation > 0 ";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
if ($search_lineid) {
|
||||
$sql .= natural_search("fd.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.facnumber", $search_invoice);
|
||||
}
|
||||
@@ -196,7 +201,7 @@ if (strlen(trim($search_country))) {
|
||||
if (strlen(trim($search_tvaintra))) {
|
||||
$sql .= natural_search("s.tva_intra", $search_tva_intra);
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
@@ -243,19 +248,37 @@ if ($result) {
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" 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_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
print $langs->trans("DescVentilDoneCustomer") . '<br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formventilation->select_account($account_parent, 'account_parent', 1);
|
||||
print $formaccounting->select_account($account_parent, 'account_parent', 1);
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '"/></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" placeholder="%" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "fd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
@@ -268,46 +291,28 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Country"), $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATIntra"), $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
$clickpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($clickpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tavintra" value="' . dol_escape_htmltag($search_tavintra) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
||||
print $searchpitco;
|
||||
print "</td></tr>\n";
|
||||
|
||||
$facture_static = new Facture($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
$var = True;
|
||||
while ( $objp = $db->fetch_object($result) ) {
|
||||
$var = ! $var;
|
||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
|
||||
|
||||
$facture_static->ref = $objp->facnumber;
|
||||
$facture_static->id = $objp->rowid;
|
||||
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
$product_static->type = $objp->product_type;
|
||||
$product_static->label = $objp->product_label;
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
|
||||
@@ -319,31 +324,34 @@ if ($result) {
|
||||
print $product_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
print $form->textwithtooltip(dol_trunc($text,$trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="right">' . price($objp->total_ht) . '</td>';
|
||||
print '<td align="center">' . price($objp->tva_tx) . '</td>';
|
||||
print '<td>';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->fdid . '">';
|
||||
print $codecompta . ' <a href="./card.php?id=' . $objp->rowid . '">';
|
||||
print img_edit();
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->country .'</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
print '<td align="right"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->fdid . '"/></td>';
|
||||
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
print "</tr>";
|
||||
$i ++;
|
||||
}
|
||||
|
||||
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
|
||||
|
||||
if ($nbtotalofrecords > $limit) {
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, '', 0, '', '', $limit, 1);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ require '../../main.inc.php';
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
@@ -52,6 +52,7 @@ $toselect = GETPOST('toselect', 'array');
|
||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||
|
||||
// Search Getpost
|
||||
$search_lineid = GETPOST('search_lineid', 'int');
|
||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
@@ -62,7 +63,7 @@ $search_vat = GETPOST('search_vat', 'alpha');
|
||||
$btn_ventil = GETPOST('ventil', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page','int');
|
||||
@@ -84,7 +85,7 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
||||
$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT, 1);
|
||||
@@ -100,6 +101,7 @@ if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction !=
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
@@ -177,7 +179,7 @@ llxHeader('', $langs->trans("Ventilation"));
|
||||
|
||||
// Customer Invoice lines
|
||||
$sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
|
||||
$sql .= " l.fk_product, l.description, l.total_ht, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,";
|
||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line,";
|
||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql .= " aa.rowid as aarowid";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
@@ -189,6 +191,9 @@ $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND product_type <= 2";
|
||||
$sql .= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_sell IS NULL OR p.accountancy_code_sell ='')";
|
||||
// Add search filter like
|
||||
if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.facnumber",$search_invoice);
|
||||
}
|
||||
@@ -215,7 +220,7 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@@ -236,7 +241,7 @@ if ($result) {
|
||||
$i = 0;
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
@@ -249,8 +254,7 @@ if ($result) {
|
||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
//if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@@ -258,19 +262,37 @@ if ($result) {
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
//$center='<div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '" name="ventil"></div>';
|
||||
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilTodoCustomer") . '</br><br>';
|
||||
|
||||
if ($msg) print $msg.'<br>';
|
||||
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.facnumber", "", $param, '', $sortfield, $sortorder);
|
||||
@@ -282,27 +304,11 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '">%</td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$facture_static = new Facture($db);
|
||||
$product_static = new Product($db);
|
||||
$form = new Form($db);
|
||||
@@ -310,7 +316,6 @@ if ($result) {
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
$objp->code_sell_l = '';
|
||||
$objp->code_sell_p = '';
|
||||
@@ -324,7 +329,7 @@ if ($result) {
|
||||
$facture_static->ref = $objp->facnumber;
|
||||
$facture_static->id = $objp->facid;
|
||||
$facture_static->type = $objp->ftype;
|
||||
|
||||
|
||||
$code_sell_p_notset = '';
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
|
||||
@@ -344,30 +349,30 @@ if ($result) {
|
||||
if (! empty($objp->code_sell)) {
|
||||
$objp->code_sell_p = $objp->code_sell; // Code on product
|
||||
} else {
|
||||
$code_sell_p_notset = 'color:orange';
|
||||
$code_sell_p_notset = 'color:orange';
|
||||
}
|
||||
if (empty($objp->code_sell_l) && empty($objp->code_sell_p)) $code_sell_p_notset = 'color:red';
|
||||
|
||||
|
||||
// $objp->code_sell_p is now code of product/service
|
||||
// $objp->code_sell_l is now default code of product/service
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facture_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
|
||||
// Ref Product
|
||||
print '<td>';
|
||||
if ($product_static->id)
|
||||
print $product_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = defined('ACCOUNTING_LENGTH_DESCRIPTION') ? ACCOUNTING_LENGTH_DESCRIPTION : 32;
|
||||
@@ -377,14 +382,14 @@ if ($result) {
|
||||
print '<td align="right">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Vat rate
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p)
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
print '<td style="' . $code_vat_differ . '" align="right">';
|
||||
print price($objp->tva_tx_line);
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Current account
|
||||
print '<td align="center" style="' . $code_sell_p_notset . '">';
|
||||
print (($objp->type_l == 1)?$langs->trans("DefaultForService"):$langs->trans("DefaultForProduct")) . ' = ' . ($objp->code_sell_l > 0 ? length_accountg($objp->code_sell_l) : $langs->trans("Unknown"));
|
||||
@@ -397,10 +402,10 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td align="center">';
|
||||
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@@ -408,7 +413,7 @@ if ($result) {
|
||||
}
|
||||
print '</table>';
|
||||
print "</div>";
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print $db->error();
|
||||
|
||||
@@ -30,7 +30,7 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
@@ -85,7 +85,7 @@ if ($cancel == $langs->trans("Cancel")) {
|
||||
// Create
|
||||
$form = new Form($db);
|
||||
$expensereport_static = new ExpenseReport($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
if (! empty($id)) {
|
||||
$sql = "SELECT er.ref, er.rowid as facid, erd.fk_c_type_fees, erd.comments, erd.rowid, erd.fk_code_ventilation,";
|
||||
@@ -96,7 +96,7 @@ if (! empty($id)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON erd.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
|
||||
$sql .= " WHERE er.fk_statut > 0 AND erd.rowid = " . $id;
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog("/accounting/expensereport/card.php sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -135,7 +135,7 @@ if (! empty($id)) {
|
||||
print '<td>' . ($langs->trans($objp->type_fees_code) == $objp->type_fees_code ? $objp->type_fees_label : $langs->trans(($objp->type_fees_code))) . '</td>';
|
||||
|
||||
print '<tr><td>' . $langs->trans("Account") . '</td><td>';
|
||||
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||
print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ if ($year == 0) {
|
||||
}
|
||||
|
||||
// Validate History
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
|
||||
/*
|
||||
@@ -134,7 +134,7 @@ if ($action == 'validatehistory') {
|
||||
$sql1.= " WHERE erd.fk_expensereport IN ( SELECT er.rowid FROM " . MAIN_DB_PREFIX . "expensereport as er";
|
||||
$sql1.= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||
$sql1.= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND er.entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.=")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
@@ -167,7 +167,7 @@ print '<br>';
|
||||
|
||||
//print '<div class="inline-block divButAction">';
|
||||
// TODO Remove this. Should be done always.
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 0) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL > 1) print '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=fixaccountancycode">' . $langs->trans("CleanFixHistory", $year_current) . '</a>';
|
||||
//print '</div>';
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid =
|
||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
@@ -217,8 +217,7 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -260,7 +259,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid =
|
||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
@@ -271,8 +270,7 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -315,7 +313,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND er.fk_statut > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
@@ -52,7 +52,7 @@ $search_account = GETPOST('search_account', 'alpha');
|
||||
$search_vat = GETPOST('search_vat', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page', 'int');
|
||||
@@ -74,7 +74,7 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
|
||||
/*
|
||||
@@ -173,7 +173,7 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= " AND (erd.tva_tx like '" . $search_vat . "%')";
|
||||
}
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@@ -219,13 +219,14 @@ if ($result) {
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" 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_barre_liste($langs->trans("ExpenseReportLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilDoneExpenseReport") . '<br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print $formaccounting->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
@@ -233,6 +234,22 @@ if ($result) {
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_vat" size="1" placeholder="%" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||
@@ -243,23 +260,8 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre('');
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons(1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
$expensereport_static = new ExpenseReport($db);
|
||||
@@ -267,13 +269,12 @@ if ($result) {
|
||||
$var = True;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
$codeCompta = length_accountg($objp->account_number) . ' - ' . $objp->label;
|
||||
|
||||
$expensereport_static->ref = $objp->ref;
|
||||
$expensereport_static->id = $objp->erid;
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
@@ -300,7 +301,7 @@ if ($result) {
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
print '<td align="right"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
print "</tr>";
|
||||
$i ++;
|
||||
|
||||
@@ -29,7 +29,7 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
@@ -61,7 +61,7 @@ $search_vat = GETPOST('search_vat', 'alpha');
|
||||
$btn_ventil = GETPOST('ventil', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page','int');
|
||||
@@ -83,7 +83,7 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("erd.tva_tx",$search_vat,1);
|
||||
}
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@@ -246,9 +246,8 @@ if ($result) {
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
//$center='<div class="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '" name="ventil"></div>';
|
||||
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print_barre_liste($langs->trans("ExpenseReportLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilTodoExpenseReport") . '</br><br>';
|
||||
@@ -259,6 +258,24 @@ if ($result) {
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("ExpenseReport"), $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
|
||||
@@ -269,33 +286,18 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "erd.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="' . dol_escape_htmltag($search_expensereport) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
|
||||
$expensereport_static = new ExpenseReport($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
$objp->aarowid_suggest = '';
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
@@ -303,7 +305,7 @@ if ($result) {
|
||||
$expensereport_static->ref = $objp->ref;
|
||||
$expensereport_static->id = $objp->erid;
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
@@ -341,10 +343,10 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td align="center">';
|
||||
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
print '<td align="right">';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -45,10 +45,13 @@ $langs->load("compta");
|
||||
$langs->load("banks");
|
||||
$langs->load("loans");
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@@ -71,33 +74,33 @@ print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescMisc", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
if (! empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
@@ -112,7 +115,6 @@ if (! empty($conf->expensereport->enabled)) // TODO Move this in the default ac
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
@@ -120,49 +122,50 @@ if (! empty($conf->loan->enabled))
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
$textlink='<strong>'.$langs->transnoentitiesnoconv("Home").'-'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, $textlink);
|
||||
print "<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>')."<br>\n";
|
||||
$textlink='<strong>'.$langs->transnoentitiesnoconv("MenuBankCash").'</strong>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, $textlink);
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print "<br>\n";
|
||||
print_fiche_titre($langs->trans("AccountancyAreaDescActionFreq"), '', 'object_calendarweek');
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
$step = 0;
|
||||
|
||||
$langs->loadLangs(array('bills', 'trips'));
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescCustomer", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSupplier", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", $step)."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", $step)."<br>\n";
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
llxFooter();
|
||||
|
||||
@@ -28,17 +28,17 @@
|
||||
* \brief Page with bank journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/don/class/don.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/don/class/paymentdonation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/salaries/class/paymentsalary.class.php';
|
||||
@@ -51,8 +51,6 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
|
||||
|
||||
|
||||
// Langs
|
||||
$langs->load("companies");
|
||||
$langs->load("other");
|
||||
$langs->load("compta");
|
||||
@@ -61,9 +59,10 @@ $langs->load('bills');
|
||||
$langs->load('donations');
|
||||
$langs->load("accountancy");
|
||||
$langs->load("trips");
|
||||
$langs->load("hrm");
|
||||
$langs->load("salaries");
|
||||
|
||||
$id_bank_account = GETPOST('id_account', 'int');
|
||||
// Multi journal
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth');
|
||||
$date_startday = GETPOST('date_startday');
|
||||
@@ -71,21 +70,22 @@ $date_startyear = GETPOST('date_startyear');
|
||||
$date_endmonth = GETPOST('date_endmonth');
|
||||
$date_endday = GETPOST('date_endday');
|
||||
$date_endyear = GETPOST('date_endyear');
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
$now = dol_now();
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
// Security check
|
||||
if ($user->societe_id > 0 && empty($id_bank_account))
|
||||
if ($user->societe_id > 0 && empty($id_journal))
|
||||
accessforbidden();
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
@@ -106,18 +106,18 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
$idpays = $p[0];
|
||||
|
||||
$sql = "SELECT b.rowid , b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
|
||||
$sql .= " ba.courant, ba.ref as baref, ba.account_number,";
|
||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
|
||||
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
|
||||
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop,";
|
||||
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as name, u.firstname as firstname, bu2.type as typeop";
|
||||
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='user'";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as soc on bu1.url_id=soc.rowid";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "user as u on bu2.url_id=u.rowid";
|
||||
$sql .= " WHERE ba.rowid=" . $id_bank_account;
|
||||
$sql .= ' AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||
$sql .= " WHERE ba.fk_accountancy_journal=" . $id_journal;
|
||||
$sql .= ' AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND b.dateo >= '" . $db->idate($date_start) . "' AND b.dateo <= '" . $db->idate($date_end) . "'";
|
||||
$sql .= " ORDER BY b.datev";
|
||||
@@ -134,9 +134,10 @@ $paymentsalstatic = new PaymentSalary($db);
|
||||
$paymentexpensereportstatic = new PaymentExpenseReport($db);
|
||||
|
||||
// Get code of finance journal
|
||||
$bank_code_journal = new Account($db);
|
||||
$result = $bank_code_journal->fetch($id_bank_account);
|
||||
$journal = $bank_code_journal->accountancy_journal;
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch($id_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -163,7 +164,7 @@ if ($result) {
|
||||
// one line for bank jounral = tabbq
|
||||
// one line for thirdparty journal = tabtp
|
||||
$i = 0;
|
||||
while ( $i < $num )
|
||||
while ( $i < $num )
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
@@ -177,16 +178,17 @@ if ($result) {
|
||||
$tabcompany[$obj->rowid] = array (
|
||||
'id' => $obj->socid,
|
||||
'name' => $obj->name,
|
||||
'code_compta' => $compta_soc,
|
||||
'code_compta' => $compta_soc,
|
||||
);
|
||||
|
||||
|
||||
$compta_user = (! empty($obj->accountancy_code) ? $obj->accountancy_code : $account_employee);
|
||||
|
||||
$tabuser[$obj->rowid] = array (
|
||||
'id' => $obj->userid,
|
||||
'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),
|
||||
'lastname' => $obj->lastname,
|
||||
'firstname' => $obj->firstname,
|
||||
'accountancy_code' => $compta_user,
|
||||
'accountancy_code' => $compta_user,
|
||||
);
|
||||
|
||||
// Variable bookkeeping
|
||||
@@ -203,14 +205,14 @@ if ($result) {
|
||||
|
||||
// get_url may return -1 which is not traversable
|
||||
if (is_array($links)) {
|
||||
// Now loop on each link of record in bank.
|
||||
// Now loop on each link of record in bank.
|
||||
foreach ( $links as $key => $val ) {
|
||||
|
||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport'))) // So we excluded 'company' here
|
||||
{
|
||||
// We save tabtype for a future use, to remember what kind of payment it is
|
||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||
}
|
||||
|
||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'payment_salary'))) // So we excluded 'company' here
|
||||
{
|
||||
// We save tabtype for a future use, to remember what kind of payment it is
|
||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||
}
|
||||
|
||||
if ($links[$key]['type'] == 'payment') {
|
||||
$paymentstatic->id = $links[$key]['url_id'];
|
||||
@@ -262,20 +264,22 @@ if ($result) {
|
||||
} else if ($links[$key]['type'] == 'payment_donation') {
|
||||
$paymentdonstatic->id = $links[$key]['url_id'];
|
||||
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentDonation");
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
|
||||
$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'payment_vat') {
|
||||
$paymentvatstatic->id = $links[$key]['url_id'];
|
||||
$paymentvatstatic->ref = $links[$key]['url_id'];
|
||||
$paymentvatstatic->label = $links[$key]['label'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentVat");
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
|
||||
$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'payment_salary') {
|
||||
$paymentsalstatic->id = $links[$key]['url_id'];
|
||||
$paymentsalstatic->ref = $links[$key]['url_id'];
|
||||
$paymentsalstatic->label = $links[$key]['label'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
||||
// $tabtp[$obj->rowid][$account_employee] += $obj->amount;
|
||||
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
||||
} else if ($links[$key]['type'] == 'payment_expensereport') {
|
||||
$paymentexpensereportstatic->id = $links[$key]['url_id'];
|
||||
$paymentexpensereportstatic->fk_expensereport = $links[$key]['url_id'];
|
||||
@@ -290,26 +294,26 @@ if ($result) {
|
||||
|
||||
$tabbq[$obj->rowid][$compta_bank] += $obj->amount;
|
||||
|
||||
|
||||
|
||||
// Check account number is ok
|
||||
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
||||
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
||||
{
|
||||
reset($tabbq[$obj->rowid]);
|
||||
$first_key_tabbq = key($tabbq[$obj->rowid]);
|
||||
if (empty($first_key_tabbq))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorAccountancyCodeOnBankAccountNotDefined', $obj->baref), null, 'errors');
|
||||
}
|
||||
reset($tabtp[$obj->rowid]);
|
||||
$first_key_tabtp = key($tabtp[$obj->rowid]);
|
||||
if (empty($first_key_tabtp))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorAccountancyCodeOnThirdPartyNotDefined'), null, 'errors');
|
||||
}
|
||||
reset($tabbq[$obj->rowid]);
|
||||
$first_key_tabbq = key($tabbq[$obj->rowid]);
|
||||
if (empty($first_key_tabbq))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorAccountancyCodeOnBankAccountNotDefined', $obj->baref), null, 'errors');
|
||||
}
|
||||
reset($tabtp[$obj->rowid]);
|
||||
$first_key_tabtp = key($tabtp[$obj->rowid]);
|
||||
if (empty($first_key_tabtp))
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorAccountancyCodeOnThirdPartyNotDefined'), null, 'errors');
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// if($obj->socid)$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||
|
||||
$i ++;
|
||||
@@ -329,189 +333,230 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
|
||||
$error = 0;
|
||||
foreach ( $tabpay as $key => $val ) { // $key is rowid into llx_bank
|
||||
|
||||
$errorforline = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
foreach ( $tabpay as $key => $val ) { // $key is rowid into llx_bank
|
||||
|
||||
$errorforline = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
// Bank
|
||||
if (! $errorforline)
|
||||
{
|
||||
// Line into bank account
|
||||
foreach ( $tabbq[$key] as $k => $mt )
|
||||
{
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->doc_type = 'bank';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $compte->label;
|
||||
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_create = $now;
|
||||
|
||||
if ($tabtype[$key] == 'payment') {
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
// Line into bank account
|
||||
foreach ( $tabbq[$key] as $k => $mt )
|
||||
{
|
||||
if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->doc_type = 'bank';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $compte->label;
|
||||
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
|
||||
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_create = $now;
|
||||
|
||||
$sqlmid = 'SELECT fac.facnumber';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->facnumber; // Ref of invoice
|
||||
}
|
||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
if ($tabtype[$key] == 'payment') {
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
|
||||
$sqlmid = 'SELECT facf.ref_supplier, facf.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
||||
$sqlmid .= " WHERE payf.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->ref_supplier . ' (' . $objmid->ref . ')'; // Ref on invoice
|
||||
}
|
||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
||||
$bookkeeping->code_tiers = $tabuser[$key]['accountancy_code'];
|
||||
$sqlmid = 'SELECT fac.facnumber';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->facnumber; // Ref of invoice
|
||||
}
|
||||
} else if ($tabtype[$key] == 'payment_supplier') {
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
|
||||
$sqlmid = 'SELECT e.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "expensereport as e";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "payment_expensereport as payer ON payer.fk_expensereport=e.rowid";
|
||||
$sqlmid .= " WHERE payer.fk_expensereport=" . $val["fk_expensereport"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->ref; // Ref of expensereport
|
||||
}
|
||||
}
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
$sqlmid = 'SELECT facf.ref_supplier, facf.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
||||
$sqlmid .= " WHERE payf.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->ref_supplier . ' (' . $objmid->ref . ')'; // Ref on invoice
|
||||
}
|
||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
||||
$bookkeeping->code_tiers = $tabuser[$key]['accountancy_code'];
|
||||
|
||||
$sqlmid = 'SELECT e.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "expensereport as e";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "payment_expensereport as payer ON payer.fk_expensereport=e.rowid";
|
||||
$sqlmid .= " WHERE payer.fk_expensereport=" . $val["fk_expensereport"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->ref; // Ref of expensereport
|
||||
}
|
||||
} else if ($tabtype[$key] == 'payment_vat') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->doc_ref = $langs->trans("PaymentVat") . ' (' . $val["paymentvatid"] . ')'; // Rowid of vat payment
|
||||
} else if ($tabtype[$key] == 'payment_donation') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->doc_ref = $langs->trans("Donation") . ' (' . $val["paymentdonationid"] . ')'; // Rowid of donation
|
||||
} else if ($tabtype[$key] == 'payment_salary') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = $tabuser[$key]['name'];
|
||||
$bookkeeping->doc_ref = $langs->trans("SalaryPayment") . ' (' . $val["paymentsalid"] . ')'; // Ref of salary payment
|
||||
}
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Third party
|
||||
if (! $errorforline)
|
||||
{
|
||||
// Line into thirdparty account
|
||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->doc_type = 'bank';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_create = $now;
|
||||
|
||||
if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice
|
||||
$sqlmid = 'SELECT fac.facnumber';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
||||
}
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||
|
||||
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
||||
$sqlmid .= " WHERE payf.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->ref_supplier . ' (' . $objmid->ref . ')';
|
||||
}
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else {
|
||||
// FIXME Should be a temporary account ???
|
||||
$bookkeeping->doc_ref = $k;
|
||||
//$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
$bookkeeping->numero_compte = 'CodeNotDef';
|
||||
}
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
// Line into thirdparty account
|
||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->doc_type = 'bank';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_bank"];
|
||||
$bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
$bookkeeping->date_create = $now;
|
||||
|
||||
if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else if ($tabtype[$key] == 'payment') { // If payment is payment of customer invoice, we get ref of invoice
|
||||
$sqlmid = 'SELECT fac.facnumber';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture fac ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement_facture as payfac ON payfac.fk_facture=fac.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiement as pay ON payfac.fk_paiement=pay.rowid";
|
||||
$sqlmid .= " WHERE pay.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->facnumber;
|
||||
}
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||
$sqlmid = 'SELECT facf.ref_supplier,facf.ref';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "facture_fourn facf ";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfacf ON payfacf.fk_facturefourn=facf.rowid";
|
||||
$sqlmid .= " INNER JOIN " . MAIN_DB_PREFIX . "paiementfourn as payf ON payfacf.fk_paiementfourn=payf.rowid";
|
||||
$sqlmid .= " WHERE payf.fk_bank=" . $key;
|
||||
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$bookkeeping->doc_ref = $objmid->ref_supplier . ' (' . $objmid->ref . ')';
|
||||
}
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else if ($tabtype[$key] == 'payment_vat') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->doc_ref = $langs->trans("PaymentVat") . ' (' . $val["paymentvatid"] . ')'; // Rowid of vat
|
||||
} else if ($tabtype[$key] == 'payment_donation') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->doc_ref = $langs->trans("Donation") . ' (' . $val["paymentdonationid"] . ')'; // Rowid of donation
|
||||
} else if ($tabtype[$key] == 'payment_salary') {
|
||||
$bookkeeping->code_tiers = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->label_compte = $tabuser[$key]['name'];
|
||||
$bookkeeping->doc_ref = $langs->trans("SalaryPayment") . ' (' . $val["paymentsalid"] . ')'; // Rowid of salary payment
|
||||
} else if ($tabtype[$key] == 'banktransfert') {
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
} else {
|
||||
// FIXME Should be a temporary account ???
|
||||
$bookkeeping->doc_ref = $k;
|
||||
//$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
$bookkeeping->numero_compte = 'CodeNotDef';
|
||||
}
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! $errorforline)
|
||||
{
|
||||
$db->commit();
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($error)) {
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
elseif (count($tabpay) == $error)
|
||||
{
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
}
|
||||
|
||||
|
||||
$action = '';
|
||||
}
|
||||
|
||||
// Export
|
||||
/*
|
||||
if ($action == 'export_csv') {
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
|
||||
@@ -547,7 +592,7 @@ if ($action == 'export_csv') {
|
||||
if ($reflabel == '(ExpenseReportPayment)') {
|
||||
$reflabel = $langs->trans('Employee');
|
||||
}
|
||||
|
||||
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
|
||||
@@ -678,8 +723,7 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@@ -692,49 +736,53 @@ if (empty($action) || $action == 'view') {
|
||||
$invoicestatic = new Facture($db);
|
||||
$invoicesupplierstatic = new FactureFournisseur($db);
|
||||
$expensereportstatic = new ExpenseReport($db);
|
||||
|
||||
$vatstatic = new Tva($db);
|
||||
$donationstatic = new Don($db);
|
||||
$salarystatic = new PaymentSalary($db);
|
||||
|
||||
llxHeader('', $langs->trans("FinanceJournal"));
|
||||
|
||||
$nom = $langs->trans("FinanceJournal") . ' - ' . $bank_code_journal->getNomUrl(1);
|
||||
$nom = $langs->trans("FinanceJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$builddate = time();
|
||||
//$description = $langs->trans("DescFinanceJournal") . '<br>';
|
||||
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||
|
||||
$varlink = 'id_account=' . $id_bank_account;
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
||||
'action' => ''
|
||||
), '', $varlink);
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
/*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans('Export') . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||
} else {
|
||||
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||
}
|
||||
}*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
print '</div>';
|
||||
|
||||
// TODO Avoid using js. We can use a direct link with $param
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
function launch_export() {
|
||||
console.log("Set value into form and submit");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
||||
console.log("Set value into form and submit");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
function writebookkeeping() {
|
||||
console.log("Set value into form and submit");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
console.log("Set value into form and submit");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
</script>';
|
||||
|
||||
/*
|
||||
* Show result array
|
||||
*/
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
@@ -749,10 +797,9 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td align='right'>" . $langs->trans("Credit") . "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var = true;
|
||||
$r = '';
|
||||
|
||||
foreach ( $tabpay as $key => $val ) { // $key is rowid in llx_bank
|
||||
foreach ( $tabpay as $key => $val ) { // $key is rowid in llx_bank
|
||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||
|
||||
$reflabel = $val["ref"];
|
||||
@@ -761,7 +808,7 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
if ($reflabel == '(CustomerInvoicePayment)') {
|
||||
$reflabel = $langs->trans('Customer');
|
||||
}
|
||||
}
|
||||
if ($reflabel == '(SocialContributionPayment)') {
|
||||
$reflabel = $langs->trans('SocialContribution');
|
||||
}
|
||||
@@ -774,49 +821,91 @@ if (empty($action) || $action == 'view') {
|
||||
if ($reflabel == '(ExpenseReportPayment)') {
|
||||
$reflabel = $langs->trans('Employee');
|
||||
}
|
||||
|
||||
|
||||
$ref=$reflabel;
|
||||
if ($tabtype[$key] == 'payment')
|
||||
{
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac";
|
||||
$sqlmid .= " WHERE payfac.fk_paiement=" . $val["paymentid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$invoicestatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac";
|
||||
$sqlmid .= " WHERE payfac.fk_paiement=" . $val["paymentid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$invoicestatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("Invoice").' '.$invoicestatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
elseif ($tabtype[$key] == 'payment_supplier')
|
||||
{
|
||||
$sqlmid = 'SELECT payfac.fk_facturefourn as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac";
|
||||
$sqlmid .= " WHERE payfac.fk_paiementfourn=" . $val["paymentsupplierid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$invoicesupplierstatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("SupplierInvoice").' '.$invoicesupplierstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$sqlmid = 'SELECT payfac.fk_facturefourn as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "paiementfourn_facturefourn as payfac";
|
||||
$sqlmid .= " WHERE payfac.fk_paiementfourn=" . $val["paymentsupplierid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$invoicesupplierstatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("SupplierInvoice").' '.$invoicesupplierstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
elseif ($tabtype[$key] == 'payment_expensereport')
|
||||
{
|
||||
$sqlmid = 'SELECT payer.fk_expensereport as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as payer";
|
||||
$sqlmid .= " WHERE payer.fk_expensereport=" . $val["fk_expensereport"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$expensereportstatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("ExpenseReport").' '.$expensereportstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
$sqlmid = 'SELECT payer.fk_expensereport as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_expensereport as payer";
|
||||
$sqlmid .= " WHERE payer.fk_expensereport=" . $val["fk_expensereport"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$expensereportstatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("ExpenseReport").' '.$expensereportstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
elseif ($tabtype[$key] == 'payment_vat')
|
||||
{
|
||||
$sqlmid = 'SELECT v.rowid as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "tva as v";
|
||||
$sqlmid .= " WHERE v.rowid=" . $val["paymentvatid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$vatstatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("PaymentVat").' '.$vatstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
elseif ($tabtype[$key] == 'payment_donation')
|
||||
{
|
||||
$sqlmid = 'SELECT payd.fk_donation as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_donation as payd";
|
||||
$sqlmid .= " WHERE payd.fk_donation=" . $val["paymentdonationid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$donationstatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("Donation").' '.$donationstatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
elseif ($tabtype[$key] == 'payment_salary')
|
||||
{
|
||||
$sqlmid = 'SELECT s.rowid as id';
|
||||
$sqlmid .= " FROM " . MAIN_DB_PREFIX . "payment_salary as s";
|
||||
$sqlmid .= " WHERE s.rowid=" . $val["paymentsalid"];
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=" . $sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$salarystatic->fetch($objmid->id);
|
||||
$ref=$langs->trans("SalaryPayment").' '.$salarystatic->getNomUrl(1);
|
||||
}
|
||||
else dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
@@ -824,24 +913,24 @@ if (empty($action) || $action == 'view') {
|
||||
$invoicestatic->ref = $val["ref"];
|
||||
$invoicestatic->type = $val["type"];*/
|
||||
// Bank
|
||||
foreach ( $tabbq[$key] as $k => $mt )
|
||||
foreach ( $tabbq[$key] as $k => $mt )
|
||||
{
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print "<td><!-- Bank bank.rowid=".$key."--></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Bank bank.rowid=".$key."--></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $ref . "</td>";
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
if ($val['soclib'] == '') {
|
||||
print "<td>" . $bank_code_journal->label . " - " . $val["ref"] . "</td>";
|
||||
print "<td>" . $bankstatic->label . " - " . $reflabel . "</td>";
|
||||
} else {
|
||||
print "<td>" . $bank_code_journal->label . " - " . $val['soclib'] . "</td>";
|
||||
print "<td>" . $bankstatic->label . " - " . $val['soclib'] . "</td>";
|
||||
}
|
||||
print "<td>" . $val["type_payment"] . "</td>";
|
||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
@@ -853,17 +942,17 @@ if (empty($action) || $action == 'view') {
|
||||
if (is_array($tabtp[$key])) {
|
||||
foreach ( $tabtp[$key] as $k => $mt ) {
|
||||
if ($k != 'type') {
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Thirdparty bank.rowid=".$key." --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $ref . "</td>";
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
$accountoshow = length_accounta($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
print "<td>" . $reflabel . ' ' . $val['soclib'] . "</td>";
|
||||
print "<td>" . $val["type_payment"] . "</td>";
|
||||
@@ -874,16 +963,16 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
} else {
|
||||
foreach ( $tabbq[$key] as $k => $mt ) {
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Wait bank.rowid=".$key." --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $ref . "</td>";
|
||||
print "<td>";
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||
}
|
||||
else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||
}
|
||||
else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
print "</td>";
|
||||
print "<td>" . $reflabel . "</td>";
|
||||
print "<td> </td>";
|
||||
@@ -892,7 +981,6 @@ if (empty($action) || $action == 'view') {
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
$var = ! $var;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@@ -22,22 +22,20 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/expensereportsjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with expense reports journal
|
||||
* \file htdocs/accountancy/journal/expensereportsjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with expense reports journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
@@ -45,6 +43,9 @@ $langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
$langs->load("trips");
|
||||
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth');
|
||||
$date_startday = GETPOST('date_startday');
|
||||
$date_startyear = GETPOST('date_startyear');
|
||||
@@ -58,12 +59,15 @@ $now = dol_now();
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Get informations of journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch($id_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
@@ -97,7 +101,7 @@ $sql .= " JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_ex
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "user as u ON u.rowid = er.fk_user_author";
|
||||
$sql .= " WHERE er.fk_statut > 0 ";
|
||||
$sql .= " AND erd.fk_code_ventilation > 0 ";
|
||||
$sql .= " AND er.entity IN (" . getEntity("expensereport", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND er.date_debut >= '" . $db->idate($date_start) . "' AND er.date_debut <= '" . $db->idate($date_end) . "'";
|
||||
$sql .= " ORDER BY er.date_debut";
|
||||
@@ -157,42 +161,105 @@ if ($action == 'writebookkeeping') {
|
||||
{
|
||||
$errorforline = 0;
|
||||
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
// get compte id and label
|
||||
$db->begin();
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'expense_report';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->code_tiers = $tabuser[$key]['user_accountancy_code'];
|
||||
$bookkeeping->label_compte = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'expense_report';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->code_tiers = $tabuser[$key]['user_accountancy_code'];
|
||||
$bookkeeping->label_compte = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fees
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
if (! $errorforline)
|
||||
{
|
||||
// Fees
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'expense_report';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $errorforline)
|
||||
{
|
||||
// VAT
|
||||
// var_dump($tabtva);
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
@@ -201,77 +268,55 @@ if ($action == 'writebookkeeping') {
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
$bookkeeping->label_compte = $langs->trans("VAT"). ' '.$def_tva[$key];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VAT
|
||||
// var_dump($tabtva);
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'expense_report';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_expensereportdet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = $langs->trans("VAT"). ' '.$def_tva[$key];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $errorforline)
|
||||
{
|
||||
$db->commit();
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($error) && count($tabpay)) {
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
elseif (count($tabpay) == $error)
|
||||
{
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
}
|
||||
|
||||
$action='';
|
||||
@@ -286,9 +331,8 @@ $form = new Form($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
// Export
|
||||
if ($action == 'export_csv') {
|
||||
/*if ($action == 'export_csv') {
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$journal = $conf->global->ACCOUNTING_EXPENSEREPORT_JOURNAL;
|
||||
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
@@ -393,12 +437,13 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (empty($action) || $action == 'view') {
|
||||
|
||||
llxHeader('', $langs->trans("ExpenseReportsJournal"));
|
||||
|
||||
$nom = $langs->trans("ExpenseReportsJournal");
|
||||
$nom = $langs->trans("ExpenseReportsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nomlink = '';
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
@@ -406,17 +451,20 @@ if (empty($action) || $action == 'view') {
|
||||
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||
|
||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
||||
'action' => ''
|
||||
));
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
/*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||
} else {
|
||||
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||
}
|
||||
}*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
print '</div>';
|
||||
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
@@ -435,7 +483,7 @@ if (empty($action) || $action == 'view') {
|
||||
/*
|
||||
* Show result array
|
||||
*/
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
@@ -449,7 +497,6 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td align='right'>" . $langs->trans("Credit") . "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var = true;
|
||||
$r = '';
|
||||
|
||||
$expensereportstatic = new ExpenseReport($db);
|
||||
@@ -468,7 +515,7 @@ if (empty($action) || $action == 'view') {
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
|
||||
if ($mt) {
|
||||
print "<tr " . $bc[$var] . " >";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Fees --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $expensereportstatic->getNomUrl(1) . "</td>";
|
||||
@@ -494,7 +541,7 @@ if (empty($action) || $action == 'view') {
|
||||
// VAT
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print "<tr " . $bc[$var] . " >";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- VAT --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $expensereportstatic->getNomUrl(1) . "</td>";
|
||||
@@ -512,12 +559,12 @@ if (empty($action) || $action == 'view') {
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
|
||||
// Third party
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Thirdparty --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $expensereportstatic->getNomUrl(1) . "</td>";
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
@@ -525,17 +572,15 @@ if (empty($action) || $action == 'view') {
|
||||
$accountoshow = length_accounta($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
print "<td>" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("Code_tiers") . "</td>";
|
||||
print '<td align="right">' . ($mt < 0 ? - price(- $mt) : '') . "</td>";
|
||||
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
$var = ! $var;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
* 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
|
||||
@@ -22,28 +22,29 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/accountancy/journal/purchasesjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with purchases journal
|
||||
* \file htdocs/accountancy/journal/purchasesjournal.php
|
||||
* \ingroup Advanced accountancy
|
||||
* \brief Page with purchases journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth');
|
||||
$date_startday = GETPOST('date_startday');
|
||||
$date_startyear = GETPOST('date_startyear');
|
||||
@@ -57,13 +58,16 @@ $now = dol_now();
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Get informations of journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch($id_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
@@ -96,7 +100,7 @@ $sql .= " JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = fd.fk_factu
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " WHERE f.fk_statut > 0 ";
|
||||
$sql .= " AND fd.fk_code_ventilation > 0 ";
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS))
|
||||
$sql .= " AND f.type IN (0,1,2)";
|
||||
else
|
||||
@@ -109,6 +113,7 @@ dol_syslog('accountancy/journal/purchasesjournal.php:: $sql=' . $sql);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
// les variables
|
||||
$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef");
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
@@ -123,8 +128,10 @@ if ($result) {
|
||||
$i = 0;
|
||||
while ( $i < $num ) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// contrôles
|
||||
$compta_soc = (! empty($obj->code_compta_fournisseur)) ? $obj->code_compta_fournisseur : $cptfour;
|
||||
|
||||
$compta_prod = $obj->compte;
|
||||
if (empty($compta_prod)) {
|
||||
if ($obj->product_type == 0)
|
||||
@@ -144,14 +151,21 @@ if ($result) {
|
||||
|
||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||
$tabfac[$obj->rowid]["description"] = $obj->description;
|
||||
$tabfac[$obj->rowid]["fk_facturefourndet"] = $obj->fdid;
|
||||
//$tabfac[$obj->rowid]["fk_facturefourndet"] = $obj->fdid;
|
||||
|
||||
// Avoid warnings
|
||||
if (! isset($tabttc[$obj->rowid][$compta_soc])) $tabttc[$obj->rowid][$compta_soc] = 0;
|
||||
if (! isset($tabht[$obj->rowid][$compta_prod])) $tabht[$obj->rowid][$compta_prod] = 0;
|
||||
if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva] = 0;
|
||||
|
||||
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc;
|
||||
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht;
|
||||
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva;
|
||||
$tabcompany[$obj->rowid] = array (
|
||||
'id' => $obj->socid,
|
||||
'name' => $obj->name,
|
||||
'code_fournisseur' => $obj->code_compta_fournisseur
|
||||
'code_fournisseur' => $obj->code_fournisseur,
|
||||
'code_compta_fournisseur' => $compta_soc
|
||||
);
|
||||
|
||||
$i ++;
|
||||
@@ -165,12 +179,12 @@ if ($action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
$error = 0;
|
||||
|
||||
foreach ($tabfac as $key => $val)
|
||||
foreach ($tabfac as $key => $val) // Loop on each invoice
|
||||
{
|
||||
$errorforline = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$errorforline = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
$invoicestatic = new FactureFournisseur($db);
|
||||
|
||||
@@ -188,64 +202,91 @@ if ($action == 'writebookkeeping') {
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
// get compte id and label
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_fournisseur'];
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("Code_tiers");
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
if ($mt) {
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
// get compte id and label
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_fournisseur'];
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("Code_tiers");
|
||||
$bookkeeping->numero_compte = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,60 +294,69 @@ if ($action == 'writebookkeeping') {
|
||||
|
||||
// VAT
|
||||
// var_dump($tabtva);
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_facturefourndet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("VAT"). ' '.$def_tva[$key];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'supplier_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("VAT"). ' '.$def_tva[$key];
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'C' : 'D';
|
||||
$bookkeeping->debit = ($mt > 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt <= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (! $errorforline)
|
||||
{
|
||||
$db->commit();
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($error) && count($tabpay)) {
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
elseif (count($tabpay) == $error)
|
||||
{
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
}
|
||||
|
||||
$action='';
|
||||
}
|
||||
|
||||
@@ -319,7 +369,7 @@ $form = new Form($db);
|
||||
$companystatic = new Fournisseur($db);
|
||||
|
||||
// Export
|
||||
if ($action == 'export_csv') {
|
||||
/*if ($action == 'export_csv') {
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL;
|
||||
|
||||
@@ -437,12 +487,13 @@ if ($action == 'export_csv') {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (empty($action) || $action == 'view') {
|
||||
|
||||
llxHeader('', $langs->trans("PurchasesJournal"));
|
||||
|
||||
$nom = $langs->trans("PurchasesJournal");
|
||||
$nom = $langs->trans("PurchasesJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nomlink = '';
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
@@ -456,49 +507,52 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
|
||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
||||
'action' => ''
|
||||
));
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
/*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||
} else {
|
||||
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||
}
|
||||
}*/
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
print '</div>';
|
||||
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
function launch_export() {
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
function writebookkeeping() {
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
</script>';
|
||||
|
||||
/*
|
||||
* Show result array
|
||||
*/
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
// /print "<td>".$langs->trans("JournalNum")."</td>";
|
||||
print "<td></td>";
|
||||
print "<td>" . $langs->trans("Date") . "</td>";
|
||||
print "<td>" . $langs->trans("Piece") . ' (' . $langs->trans("InvoiceRef") . ")</td>";
|
||||
print "<td>" . $langs->trans("AccountAccounting") . "</td>";
|
||||
print "<t><td>" . $langs->trans("Type") . "</td><td align='right'>" . $langs->trans("Debit") . "</td><td align='right'>" . $langs->trans("Credit") . "</td>";
|
||||
print "<td>" . $langs->trans("Type") . "</td>";
|
||||
print "<td align='right'>" . $langs->trans("Debit") . "</td>";
|
||||
print "<td align='right'>" . $langs->trans("Credit") . "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var = true;
|
||||
$r = '';
|
||||
|
||||
$invoicestatic = new FactureFournisseur($db);
|
||||
@@ -521,17 +575,17 @@ if (empty($action) || $action == 'view') {
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
|
||||
if ($mt) {
|
||||
print "<tr " . $bc[$var] . " >";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Product --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
@@ -542,20 +596,21 @@ if (empty($action) || $action == 'view') {
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
// VAT
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print "<tr " . $bc[$var] . " >";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- VAT --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VatAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VatAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("VAT"). ' '.$def_tva[$key]. "</td>";
|
||||
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
@@ -563,12 +618,12 @@ if (empty($action) || $action == 'view') {
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
|
||||
// Third party
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Thirdparty --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
@@ -576,20 +631,18 @@ if (empty($action) || $action == 'view') {
|
||||
$accountoshow = length_accounta($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
print "</td>";
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->refsupplier . ' - ' . $langs->trans("Code_tiers") . "</td>";
|
||||
// print "</td><td>" . $langs->trans("ThirdParty");
|
||||
// print ' (' . $companystatic->getNomUrl(0, 'supplier', 16) . ')';
|
||||
// print "</td>";
|
||||
print '<td align="right">' . ($mt < 0 ? - price(- $mt) : '') . "</td>";
|
||||
print '<td align="right">' . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
$var = ! $var;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -29,17 +29,15 @@
|
||||
* \brief Page with sells journal
|
||||
*/
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("commercial");
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
@@ -47,6 +45,9 @@ $langs->load("other");
|
||||
$langs->load("main");
|
||||
$langs->load("accountancy");
|
||||
|
||||
$id_journal = GETPOST('id_journal', 'int');
|
||||
$action = GETPOST('action','aZ09');
|
||||
|
||||
$date_startmonth = GETPOST('date_startmonth');
|
||||
$date_startday = GETPOST('date_startday');
|
||||
$date_startyear = GETPOST('date_startyear');
|
||||
@@ -60,19 +61,23 @@ $now = dol_now();
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
|
||||
$action = GETPOST('action');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// Get informations of journal
|
||||
$accountingjournalstatic = new AccountingJournal($db);
|
||||
$accountingjournalstatic->fetch($id_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
$year_current = strftime("%Y", dol_now());
|
||||
$pastmonth = strftime("%m", dol_now()) - 1;
|
||||
$pastmonthyear = $year_current;
|
||||
if ($pastmonth == 0) {
|
||||
$pastmonth = 12;
|
||||
$pastmonthyear --;
|
||||
$pastmonth = 12;
|
||||
$pastmonthyear --;
|
||||
}
|
||||
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
@@ -80,8 +85,8 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
if (empty($date_start) || empty($date_end)) // We define date_start and date_end
|
||||
{
|
||||
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
}
|
||||
|
||||
$p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
@@ -99,233 +104,277 @@ $sql .= " JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
|
||||
$sql .= " JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_tva as ct ON fd.tva_tx = ct.taux AND ct.fk_pays = '" . $idpays . "'";
|
||||
$sql .= " WHERE fd.fk_code_ventilation > 0";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture', 0).')'; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
$sql .= " AND f.entity IN (".getEntity('facture', 0).')'; // We don't share object for accountancy
|
||||
$sql .= " AND f.fk_statut > 0"; // TODO Facture annulée ?
|
||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
|
||||
} else {
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_STANDARD . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
|
||||
}
|
||||
$sql .= " AND fd.product_type IN (0,1)";
|
||||
if ($date_start && $date_end)
|
||||
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||
$sql .= " AND f.datef >= '" . $db->idate($date_start) . "' AND f.datef <= '" . $db->idate($date_end) . "'";
|
||||
$sql .= " ORDER BY f.datef";
|
||||
|
||||
dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$tabfac = array ();
|
||||
$tabht = array ();
|
||||
$tabtva = array ();
|
||||
$def_tva = array ();
|
||||
$tabttc = array ();
|
||||
$tabcompany = array ();
|
||||
$tabfac = array ();
|
||||
$tabht = array ();
|
||||
$tabtva = array ();
|
||||
$def_tva = array ();
|
||||
$tabttc = array ();
|
||||
$tabcompany = array ();
|
||||
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0;
|
||||
|
||||
while ( $i < $num ) {
|
||||
$obj = $db->fetch_object($result);
|
||||
// les variables
|
||||
$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef");
|
||||
$compta_soc = (! empty($obj->code_compta)) ? $obj->code_compta : $cptcli;
|
||||
$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER)) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef");
|
||||
|
||||
$compta_prod = $obj->compte;
|
||||
if (empty($compta_prod)) {
|
||||
if ($obj->product_type == 0)
|
||||
$compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
else
|
||||
$compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
}
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
|
||||
while ( $i < $num ) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// les variables
|
||||
$compta_soc = (! empty($obj->code_compta)) ? $obj->code_compta : $cptcli;
|
||||
|
||||
$compta_prod = $obj->compte;
|
||||
if (empty($compta_prod)) {
|
||||
if ($obj->product_type == 0)
|
||||
$compta_prod = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
else
|
||||
$compta_prod = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
}
|
||||
$cpttva = (! empty($conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_SOLD_ACCOUNT : $langs->trans("CodeNotDef");
|
||||
$compta_tva = (! empty($obj->account_tva) ? $obj->account_tva : $cpttva);
|
||||
|
||||
|
||||
//Define array for display vat tx
|
||||
$def_tva[$obj->rowid]=price($obj->tva_tx);
|
||||
//Define array for display vat tx
|
||||
$def_tva[$obj->rowid]=price($obj->tva_tx);
|
||||
|
||||
// Situation invoices handling
|
||||
$line = new FactureLigne($db);
|
||||
$line->fetch($obj->fdid);
|
||||
$prev_progress = $line->get_prev_progress($obj->fdid);
|
||||
if ($obj->type == Facture::TYPE_SITUATION) {
|
||||
// Avoid divide by 0
|
||||
if ($obj->situation_percent == 0) {
|
||||
$situation_ratio = 0;
|
||||
} else {
|
||||
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
||||
}
|
||||
} else {
|
||||
$situation_ratio = 1;
|
||||
}
|
||||
// Situation invoices handling
|
||||
$line = new FactureLigne($db);
|
||||
$line->fetch($obj->fdid);
|
||||
$prev_progress = $line->get_prev_progress($obj->fdid);
|
||||
if ($obj->type == Facture::TYPE_SITUATION) {
|
||||
// Avoid divide by 0
|
||||
if ($obj->situation_percent == 0) {
|
||||
$situation_ratio = 0;
|
||||
} else {
|
||||
$situation_ratio = ($obj->situation_percent - $prev_progress) / $obj->situation_percent;
|
||||
}
|
||||
} else {
|
||||
$situation_ratio = 1;
|
||||
}
|
||||
|
||||
// Invoice lines
|
||||
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
|
||||
$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
|
||||
if (! isset($tabttc[$obj->rowid][$compta_soc]))
|
||||
$tabttc[$obj->rowid][$compta_soc] = 0;
|
||||
if (! isset($tabht[$obj->rowid][$compta_prod]))
|
||||
$tabht[$obj->rowid][$compta_prod] = 0;
|
||||
if (! isset($tabtva[$obj->rowid][$compta_tva]))
|
||||
$tabtva[$obj->rowid][$compta_tva] = 0;
|
||||
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc * $situation_ratio;
|
||||
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht * $situation_ratio;
|
||||
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva * $situation_ratio;
|
||||
$tabcompany[$obj->rowid] = array (
|
||||
'id' => $obj->socid,
|
||||
'name' => $obj->name,
|
||||
'code_client' => $obj->code_compta
|
||||
);
|
||||
// Invoice lines
|
||||
$tabfac[$obj->rowid]["date"] = $db->jdate($obj->df);
|
||||
$tabfac[$obj->rowid]["ref"] = $obj->facnumber;
|
||||
$tabfac[$obj->rowid]["type"] = $obj->type;
|
||||
$tabfac[$obj->rowid]["description"] = $obj->label_compte;
|
||||
//$tabfac[$obj->rowid]["fk_facturedet"] = $obj->fdid;
|
||||
|
||||
$i ++;
|
||||
}
|
||||
// Avoid warnings
|
||||
if (! isset($tabttc[$obj->rowid][$compta_soc])) $tabttc[$obj->rowid][$compta_soc] = 0;
|
||||
if (! isset($tabht[$obj->rowid][$compta_prod])) $tabht[$obj->rowid][$compta_prod] = 0;
|
||||
if (! isset($tabtva[$obj->rowid][$compta_tva])) $tabtva[$obj->rowid][$compta_tva] = 0;
|
||||
|
||||
$tabttc[$obj->rowid][$compta_soc] += $obj->total_ttc * $situation_ratio;
|
||||
$tabht[$obj->rowid][$compta_prod] += $obj->total_ht * $situation_ratio;
|
||||
$tabtva[$obj->rowid][$compta_tva] += $obj->total_tva * $situation_ratio;
|
||||
$tabcompany[$obj->rowid] = array (
|
||||
'id' => $obj->socid,
|
||||
'name' => $obj->name,
|
||||
'code_client' => $obj->code_client,
|
||||
'code_compta' => $compta_soc
|
||||
);
|
||||
|
||||
$i ++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// Bookkeeping Write
|
||||
if ($action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
$error = 0;
|
||||
$now = dol_now();
|
||||
$error = 0;
|
||||
|
||||
foreach ( $tabfac as $key => $val ) {
|
||||
|
||||
$errorforline = 0;
|
||||
foreach ( $tabfac as $key => $val ) { // Loop on each invoice
|
||||
|
||||
$db->begin();
|
||||
$errorforline = 0;
|
||||
|
||||
$companystatic = new Societe($db);
|
||||
$invoicestatic = new Facture($db);
|
||||
$db->begin();
|
||||
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic = new Societe($db);
|
||||
$invoicestatic = new Facture($db);
|
||||
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->code_compta = $tabcompany[$key]['code_compta'];
|
||||
$companystatic->code_compta_fournisseur = $tabcompany[$key]['code_compta_fournisseur'];
|
||||
$companystatic->code_client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->code_fournisseur = $tabcompany[$key]['code_fournisseur'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
|
||||
$invoicestatic->id = $key;
|
||||
$invoicestatic->ref = (string) $val["ref"];
|
||||
$invoicestatic->id = $key;
|
||||
$invoicestatic->ref = (string) $val["ref"];
|
||||
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
// $bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers");
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt < 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
// Thirdparty
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->code_tiers = $tabcompany[$key]['code_client'];
|
||||
$bookkeeping->numero_compte = $tabcompany[$key]['code_compta'];
|
||||
// $bookkeeping->label_compte = $tabcompany[$key]['name'];
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers");
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt < 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
// Product / Service
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
// get compte id and label
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
if ($accountingaccount->fetch(null, $k, true)) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add;
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VAT
|
||||
// var_dump($tabtva);
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = $val["fk_facturedet"];
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.$def_tva[$key];
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
// VAT
|
||||
// var_dump($tabtva);
|
||||
if (! $errorforline)
|
||||
{
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
$bookkeeping->doc_date = $val["date"];
|
||||
$bookkeeping->doc_ref = $val["ref"];
|
||||
$bookkeeping->date_create = $now;
|
||||
$bookkeeping->doc_type = 'customer_invoice';
|
||||
$bookkeeping->fk_doc = $key;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->code_tiers = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT").' '.$def_tva[$key];
|
||||
$bookkeeping->montant = $mt;
|
||||
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
|
||||
$bookkeeping->debit = ($mt < 0) ? $mt : 0;
|
||||
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
|
||||
$bookkeeping->code_journal = $journal;
|
||||
$bookkeeping->journal_label = $journal_label;
|
||||
$bookkeeping->fk_user_author = $user->id;
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
//setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->doc_ref.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $errorforline)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
|
||||
if (! $errorforline)
|
||||
{
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($error) && count($tabpay) > 0) {
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
elseif (count($tabpay) == $error)
|
||||
{
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
}
|
||||
|
||||
$action='';
|
||||
if (empty($error) && count($tabpay) > 0) {
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
}
|
||||
elseif (count($tabpay) == $error)
|
||||
{
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
}
|
||||
|
||||
$action='';
|
||||
}
|
||||
|
||||
|
||||
@@ -337,132 +386,134 @@ if ($action == 'writebookkeeping') {
|
||||
$form = new Form($db);
|
||||
|
||||
// Export
|
||||
if ($action == 'export_csv') {
|
||||
/*if ($action == 'export_csv') {
|
||||
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$sell_journal = $conf->global->ACCOUNTING_SELL_JOURNAL;
|
||||
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
|
||||
|
||||
$companystatic = new Client($db);
|
||||
$companystatic = new Client($db);
|
||||
|
||||
// Model Cegid Expert Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) {
|
||||
$sep = ";";
|
||||
// Model Cegid Expert Export
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 2) {
|
||||
$sep = ";";
|
||||
|
||||
foreach ( $tabfac as $key => $val ) {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
foreach ( $tabfac as $key => $val ) {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
|
||||
$invoicestatic->id = $key;
|
||||
$invoicestatic->ref = $val["ref"];
|
||||
$invoicestatic->id = $key;
|
||||
$invoicestatic->ref = $val["ref"];
|
||||
|
||||
$date = dol_print_date($val["date"], '%d%m%Y');
|
||||
$date = dol_print_date($val["date"], '%d%m%Y');
|
||||
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print $date . $sep;
|
||||
print $sell_journal . $sep;
|
||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
|
||||
print length_accounta(html_entity_decode($k)) . $sep;
|
||||
print ($mt < 0 ? 'C' : 'D') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . $sep;
|
||||
print $val["ref"];
|
||||
print "\n";
|
||||
}
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print $date . $sep;
|
||||
print $sell_journal . $sep;
|
||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) . $sep;
|
||||
print length_accounta(html_entity_decode($k)) . $sep;
|
||||
print ($mt < 0 ? 'C' : 'D') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . $sep;
|
||||
print $val["ref"];
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount_static = new AccountingAccount($db);
|
||||
if ($accountingaccount_static->fetch(null, $k, true)) {
|
||||
print $date . $sep;
|
||||
print $sell_journal . $sep;
|
||||
print length_accountg(html_entity_decode($k)) . $sep;
|
||||
print $sep;
|
||||
print ($mt < 0 ? 'D' : 'C') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount_static->label . $sep;
|
||||
print $val["ref"];
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount_static = new AccountingAccount($db);
|
||||
if ($accountingaccount_static->fetch(null, $k, true)) {
|
||||
print $date . $sep;
|
||||
print $sell_journal . $sep;
|
||||
print length_accountg(html_entity_decode($k)) . $sep;
|
||||
print $sep;
|
||||
print ($mt < 0 ? 'D' : 'C') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount_static->label . $sep;
|
||||
print $val["ref"];
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// TVA
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print $date . $sep;
|
||||
print $sell_journal . $sep;
|
||||
print length_accountg(html_entity_decode($k)) . $sep;
|
||||
print $sep;
|
||||
print ($mt < 0 ? 'D' : 'C') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . $sep;
|
||||
// print $langs->trans("VAT") . $sep;
|
||||
print $val["ref"];
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
|
||||
// Model Classic Export
|
||||
foreach ( $tabfac as $key => $val ) {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
// TVA
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print $date . $sep;
|
||||
print $sell_journal . $sep;
|
||||
print length_accountg(html_entity_decode($k)) . $sep;
|
||||
print $sep;
|
||||
print ($mt < 0 ? 'D' : 'C') . $sep;
|
||||
print ($mt <= 0 ? price(- $mt) : $mt) . $sep;
|
||||
print dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . $sep;
|
||||
// print $langs->trans("VAT") . $sep;
|
||||
print $val["ref"];
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($conf->global->ACCOUNTING_EXPORT_MODELCSV == 1) {
|
||||
// Model Classic Export
|
||||
foreach ( $tabfac as $key => $val ) {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
$companystatic->client = $tabcompany[$key]['code_client'];
|
||||
|
||||
$invoicestatic->id = $key;
|
||||
$invoicestatic->ref = $val["ref"];
|
||||
$invoicestatic->id = $key;
|
||||
$invoicestatic->ref = $val["ref"];
|
||||
|
||||
$date = dol_print_date($val["date"], 'day');
|
||||
$date = dol_print_date($val["date"], 'day');
|
||||
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
$accountingaccount = new AccountingAccount($db);
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($companystatic->name, 16) . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($companystatic->name, 16) . ' - ' . dol_trunc($accountingaccount->label, 32) . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// VAT
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// VAT
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print '"' . $date . '"' . $sep;
|
||||
print '"' . $val["ref"] . '"' . $sep;
|
||||
print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep;
|
||||
print '"' . dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . '"' . $sep;
|
||||
print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep;
|
||||
print '"' . ($mt >= 0 ? price($mt) : '') . '"';
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if (empty($action) || $action == 'view') {
|
||||
|
||||
llxHeader('', $langs->trans("SellsJournal"));
|
||||
|
||||
$nom = $langs->trans("SellsJournal");
|
||||
$nom = $langs->trans("SellsJournal") . ' - ' . $accountingjournalstatic->getNomUrl(1);
|
||||
$nomlink = '';
|
||||
$periodlink = '';
|
||||
$exportlink = '';
|
||||
@@ -474,36 +525,38 @@ if (empty($action) || $action == 'view') {
|
||||
else
|
||||
$description .= $langs->trans("DepositsAreIncluded");
|
||||
$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
|
||||
report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
|
||||
'action' => ''
|
||||
));
|
||||
|
||||
if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
$varlink = 'id_journal=' . $id_journal;
|
||||
|
||||
journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink);
|
||||
|
||||
/*if ($conf->global->ACCOUNTING_EXPORT_MODELCSV != 1 && $conf->global->ACCOUNTING_EXPORT_MODELCSV != 2) {
|
||||
print '<input type="button" class="butActionRefused" style="float: right;" value="' . $langs->trans("Export") . '" disabled="disabled" title="' . $langs->trans('ExportNotSupported') . '"/>';
|
||||
} else {
|
||||
print '<input type="button" class="butAction" style="float: right;" value="' . $langs->trans("Export") . '" onclick="launch_export();" />';
|
||||
}
|
||||
|
||||
}*/
|
||||
print '<div class="tabsAction">';
|
||||
print '<input type="button" class="butAction" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
print '</div>';
|
||||
|
||||
print '
|
||||
<script type="text/javascript">
|
||||
function launch_export() {
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("export_csv");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
function writebookkeeping() {
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("writebookkeeping");
|
||||
$("div.fiche div.tabBar form input[type=\"submit\"]").click();
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
$("div.fiche div.tabBar form input[name=\"action\"]").val("");
|
||||
}
|
||||
</script>';
|
||||
|
||||
/*
|
||||
* Show result array
|
||||
*/
|
||||
print '<br><br>';
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
@@ -517,7 +570,6 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td align='right'>" . $langs->trans("Credit") . "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$var = true;
|
||||
$r = '';
|
||||
|
||||
$invoicestatic = new Facture($db);
|
||||
@@ -532,7 +584,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Third party
|
||||
foreach ( $tabttc[$key] as $k => $mt ) {
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Thirdparty --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
@@ -544,17 +596,17 @@ if (empty($action) || $action == 'view') {
|
||||
$accountoshow = length_accounta($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
// print "</td><td>" . $langs->trans("ThirdParty");
|
||||
// print ' (' . $companystatic->getNomUrl(0, 'customer', 16) . ')';
|
||||
print '</td>';
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("Code_tiers") . "</td>";
|
||||
print "</td><td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
|
||||
print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
print "</tr>";
|
||||
|
||||
// Product / Service
|
||||
foreach ( $tabht[$key] as $k => $mt ) {
|
||||
@@ -562,17 +614,17 @@ if (empty($action) || $action == 'view') {
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
|
||||
if ($mt) {
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- Product --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("ProductNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
// print "<td>" . $accountingaccount->label . "</td>";
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . "</td>";
|
||||
@@ -585,17 +637,17 @@ if (empty($action) || $action == 'view') {
|
||||
// VAT
|
||||
foreach ( $tabtva[$key] as $k => $mt ) {
|
||||
if ($mt) {
|
||||
print "<tr " . $bc[$var] . ">";
|
||||
print '<tr class="oddeven">';
|
||||
print "<td><!-- VAT --></td>";
|
||||
print "<td>" . $date . "</td>";
|
||||
print "<td>" . $invoicestatic->getNomUrl(1) . "</td>";
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
$accountoshow = length_accountg($k);
|
||||
if (empty($accountoshow) || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("VATAccountNotDefined").'</span>';
|
||||
}
|
||||
else print $accountoshow;
|
||||
print "</td>";
|
||||
print "<td>" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("VAT") . ' '.$def_tva[$key]. "</td>";
|
||||
// print "<td>" . $langs->trans("VAT") . "</td>";
|
||||
@@ -604,8 +656,6 @@ if (empty($action) || $action == 'view') {
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$var = ! $var;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
@@ -35,7 +35,7 @@ $langs->load("accountancy");
|
||||
$langs->load("compta");
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action');
|
||||
$action = GETPOST('action','aZ09');
|
||||
$cat_id = GETPOST('account_category');
|
||||
$selectcpt = GETPOST('cpt_bk');
|
||||
$id = GETPOST('id', 'int');
|
||||
@@ -127,7 +127,6 @@ if (!empty($cats))
|
||||
$position = -1;
|
||||
$code = -1;
|
||||
foreach($cpts as $i => $cpt){
|
||||
$var = ! $var;
|
||||
|
||||
$position = $cpt['position'];
|
||||
$code = $cpt['code'];
|
||||
@@ -149,7 +148,7 @@ if (!empty($cats))
|
||||
}
|
||||
$sommes[$code]['NP'] += $resultNP;
|
||||
$sommes[$code]['N'] += $resultN;
|
||||
print '<tr'. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>' . $cpt['account_number'] . '</td>';
|
||||
print '<td>' . $cpt['name_cpt'] . '</td>';
|
||||
print '<td>' . price($resultNP) . '</td>';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2013-2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
|
||||
@@ -30,7 +30,7 @@ require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Langs
|
||||
$langs->load("bills");
|
||||
@@ -52,11 +52,11 @@ if ($user->societe_id > 0)
|
||||
if ($action == 'ventil' && $user->rights->accounting->bind->write) {
|
||||
if (! GETPOST('cancel', 'alpha')) {
|
||||
if ($codeventil < 0) $codeventil = 0;
|
||||
|
||||
|
||||
$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql .= " SET fk_code_ventilation = " . $codeventil;
|
||||
$sql .= " WHERE rowid = " . $id;
|
||||
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (! $resql) {
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
@@ -85,7 +85,7 @@ if ($cancel == $langs->trans("Cancel")) {
|
||||
// Create
|
||||
$form = new Form($db);
|
||||
$facturefournisseur_static = new FactureFournisseur($db);
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
if (! empty($id)) {
|
||||
$sql = "SELECT f.ref as facnumber, f.rowid as facid, l.fk_product, l.description, l.rowid, l.fk_code_ventilation, ";
|
||||
@@ -96,7 +96,7 @@ if (! empty($id)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON l.fk_code_ventilation = aa.rowid";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn ";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.rowid = " . $id;
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog("/accounting/supplier/card.php sql=" . $sql, LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
@@ -107,41 +107,41 @@ if (! empty($id)) {
|
||||
|
||||
if ($num_lines) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '?id=' . $id . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans('SuppliersVentilation'), '', 'title_setup');
|
||||
|
||||
|
||||
dol_fiche_head();
|
||||
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
|
||||
// ref invoice
|
||||
print '<tr><td>' . $langs->trans("BillsSuppliers") . '</td>';
|
||||
$facturefournisseur_static->ref = $objp->facnumber;
|
||||
$facturefournisseur_static->id = $objp->facid;
|
||||
print '<td>' . $facturefournisseur_static->getNomUrl(1) . '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr><td width="20%">' . $langs->trans("Line") . '</td>';
|
||||
print '<td>' . stripslashes(nl2br($objp->description)) . '</td></tr>';
|
||||
print '<tr><td width="20%">' . $langs->trans("ProductLabel") . '</td>';
|
||||
print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
|
||||
print '<tr><td width="20%">' . $langs->trans("Account") . '</td><td>';
|
||||
print $formventilation->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||
print $formaccounting->select_account($objp->fk_code_ventilation, 'codeventil', 1);
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input class="button" type="submit" value="' . $langs->trans("Save") . '">';
|
||||
print ' ';
|
||||
print '<input class="button" type="submit" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '</form>';
|
||||
} else {
|
||||
print "Error";
|
||||
|
||||
@@ -134,7 +134,7 @@ if ($action == 'validatehistory') {
|
||||
$sql1.= " WHERE fd.fk_facture_fourn IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
|
||||
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
|
||||
$sql1.= " AND f.entity IN (" . getEntity("accountancy", 1) . ")";
|
||||
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
|
||||
$sql1.= ")";
|
||||
|
||||
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
|
||||
@@ -204,7 +204,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid
|
||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND ff.fk_statut > 0 ";
|
||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NULL";
|
||||
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
@@ -215,8 +215,7 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -259,7 +258,7 @@ $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid
|
||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND ff.fk_statut > 0 ";
|
||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND aa.account_number IS NOT NULL";
|
||||
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
|
||||
|
||||
@@ -270,8 +269,7 @@ if ($resql) {
|
||||
|
||||
while ( $row = $db->fetch_row($resql)) {
|
||||
|
||||
$var = ! $var;
|
||||
print '<tr ' . $bc[$var] . '><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<tr class="oddeven"><td>' . length_accountg($row[0]) . '</td>';
|
||||
print '<td align="left">' . $row[1] . '</td>';
|
||||
for($i = 2; $i <= 12; $i ++) {
|
||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||
@@ -314,7 +312,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
||||
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||
$sql .= " AND ff.fk_statut > 0 ";
|
||||
$sql .= " AND ff.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
dol_syslog('/accountancy/supplier/index.php:: sql=' . $sql);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,7 +27,7 @@
|
||||
require '../../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
@@ -44,6 +44,7 @@ $langs->load("productbatch");
|
||||
$account_parent = GETPOST('account_parent');
|
||||
$changeaccount = GETPOST('changeaccount');
|
||||
// Search Getpost
|
||||
$search_lineid = GETPOST('search_lineid', 'int');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
@@ -53,7 +54,7 @@ $search_account = GETPOST('search_account', 'alpha');
|
||||
$search_vat = GETPOST('search_vat', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page', 'int');
|
||||
@@ -75,7 +76,7 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
|
||||
/*
|
||||
@@ -85,6 +86,7 @@ $formventilation = new FormVentilation($db);
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
@@ -148,7 +150,7 @@ print '<script type="text/javascript">
|
||||
* Supplier Invoice lines
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.ref as facnumber, f.ref_supplier, f.libelle as invoice_label, f.datef,";
|
||||
$sql.= " l.fk_product, l.description, l.total_ht , l.qty, l.rowid, l.tva_tx, aa.label, aa.account_number, ";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, aa.label, aa.account_number, ";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql.= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||
@@ -156,6 +158,9 @@ $sql.= " , " . MAIN_DB_PREFIX . "facture_fourn_det as l";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
|
||||
$sql.= " AND aa.rowid = l.fk_code_ventilation";
|
||||
if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.ref", $search_invoice);
|
||||
}
|
||||
@@ -177,7 +182,7 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx", $search_vat, 1);
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@@ -225,13 +230,14 @@ if ($result) {
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" 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_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilDoneSupplier") . '<br>';
|
||||
|
||||
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
|
||||
print $formventilation->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print $formaccounting->select_account(GETPOST('account_parent'), 'account_parent', 1);
|
||||
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
|
||||
|
||||
$moreforfilter = '';
|
||||
@@ -239,6 +245,23 @@ if ($result) {
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
@@ -250,33 +273,16 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("Amount"), $_SERVER["PHP_SELF"], "l.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Account"), $_SERVER["PHP_SELF"], "aa.account_number", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="center"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_account" value="' . dol_escape_htmltag($search_account) . '"></td>';
|
||||
print '<td class="liste_titre" align="center">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons(1);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
$checkpicto=$form->showCheckAddButtons();
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
$facturefournisseur_static = new FactureFournisseur($db);
|
||||
$product_static = new Product($db);
|
||||
|
||||
$var = True;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label;
|
||||
|
||||
$facturefournisseur_static->ref = $objp->facnumber;
|
||||
@@ -287,7 +293,7 @@ if ($result) {
|
||||
$product_static->type = $objp->type;
|
||||
$product_static->label = $objp->product_label;
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
@@ -320,7 +326,7 @@ if ($result) {
|
||||
print img_edit();
|
||||
print '</a></td>';
|
||||
|
||||
print '<td align="right"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
print '<td class="center"><input type="checkbox" class="checkforaction" name="changeaccount[]" value="' . $objp->rowid . '"/></td>';
|
||||
|
||||
print "</tr>";
|
||||
$i ++;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>s
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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
|
||||
@@ -30,7 +30,7 @@ require '../../main.inc.php';
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/html.formventilation.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
|
||||
@@ -52,6 +52,7 @@ $toselect = GETPOST('toselect', 'array');
|
||||
$mesCasesCochees = GETPOST('toselect', 'array');
|
||||
|
||||
// Search Getpost
|
||||
$search_lineid = GETPOST('search_lineid', 'int');
|
||||
$search_invoice = GETPOST('search_invoice', 'alpha');
|
||||
$search_ref = GETPOST('search_ref', 'alpha');
|
||||
$search_label = GETPOST('search_label', 'alpha');
|
||||
@@ -62,7 +63,7 @@ $search_vat = GETPOST('search_vat', 'alpha');
|
||||
$btn_ventil = GETPOST('ventil', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):(empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION)?$conf->liste_limit:$conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'alpha');
|
||||
$sortorder = GETPOST('sortorder', 'alpha');
|
||||
$page = GETPOST('page','int');
|
||||
@@ -84,7 +85,7 @@ if ($user->societe_id > 0)
|
||||
if (! $user->rights->accounting->bind->write)
|
||||
accessforbidden();
|
||||
|
||||
$formventilation = new FormVentilation($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
$accounting = new AccountingAccount($db);
|
||||
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT, 1);
|
||||
@@ -101,6 +102,7 @@ if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction !=
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
|
||||
{
|
||||
$search_lineid = '';
|
||||
$search_ref = '';
|
||||
$search_invoice = '';
|
||||
$search_label = '';
|
||||
@@ -179,7 +181,7 @@ llxHeader('', $langs->trans("SuppliersVentilation"));
|
||||
|
||||
// Supplier Invoice Lines
|
||||
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef,";
|
||||
$sql.= " l.fk_product, l.description, l.total_ht as price, l.rowid, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, ";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, ";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
@@ -191,6 +193,9 @@ $sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND product_type <= 2";
|
||||
$sql.= " AND (accsys.rowid='" . $conf->global->CHARTOFACCOUNTS . "' OR p.accountancy_code_buy IS NULL OR p.accountancy_code_buy ='')";
|
||||
// Add search filter like
|
||||
if ($search_lineid) {
|
||||
$sql .= natural_search("l.rowid", $search_lineid, 1);
|
||||
}
|
||||
if (strlen(trim($search_invoice))) {
|
||||
$sql .= natural_search("f.ref",$search_invoice);
|
||||
}
|
||||
@@ -212,7 +217,7 @@ if (strlen(trim($search_account))) {
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx",$search_vat,1);
|
||||
}
|
||||
$sql .= " AND f.entity IN (" . getEntity("facture_fourn", 0) . ")"; // We don't share object for accountancy
|
||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
@@ -233,11 +238,11 @@ if ($result) {
|
||||
$i = 0;
|
||||
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
|
||||
|
||||
$arrayofmassactions = array(
|
||||
'ventil'=>$langs->trans("Ventilate")
|
||||
//'presend'=>$langs->trans("SendByMail"),
|
||||
@@ -246,8 +251,7 @@ if ($result) {
|
||||
//if ($user->rights->mymodule->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
|
||||
//if ($massaction == 'presend') $arrayofmassactions=array();
|
||||
$massactionbutton=$form->selectMassAction('ventil', $arrayofmassactions, 1);
|
||||
|
||||
|
||||
|
||||
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
|
||||
print '<input type="hidden" name="action" value="ventil">';
|
||||
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
@@ -255,19 +259,39 @@ if ($result) {
|
||||
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
//$center='<div align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '" name="ventil"></div>';
|
||||
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
|
||||
print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
|
||||
|
||||
print $langs->trans("DescVentilTodoCustomer") . '</br><br>';
|
||||
|
||||
if ($msg) print $msg.'<br>';
|
||||
|
||||
|
||||
$moreforfilter = '';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_lineid" value="' . dol_escape_htmltag($search_lineid) . '""></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="right flat maxwidth50" name="search_vat" placeholder="%" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="center" class="liste_titre">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("LineId"), $_SERVER["PHP_SELF"], "l.rowid", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("Invoice"), $_SERVER["PHP_SELF"], "f.ref", "", $param, '', $sortfield, $sortorder);
|
||||
@@ -280,28 +304,11 @@ if ($result) {
|
||||
print_liste_field_titre($langs->trans("VATRate"), $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
print_liste_field_titre($langs->trans("AccountAccountingSuggest"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre($langs->trans("IntoAccount"), '', '', '', '', 'align="center"');
|
||||
print_liste_field_titre('', '', '', '', '', 'align="center"');
|
||||
$checkpicto='';
|
||||
if ($massactionbutton) $checkpicto=$form->showCheckAddButtons('checkforselect', 1);
|
||||
print_liste_field_titre($checkpicto, '', '', '', '', 'align="center"');
|
||||
print "</tr>\n";
|
||||
|
||||
// We add search filter
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_invoice" value="' . dol_escape_htmltag($search_invoice) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_ref" value="' . dol_escape_htmltag($search_ref) . '"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_label" value="' . dol_escape_htmltag($search_label) . '"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidthonsmartphone" name="search_desc" value="' . dol_escape_htmltag($search_desc) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_amount" value="' . dol_escape_htmltag($search_amount) . '"></td>';
|
||||
print '<td class="liste_titre" align="right"><input type="text" class="flat maxwidth50" name="search_vat" size="1" value="' . dol_escape_htmltag($search_vat) . '"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td align="right" class="liste_titre">';
|
||||
$searchpitco=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
|
||||
print $searchpitco;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
$facturefourn_static = new FactureFournisseur($db);
|
||||
$productfourn_static = new ProductFournisseur($db);
|
||||
$form = new Form($db);
|
||||
@@ -309,7 +316,6 @@ if ($result) {
|
||||
$var = true;
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
$objp = $db->fetch_object($result);
|
||||
$var = ! $var;
|
||||
|
||||
// product_type: 0 = service ? 1 = product
|
||||
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
|
||||
@@ -322,7 +328,7 @@ if ($result) {
|
||||
$productfourn_static->id = $objp->product_id;
|
||||
$productfourn_static->type = $objp->type;
|
||||
$productfourn_static->label = $objp->product_label;
|
||||
|
||||
|
||||
$facturefourn_static->ref = $objp->ref;
|
||||
$facturefourn_static->id = $objp->facid;
|
||||
$facturefourn_static->type = $objp->type;
|
||||
@@ -340,38 +346,38 @@ if ($result) {
|
||||
$objp->aarowid_suggest = $aarowid_p;
|
||||
}
|
||||
if ($objp->code_buy_l == -1) $objp->code_buy_l='';
|
||||
|
||||
|
||||
if (! empty($objp->code_buy)) {
|
||||
$objp->code_buy_p = $objp->code_buy; // Code on product
|
||||
} else {
|
||||
$code_buy_p_notset = 'color:orange';
|
||||
}
|
||||
if (empty($objp->code_buy_l) && empty($objp->code_buy_p)) $code_buy_p_notset = 'color:red';
|
||||
|
||||
|
||||
// $objp->code_buy_p is now code of product/service
|
||||
// $objp->code_buy_l is now default code of product/service
|
||||
|
||||
print '<tr '. $bc[$var].'>';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Line id
|
||||
print '<td>' . $objp->rowid . '</td>';
|
||||
|
||||
|
||||
// Ref Invoice
|
||||
print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
|
||||
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
print $objp->invoice_label;
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '<td align="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
|
||||
// Ref product
|
||||
print '<td>';
|
||||
if ($productfourn_static->id)
|
||||
print $productfourn_static->getNomUrl(1);
|
||||
if ($objp->product_label) print '<br>'.$objp->product_label;
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Description
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
@@ -402,11 +408,11 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td align="center">';
|
||||
print $formventilation->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
|
||||
// Colonne choix ligne a ventiler
|
||||
print '<td align="right">';
|
||||
print '<td align="center">';
|
||||
print '<input type="checkbox" class="flat checkforselect" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||
print '</td>';
|
||||
|
||||
|
||||
@@ -48,6 +48,37 @@ $action = GETPOST('action','alpha');
|
||||
* Actions
|
||||
*/
|
||||
|
||||
//
|
||||
if ($action == 'updateall')
|
||||
{
|
||||
$db->begin();
|
||||
$res1=$res2=$res3=$res4=$res5=$res6=0;
|
||||
$res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res2=dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res3=dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
// Use vat for invoice creation
|
||||
if ($conf->facture->enabled)
|
||||
{
|
||||
$res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
$res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
{
|
||||
$res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0)
|
||||
{
|
||||
setEventMessages('ErrorFailedToSaveDate', null, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessages('RecordModifiedSuccessfully', null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
}
|
||||
|
||||
// Action mise a jour ou ajout d'une constante
|
||||
if ($action == 'update' || $action == 'add')
|
||||
{
|
||||
@@ -116,120 +147,81 @@ print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Members"), 0, 'user');
|
||||
dol_fiche_head($head, 'general', $langs->trans("Members"), -1, 'user');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="updateall">';
|
||||
|
||||
print load_fiche_titre($langs->trans("MemberMainOptions"),'','');
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print '<td align="center">'.$langs->trans("Action").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=true;
|
||||
|
||||
// Login/Pass required for members
|
||||
$var=!$var;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Mail required for members
|
||||
$var=!$var;
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_MAIL_REQUIRED">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_MAIL_REQUIRED',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Send mail information is on by default
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_DEFAULT_SENDINFOBYMAIL">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
|
||||
print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Insert subscription into bank account
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
|
||||
$arraychoices=array('0'=>$langs->trans("None"));
|
||||
if (! empty($conf->banque->enabled)) $arraychoices['bankdirect']=$langs->trans("MoreActionBankDirect");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['invoiceonly']=$langs->trans("MoreActionInvoiceOnly");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $arraychoices['bankviainvoice']=$langs->trans("MoreActionBankViaInvoice");
|
||||
print '<td>';
|
||||
print $form->selectarray('constvalue',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print $form->selectarray('ADHERENT_BANK_USE',$arraychoices,$conf->global->ADHERENT_BANK_USE,0);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
// Use vat for invoice creation
|
||||
if ($conf->facture->enabled)
|
||||
{
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_VAT_FOR_SUBSCRIPTIONS">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("VATToUseForSubscriptions").'</td>';
|
||||
if (! empty($conf->banque->enabled))
|
||||
{
|
||||
print '<td>';
|
||||
print $form->selectarray('constvalue', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"),'defaultforfoundationcountry'=>$langs->trans("Default")), (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS)?'0':$conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS), 0);
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="right" colspan="2">';
|
||||
print '<td align="right">';
|
||||
print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name"));
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
|
||||
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
{
|
||||
$var=!$var;
|
||||
print '<form action="adherent.php" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="constname" value="ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS">';
|
||||
print '<tr '.$bc[$var].'><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||
print '<td>';
|
||||
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'constvalue_ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
||||
print '</td><td align="center" width="80">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
|
||||
print '</td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<center>';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
|
||||
print '</center>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@@ -247,13 +239,12 @@ $constantes=array(
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersCards"),'','');
|
||||
|
||||
form_constantes($constantes);
|
||||
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
$helptext.='%YEAR%, %MONTH%, %DAY%';
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
print '%YEAR%, %MONTH%, %DAY%';
|
||||
print '<br>';
|
||||
form_constantes($constantes, 0, $helptext);
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -265,13 +256,12 @@ $constantes=array('ADHERENT_ETIQUETTE_TYPE','ADHERENT_ETIQUETTE_TEXT');
|
||||
|
||||
print load_fiche_titre($langs->trans("MembersTickets"),'','');
|
||||
|
||||
form_constantes($constantes);
|
||||
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
$helptext.='%YEAR%, %MONTH%, %DAY%';
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
print '%YEAR%, %MONTH%, %DAY%';
|
||||
print '<br>';
|
||||
form_constantes($constantes, 0, $helptext);
|
||||
|
||||
print '<br>';
|
||||
|
||||
@@ -295,13 +285,17 @@ $constantes=array(
|
||||
|
||||
print load_fiche_titre($langs->trans("Other"),'','');
|
||||
|
||||
form_constantes($constantes);
|
||||
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
$helptext.='%YEAR%, %MONTH%, %DAY%';
|
||||
|
||||
print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
print '%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
print '%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
//print '%YEAR%, %MONTH%, %DAY%'; // Not supported
|
||||
print '<br>';
|
||||
$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
|
||||
$helptext.='%DOL_MAIN_URL_ROOT%, %ID%, %FIRSTNAME%, %LASTNAME%, %FULLNAME%, %LOGIN%, %PASSWORD%, ';
|
||||
$helptext.='%COMPANY%, %ADDRESS%, %ZIP%, %TOWN%, %COUNTRY%, %EMAIL%, %BIRTH%, %PHOTO%, %TYPE%, ';
|
||||
//$helptext.='%YEAR%, %MONTH%, %DAY%'; // Not supported
|
||||
|
||||
form_constantes($constantes, 0, $helptext);
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Members"), 0, 'user');
|
||||
dol_fiche_head($head, 'attributes', $langs->trans("Members"), -1, 'user');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ print load_fiche_titre($langs->trans("MembersSetup"),$linkback,'title_setup');
|
||||
|
||||
$head = member_admin_prepare_head();
|
||||
|
||||
dol_fiche_head($head, 'attributes_type', $langs->trans("Members"), 0, 'user');
|
||||
dol_fiche_head($head, 'attributes_type', $langs->trans("Members"), -1, 'user');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
|
||||
$langs->load("members");
|
||||
$langs->load("admin");
|
||||
@@ -49,12 +50,15 @@ if ($action == 'update')
|
||||
$editamount=GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
|
||||
$payonline=GETPOST('MEMBER_NEWFORM_PAYONLINE');
|
||||
$email=GETPOST('MEMBER_PAYONLINE_SENDEMAIL');
|
||||
$forcetype=GETPOST('MEMBER_NEWFORM_FORCETYPE');
|
||||
|
||||
$res=dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC",$public,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_AMOUNT",$amount,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_EDITAMOUNT",$editamount,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_NEWFORM_PAYONLINE",$payonline,'chaine',0,'',$conf->entity);
|
||||
$res=dolibarr_set_const($db, "MEMBER_PAYONLINE_SENDEMAIL",$email,'chaine',0,'',$conf->entity);
|
||||
if ($forcetype < 0) $res=dolibarr_del_const($db, "MEMBER_NEWFORM_FORCETYPE",$conf->entity);
|
||||
else $res=dolibarr_set_const($db, "MEMBER_NEWFORM_FORCETYPE",$forcetype,'chaine',0,'',$conf->entity);
|
||||
|
||||
if (! $res > 0) $error++;
|
||||
|
||||
@@ -88,8 +92,9 @@ $head = member_admin_prepare_head();
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
|
||||
dol_fiche_head($head, 'public', $langs->trans("Members"), 0, 'user');
|
||||
dol_fiche_head($head, 'public', $langs->trans("Members"), -1, 'user');
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
@@ -110,16 +115,11 @@ if ($conf->use_javascript_ajax)
|
||||
{
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'0\')
|
||||
{
|
||||
jQuery("#tramount").hide();
|
||||
jQuery("#tredit").hide();
|
||||
jQuery("#trpayment").hide();
|
||||
jQuery("#tremail").hide();
|
||||
jQuery("#trforcetype, #tramount, #tredit, #trpayment, #tremail").hide();
|
||||
}
|
||||
if (jQuery("#MEMBER_ENABLE_PUBLIC").val()==\'1\')
|
||||
{
|
||||
jQuery("#tramount").show();
|
||||
jQuery("#tredit").show();
|
||||
jQuery("#trpayment").show();
|
||||
jQuery("#trforcetype, #tramount, #tredit, #trpayment").show();
|
||||
if (jQuery("#MEMBER_NEWFORM_PAYONLINE").val()==\'-1\') jQuery("#tremail").hide();
|
||||
else jQuery("#tremail").show();
|
||||
}
|
||||
@@ -141,63 +141,57 @@ print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
$var=true;
|
||||
|
||||
// Allow public form
|
||||
$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].'><td>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("EnablePublicSubscriptionForm");
|
||||
print '</td><td align="right">';
|
||||
print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Type
|
||||
/*$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].' class="drag"><td>';
|
||||
print $langs->trans("EnablePublicSubscriptionForm");
|
||||
print '</td><td width="60" align="center">';
|
||||
print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1);
|
||||
print "</td></tr>\n"; */
|
||||
// Force Type
|
||||
$adht = new AdherentType($db);
|
||||
print '<tr class="oddeven drag" id="trforcetype"><td>';
|
||||
print $langs->trans("ForceMemberType");
|
||||
print '</td><td width="60" align="right">';
|
||||
$listofval = array(-1 => $langs->trans("Undefined"));
|
||||
$listofval += $adht->liste_array();
|
||||
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listetype)>1?1:0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Amount
|
||||
$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].' id="tramount"><td>';
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td align="right">';
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(! empty($conf->global->MEMBER_NEWFORM_AMOUNT)?$conf->global->MEMBER_NEWFORM_AMOUNT:'').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
$var=! $var;
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<tr '.$bc[$var].' id="tredit"><td>';
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("CanEditAmount");
|
||||
print '</td><td align="right">';
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled))
|
||||
{
|
||||
// Jump to an online payment page
|
||||
$var=! $var;
|
||||
print '<tr '.$bc[$var].' id="trpayment"><td>';
|
||||
print '<tr class="oddeven" id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
print '</td><td align="right">';
|
||||
$listofval=array();
|
||||
if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
|
||||
if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
|
||||
if (! empty($conf->stripe->enabled)) $listofval['stripe']='Stripe';
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
|
||||
print "</td></tr>\n";
|
||||
}
|
||||
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
|
||||
if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled) || ! empty($conf->stripe->enabled))
|
||||
{
|
||||
// Jump to an online payment page
|
||||
$var=! $var;
|
||||
print '<tr '.$bc[$var].' id="tremail"><td>';
|
||||
print '<tr class="oddeven" id="tremail"><td>';
|
||||
print $langs->trans("MEMBER_PAYONLINE_SENDEMAIL");
|
||||
print '</td><td align="right">';
|
||||
print '<input type="text" id="MEMBER_PAYONLINE_SENDEMAIL" name="MEMBER_PAYONLINE_SENDEMAIL" size="24" value="'.(! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL)?$conf->global->MEMBER_PAYONLINE_SENDEMAIL:'').'">';
|
||||
|
||||
@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
$langs->load("companies");
|
||||
$langs->load("members");
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int');
|
||||
|
||||
// Security check
|
||||
$result=restrictedArea($user,'adherent',$id);
|
||||
@@ -85,50 +85,20 @@ if ($object->id > 0)
|
||||
if (! empty($conf->notification->enabled)) $langs->load("mails");
|
||||
$head = member_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user');
|
||||
dol_fiche_head($head, 'agenda', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("Nature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||
/*print '<td rowspan="'.$rowspan.'" align="center" valign="middle" width="25%">';
|
||||
print $form->showphoto('memberphoto',$member);
|
||||
print '</td>';*/
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'</td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
print '<br>';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
$object->info($id);
|
||||
print dol_print_object_info($object, 1);
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@@ -146,30 +116,11 @@ if ($object->id > 0)
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
$out='';
|
||||
|
||||
/*$objthirdparty=$object->thirdparty;
|
||||
$objcon=new stdClass();
|
||||
|
||||
$permok=$user->rights->agenda->myactions->create;
|
||||
if ((! empty($objthirdparty->id) || ! empty($objcon->id)) && $permok)
|
||||
{
|
||||
$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') $out.='&socid='.$objthirdparty->id;
|
||||
$out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=-1">';
|
||||
$out.=$langs->trans("AddAnAction").' ';
|
||||
$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||
$out.="</a>";
|
||||
}*/
|
||||
|
||||
print load_fiche_titre($langs->trans("ActionsOnMember"),$out,'');
|
||||
|
||||
// List of todo actions
|
||||
//show_actions_todo($conf,$langs,$db,$object);
|
||||
|
||||
// List of done actions
|
||||
// List of actions
|
||||
show_actions_done($conf,$langs,$db,$object,null,0,'','');
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ abstract class ActionsAdherentCardCommon
|
||||
$this->object->old_name = $_POST["old_name"];
|
||||
$this->object->old_firstname = $_POST["old_firstname"];
|
||||
|
||||
$result = $this->object->delete();
|
||||
$result = $this->object->delete(0, $user, 0);
|
||||
if ($result > 0)
|
||||
{
|
||||
header("Location: list.php");
|
||||
@@ -424,7 +424,7 @@ abstract class ActionsAdherentCardCommon
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
|
||||
$this->object->country_code = $obj->code;
|
||||
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ if ($id > 0)
|
||||
// Define variables to know what current user can do on properties of user linked to edited member
|
||||
if ($object->user_id)
|
||||
{
|
||||
// $ User is the user who edits, $ object->user_id is the id of the related user in the edited member
|
||||
// $ User is the user who edits, $ object->user_id is the id of the related user in the edited member
|
||||
$caneditfielduser=((($user->id == $object->user_id) && $user->rights->user->self->creer)
|
||||
|| (($user->id != $object->user_id) && $user->rights->user->user->creer));
|
||||
$caneditpassworduser=((($user->id == $object->user_id) && $user->rights->user->self->password)
|
||||
@@ -213,7 +213,7 @@ if (empty($reshook))
|
||||
{
|
||||
if ($result > 0)
|
||||
{
|
||||
// User creation
|
||||
// User creation
|
||||
$company = new Societe($db);
|
||||
$result=$company->create_from_member($object,GETPOST('companyname'));
|
||||
|
||||
@@ -307,7 +307,7 @@ if (empty($reshook))
|
||||
$object->phone = trim($_POST["phone"]);
|
||||
$object->phone_perso = trim($_POST["phone_perso"]);
|
||||
$object->phone_mobile= trim($_POST["phone_mobile"]);
|
||||
$object->email = trim($_POST["email"]);
|
||||
$object->email = trim($_POST["member_email"]);
|
||||
$object->skype = trim($_POST["skype"]);
|
||||
$object->birth = $birthdate;
|
||||
|
||||
@@ -585,7 +585,7 @@ if (empty($reshook))
|
||||
|
||||
if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confirm == 'yes')
|
||||
{
|
||||
$result=$object->delete($id);
|
||||
$result=$object->delete($id, $user);
|
||||
if ($result > 0)
|
||||
{
|
||||
if (! empty($backtopage))
|
||||
@@ -714,7 +714,7 @@ if (empty($reshook))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Actions to build doc
|
||||
$upload_dir = $conf->adherent->dir_output;
|
||||
$permissioncreate=$user->rights->adherent->creer;
|
||||
@@ -825,6 +825,16 @@ else
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="member_login" class="maxwidth200" value="'.(isset($_POST["member_login"])?GETPOST("member_login", 'alpha', 2):$object->login).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
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 size="30" maxsize="32" type="text" name="password" value="'.$generated_password.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("MemberType").'</td><td>';
|
||||
$listetype=$adht->liste_array();
|
||||
@@ -862,16 +872,6 @@ else
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" size="40" value="'.(GETPOST('member_email','alpha')?GETPOST('member_email','alpha'):$object->email).'"></td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
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 size="30" maxsize="32" type="text" name="password" value="'.$generated_password.'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Address
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
|
||||
@@ -948,20 +948,6 @@ else
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
|
||||
/*
|
||||
// Third party Dolibarr
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td class="valeur">';
|
||||
print $form->select_company($object->fk_soc,'socid','',1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Login Dolibarr
|
||||
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td class="valeur">';
|
||||
print $form->select_dolusers($object->user_id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
@@ -1061,14 +1047,19 @@ else
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$object->id.'</td></tr>';
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("Ref").'</td><td class="valeur">'.$object->id.'</td></tr>';
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td colspan="2"><input type="text" name="login" class="maxwidth200" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").' / '.$langs->trans("Id").'</span></td><td><input type="text" name="login" class="maxwidth200" value="'.(isset($_POST["login"])?GETPOST("login",'alpha',2):$object->login).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="maxwdith200" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
|
||||
}
|
||||
// Morphy
|
||||
$morphys["phy"] = $langs->trans("Physical");
|
||||
$morphys["mor"] = $langs->trans("Morale");
|
||||
@@ -1090,7 +1081,7 @@ else
|
||||
print "</td></tr>";
|
||||
|
||||
// Company
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';
|
||||
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth100" value="'.(isset($_POST["societe"])?GETPOST("societe",'',2):$object->societe).'"></td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
|
||||
@@ -1099,11 +1090,11 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// Lastname
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
|
||||
print '<tr><td id="tdlastname">'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="minwidth100" value="'.(isset($_POST["lastname"])?GETPOST("lastname",'',2):$object->lastname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Firstname
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
|
||||
print '<tr><td id="tdfirstname">'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="minwidth100" value="'.(isset($_POST["firstname"])?GETPOST("firstname",'',3):$object->firstname).'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
// Photo
|
||||
@@ -1122,17 +1113,11 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// EMail
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="email" size="40" value="'.(isset($_POST["email"])?GETPOST("email",'',2):$object->email).'"></td></tr>';
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
|
||||
{
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="maxwdith200" value="'.(isset($_POST["pass"])?GETPOST("pass",'',2):$object->pass).'"></td></tr>';
|
||||
}
|
||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED?'<span class="fieldrequired">':'').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'</span>':'').'</td><td><input type="text" name="member_email" size="40" value="'.(isset($_POST["member_email"])?GETPOST("member_email",'',2):$object->email).'"></td></tr>';
|
||||
|
||||
// Address
|
||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
|
||||
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.'">'.(isset($_POST["address"])?GETPOST("address",'',2):$object->address).'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Zip / Town
|
||||
@@ -1144,7 +1129,7 @@ else
|
||||
|
||||
// Country
|
||||
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
print $form->select_country(isset($_POST["country_id"])?$_POST["country_id"]:$object->country_id,'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
|
||||
print '</td></tr>';
|
||||
@@ -1169,7 +1154,7 @@ else
|
||||
// Skype
|
||||
if (! empty($conf->skype->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" size="40" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Skype").'</td><td><input type="text" name="skype" class="minwidth100" value="'.(isset($_POST["skype"])?GETPOST("skype"):$object->skype).'"></td></tr>';
|
||||
}
|
||||
|
||||
// Birthday
|
||||
@@ -1186,7 +1171,7 @@ else
|
||||
if (! empty( $conf->categorie->enabled ) && !empty( $user->rights->categorie->lire ))
|
||||
{
|
||||
print '<tr><td>' . fieldLabel('Categories', 'memcats') . '</td>';
|
||||
print '<td colspan="2">';
|
||||
print '<td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1);
|
||||
$c = new Categorie($db);
|
||||
$cats = $c->containing($object->id, Categorie::TYPE_MEMBER);
|
||||
@@ -1198,7 +1183,7 @@ else
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array("colspan"=>2);
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
@@ -1274,7 +1259,7 @@ else
|
||||
*/
|
||||
$head = member_prepare_head($object);
|
||||
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"), 0, 'user');
|
||||
dol_fiche_head($head, 'general', $langs->trans("Member"), -1, 'user');
|
||||
|
||||
// Confirm create user
|
||||
if ($action == 'create_user')
|
||||
@@ -1417,12 +1402,12 @@ else
|
||||
if (! empty($conf->societe->enabled)) $rowspan++;
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
@@ -1464,15 +1449,15 @@ else
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
print '</div>';
|
||||
print '<div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border tableforfield" width="100%">';
|
||||
|
||||
|
||||
// Birthday
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Birthday").'</td><td class="valeur">'.dol_print_date($object->birth,'day').'</td></tr>';
|
||||
|
||||
@@ -1488,13 +1473,8 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Other attributes
|
||||
$parameters=array('colspan'=>2);
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields, 'view', $parameters);
|
||||
}
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
@@ -1519,7 +1499,7 @@ else
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
// Third party Dolibarr
|
||||
if (! empty($conf->societe->enabled))
|
||||
{
|
||||
@@ -1596,12 +1576,12 @@ else
|
||||
print '<div style="clear:both"></div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Hotbar
|
||||
*/
|
||||
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
@@ -1617,7 +1597,7 @@ else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</font></div>';
|
||||
}
|
||||
|
||||
|
||||
// Validate
|
||||
if ($object->statut == -1)
|
||||
{
|
||||
@@ -1630,7 +1610,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</font></div>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Reactivate
|
||||
if ($object->statut == 0)
|
||||
{
|
||||
@@ -1643,7 +1623,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Send card by email
|
||||
if ($user->rights->adherent->creer)
|
||||
{
|
||||
@@ -1661,7 +1641,7 @@ else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||
}
|
||||
|
||||
|
||||
// Terminate
|
||||
if ($object->statut >= 1)
|
||||
{
|
||||
@@ -1674,7 +1654,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Resiliate")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create third party
|
||||
if (! empty($conf->societe->enabled) && ! $object->fk_soc)
|
||||
{
|
||||
@@ -1688,7 +1668,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrThirdParty")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Create user
|
||||
if (! $user->societe_id && ! $object->user_id)
|
||||
{
|
||||
@@ -1702,7 +1682,7 @@ else
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("CreateDolibarrLogin")."</font></div>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->supprimer)
|
||||
{
|
||||
@@ -1712,12 +1692,12 @@ else
|
||||
{
|
||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Delete")."</font></div>";
|
||||
}
|
||||
|
||||
|
||||
// Action SPIP
|
||||
if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP))
|
||||
{
|
||||
$isinspip = $mailmanspip->is_in_spip($object);
|
||||
|
||||
|
||||
if ($isinspip == 1)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=del_spip">'.$langs->trans("DeleteIntoSpip")."</a></div>\n";
|
||||
@@ -1727,7 +1707,7 @@ else
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?rowid='.$object->id.'&action=add_spip">'.$langs->trans("AddIntoSpip")."</a></div>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
print '</div>';
|
||||
@@ -1737,11 +1717,11 @@ else
|
||||
print '<br><br><font class="error">'.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.'</font>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print '<div class="fichecenter"><div class="fichehalfleft">';
|
||||
print '<a name="builddoc"></a>'; // ancre
|
||||
|
||||
|
||||
// Documents generes
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
//$filename = 'tmp_cards.php';
|
||||
@@ -1753,15 +1733,15 @@ else
|
||||
|
||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('subscription'));
|
||||
//$somethingshown = $form->showLinkedObjectBlock($object, '');
|
||||
|
||||
|
||||
// Show links to link elements
|
||||
/*$linktoelem = $form->showLinkToObjectBlock($object,array('order'));
|
||||
if ($linktoelem) print ($somethingshown?'':'<br>').$linktoelem;
|
||||
|
||||
|
||||
// Link for paypal payment
|
||||
/*
|
||||
if (! empty($conf->paypal->enabled) && $object->statut != 0) {
|
||||
@@ -1770,15 +1750,15 @@ else
|
||||
}
|
||||
*/
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
// List of actions on element
|
||||
/* Already in tab Agenda/Events
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, 'member', $socid);
|
||||
*/
|
||||
print '</div></div></div>';
|
||||
|
||||
print '</div></div></div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,6 +209,23 @@ class Adherent extends CommonObject
|
||||
|
||||
// Substitutions
|
||||
$substitutionarray=array(
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__ID__'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||
'__TOWN_'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
// For backward compatibility
|
||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
||||
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
||||
'%CIVILITY%'=>$this->getCivilityLabel(),
|
||||
@@ -225,7 +242,6 @@ class Adherent extends CommonObject
|
||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||
// For backward compatibility
|
||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||
@@ -234,16 +250,10 @@ class Adherent extends CommonObject
|
||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||
);
|
||||
// Add extrafields as substitution key %EXTRA_XXX%
|
||||
foreach($this->array_options as $key => $val)
|
||||
{
|
||||
$keyshort=preg_replace('/^(options|extra)_/','',$key);
|
||||
$substitutionarray['%EXTRA_'.$keyshort.'%']=$val;
|
||||
}
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs);
|
||||
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||
|
||||
return make_substitutions($text,$substitutionarray);
|
||||
return make_substitutions($text, $substitutionarray, $langs);
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +345,7 @@ class Adherent extends CommonObject
|
||||
{
|
||||
// Add link to user
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
|
||||
$sql.= " fk_member = '".$this->id."'";
|
||||
$sql.= " fk_member = ".$this->id;
|
||||
$sql.= " WHERE rowid = ".$this->user_id;
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -439,18 +449,18 @@ class Adherent extends CommonObject
|
||||
$sql.= ", town=" .($this->town?"'".$this->db->escape($this->town)."'":"null");
|
||||
$sql.= ", country=".($this->country_id>0?"'".$this->country_id."'":"null");
|
||||
$sql.= ", state_id=".($this->state_id>0?"'".$this->state_id."'":"null");
|
||||
$sql.= ", email='".$this->email."'";
|
||||
$sql.= ", skype='".$this->skype."'";
|
||||
$sql.= ", email='".$this->db->escape($this->email)."'";
|
||||
$sql.= ", skype='".$this->db->escape($this->skype)."'";
|
||||
$sql.= ", phone=" .($this->phone?"'".$this->db->escape($this->phone)."'":"null");
|
||||
$sql.= ", phone_perso=" .($this->phone_perso?"'".$this->db->escape($this->phone_perso)."'":"null");
|
||||
$sql.= ", phone_mobile=" .($this->phone_mobile?"'".$this->db->escape($this->phone_mobile)."'":"null");
|
||||
$sql.= ", note_private=" .($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
|
||||
$sql.= ", note_public=" .($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
|
||||
$sql.= ", photo=" .($this->photo?"'".$this->photo."'":"null");
|
||||
$sql.= ", public='".$this->public."'";
|
||||
$sql.= ", public='".$this->db->escape($this->public)."'";
|
||||
$sql.= ", statut=" .$this->statut;
|
||||
$sql.= ", fk_adherent_type=".$this->typeid;
|
||||
$sql.= ", morphy='".$this->morphy."'";
|
||||
$sql.= ", morphy='".$this->db->escape($this->morphy)."'";
|
||||
$sql.= ", birth=" .($this->birth?"'".$this->db->idate($this->birth)."'":"null");
|
||||
if ($this->datefin) $sql.= ", datefin='".$this->db->idate($this->datefin)."'"; // Must be modified only when deleting a subscription
|
||||
if ($this->datevalid) $sql.= ", datevalid='".$this->db->idate($this->datevalid)."'"; // Must be modified only when validating a member
|
||||
@@ -649,7 +659,7 @@ class Adherent extends CommonObject
|
||||
// Search for last subscription id and end date
|
||||
$sql = "SELECT rowid, datec as dateop, dateadh as datedeb, datef as datefin";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."subscription";
|
||||
$sql.= " WHERE fk_adherent='".$this->id."'";
|
||||
$sql.= " WHERE fk_adherent=".$this->id;
|
||||
$sql.= " ORDER by dateadh DESC"; // Sort by start subscription date
|
||||
|
||||
dol_syslog(get_class($this)."::update_end_date", LOG_DEBUG);
|
||||
@@ -695,11 +705,13 @@ class Adherent extends CommonObject
|
||||
* Fonction qui supprime l'adherent et les donnees associees
|
||||
*
|
||||
* @param int $rowid Id of member to delete
|
||||
* @param User $user User object
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, 0=nothing to do, >0 if OK
|
||||
*/
|
||||
function delete($rowid)
|
||||
function delete($rowid, $user, $notrigger=0)
|
||||
{
|
||||
global $conf, $langs, $user;
|
||||
global $conf, $langs;
|
||||
|
||||
$result = 0;
|
||||
$error=0;
|
||||
@@ -710,6 +722,14 @@ class Adherent extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
if (! $error && ! $notrigger)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('MEMBER_DELETE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
// Remove category
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member WHERE fk_member = ".$rowid;
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
@@ -777,16 +797,6 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('MEMBER_DELETE',$user);
|
||||
if ($result < 0) { $error++; }
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->db->commit();
|
||||
@@ -1089,7 +1099,7 @@ class Adherent extends CommonObject
|
||||
elseif ($ref || $fk_soc) {
|
||||
$sql.= " AND d.entity IN (".getEntity().")";
|
||||
if ($ref) $sql.= " AND d.rowid='".$this->db->escape($ref)."'";
|
||||
elseif ($fk_soc) $sql.= " AND d.fk_soc='".$fk_soc."'";
|
||||
elseif ($fk_soc > 0) $sql.= " AND d.fk_soc=".$fk_soc;
|
||||
}
|
||||
elseif ($ref_ext)
|
||||
{
|
||||
@@ -1570,40 +1580,85 @@ class Adherent extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlen length max libelle
|
||||
* @param string $option Page lien
|
||||
* @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small)
|
||||
* @param int $maxlen length max label
|
||||
* @param string $option Page for link
|
||||
* @param string $mode ''=Show firstname and lastname, 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref
|
||||
* @param string $morecss Add more css on link
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$maxlen=0,$option='card')
|
||||
function getNomUrl($withpictoimg=0,$maxlen=0,$option='card',$mode='',$morecss='')
|
||||
{
|
||||
global $langs;
|
||||
global $conf, $langs;
|
||||
|
||||
$result='';
|
||||
$label = '<u>' . $langs->trans("ShowMember") . '</u>';
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && $withpictoimg) $withpictoimg=0;
|
||||
|
||||
$result=''; $label='';
|
||||
$link=''; $linkstart=''; $linkend='';
|
||||
|
||||
if (! empty($this->photo))
|
||||
{
|
||||
$label.= '<div class="photointooltip">';
|
||||
$label.= Form::showphoto('memberphoto', $this, 80, 0, 0, 'photowithmargin photologintooltip', 'small', 0, 1);
|
||||
$label.= '</div><div style="clear: both;"></div>';
|
||||
}
|
||||
|
||||
$label.= '<div class="centpercent">';
|
||||
$label.= '<u>' . $langs->trans("Member") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label.= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($this->firstname) || ! empty($this->lastname))
|
||||
$label.= '<br><b>' . $langs->trans('Name') . ':</b> ' . $this->getFullName($langs);
|
||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$label.='</div>';
|
||||
|
||||
$link=''; $linkend='';
|
||||
if ($option == 'card' || $option == 'category')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.$linkclose;
|
||||
$linkend='</a>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$this->id.'"';
|
||||
}
|
||||
if ($option == 'subscription')
|
||||
{
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$this->id.$linkclose;
|
||||
$linkend='</a>';
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/adherents/subscription.php?rowid='.$this->id.'"';
|
||||
}
|
||||
|
||||
$picto='user';
|
||||
$linkclose="";
|
||||
if (empty($notooltip))
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$langs->load("users");
|
||||
$label=$langs->trans("ShowUser");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
$linkclose.= ' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
|
||||
}
|
||||
|
||||
$link.=$linkclose.'>';
|
||||
$linkend='</a>';
|
||||
|
||||
//if ($withpictoimg == -1) $result.='<div class="nowrap">';
|
||||
$result.=$link;
|
||||
if ($withpictoimg)
|
||||
{
|
||||
$paddafterimage='';
|
||||
if (abs($withpictoimg) == 1) $paddafterimage='style="margin-right: 3px;"';
|
||||
// Only picto
|
||||
if ($withpictoimg > 0) $picto='<div class="inline-block nopadding valignmiddle'.($morecss?' userimg'.$morecss:'').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip?'':'class="classfortooltip"'), 0, 0, $notooltip?0:1).'</div>';
|
||||
// Picto must be a photo
|
||||
else $picto='<div class="inline-block nopadding valignmiddle'.($morecss?' userimg'.$morecss:'').'"'.($paddafterimage?' '.$paddafterimage:'').'>'.Form::showphoto('memberphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg==-3?'small':''), 'mini', 0, 1).'</div>';
|
||||
$result.=$picto;
|
||||
}
|
||||
if ($withpictoimg > -2 && $withpictoimg != 2)
|
||||
{
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='<div class="inline-block nopadding valignmiddle'.((! isset($this->statut) || $this->statut)?'':' strikefordisabled').($morecss?' usertext'.$morecss:'').'">';
|
||||
if ($mode == 'login') $result.=dol_trunc($this->login, $maxlen);
|
||||
elseif ($mode == 'ref') $result.=$this->id;
|
||||
else $result.=$this->getFullName($langs,'',($mode == 'firstname' ? 2 : -1),$maxlen);
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $result.='</div>';
|
||||
}
|
||||
$result.=$linkend;
|
||||
//if ($withpictoimg == -1) $result.='</div>';
|
||||
|
||||
if ($withpicto) $result.=($link.img_object('', $picto, 'class="classfortooltip"').$linkend);
|
||||
if ($withpicto && $withpicto != 2) $result.=' ';
|
||||
$result.=$link.(($withpicto != 2) ? ($maxlen?dol_trunc($this->ref,$maxlen):$this->ref) : '').$linkend;
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1725,7 +1780,7 @@ class Adherent extends CommonObject
|
||||
$sql = "SELECT count(a.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.statut > 0";
|
||||
$sql.= " AND a.entity IN (".getEntity('adherent', 1).")";
|
||||
$sql.= " AND a.entity IN (".getEntity('adherent').")";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
@@ -1763,7 +1818,7 @@ class Adherent extends CommonObject
|
||||
$sql = "SELECT a.rowid, a.datefin, a.statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a";
|
||||
$sql.= " WHERE a.statut = 1";
|
||||
$sql.= " AND a.entity IN (".getEntity('adherent', 1).")";
|
||||
$sql.= " AND a.entity IN (".getEntity('adherent').")";
|
||||
$sql.= " AND (a.datefin IS NULL or a.datefin < '".$this->db->idate($now)."')";
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
@@ -1775,7 +1830,7 @@ class Adherent extends CommonObject
|
||||
$response->warning_delay=$conf->adherent->subscription->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("MembersWithSubscriptionToReceive");
|
||||
$response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1&filter=outofdate';
|
||||
$response->img=img_object($langs->trans("Members"),"user");
|
||||
$response->img=img_object('',"user");
|
||||
|
||||
$adherentstatic = new Adherent($this->db);
|
||||
|
||||
@@ -1818,18 +1873,16 @@ class Adherent extends CommonObject
|
||||
|
||||
$langs->load("orders");
|
||||
|
||||
// Positionne le modele sur le nom du modele a utiliser
|
||||
if (! dol_strlen($modele))
|
||||
{
|
||||
if (! empty($conf->global->ADHERENT_ADDON_PDF))
|
||||
{
|
||||
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
||||
}
|
||||
else
|
||||
{
|
||||
$modele = 'standard';
|
||||
}
|
||||
}
|
||||
if (! dol_strlen($modele)) {
|
||||
|
||||
$modele = 'standard';
|
||||
|
||||
if ($this->modelpdf) {
|
||||
$modele = $this->modelpdf;
|
||||
} elseif (! empty($conf->global->ADHERENT_ADDON_PDF)) {
|
||||
$modele = $conf->global->ADHERENT_ADDON_PDF;
|
||||
}
|
||||
}
|
||||
|
||||
$modelpath = "core/modules/member/doc/";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.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
|
||||
@@ -36,7 +36,13 @@ class AdherentType extends CommonObject
|
||||
public $table_element = 'adherent_type';
|
||||
public $element = 'adherent_type';
|
||||
public $picto = 'group';
|
||||
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @deprecated Use label
|
||||
* @see label
|
||||
*/
|
||||
public $libelle;
|
||||
/** @var string Label */
|
||||
public $label;
|
||||
/**
|
||||
@@ -81,12 +87,13 @@ class AdherentType extends CommonObject
|
||||
global $conf;
|
||||
|
||||
$this->statut=(int) $this->statut;
|
||||
$this->label=(!empty($this->libelle)?trim($this->libelle):trim($this->label));
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_type (";
|
||||
$sql.= "libelle";
|
||||
$sql.= ", entity";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= "'".$this->db->escape($this->libelle)."'";
|
||||
$sql.= "'".$this->db->escape($this->label)."'";
|
||||
$sql.= ", ".$conf->entity;
|
||||
$sql.= ")";
|
||||
|
||||
@@ -117,15 +124,15 @@ class AdherentType extends CommonObject
|
||||
|
||||
$error=0;
|
||||
|
||||
$this->libelle=trim($this->libelle);
|
||||
$this->label=(!empty($this->libelle)?trim($this->libelle):trim($this->label));
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
|
||||
$sql.= "SET ";
|
||||
$sql.= "statut = ".$this->statut.",";
|
||||
$sql.= "libelle = '".$this->db->escape($this->libelle) ."',";
|
||||
$sql.= "subscription = '".$this->subscription."',";
|
||||
$sql.= "libelle = '".$this->db->escape($this->label) ."',";
|
||||
$sql.= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
$sql.= "note = '".$this->db->escape($this->note)."',";
|
||||
$sql.= "vote = '".$this->vote."',";
|
||||
$sql.= "vote = '".$this->db->escape($this->vote)."',";
|
||||
$sql.= "mail_valid = '".$this->db->escape($this->mail_valid)."'";
|
||||
$sql .= " WHERE rowid =".$this->id;
|
||||
|
||||
@@ -307,7 +314,7 @@ class AdherentType extends CommonObject
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getMailOnValid
|
||||
*
|
||||
|
||||