mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 17:18:13 +01:00
Compare commits
940 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cd529a179 | ||
|
|
82c3849baa | ||
|
|
c932a1c878 | ||
|
|
f2f8278603 | ||
|
|
cc5a8fd15a | ||
|
|
a567cade7d | ||
|
|
764bb3791b | ||
|
|
9ac82f488e | ||
|
|
222cd76799 | ||
|
|
47799b88cf | ||
|
|
78ca968db6 | ||
|
|
aa8fac1deb | ||
|
|
2ebdcfda5c | ||
|
|
70431043af | ||
|
|
ad37ece7bc | ||
|
|
a1476fd221 | ||
|
|
0e1c580f11 | ||
|
|
4223ff08ce | ||
|
|
d16f8b68db | ||
|
|
d8891130f5 | ||
|
|
b2f9de7489 | ||
|
|
17ff2bea5d | ||
|
|
1002557746 | ||
|
|
908880c82c | ||
|
|
3608e9b102 | ||
|
|
c1c2358e75 | ||
|
|
69ac8cebbf | ||
|
|
1e16bf5160 | ||
|
|
c2635f5242 | ||
|
|
9394f24cf7 | ||
|
|
b1a4520059 | ||
|
|
2935a245a3 | ||
|
|
5589ed71b2 | ||
|
|
32f160355b | ||
|
|
5a61cc9393 | ||
|
|
7ed0af2a13 | ||
|
|
1cd3ca3222 | ||
|
|
c8acd48e34 | ||
|
|
9e8460c3dc | ||
|
|
70f5e20572 | ||
|
|
3a617ed772 | ||
|
|
f32386208d | ||
|
|
1adf4ce67f | ||
|
|
515a615915 | ||
|
|
ac4820b4cb | ||
|
|
f9d285c416 | ||
|
|
f1f7ea93b0 | ||
|
|
1f6cec841f | ||
|
|
4dcbd826e6 | ||
|
|
fd5c9b0562 | ||
|
|
8e30fc0bd1 | ||
|
|
21843e68b0 | ||
|
|
30ecf80732 | ||
|
|
9de04b1c48 | ||
|
|
7e7939d234 | ||
|
|
dba065c222 | ||
|
|
29edc77dd5 | ||
|
|
99fe044868 | ||
|
|
8ae27c3a5f | ||
|
|
ea28972862 | ||
|
|
5fa475a074 | ||
|
|
3ad30f8622 | ||
|
|
3b7cda03f3 | ||
|
|
e5f3c2c117 | ||
|
|
1d24cf5ea5 | ||
|
|
689b992afb | ||
|
|
a16f3bdf31 | ||
|
|
dc7932700b | ||
|
|
af13e3354b | ||
|
|
e7a1e58ebf | ||
|
|
534d4ed4bc | ||
|
|
50b90d795c | ||
|
|
3209eb4bd8 | ||
|
|
17bb284e0c | ||
|
|
223326610e | ||
|
|
2555b14f9c | ||
|
|
edd4565921 | ||
|
|
38980a935c | ||
|
|
700b89d578 | ||
|
|
a4b78f8230 | ||
|
|
88db5b4bd7 | ||
|
|
1f65548836 | ||
|
|
5de1fcca2f | ||
|
|
66d72d0bba | ||
|
|
403dad1660 | ||
|
|
e801a7602c | ||
|
|
c6dd95e6d2 | ||
|
|
12d078c651 | ||
|
|
0dbbd453e5 | ||
|
|
8ddf9f6075 | ||
|
|
cc22f978cd | ||
|
|
1afb65a042 | ||
|
|
50afc9682b | ||
|
|
a692c73071 | ||
|
|
def8495513 | ||
|
|
b2fce5052f | ||
|
|
b1d57a6bd1 | ||
|
|
16904d12f8 | ||
|
|
1525b9c85e | ||
|
|
ffe07999cf | ||
|
|
24146d89c5 | ||
|
|
1dd2cc36e4 | ||
|
|
477d755bbc | ||
|
|
f85b53a4ca | ||
|
|
a6e01fe7b7 | ||
|
|
43c2336683 | ||
|
|
e1b919366e | ||
|
|
40e4a6959f | ||
|
|
e9869bb5da | ||
|
|
22995dae99 | ||
|
|
52ae202aff | ||
|
|
2ca2fe7f28 | ||
|
|
140310c508 | ||
|
|
64cf2513bd | ||
|
|
6c207f78d8 | ||
|
|
a3969c1d2c | ||
|
|
d9563ac0ed | ||
|
|
bea2f674f0 | ||
|
|
80494870c0 | ||
|
|
d25847602b | ||
|
|
283efbbffe | ||
|
|
2e430a71a3 | ||
|
|
faf2971ff7 | ||
|
|
acf5e30b30 | ||
|
|
76b5540124 | ||
|
|
8bb63c5963 | ||
|
|
f532f85d8c | ||
|
|
f93fdc641a | ||
|
|
0226d75ec6 | ||
|
|
a63eae7903 | ||
|
|
79210c0120 | ||
|
|
d87ebbf926 | ||
|
|
08b105502e | ||
|
|
bd2aba1a2f | ||
|
|
a4601686a6 | ||
|
|
bcf6d6a7a2 | ||
|
|
db5f33442a | ||
|
|
84ba1852aa | ||
|
|
65a3b0893d | ||
|
|
669c939bcd | ||
|
|
92454d671f | ||
|
|
4e7954b85c | ||
|
|
41e914f9ac | ||
|
|
5614def20b | ||
|
|
f33fe1036f | ||
|
|
f43f2909ff | ||
|
|
fc8b0a80c0 | ||
|
|
4adc4a31e2 | ||
|
|
8c6ecd1144 | ||
|
|
7920cf8596 | ||
|
|
c5451242e7 | ||
|
|
a54c5fcdcb | ||
|
|
60f089c015 | ||
|
|
8e689c1479 | ||
|
|
8efe6d477e | ||
|
|
870c2a8f50 | ||
|
|
7d898184b5 | ||
|
|
bba84133e7 | ||
|
|
91664a34db | ||
|
|
781adf507b | ||
|
|
01aa901f93 | ||
|
|
75ee26c3ed | ||
|
|
96a74c4976 | ||
|
|
258fe1124b | ||
|
|
a69ba88857 | ||
|
|
b05be5e1df | ||
|
|
247c38923f | ||
|
|
e818bf732d | ||
|
|
2d55195982 | ||
|
|
5788438864 | ||
|
|
4f684df12f | ||
|
|
adbbf9e3b2 | ||
|
|
1f29c7758c | ||
|
|
07512d1dad | ||
|
|
edf07d40b3 | ||
|
|
381c6fbecf | ||
|
|
3362a6b06d | ||
|
|
e3953f684b | ||
|
|
9666a96d8c | ||
|
|
18109e8ba5 | ||
|
|
364cd0042c | ||
|
|
1b59bcfadb | ||
|
|
347bf3e4d6 | ||
|
|
5024aee975 | ||
|
|
b3a2257638 | ||
|
|
24652ec722 | ||
|
|
8dc50b4c5a | ||
|
|
b226894e36 | ||
|
|
3b0a4c9fa9 | ||
|
|
0928191fdd | ||
|
|
154a25f8cb | ||
|
|
75d7d2d66b | ||
|
|
c740b8aa7d | ||
|
|
fe7eda2a4c | ||
|
|
72636dde06 | ||
|
|
6a88d31675 | ||
|
|
437a07ba3c | ||
|
|
f4555c4413 | ||
|
|
d202af2593 | ||
|
|
ed4006b51b | ||
|
|
bc33f7e1a7 | ||
|
|
3c1b5846c9 | ||
|
|
fe96d826ef | ||
|
|
2d48131a91 | ||
|
|
df60ce695c | ||
|
|
abc7f824d7 | ||
|
|
3b5e07dca9 | ||
|
|
8927d1260a | ||
|
|
ee294917e1 | ||
|
|
704173f4a6 | ||
|
|
75593e84b2 | ||
|
|
53cf9f0bf1 | ||
|
|
f4efa58022 | ||
|
|
737dc7726e | ||
|
|
af095c0e11 | ||
|
|
453b289346 | ||
|
|
9d30492846 | ||
|
|
2bef534e60 | ||
|
|
c0161ccead | ||
|
|
1be67fee52 | ||
|
|
4a88509cdf | ||
|
|
a4b1700bae | ||
|
|
f5cb64afaa | ||
|
|
4841a8d2ce | ||
|
|
919d9635ab | ||
|
|
52a5d4ca0a | ||
|
|
cb0d39ff6e | ||
|
|
a5c51589d3 | ||
|
|
b4501511c8 | ||
|
|
e18c5b9d68 | ||
|
|
b940f2eae3 | ||
|
|
d268fc42c2 | ||
|
|
e6ff31abf1 | ||
|
|
d31bad82a1 | ||
|
|
bc0b0bebd3 | ||
|
|
031acacdab | ||
|
|
18725aec6b | ||
|
|
d2e9c01796 | ||
|
|
75c3456743 | ||
|
|
9a63af82de | ||
|
|
c0db33caf2 | ||
|
|
b2820ebfb7 | ||
|
|
8159249209 | ||
|
|
4e2a76c807 | ||
|
|
5042c0959e | ||
|
|
9f76298e58 | ||
|
|
f1ecb023ff | ||
|
|
ce1243140f | ||
|
|
52c827c2bb | ||
|
|
c263fccb5f | ||
|
|
c3f11fd0a7 | ||
|
|
719de0aef3 | ||
|
|
8a00ba81d0 | ||
|
|
0da1e6b464 | ||
|
|
4cc3be24d3 | ||
|
|
b1109f6803 | ||
|
|
fda1499eee | ||
|
|
4bb42de5d6 | ||
|
|
f31270df2a | ||
|
|
d50a938d12 | ||
|
|
478a8a4d52 | ||
|
|
fa135a216b | ||
|
|
79779b1d2f | ||
|
|
456adc1e95 | ||
|
|
06dc4f5426 | ||
|
|
467c772504 | ||
|
|
b8400d1b21 | ||
|
|
1bd6757e62 | ||
|
|
1c52426b90 | ||
|
|
bc18656fd5 | ||
|
|
c77c4efcb8 | ||
|
|
7152705e70 | ||
|
|
cada04442b | ||
|
|
4bd11f64d7 | ||
|
|
9c45f42e4f | ||
|
|
c9f743983a | ||
|
|
1497541129 | ||
|
|
da7e597436 | ||
|
|
b47fbccfe3 | ||
|
|
878474f1d1 | ||
|
|
956d545b41 | ||
|
|
0afd5cc7e3 | ||
|
|
b64407f04d | ||
|
|
f9cbe6c2a0 | ||
|
|
18bfa0e637 | ||
|
|
debc895bb0 | ||
|
|
32e0ac0975 | ||
|
|
aceb01adbe | ||
|
|
c444fe3c1f | ||
|
|
1aaa29ad9e | ||
|
|
58bd0ed0f6 | ||
|
|
4096b00bd5 | ||
|
|
dcc4334768 | ||
|
|
f137074a98 | ||
|
|
f8f31daa16 | ||
|
|
35528a5885 | ||
|
|
8853bfd51a | ||
|
|
6202f614a4 | ||
|
|
ce0f46a483 | ||
|
|
11d357b79e | ||
|
|
9a8a07e85a | ||
|
|
26bcc944cf | ||
|
|
d2d9590019 | ||
|
|
fe4b1ff34d | ||
|
|
4e95aab6b5 | ||
|
|
4fb79ba8a1 | ||
|
|
a42593db0d | ||
|
|
cfc766ebbe | ||
|
|
51e4ce05c9 | ||
|
|
819c3fd08a | ||
|
|
4c6955017f | ||
|
|
aa93bf3f31 | ||
|
|
de40214a09 | ||
|
|
491ecaccfe | ||
|
|
3b3f3fa29b | ||
|
|
6c0d947831 | ||
|
|
efb9327896 | ||
|
|
629533494a | ||
|
|
445f089556 | ||
|
|
223f0c2763 | ||
|
|
46ac3d5b12 | ||
|
|
b85bfc40f4 | ||
|
|
cc78023a44 | ||
|
|
db6fe50106 | ||
|
|
f70cfeb6d3 | ||
|
|
9b74628e29 | ||
|
|
0ef0d339b5 | ||
|
|
5bf5d23495 | ||
|
|
02588036c2 | ||
|
|
8e0d3911e6 | ||
|
|
3929ef0bfa | ||
|
|
c3b35d4da5 | ||
|
|
8221ab0a58 | ||
|
|
5e887e8850 | ||
|
|
bfc8cb4708 | ||
|
|
0339ee6f1f | ||
|
|
61df34acd6 | ||
|
|
f5b11b78da | ||
|
|
d7758f9ae6 | ||
|
|
c52b76cb2e | ||
|
|
407eb0214c | ||
|
|
8524a2f938 | ||
|
|
8434e6567f | ||
|
|
2c38bea2b0 | ||
|
|
096b59913d | ||
|
|
d38b9e6248 | ||
|
|
f256deb54b | ||
|
|
cbae456978 | ||
|
|
7fa3474ecd | ||
|
|
0bd93fa05a | ||
|
|
86cf3fe8dd | ||
|
|
363b05d314 | ||
|
|
84674e7bad | ||
|
|
4c523cf3e5 | ||
|
|
733fbecd45 | ||
|
|
202a71ab8f | ||
|
|
915eb89406 | ||
|
|
3fe6132c94 | ||
|
|
238f684576 | ||
|
|
05184e7f46 | ||
|
|
e6ebf315ed | ||
|
|
70e4d1ccd0 | ||
|
|
a8a95cba75 | ||
|
|
1a015cd91e | ||
|
|
9b36b6e965 | ||
|
|
cbb9f5aa0c | ||
|
|
ef159f919e | ||
|
|
1ab438d62e | ||
|
|
3e8c5651cd | ||
|
|
0a4f1ffc06 | ||
|
|
42a1cde41a | ||
|
|
324f9631d7 | ||
|
|
8073c0e1be | ||
|
|
b256c9aaba | ||
|
|
681b20f09e | ||
|
|
4897c9de7f | ||
|
|
2058d572d9 | ||
|
|
089fab828b | ||
|
|
fa05dc44ce | ||
|
|
5b9453e302 | ||
|
|
d81a2d060e | ||
|
|
8d9dc8c87d | ||
|
|
97aaff7395 | ||
|
|
7a1fa20959 | ||
|
|
8942380605 | ||
|
|
2f36edef3b | ||
|
|
f7fe6c4f1a | ||
|
|
81b5771270 | ||
|
|
b9f4ddb021 | ||
|
|
6f4b2a8905 | ||
|
|
03cbf05f0f | ||
|
|
e7c05f744b | ||
|
|
200fa88e1d | ||
|
|
8f44b0a974 | ||
|
|
0e95f70b8d | ||
|
|
dd7189b1d0 | ||
|
|
9f1f5fd864 | ||
|
|
cd21d385d6 | ||
|
|
86442aa7f0 | ||
|
|
39cd4fcb9e | ||
|
|
4272cfa7e4 | ||
|
|
db56e5c8ea | ||
|
|
0c573812e9 | ||
|
|
4cf6394f01 | ||
|
|
e66e914dba | ||
|
|
1df01397da | ||
|
|
b1492818f6 | ||
|
|
70422e891c | ||
|
|
00ccb45bc4 | ||
|
|
3655b03331 | ||
|
|
7cc16734f9 | ||
|
|
8aa1d1165f | ||
|
|
5911d7d0c0 | ||
|
|
41e54529b0 | ||
|
|
f89aff96f7 | ||
|
|
54df3c2991 | ||
|
|
85bce8b71f | ||
|
|
9d9d890c97 | ||
|
|
f511e2e523 | ||
|
|
bd9bf8b5a8 | ||
|
|
5fd5eae3b1 | ||
|
|
054010f8ec | ||
|
|
36fd5b7b26 | ||
|
|
6aa4d6a940 | ||
|
|
7997e927a0 | ||
|
|
9516f9bbd2 | ||
|
|
f7bd03fb75 | ||
|
|
e381362d9c | ||
|
|
7bc29c61a9 | ||
|
|
ea60024712 | ||
|
|
edea44bccb | ||
|
|
09df62600e | ||
|
|
94eaf5d089 | ||
|
|
d04ac67ecd | ||
|
|
81b9286ea4 | ||
|
|
c648bd8c90 | ||
|
|
99a291f878 | ||
|
|
47f10cdc29 | ||
|
|
7eba8832e6 | ||
|
|
03340d6016 | ||
|
|
d288fe74a2 | ||
|
|
28d588fd40 | ||
|
|
16a3ce91d9 | ||
|
|
7e5a35cb45 | ||
|
|
39293b79ff | ||
|
|
9fc78cd1b6 | ||
|
|
34298f6c8c | ||
|
|
bbbba45fc1 | ||
|
|
ef8a49ad57 | ||
|
|
857cc730cb | ||
|
|
bfb97edccf | ||
|
|
989c9b9548 | ||
|
|
82b7326c99 | ||
|
|
d2e6335e95 | ||
|
|
711f21e8a0 | ||
|
|
e1c343cedd | ||
|
|
419da592a6 | ||
|
|
7e7b07fa6d | ||
|
|
0cc61215a9 | ||
|
|
0871b6e9f2 | ||
|
|
bef5cbc8bc | ||
|
|
51def8d31d | ||
|
|
0578a5654f | ||
|
|
bbb8b0f01f | ||
|
|
a8d3973a8d | ||
|
|
c115a76d4e | ||
|
|
63ab8d9f75 | ||
|
|
7848d77830 | ||
|
|
737a807456 | ||
|
|
ba5c3cc61f | ||
|
|
e6a6426b5b | ||
|
|
f3dc94d334 | ||
|
|
e4f0c1a42b | ||
|
|
44d6803d12 | ||
|
|
f80e83b846 | ||
|
|
ce19d7cdc0 | ||
|
|
353c373361 | ||
|
|
bdcd7b5ef3 | ||
|
|
17d1c279ab | ||
|
|
dd40aea380 | ||
|
|
f9ec70f1db | ||
|
|
83bc7b70a0 | ||
|
|
2cbede2ef8 | ||
|
|
729e6c4aba | ||
|
|
a2e865587f | ||
|
|
c6ab6cd57e | ||
|
|
837b2ff060 | ||
|
|
c7ee83b3b9 | ||
|
|
9ba3c12b3f | ||
|
|
a404b80988 | ||
|
|
cbe15c7c71 | ||
|
|
8d0a4ac6d9 | ||
|
|
4f80adc2bf | ||
|
|
8069cd304d | ||
|
|
278b07099c | ||
|
|
576e70c3ce | ||
|
|
e4078477c6 | ||
|
|
02dea8d103 | ||
|
|
5433aa8d2e | ||
|
|
b67fdb3e51 | ||
|
|
36b48a81ec | ||
|
|
dcb0befcd4 | ||
|
|
1f360ca498 | ||
|
|
7f2a253625 | ||
|
|
ad60a50d4d | ||
|
|
08a976fd85 | ||
|
|
426f4305b0 | ||
|
|
db47ce3bb1 | ||
|
|
1b42078d1e | ||
|
|
736890b244 | ||
|
|
2664518bd3 | ||
|
|
c6f90d8361 | ||
|
|
cc732621ab | ||
|
|
04fed9526a | ||
|
|
9f4692e1c9 | ||
|
|
1fa3b63fdc | ||
|
|
af2889e982 | ||
|
|
4d925db3cd | ||
|
|
36d91f1c07 | ||
|
|
bcc260dc08 | ||
|
|
9507b89fec | ||
|
|
2790f9cc7a | ||
|
|
a9ff78528a | ||
|
|
a52a218ae4 | ||
|
|
0409b8b9c5 | ||
|
|
f68cf0034a | ||
|
|
ba4e97f07b | ||
|
|
c2c3879032 | ||
|
|
c4529ed986 | ||
|
|
8b7eaf360e | ||
|
|
2f317f0f52 | ||
|
|
bd35af1360 | ||
|
|
351a7bd6bb | ||
|
|
fe6d59c090 | ||
|
|
d4e66426e7 | ||
|
|
88d81aa943 | ||
|
|
f24f4e012d | ||
|
|
60ea952b78 | ||
|
|
5354b54ec0 | ||
|
|
49feeee85e | ||
|
|
42d8591758 | ||
|
|
0801f91ea7 | ||
|
|
cf156e024d | ||
|
|
6b0c8f39d5 | ||
|
|
2c2e01d14c | ||
|
|
abc1d1dcb3 | ||
|
|
628189f57f | ||
|
|
748dcd0881 | ||
|
|
2d1d6f13c9 | ||
|
|
4f98ca37e2 | ||
|
|
a34eaa07ed | ||
|
|
20f2293c01 | ||
|
|
7869e45954 | ||
|
|
9af7eaf08c | ||
|
|
79ed9c7e37 | ||
|
|
eb8167bc57 | ||
|
|
df992477be | ||
|
|
79c55149b2 | ||
|
|
ac1077bfe3 | ||
|
|
54477083d4 | ||
|
|
a46c47c134 | ||
|
|
ee8dbf225b | ||
|
|
9471f060b3 | ||
|
|
56efa67432 | ||
|
|
39fe6c20b6 | ||
|
|
762e4ec8d1 | ||
|
|
77f982d1a8 | ||
|
|
8a7fdd0ed6 | ||
|
|
7a7146c03d | ||
|
|
a34d760a88 | ||
|
|
e9eb22f8f0 | ||
|
|
81a4eec990 | ||
|
|
e37b6fac4d | ||
|
|
b32789f42a | ||
|
|
e1a47ed0fb | ||
|
|
6388f6e62a | ||
|
|
e2605fbf64 | ||
|
|
90c24b3d95 | ||
|
|
0912b3b04f | ||
|
|
7e82f70c77 | ||
|
|
249dfe1bea | ||
|
|
21e997acd7 | ||
|
|
ea94370486 | ||
|
|
3737f3c0cd | ||
|
|
169b2ce4e8 | ||
|
|
2dd81deb13 | ||
|
|
8a5475fe7a | ||
|
|
dd7b7a8584 | ||
|
|
273ec857a3 | ||
|
|
ef564caf28 | ||
|
|
9f25fc0c8a | ||
|
|
7b08a99cf6 | ||
|
|
3ef6299c83 | ||
|
|
ec58ee940a | ||
|
|
2519278269 | ||
|
|
5c7fd531db | ||
|
|
92d448cfe6 | ||
|
|
74881ae251 | ||
|
|
c218eaa6ed | ||
|
|
259088c280 | ||
|
|
7689e0b210 | ||
|
|
dd41f3f47d | ||
|
|
48a3393264 | ||
|
|
0158b2b832 | ||
|
|
21607b4f28 | ||
|
|
886abc96d1 | ||
|
|
b7cb799af0 | ||
|
|
78bf506790 | ||
|
|
61b03b0c05 | ||
|
|
b31962f7e2 | ||
|
|
112220da86 | ||
|
|
757d1b2998 | ||
|
|
1fafc1b6ad | ||
|
|
eb4e059683 | ||
|
|
b5ff688841 | ||
|
|
8805b8cac4 | ||
|
|
d01a99cd79 | ||
|
|
1866713082 | ||
|
|
9ecc88230f | ||
|
|
86a6322287 | ||
|
|
83abe6aa34 | ||
|
|
8ddd050a34 | ||
|
|
4c4b773de5 | ||
|
|
37a815af53 | ||
|
|
f60f34cdf8 | ||
|
|
4267f5f010 | ||
|
|
f08c9605db | ||
|
|
e41dfcbbb3 | ||
|
|
a0b6aa28a7 | ||
|
|
c273495261 | ||
|
|
220090813d | ||
|
|
e65ee097a5 | ||
|
|
92963af09f | ||
|
|
8ccdbf374b | ||
|
|
9e8fcba04a | ||
|
|
da7679dfda | ||
|
|
0300209b3d | ||
|
|
a5f51dc969 | ||
|
|
04b7fdd4c4 | ||
|
|
e3c44568a0 | ||
|
|
37f3fccc35 | ||
|
|
fedcec58a6 | ||
|
|
be95c92c45 | ||
|
|
8991dcb3eb | ||
|
|
7185da6504 | ||
|
|
810fd7e744 | ||
|
|
c6afa1a6cb | ||
|
|
29eedd2ac4 | ||
|
|
ead519811c | ||
|
|
5203652796 | ||
|
|
750ed5e91c | ||
|
|
0ec6a240bf | ||
|
|
425c23d28c | ||
|
|
0da6e25881 | ||
|
|
4aba65eaeb | ||
|
|
aa2af316e5 | ||
|
|
900a91a0a2 | ||
|
|
ce06c12da6 | ||
|
|
b73bcd68a9 | ||
|
|
86833633ef | ||
|
|
21ac3b28ef | ||
|
|
1895fb3394 | ||
|
|
d16dd82297 | ||
|
|
6aee2db1d4 | ||
|
|
a6da3b189a | ||
|
|
ce958276b4 | ||
|
|
0363c20047 | ||
|
|
323093eaea | ||
|
|
03b560d688 | ||
|
|
7f6f2f44c3 | ||
|
|
3ab98124b6 | ||
|
|
65d6403fa3 | ||
|
|
62c1d500e8 | ||
|
|
2b3bd3d6dc | ||
|
|
ef090aa895 | ||
|
|
d9be3efa90 | ||
|
|
a4785adb3d | ||
|
|
2ccc6f71ae | ||
|
|
492505ad0b | ||
|
|
335566a4ef | ||
|
|
f8bd644b58 | ||
|
|
b5bb71ed63 | ||
|
|
3c22179183 | ||
|
|
b86c1b22f4 | ||
|
|
a96d13d5aa | ||
|
|
f1868ee162 | ||
|
|
cfd4919829 | ||
|
|
30893bf676 | ||
|
|
7beb874f93 | ||
|
|
28213b3129 | ||
|
|
c3ede4413d | ||
|
|
21eca275e9 | ||
|
|
127b9701ff | ||
|
|
ee7201fc61 | ||
|
|
c075e078e9 | ||
|
|
f9eb6b69f5 | ||
|
|
3d9b7ed7d3 | ||
|
|
6920b72cf4 | ||
|
|
9a9602f418 | ||
|
|
0960fcba2a | ||
|
|
9b46ed9c2d | ||
|
|
d055b1fb29 | ||
|
|
9411ac2144 | ||
|
|
eb2b35e3b1 | ||
|
|
ab5f9a0884 | ||
|
|
b4ece8d154 | ||
|
|
75e504ffbc | ||
|
|
3877f257b4 | ||
|
|
6f2d8b23b4 | ||
|
|
80326acb71 | ||
|
|
d9035eecda | ||
|
|
da6f1fbc9a | ||
|
|
4bb2b9f971 | ||
|
|
a0864dfb3f | ||
|
|
d3d534efee | ||
|
|
2e94f7dbd4 | ||
|
|
2c4b3bf6ad | ||
|
|
25e3224121 | ||
|
|
2e18936209 | ||
|
|
886c54eb37 | ||
|
|
3a866b0140 | ||
|
|
e8aaa51edc | ||
|
|
e48e1e27d5 | ||
|
|
c86b50e3fc | ||
|
|
42368b37e9 | ||
|
|
addefdf0cf | ||
|
|
59642d8d93 | ||
|
|
a26eecf0fd | ||
|
|
69449668a8 | ||
|
|
084d99f670 | ||
|
|
15c19b99c9 | ||
|
|
c418a6ff57 | ||
|
|
3f1e4e27ff | ||
|
|
3aad5fd283 | ||
|
|
5236372921 | ||
|
|
7fbaa88b9f | ||
|
|
41d58cd88e | ||
|
|
170d43439f | ||
|
|
a7ed20d74b | ||
|
|
211d21306c | ||
|
|
d04b1e57d2 | ||
|
|
ec7fd647ac | ||
|
|
8c85933da9 | ||
|
|
b10483ddc8 | ||
|
|
d39ccbc98c | ||
|
|
1080de062e | ||
|
|
6c34431336 | ||
|
|
e61da22458 | ||
|
|
f5c715c6a7 | ||
|
|
d8fecc1522 | ||
|
|
30a9da8fbf | ||
|
|
e6712300d5 | ||
|
|
9227add8f4 | ||
|
|
c547362ae9 | ||
|
|
9ec4575c43 | ||
|
|
4962dd1a81 | ||
|
|
06808b38b5 | ||
|
|
6337a987d8 | ||
|
|
cf0d945daa | ||
|
|
b02742ebe1 | ||
|
|
7e3624ee27 | ||
|
|
89fc9ac8ea | ||
|
|
7a500976d2 | ||
|
|
0e1744a6ec | ||
|
|
c01ab2b7ea | ||
|
|
23617a11fc | ||
|
|
18775c06ea | ||
|
|
53f566e9f1 | ||
|
|
677525a663 | ||
|
|
f5d639b841 | ||
|
|
fe3fb72e5e | ||
|
|
9dcabdbab6 | ||
|
|
1080d0718c | ||
|
|
29a7a410c8 | ||
|
|
e9009ede87 | ||
|
|
7b16039084 | ||
|
|
acdab170a7 | ||
|
|
32b18d6bfd | ||
|
|
9cd7d381a6 | ||
|
|
e35b534ee2 | ||
|
|
682544ad45 | ||
|
|
53ffe42f92 | ||
|
|
c2a037842d | ||
|
|
552bebf564 | ||
|
|
ec93f50863 | ||
|
|
240c5bb311 | ||
|
|
c12a7e144a | ||
|
|
991f53db9e | ||
|
|
877fd00353 | ||
|
|
d420d035de | ||
|
|
115323dec8 | ||
|
|
4706b5d1fe | ||
|
|
fc1f397f08 | ||
|
|
ac6c57e90e | ||
|
|
9c4bb84460 | ||
|
|
5a58b8e721 | ||
|
|
b068fdc9b3 | ||
|
|
b8533e1853 | ||
|
|
753e5e535d | ||
|
|
93b11038d5 | ||
|
|
99774022a5 | ||
|
|
c5ebc9b7bd | ||
|
|
f2f3e478d1 | ||
|
|
f10d9464a1 | ||
|
|
02eb16a703 | ||
|
|
580d789a00 | ||
|
|
98d106e6b5 | ||
|
|
bca77bddb8 | ||
|
|
7ca9f0022a | ||
|
|
a960be440b | ||
|
|
a602309e04 | ||
|
|
f51935a258 | ||
|
|
fac36d2376 | ||
|
|
976399c2d9 | ||
|
|
cd6ed63768 | ||
|
|
348981a419 | ||
|
|
adf59f2599 | ||
|
|
5d9d282f1b | ||
|
|
d0323fa27d | ||
|
|
038f8d5dff | ||
|
|
bab49d66c5 | ||
|
|
230eee4ead | ||
|
|
ef67a4c31b | ||
|
|
f408803ae0 | ||
|
|
fd3482f331 | ||
|
|
ce9a1b3661 | ||
|
|
4feb9def4e | ||
|
|
c845cc337c | ||
|
|
dccde49388 | ||
|
|
2b26521e32 | ||
|
|
b9c628413e | ||
|
|
a039a00277 | ||
|
|
d30a0ea066 | ||
|
|
ab6c74ae88 | ||
|
|
fbca98ec2a | ||
|
|
93f23fe452 | ||
|
|
ad2e2fe63d | ||
|
|
67c2a48fc9 | ||
|
|
49d936c3f6 | ||
|
|
792ff4044e | ||
|
|
29ef86a245 | ||
|
|
62bff1d070 | ||
|
|
46769d65f3 | ||
|
|
d5add8aa49 | ||
|
|
d3b9a83055 | ||
|
|
1729df2a75 | ||
|
|
294912420b | ||
|
|
4cd2e572ae | ||
|
|
f4b2269e2e | ||
|
|
0eee1ad18b | ||
|
|
5b4744a677 | ||
|
|
d5e2f89edc | ||
|
|
67bcc242db | ||
|
|
c28cd8e287 | ||
|
|
5bb34ab2b6 | ||
|
|
1a3e9de52a | ||
|
|
8a55e2f6a4 | ||
|
|
5eb5033aba | ||
|
|
e1b0cb6cf0 | ||
|
|
723c8278ce | ||
|
|
bbf83c7053 | ||
|
|
43fb9dbb52 | ||
|
|
a9b6e6916c | ||
|
|
6a01be1b8f | ||
|
|
56925afe8e | ||
|
|
b8286ab8f3 | ||
|
|
7133c6529b | ||
|
|
e0a3756c6e | ||
|
|
87fdd4ea5f | ||
|
|
c396a08cb2 | ||
|
|
d51bf2b0ea | ||
|
|
0981c69515 | ||
|
|
1987ea2eb7 | ||
|
|
6a4ee18380 | ||
|
|
b3a2908b48 | ||
|
|
910f7e8564 | ||
|
|
7cf1a97673 | ||
|
|
cf57e7e88b | ||
|
|
8b4dcb1194 | ||
|
|
a186e16568 | ||
|
|
eaa31ed4a3 | ||
|
|
0ed4c9f8e7 | ||
|
|
0e62008db6 | ||
|
|
399d778a7e | ||
|
|
aa096448be | ||
|
|
d9d0618eec | ||
|
|
39afafc585 | ||
|
|
b37b2ba76f | ||
|
|
1778401423 | ||
|
|
c48b035a15 | ||
|
|
710905470b | ||
|
|
1d197e42bb | ||
|
|
b0c7b8750a | ||
|
|
4a00350859 | ||
|
|
c160da91ed | ||
|
|
85f1338b19 | ||
|
|
402570e1c5 | ||
|
|
a0b791a4a6 | ||
|
|
e97c1dc48e | ||
|
|
2aa67ba983 | ||
|
|
0844ed2f9b | ||
|
|
abefce7ae2 | ||
|
|
352bdaf9c4 | ||
|
|
87c16498ca | ||
|
|
59fd0dbae7 | ||
|
|
84225c9077 | ||
|
|
7903a8b780 | ||
|
|
202263dbb5 | ||
|
|
542a4fb060 | ||
|
|
ae09fc75f0 | ||
|
|
35f3a4f441 | ||
|
|
111e3fcd32 | ||
|
|
ccc27739d7 | ||
|
|
f3f7b67ce2 | ||
|
|
30fd0544f8 | ||
|
|
b099e103b3 | ||
|
|
d819d88718 | ||
|
|
278eea6fae | ||
|
|
7cd1425bc1 | ||
|
|
fa22ebd893 | ||
|
|
793e77bc5f | ||
|
|
70a453a5c2 | ||
|
|
33c6d95b1c | ||
|
|
1e64870a9e | ||
|
|
14dec516a3 | ||
|
|
9509929f5d | ||
|
|
336d3ad8e5 | ||
|
|
e71631abe0 | ||
|
|
bad8ee865d | ||
|
|
1ee3c5e5a0 | ||
|
|
0be0c1a1c1 | ||
|
|
66a175e48d | ||
|
|
e24da32424 | ||
|
|
a13b720598 | ||
|
|
86971c7b86 | ||
|
|
daccab5a07 | ||
|
|
4d32d93ee2 | ||
|
|
abc9eb7bdc | ||
|
|
ec19dcc8f8 | ||
|
|
9051e411d0 |
86
.github/scripts/get_changed_php.sh
vendored
Executable file
86
.github/scripts/get_changed_php.sh
vendored
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# This script retrieves the list of changed PHP files for a pull request
|
||||
# using the GitHub API and sets two outputs:
|
||||
# - any_changed: "true" if at least one PHP file changed, "false" otherwise
|
||||
# - all_changed_files: space-separated list of changed PHP file paths
|
||||
#
|
||||
# Required environment variables:
|
||||
# GITHUB_TOKEN - GitHub token with repo access
|
||||
# GITHUB_REPOSITORY - "owner/repo"
|
||||
# GITHUB_EVENT_PATH - Path to the event JSON payload
|
||||
|
||||
# Verify required environment variables are set
|
||||
if [[ -z "${GITHUB_TOKEN:-}" ]]; then
|
||||
echo "GITHUB_TOKEN is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${GITHUB_REPOSITORY:-}" ]]; then
|
||||
echo "GITHUB_REPOSITORY is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z "${GITHUB_EVENT_PATH:-}" ]]; then
|
||||
echo "GITHUB_EVENT_PATH is not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract the pull request number from the event payload
|
||||
pr_number=$(jq --raw-output '.pull_request.number' "$GITHUB_EVENT_PATH")
|
||||
if [[ "$pr_number" == "null" ]]; then
|
||||
echo "Not a pull request event"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Split repository into owner and repo name
|
||||
# Split repository into owner and repo name using Bash parameter expansion
|
||||
owner="${GITHUB_REPOSITORY%%/*}" # Extract text before the first '/'
|
||||
repo="${GITHUB_REPOSITORY##*/}" # Extract text after the last '/'
|
||||
|
||||
page=1
|
||||
per_page=100
|
||||
changed_php_files=()
|
||||
|
||||
# Loop through all pages to gather changed files
|
||||
while true; do
|
||||
response=$(curl -s -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||
"https://api.github.com/repos/${owner}/${repo}/pulls/${pr_number}/files?per_page=${per_page}&page=${page}")
|
||||
|
||||
# Filter for files ending with .php and add them to the list
|
||||
mapfile -t files < <(echo "$response" | jq -r '.[] | select(.filename | test("\\.php$")) | .filename')
|
||||
changed_php_files+=("${files[@]}")
|
||||
|
||||
# Check if we have reached the last page (less than per_page results)
|
||||
count=$(echo "$response" | jq 'length')
|
||||
if (( count < per_page )); then
|
||||
break
|
||||
fi
|
||||
((page++))
|
||||
done
|
||||
|
||||
|
||||
# Build a space-separated string of changed PHP files
|
||||
# This does not cope with files that have spaces.
|
||||
# But such files do not exist in the project (at least not for the
|
||||
# files we are filtering).
|
||||
all_changed_files=$(IFS=" " ; echo "${changed_php_files[*]}")
|
||||
|
||||
|
||||
# Determine changed files flag
|
||||
if [ -z "$all_changed_files" ]; then
|
||||
any_changed="false"
|
||||
else
|
||||
any_changed="true"
|
||||
fi
|
||||
|
||||
# Set outputs for GitHub Actions if GITHUB_OUTPUT is available
|
||||
if [ -n "${GITHUB_OUTPUT:-}" ]; then
|
||||
echo "any_changed=${any_changed}" >> "$GITHUB_OUTPUT"
|
||||
echo "all_changed_files=${all_changed_files}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
# Otherwise, print the outputs
|
||||
echo "any_changed=${any_changed}"
|
||||
echo "all_changed_files=${all_changed_files}"
|
||||
fi
|
||||
24
.github/workflows/ci-on-release.yml
vendored
Normal file
24
.github/workflows/ci-on-release.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: "CI-RELEASE"
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
trigger-docker:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Generate a token
|
||||
id: generate-token
|
||||
uses: actions/create-github-app-token@v2
|
||||
with:
|
||||
app-id: ${{ vars.RELEASE_DOCKER_ID }}
|
||||
private-key: ${{ secrets.RELEASE_DOCKER_SECRET }}
|
||||
|
||||
- uses: peter-evans/repository-dispatch@v4
|
||||
with:
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
repository: Dolibarr/dolibarr-docker
|
||||
event-type: new-release
|
||||
client-payload: '{"version": "${{ github.event.release.tag_name }}"}'
|
||||
@@ -1,28 +0,0 @@
|
||||
name: Qodana
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 20 * * 1,3,5"
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- develop
|
||||
# push:
|
||||
# branches:
|
||||
# - develop
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
qodana:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 1
|
||||
#php-version: '7.1'
|
||||
- name: 'Qodana Scan'
|
||||
uses: JetBrains/qodana-action@v2023.2.1
|
||||
#with:
|
||||
# php-version: '7.1'
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
9
.github/workflows/exakat.yml
vendored
9
.github/workflows/exakat.yml
vendored
@@ -6,8 +6,7 @@ on:
|
||||
schedule:
|
||||
- cron: "0 20 1 * *"
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- develop
|
||||
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -22,7 +21,7 @@ jobs:
|
||||
- name: Exakat
|
||||
uses: docker://exakat/exakat-ga
|
||||
with:
|
||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/NestedTernary,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||
ignore_dirs: '/htdocs/includes/,/htdocs/install/doctemplates/,/build/,/dev/,/doc/,/scripts/,/test/'
|
||||
file_extensions: php
|
||||
project_reports: Perfile
|
||||
file_extensions: php
|
||||
project_reports: Perfile
|
||||
|
||||
47
.github/workflows/pre-commit.yml
vendored
47
.github/workflows/pre-commit.yml
vendored
@@ -14,18 +14,18 @@ jobs:
|
||||
run: sudo apt-get update && sudo apt-get install cppcheck
|
||||
if: false
|
||||
|
||||
# Checkout git sources to analyze
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# The next uses the git API because there is no clone yet.
|
||||
# This is faster for a big repo.
|
||||
- name: Get all changed php files (if PR)
|
||||
id: changed-php
|
||||
uses: tj-actions/changed-files@v42
|
||||
if: github.event_name == 'pull_request'
|
||||
with:
|
||||
files: |
|
||||
**.php
|
||||
if: env.gh_event == 'pull_request'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: ./.github/scripts/get_changed_php.sh
|
||||
|
||||
# Checkout git sources to analyze
|
||||
- uses: actions/checkout@v4
|
||||
# Action setup-python needs a requirements.txt or pyproject.toml
|
||||
# This ensures one of them exists.
|
||||
- name: Create requirements.txt if no requirements.txt or pyproject.toml
|
||||
@@ -42,6 +42,21 @@ jobs:
|
||||
with:
|
||||
path: ~/.cache/pre-commit/
|
||||
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
||||
|
||||
- name: Extract PHP version
|
||||
id: extract-php-version
|
||||
run: |
|
||||
PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php)
|
||||
echo "PHP_VERSION=$PHP_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup PHPCS
|
||||
uses: shivammathur/setup-php@v2
|
||||
# Install proper php version, and also install phpcs which may be needed
|
||||
with:
|
||||
php-version: ${{ env.PHP_VERSION }} # Version from check.php
|
||||
coverage: none # disable xdebug, pcov
|
||||
tools: phpcs
|
||||
|
||||
# Run all the precommit tools (defined into pre-commit-config.yaml).
|
||||
# We can force exclusion of some of them here.
|
||||
- name: Run pre-commit hooks
|
||||
@@ -62,24 +77,6 @@ jobs:
|
||||
# files: |
|
||||
# **.php
|
||||
|
||||
- name: Setup PHPCS
|
||||
uses: shivammathur/setup-php@v2
|
||||
# Install when we're going to run phpcs
|
||||
if: |
|
||||
steps.changed-php.outputs.any_changed == 'true'
|
||||
||
|
||||
(
|
||||
github.event_name == 'push'
|
||||
&& (
|
||||
github.event.ref == 'refs/heads/develop'
|
||||
|| endsWith(github.event.ref, '.0')
|
||||
)
|
||||
)
|
||||
with:
|
||||
php-version: 8.1
|
||||
coverage: none # disable xdebug, pcov
|
||||
tools: phpcs
|
||||
|
||||
- name: Run some pre-commit hooks on selected changed files only
|
||||
if: steps.changed-php.outputs.any_changed == 'true'
|
||||
env:
|
||||
|
||||
2
.github/workflows/stale-issues-safe.yml
vendored
2
.github/workflows/stale-issues-safe.yml
vendored
@@ -8,7 +8,7 @@ on:
|
||||
types: [created]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {} # none
|
||||
permissions: {} # no restriction by default
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
|
||||
@@ -6,7 +6,7 @@ repos:
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: no-commit-to-branch
|
||||
args: [--branch, develop, --pattern, \d+.0]
|
||||
args: [--branch, develop, --pattern, \d+.0$]
|
||||
- id: check-yaml
|
||||
args: [--unsafe]
|
||||
- id: check-json
|
||||
@@ -87,6 +87,8 @@ repos:
|
||||
]
|
||||
pass_filenames: false # Run on all files
|
||||
- id: php-lint
|
||||
exclude:
|
||||
(?x)^(htdocs/includes/symfony/var-dumper/Tests/.*)$
|
||||
- id: php-stan
|
||||
stages: [manual]
|
||||
files: \.(php)$
|
||||
|
||||
42
.travis.yml
42
.travis.yml
@@ -2,9 +2,9 @@
|
||||
# from Dolibarr GitHub repository.
|
||||
# For syntax, see https://docs.travis-ci.com/user/languages/php/
|
||||
|
||||
# We use dist: bionic = 18.04, focal = 20.04
|
||||
# We use dist: focal = 20.04, jammy = 22.04
|
||||
os: linux
|
||||
dist: focal
|
||||
dist: jammy
|
||||
|
||||
language: generic
|
||||
|
||||
@@ -21,7 +21,7 @@ services:
|
||||
|
||||
|
||||
addons:
|
||||
mariadb: '10.5'
|
||||
mariadb: '10.6'
|
||||
|
||||
|
||||
env:
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
- stage: PHP min and max
|
||||
if: type = push
|
||||
php: '7.1'
|
||||
env:
|
||||
env:
|
||||
- DB=postgresql
|
||||
- TRAVIS_PHP_VERSION=7.1
|
||||
- stage: PHP min and max
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
- stage: PHP 8.3
|
||||
if: type = push AND branch = develop
|
||||
php: '8.3'
|
||||
env:
|
||||
env:
|
||||
- DB=mysql
|
||||
- TRAVIS_PHP_VERSION=8.3
|
||||
|
||||
@@ -89,7 +89,7 @@ before_install:
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.3' ]; then
|
||||
sudo apt install unzip apache2 php8.3 php8.3-cli php8.3-curl php8.3-mysql php8.3-pgsql php8.3-gd php8.3-imap php8.3-intl php8.3-ldap php8.3-xml php8.3-mbstring php8.3-xml php8.3-zip libapache2-mod-php8.3
|
||||
fi
|
||||
|
||||
|
||||
- |
|
||||
echo Install pgsql if run is for pgsql
|
||||
if [ "$DB" = 'postgresql' ]; then
|
||||
@@ -114,17 +114,20 @@ before_install:
|
||||
|
||||
install:
|
||||
- |
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.0' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php7.0
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '7.1' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php7.1
|
||||
fi
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.1' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php8.1
|
||||
fi
|
||||
fi
|
||||
if [ "$TRAVIS_PHP_VERSION" = '8.2' ]; then
|
||||
sudo update-alternatives --set php /usr/bin/php8.2
|
||||
fi
|
||||
fi
|
||||
php -i | head -
|
||||
|
||||
|
||||
- |
|
||||
echo "Updating Composer config"
|
||||
curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php
|
||||
@@ -133,10 +136,11 @@ install:
|
||||
php -r "if (hash_file('SHA384', '/tmp/composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer
|
||||
sudo chmod -R a+rwx /usr/local/bin/composer
|
||||
|
||||
|
||||
#sudo apt install composer
|
||||
composer -V
|
||||
composer -n config -g vendor-dir htdocs/includes
|
||||
sudo composer -n config -g vendor-dir htdocs/includes
|
||||
sudo chmod -R a+rwx /home/travis/.config/composer
|
||||
echo
|
||||
|
||||
- |
|
||||
@@ -206,8 +210,8 @@ before_script:
|
||||
phpcs -i | head -
|
||||
# Check PHP Vardump check version
|
||||
echo "PHP Vardump check version"
|
||||
which var_dump_check
|
||||
var_dump_check --version
|
||||
which var-dump-check
|
||||
var-dump-check --version
|
||||
# Check PHPUnit version
|
||||
echo "PHPUnit version"
|
||||
which phpunit
|
||||
@@ -229,7 +233,7 @@ before_script:
|
||||
#sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa
|
||||
sudo mysqld_safe --skip-grant-tables --socket=/tmp/aaa &
|
||||
sleep 3
|
||||
sudo ps fauxww
|
||||
sudo ps fauxww
|
||||
echo "MySQL set root password"
|
||||
sudo mysql -u root -h 127.0.0.1 -e "FLUSH PRIVILEGES; CREATE DATABASE IF NOT EXISTS travis CHARACTER SET = 'utf8'; ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; CREATE USER 'root'@'127.0.0.1' IDENTIFIED BY 'password'; CREATE USER 'travis'@'127.0.0.1' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON travis.* TO root@127.0.0.1; GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1; FLUSH PRIVILEGES;"
|
||||
echo "MySQL grant"
|
||||
@@ -238,7 +242,7 @@ before_script:
|
||||
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'use mysql; select * from user;'
|
||||
echo "List pid file"
|
||||
sudo mysql -u root -h 127.0.0.1 -ppassword -e "show variables like '%pid%';"
|
||||
|
||||
|
||||
#sudo kill `cat /var/lib/mysqld/mysqld.pid`
|
||||
#sudo systemctl start mariadb
|
||||
|
||||
@@ -246,7 +250,7 @@ before_script:
|
||||
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'GRANT ALL PRIVILEGES ON travis.* TO travis@127.0.0.1;'
|
||||
echo "MySQL flush"
|
||||
sudo mysql -u root -h 127.0.0.1 -ppassword -e 'FLUSH PRIVILEGES;'
|
||||
|
||||
|
||||
echo "MySQL load sql"
|
||||
sudo mysql -u root -h 127.0.0.1 -ppassword -D travis < dev/initdemo/mysqldump_dolibarr_3.5.0.sql
|
||||
fi
|
||||
@@ -415,12 +419,12 @@ script:
|
||||
echo '$'force_install_main_data_root=\'$TRAVIS_BUILD_DIR/htdocs\'';' >> $INSTALL_FORCED_FILE
|
||||
#cat $INSTALL_FORCED_FILE
|
||||
echo
|
||||
|
||||
|
||||
- |
|
||||
echo "Upgrading Dolibarr"
|
||||
# Ensure we catch errors with -e. Set this to +e if you want to go to the end to see log files.
|
||||
# Note: We keep +e because with pgsql, one of upgrade process fails even if migration seems ok, so
|
||||
# I disable stop on error to be able to continue.
|
||||
# I disable stop on error to be able to continue.
|
||||
set +e
|
||||
cd htdocs/install
|
||||
php upgrade.php 3.5.0 3.6.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade350360.log
|
||||
|
||||
292
ChangeLog
292
ChangeLog
@@ -2,6 +2,59 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 19.0.4 compared to 19.0.3 *****
|
||||
FIX: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
|
||||
FIX: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
|
||||
FIX: #25853 Thirdparty Massaction (#25868)
|
||||
FIX: #28505 Blank page from thirparty to projects (#31637)
|
||||
FIX: #30757
|
||||
FIX: #30762
|
||||
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
|
||||
FIX: #30772 Accountancy document export - The project filter on expenses report don't work (#30824)
|
||||
FIX: #30836
|
||||
FIX: #30960 show and search extrafields (#31026)
|
||||
FIX: Add same security test when uploading files from API than from GUI (#31114)
|
||||
FIX: ajaxik URL in ExpenseReport to load coef calculation (#30918)
|
||||
FIX: attached file on first page load (#30694)
|
||||
FIX: autoselect the fiscal period by default
|
||||
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
|
||||
FIX: avoid odt errors (#31126)
|
||||
FIX: avoid pgsql error (#30678)
|
||||
FIX: avoid the return "AND (())" (#30829)
|
||||
FIX: Backport fix fatal error on price with some truncating setup
|
||||
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
|
||||
FIX: can validate shipment without stock movement (#31780)
|
||||
FIX: column position on PDF of payments
|
||||
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
|
||||
FIX: Debug extrafields for bank lines
|
||||
FIX: email templates for expense report not visible
|
||||
FIX: Error message overwritten when a error occurs during update of product multilangs (#30841)
|
||||
FIX: error return missing in mo creation when qty to consume is <= 0 (#31134)
|
||||
FIX: Extrafield following between rec invoice and classic invoice (#31445)
|
||||
FIX: Fatal error on create loan schedule (#30656)
|
||||
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
|
||||
FIX: fixed search filter for projects resetting when set to empty (#30902)
|
||||
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
|
||||
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
|
||||
FIX: Invoice unpaid widget - SQL error on group by with constant MAIN_COMPANY_PERENTITY_SHARED (#30866)
|
||||
FIX: issue on action set condition in particular when you set a deposi… (#31518)
|
||||
FIX: late order search option (v18+) (#30692)
|
||||
FIX: late propal search option (v18+) (#30687)
|
||||
FIX: missing fk_parent_line parameter (#30806)
|
||||
FIX: mysql error during dump for enable sandbox M999999 (#31116)
|
||||
FIX: PHP-warning-multiprice-in-liste-product-if-level-is-not-defined-on-product (#31507)
|
||||
FIX: Protection to avoid an extrafield to be mandatory if computed
|
||||
FIX: purge files cron: php warnings when rest module enabled (#30919)
|
||||
FIX: removed unreachable code (#31141)
|
||||
FIX: show preview pdf list expensereport (#31694)
|
||||
FIX: Substitution error in ticket emails in the subject (#30778)
|
||||
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
|
||||
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
|
||||
FIX: Vat code is lost when updating lines in POS
|
||||
FIX: when qty is not an integer, apply price() (#31138)
|
||||
FIX: Wrong default PDF model when creating the second situation invoice (#30843)
|
||||
FIX: wrong subprice if price base type is TTC (#30887)
|
||||
|
||||
|
||||
***** ChangeLog for 19.0.3 compared to 19.0.2 *****
|
||||
FIX: #29403 HRM - Unable to delete a skill in a job Profile (#29779)
|
||||
@@ -238,7 +291,6 @@ SEC: Add a protection against installation of external module bypassing
|
||||
SEC: A user with export permission can export module data without permissions on module.
|
||||
|
||||
***** ChangeLog for 19.0.1 compared to 19.0.0 *****
|
||||
|
||||
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
|
||||
FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)
|
||||
FIX: #22948
|
||||
@@ -466,7 +518,7 @@ NEW: Upgrade in module builder in menu section
|
||||
NEW: use account address in sepa mandate (#23642)
|
||||
NEW: VAT rate - Add entity
|
||||
NEW: When an user unset the batch management of products, transformation of each batch stock mouvement in global stock mouvement
|
||||
NEW: PDF Generation for each Human Resource Evaluations.
|
||||
NEW: PDF Generation for each Human Resource Evaluations.
|
||||
|
||||
SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
|
||||
SEC: Add action confirm_... as sensitive to need a CSRF token
|
||||
@@ -540,7 +592,7 @@ The following changes may create regressions for some external modules, but were
|
||||
* The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id.
|
||||
* The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id.
|
||||
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
|
||||
* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation).
|
||||
* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation).
|
||||
* The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead.
|
||||
* The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog()
|
||||
* It was possible to use a variable $soc or $right inside a PHP code condition of some extrafields properties, this is no more true (this 2 variables are no more global variables).
|
||||
@@ -552,6 +604,234 @@ The following changes may create regressions for some external modules, but were
|
||||
* The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases.
|
||||
|
||||
|
||||
***** ChangeLog for 18.0.8 compared to 18.0.7 *****
|
||||
35 files changed, 647 insertions(+), 298 deletions(-)
|
||||
|
||||
FIX: #34746 - More complete fix for CVE-2024-40137
|
||||
FIX: Correct the calculation of the amount of the current period between the period provided (#35083)
|
||||
FIX: Add security test for show terminal selection if no terminal selected when invoice.php is call (#34717)
|
||||
FIX: Add security test for show terminal selection if no terminal selected when invoice.php is call
|
||||
FIX: missing quick edit for extrafields (baclport commit 4fc66c6) (#35160)
|
||||
FIX: Missing sentence part (#35144)
|
||||
FIX: set global mysoc and load langs in API access (#35041)
|
||||
FIX: set global mysoc and load langs in API access
|
||||
FIX: reset mysoc and langs only if entity of API has changed
|
||||
FIX: accountancy general ledger: bad handling of hook return (#34029)
|
||||
FIX: accountancy general ledger: bad handling of hook return
|
||||
FIX: accountancy balance: bad handling of hook return
|
||||
FIX: - Fix missing token for disable custom group category for compta report (page /htdocs/accountancy/admin/categories_list.php) (#35084)
|
||||
FIX: The combo of custom groups has disappeared (backport v19) (#35016)
|
||||
FIX: #34893 (#34897)
|
||||
FIX: #34893
|
||||
FIX: change error code to USERNOTALLOWEDTOCHANGEPASS
|
||||
FIX: asset: could not select invoice in disposal pop-in (#34725)
|
||||
FIX: 17.0 SQL syntax error and/or constraint error when calling Facture::update() after a clone (e.g. in a trigger) (#34778)
|
||||
FIX: 17.0: when you clone an invoice that was created from a template invoice, the clone should not be linked to the template invoice (#34777)
|
||||
FIX: pre-send mail mass action: keep __EMAIL__ substitution (#34522)
|
||||
FIX: pre-send mail mass action: keep __EMAIL__ substitution
|
||||
FIX: comment
|
||||
FIX: massaction email tpl: keep preset
|
||||
FIX: loop interrupt if an error occurs in sendEmailsRemindersOnInvoiceDueDate (#34657)
|
||||
FIX: #34654
|
||||
|
||||
***** ChangeLog for 18.0.7 compared to 18.0.6 *****
|
||||
138 files changed, 1622 insertions(+), 530 deletions(-)
|
||||
|
||||
FIX: 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237
|
||||
FIX: 17.0 - collisions in cache for dol_getIdFromCode
|
||||
FIX: 17.0 - missing error handling for FactureRec::fetch in card-rec.php
|
||||
FIX: 17.0: warnings due to uninitialized variables + delete code that doesn't apply to recurring invoices (AFAIK, there is no recurring credit note feature)
|
||||
FIX: #21294 Stock import sql query
|
||||
FIX: #26250 fatal error on kit
|
||||
FIX: #32339 Delete a loan settlement is partial
|
||||
FIX: #33038 drag and drop files are not prefixed with object reference
|
||||
FIX: #33117 accountancy export Quadratus when doc ref is less than 10 char
|
||||
FIX: #33145 wrong label status buy on product tooltip
|
||||
FIX: accountancy export Quadratus when doc ref is less than 10 char
|
||||
FIX: bad dispatched quantities for batches on shipment card
|
||||
FIX: bank payment rejection on SEPA (backport commit 100a657) (#33838)
|
||||
FIX: calculate start date of cloned task from cloned project (#31799)
|
||||
FIX: can not delete files in task card
|
||||
FIX: close all services on contract will close all lines (#33466)
|
||||
FIX: compatibility with multicompany
|
||||
FIX: constant PAYMENTBYBANKTRANSFER_ADDDAYS was never saved (#33799)
|
||||
FIX: Count on supplier invoice list does not match count in DB (#33351)
|
||||
FIX: #CVE-2024-34051
|
||||
FIX: delete supplier order line when linked to customer order line
|
||||
FIX: delete supplier order when at least one line linked to customer order line
|
||||
FIX: display error when loan can't be deleted
|
||||
FIX: display full tree on shipment card when a kit contains a same component in other sub-kit
|
||||
FIX: Fix case when the value of a extrafields of the type 'boolean', 'select' or other have an option with a value equal to '0'.
|
||||
FIX: Fix return value of hook sendMail when hook return -1 who must be return false in sendfile() function
|
||||
FIX: GETPOST('private_message')
|
||||
FIX: in projet/element.php total_time is always back to 0
|
||||
FIX: invoice creation : use dol_include_once instead of require_once to allow external modules
|
||||
FIX: invoice creation : use dol_include_once instead of require_once to allow external modules.
|
||||
FIX: issue #28222 Edit date extrafield displayed on all on lines (#31914)
|
||||
FIX: Many status on invoice linked object block
|
||||
FIX: Multilangs : PDF lines description
|
||||
FIX: ODT substitution when many HTML tags in string
|
||||
FIX: old copy not needed in supplier order create method (#31733)
|
||||
FIX: PAIEMENT Wrong field displayed for DateChequeReceived (#33390)
|
||||
FIX: phpcs
|
||||
FIX: product variants copy: also copy multiprice variations
|
||||
FIX: qual
|
||||
FIX: removes traces of <<<HEAD conflicts following the postponement of branch 13 modifications (#32014)
|
||||
FIX: Replace compromised tj-actions/changed-files (#33481)
|
||||
FIX: selectcontact is loading all contacts if socid is empty and MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT is not set
|
||||
FIX: selectcontact is loading all contacts when update event
|
||||
FIX: select group and severity search fields on ticket list
|
||||
FIX: send email to assigned user on ticket create
|
||||
FIX: send mail to BCC when email formatted as Fullname <email> (#31983)
|
||||
FIX: Show true error when send notify email at validate expense report
|
||||
FIX: status ticket update for new message
|
||||
FIX: swiftmailer: correctly set errors-to header (#31826)
|
||||
FIX: TakePos barcode rule (#31857)
|
||||
FIX: There were many status indicator in the invoice linked object block (propal card)
|
||||
FIX(ticket): Notification email without public interface
|
||||
FIX: Update on a sold line of bank entries set the type to empty, now it's fixed #22539 (#31888)
|
||||
FIX: update status on create supplier order for trigger (#31642)
|
||||
FIX: use tax with code on supplier order line give tax code missing in supplier invoice (#32018)
|
||||
FIX: use vat with code on supplier order result code missing in supplier invoice
|
||||
FIX: warehouse list: broken status filter (#33667)
|
||||
FIX: warnings (#33423)
|
||||
FIX: wrong left margin (v18 to develop ?)
|
||||
FIX: wrong message on update shipment
|
||||
FIX: wrong update function parameter
|
||||
|
||||
|
||||
***** ChangeLog for 18.0.6 compared to 18.0.5 *****
|
||||
FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269)
|
||||
FIX: 16.0 - the e-mail templates configured in the notification module are not used if the recipient is a fixed e-mail address (#29407)
|
||||
FIX: 17.0: $num doesn't take trigger-modified newref into account, leading to inconsistencies if BILL_SUPPLIER_VALIDATE changes the invoice's ref (#28684)
|
||||
FIX: 17.0: fatal when updating recurring supplier invoice line with php8 ($remise_percent is '' instead of 0) (#31713)
|
||||
FIX: 17.0: supplier invoice template card: buyer and seller swapped in VAT-related function calls (probably a copy-paste from customer invoice templates) (#31446)
|
||||
FIX: #24265 regression cannot see all product on takepos (#28753)
|
||||
FIX: #25853 Thirdparty Massaction (#25868)
|
||||
FIX: #28205
|
||||
FIX: #28251 Fixing subpermission name on api_multicurrencies.class.php (#28252)
|
||||
FIX: #28369
|
||||
FIX: #28518 (#28520)
|
||||
FIX: #28978 FIX: #28976
|
||||
FIX: #29029 Impossible to delete an order line
|
||||
FIX: #29114 Missing contact term in intervention
|
||||
FIX: #29114 Translate contact term in intervention
|
||||
FIX: #29439 incomplete API return (#29796)
|
||||
FIX: #29496 filtering a record should not hide its child not filtered
|
||||
FIX: #30010 Use conf TICKET_MESSAGE_MAIL_INTRO instead of translation key (#30081)
|
||||
FIX: #30274 Add the include before executing dolibarr_set_const (#30320)
|
||||
FIX: #30467
|
||||
FIX: #30768 allocate the correct invoice_line_id to the element timespent (#30769)
|
||||
FIX: Accountancy export with file or not
|
||||
FIX: Accountancy - Generate entries of expense report with localtax (#30411)
|
||||
FIX: Accountancy - Not trunc id_import
|
||||
FIX: accounting FEC import (Issue #28306) (#29414)
|
||||
FIX: Add new hidden conf "DISABLE_QTY_OVERWRITTEN" (#28523)
|
||||
FIX: Add same security test when uploading files from API than from GUI (#31114)
|
||||
FIX: Amount of localtaxes in foreign currency was wrong on screen and PDF
|
||||
FIX: an error in a complex else condition
|
||||
FIX: ASSET: annual depreciation starting year (Again ;-)) #26084 (#30040)
|
||||
FIX: avoid error "Column 'entity' in where clause is ambiguous" (#28270)
|
||||
FIX: avoid from re-initializing array result on nested hook getEntity (#30626)
|
||||
FIX: avoid php warnings (#29247)
|
||||
FIX: avoid to delete "lock" and "unlock" files
|
||||
FIX: avoid Unknown column 'pfp.ref_fourn' (#28145)
|
||||
FIX: background color for enabled modules (#29378)
|
||||
FIX: Backport fix fatal error on price with some truncating setup
|
||||
FIX: Backport page inventory.php from v18 to fix pagination bugs causing data loss (#29688)
|
||||
FIX: back to page on error in contact card (#29627)
|
||||
FIX: Bad calculation of $nbtotalofrecord (#30183)
|
||||
FIX: box_actions.php still uses fk_user_done which no longer exists (#31190)
|
||||
FIX: can validate shipment without stock movement (#31780)
|
||||
FIX: Condition on newDateLimReglement
|
||||
FIX: Conflict with autoload (#30399)
|
||||
FIX: const WORKFLOW_RECEPTION_CLASSIFY_NEWD_INVOICE (#31601)
|
||||
FIX: contact/address title is always "New Contact/Address" even if the contact/address already exists (#29581)
|
||||
FIX: Display the date according to user language on substitutions (#29510)
|
||||
FIX: Display the real_PMP on inventory when its value is equal to 0 (#22291)
|
||||
FIX: Don't display column when it's out of date (#28271)
|
||||
FIX: email templates for expense report not visible
|
||||
FIX: Error mesg show untranslated extrafield name (#30227)
|
||||
FIX: Error message overwrote when a error occurs during update of product multilangs (#30841)
|
||||
FIX: Error When cloning fourn price no default value for tva_tx (#28368)
|
||||
FIX: executeHooks $object default value (#29647)
|
||||
FIX: expedition PDF models using units labels (#30358)
|
||||
FIX: Extrafield following between rec invoice and classic invoice (#31445)
|
||||
FIX: fatal error on loading pictures in attached documents of an event (#30553)
|
||||
FIX: fatal error Unsupported operand types when recording load payment
|
||||
FIX: Fix bug select columns and access to the public ticket list from the public ticket card (case when we have connected to another client before, the track id stocked in session overwrite the new track id from the public ticket card) (#31000)
|
||||
FIX: Fix create shipping with product who have negative stocks on warehouse but the negative stock transfer is allowed (#26217)
|
||||
FIX: Fix save directory for invoice ODT and multientities
|
||||
FIX: group by qty in product margin tab (#29853)
|
||||
FIX: Hierarchy Employee view do not filter on employee = 1 (#29496)
|
||||
FIX: if you call fetchLines several times, your $object->lines contains duplicates (#31167)
|
||||
FIX: If you have no stock of your product, an error is displayed when you delete the reception. (#31504)
|
||||
FIX: incorrect page numbering in PDF #29458 (#29476)
|
||||
FIX: inventoryDeletePermission id define twice
|
||||
FIX: issue on action set condition in particular when you set a deposi… (#31518)
|
||||
FIX: issue to get the right files exported in Quadratrus export.php (#30004)
|
||||
FIX: lang output for sales representative on PDF (#30469)
|
||||
FIX: late order search option (#30692) and propal (#30687)
|
||||
FIX: lettering (auto) for invoice deposit with company discount (#29633)
|
||||
FIX: made invalid code shape error more user friendly (#29498)
|
||||
FIX: Merge of thirdparties must also move uploaded files
|
||||
FIX: missing entity parameter for ajax_constantonoff
|
||||
FIX: missing hide "new" button where "product" or "service" module are disable
|
||||
FIX: mo cloning (#29686)
|
||||
FIX: modification date from label in accounting bookkeeping list (#30038)
|
||||
FIX: Move the trigger for delete order line before the SQL request
|
||||
FIX: multiple problems with multicompany
|
||||
FIX: mysql error during dump for enable sandbox M999999 (#31116)
|
||||
FIX: notification: error 500 in fixed emails due to a bad copy/paste (#29580)
|
||||
FIX: notification module: for supplier orders (any of the 3 triggers), user can choose an e-mail template in conf, but the conf is not used when sending the notification (#28216)
|
||||
FIX: Not qualified lines for reception (#29473)
|
||||
FIX: not redirect when error occurs on updating card (#29388)
|
||||
FIX: Not trancate the multicurrency rate shown on cards (even if the global MAIN_MAX_DECIMALS_SHOWN is set to 0) (#28211)
|
||||
FIX: on change ref for bank account attachment are lost (#30529)
|
||||
FIX: Option MAIN_DOC_USE_TIMING can be a string with date format
|
||||
FIX: orders to bill menu (#30179)
|
||||
FIX: Payment on customer invoice - Remove accountid in url if empty for apply default value (#28156)
|
||||
FIX: PDF Fatal error : Backport fix from #23972
|
||||
FIX: PDF Translations Extrafields
|
||||
FIX: permission on payment file of a tax
|
||||
FIX: php8: Fatal when empty $tmpvat is an empty string (no silent conversion to '0' when used in arithmetic operations) (#29451)
|
||||
FIX: PHP 8 warning on output of successful cronjob (#29922)
|
||||
FIX: PHP exception on getSpecialCode (#29646)
|
||||
FIX: php warning global conf (#29478)
|
||||
FIX: pos: invoice date incorrectly set because of timezome mismatches (reverts #36e91da) (#30184)
|
||||
FIX: public project form return an error if SOCIETE_EMAIL_UNIQUE (#29942)
|
||||
FIX: purge files cron: php warnings when rest module enabled (#30919)
|
||||
FIX: PUT /thirdparties/{id} and PUT /contacts/{id} should throw exception if update returns < 0 (#29596)
|
||||
FIX: Regression #29340
|
||||
FIX: Repair the replenishment list (#29336)
|
||||
FIX: REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)
|
||||
FIX: round capital societe (#29211)
|
||||
FIX: search and add extrafields to tasks when conf disabled (#29542)
|
||||
FIX: show preview pdf list expensereport (#31694)
|
||||
FIX: sometimes a string type instead integer is return, why ?
|
||||
FIX: Special code is now transmitted by args only in order supplier (#28546) (#28619)
|
||||
FIX: SQL syntax error in DDLUpdateField
|
||||
FIX: subscription must be editable when accounting isn't reconciled (#28469)
|
||||
FIX: substitutions THIRDPARTY_XXX are not available for actioncomm reminders (#31385)
|
||||
FIX: Supplier Order search on date valid (#30448)
|
||||
FIX: supplier price duplicate entry on update supplier product ref (#29290)
|
||||
FIX: syntax error
|
||||
FIX: TakePOS | Add product / Delete line of existing invoice
|
||||
FIX: Ticket new message notification sent twice
|
||||
FIX: transfer in accountancy for expense reports.
|
||||
FIX: Unsigned propal having signing date (#29825)
|
||||
FIX: Update asset.class.php
|
||||
FIX: update date_echeance of supplier invoices when we update invoice date in the past (#29886)
|
||||
FIX: use $conf->browser->os instead
|
||||
FIX: use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165)
|
||||
FIX: User List - Function is show in wrong column when module HRM enabled (#30186)
|
||||
fix: when invoice is created by WORKFLOW_ORDER_AUTOCREATE_INVOICE on ORDER_NEW, the invoice must have the default bank account of the thirdparty is it's empty on order (#29462)
|
||||
FIX: when qty is not an integer, apply price() (#31138)
|
||||
FIX: Wrong currency shown in TakePOS payment page
|
||||
FIX: wrong shortcut key for macintosh
|
||||
FIX: wrong sql request with product category filter
|
||||
FIX: wrong stock permission number
|
||||
|
||||
***** ChangeLog for 18.0.5 compared to 18.0.4 *****
|
||||
FIX: 17.0: deprecated field should only be a fallback
|
||||
FIX: 17.0 - php8 warnings: test for $field existence before checking if it is null or empty
|
||||
@@ -825,7 +1105,7 @@ NEW: Accountancy - Quadratus export with attachments in accountancy export
|
||||
NEW: Accountancy - Can filter on a custom group of accounts. Perf or ledger list.
|
||||
NEW: Accountancy - Can select the export format during export of journals
|
||||
NEW: Accountancy - sort of column of custom group of account
|
||||
NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
|
||||
NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
|
||||
NEW: Authentication: #22740 add OpenID Connect impl
|
||||
NEW: Authentication: add experimental support for Google OAuth2 connexion
|
||||
NEW: Authentication: can now edit service name for OAuth token
|
||||
@@ -907,7 +1187,7 @@ NEW: No overwrite of optionals during put() contact
|
||||
NEW: Notifications: add Customer Order delivered (ORDER_NEW) in module Notification
|
||||
NEW: Notifications: for Sign or Refused Propal from Online Page
|
||||
NEW: Now we can edit amount on VAT and salaries clone action
|
||||
NEW: only get opened contact from liste_contact function, to not have access to closed contact as mail receiver
|
||||
NEW: only get open contact from liste_contact function, to not have access to closed contact as mail receiver
|
||||
NEW: Option: MAIN_SECURITY_MAXFILESIZE_DOWNLOADED #yogosha10660
|
||||
NEW: Option to manage deposit slips for more payment modes (not only
|
||||
NEW: Option to show column for field and line selection on the left
|
||||
@@ -1029,7 +1309,7 @@ Note that to find all the parameters that are encrypted into the setup database,
|
||||
|
||||
|
||||
***** ChangeLog for 17.0.4 compared to 17.0.3 *****
|
||||
FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming
|
||||
FIX: $this->newref already exists and could have been modified by a trigger but we still use a local variable for the filesystem-based renaming
|
||||
FIX: 16.0 only, backport fix for SQL error on global search product
|
||||
FIX: 17.0: deprecated field should only be a fallback
|
||||
FIX: 17.0 PHP8: supplier invoice class:
|
||||
|
||||
@@ -172,7 +172,7 @@ $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom
|
||||
*/
|
||||
// Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
|
||||
$regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
|
||||
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||
|
||||
$dir = '';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# \brief Dolibarr package builder (tgz, zip, rpm, deb, exe, aps)
|
||||
# \author (c)2004-2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
#
|
||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||
# This is list of constant you can set to have generated packages moved into a specific dir:
|
||||
#DESTIBETARC='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/lastbuild'
|
||||
#DESTISTABLE='/media/HDDATA1_LD/Mes Sites/Web/Dolibarr/dolibarr.org/files/stable'
|
||||
#DESTIMODULES='/media/HDDATA1_LD/Mes Sites/Web/Admin1/wwwroot/files/modules'
|
||||
@@ -18,10 +18,12 @@ 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="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
|
||||
|
||||
$PUBLISHBETARC="$ENV{'DESTIASSOLOGIN'}\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/dolibarr_documents/website/www.dolibarr.org/files";
|
||||
$PUBLISHSTABLE="$ENV{'DESTISFLOGIN'}\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||
|
||||
# due to implicit origin on git commands, example
|
||||
# implicit origin, lionel upstream, eric dolibarr
|
||||
$GITREMOTENAME="$ENV{'GITREMOTENAME'}";
|
||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||
%REQUIREMENTPUBLISH=(
|
||||
@@ -36,7 +38,7 @@ $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/asso.dolibarr.org/
|
||||
"RPM_FEDORA"=>"rpmbuild",
|
||||
"RPM_MANDRIVA"=>"rpmbuild",
|
||||
"RPM_OPENSUSE"=>"rpmbuild",
|
||||
"DEB"=>"dpkg dpatch",
|
||||
"DEB"=>"dpkg",
|
||||
"FLATPACK"=>"flatpack",
|
||||
"EXEDOLIWAMP"=>"ISCC.exe",
|
||||
"SNAPSHOT"=>"tar"
|
||||
@@ -98,6 +100,13 @@ if (! -d $ENV{"DESTIBETARC"} || ! -d $ENV{"DESTISTABLE"})
|
||||
exit 1;
|
||||
}
|
||||
|
||||
if (! $ENV{"GITREMOTENAME"})
|
||||
{
|
||||
print "Error: environment variable GITREMOTENAME does not exist. You can set it to 'origin' or any other git remote name.\n";
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 1;
|
||||
}
|
||||
# Detect OS type
|
||||
# --------------
|
||||
if ("$^O" =~ /linux/i || (-d "/etc" && -d "/var" && "$^O" !~ /cygwin/i)) { $OS='linux'; $CR=''; }
|
||||
@@ -129,7 +138,7 @@ if (! $TEMP || ! -d $TEMP) {
|
||||
print "$PROG.$Extension aborted.\n";
|
||||
sleep 2;
|
||||
exit 2;
|
||||
}
|
||||
}
|
||||
$BUILDROOT="$TEMP/buildroot";
|
||||
|
||||
|
||||
@@ -172,7 +181,7 @@ $newbuild = $BUILD;
|
||||
$newbuild =~ s/(dev|alpha)/1/gi; # dev
|
||||
$newbuild =~ s/beta(.?)/2/gi; # beta (we want beta1, beta2, betax to be same package name)
|
||||
$newbuild =~ s/rc(.?)/3/gi; # rc (we want rc1, rc2, rcx to be same package name)
|
||||
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc.
|
||||
if ($newbuild !~ /-/) { $newbuild.='-4'; } # finale is same than rc.
|
||||
# now newbuild is 0-1 or 0-4 for example. Note that for native package (see debian/source/format), we should not use a dash part but to get a better version management
|
||||
$build = $newbuild;
|
||||
$build =~ s/-.*$//g;
|
||||
@@ -190,8 +199,8 @@ for (0..@ARGV-1) {
|
||||
if ($ARGV[$_] =~ /^-*target=(\w+)/i) { $target=$1; $batch=1; }
|
||||
if ($ARGV[$_] =~ /^-*desti=(.+)/i) { $DESTI=$1; }
|
||||
if ($ARGV[$_] =~ /^-*prefix=(.+)/i) {
|
||||
$PREFIX=$1;
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
$PREFIX=$1;
|
||||
$FILENAMESNAPSHOT.="-".$PREFIX;
|
||||
}
|
||||
}
|
||||
if ($ENV{"DESTIBETARC"} && $BUILD =~ /[a-z]/i) { $DESTI = $ENV{"DESTIBETARC"}; } # Force output dir if env DESTIBETARC is defined
|
||||
@@ -210,7 +219,7 @@ print "Target directory (DESTI) : $DESTI\n";
|
||||
# Choose package targets
|
||||
#-----------------------
|
||||
if ($target) {
|
||||
if ($target eq "ALL") {
|
||||
if ($target eq "ALL") {
|
||||
foreach my $key (@LISTETARGET) {
|
||||
if ($key ne 'SNAPSHOT' && $key ne 'SF' && $key ne 'ASSO') { $CHOOSEDTARGET{$key}=1; }
|
||||
}
|
||||
@@ -236,10 +245,10 @@ else {
|
||||
printf(" %2d - %-14s (%s)\n",$cpt,"ASSO (publish)","Need ".$REQUIREMENTPUBLISH{"ASSO"});
|
||||
$cpt=99;
|
||||
printf(" %2d - %-14s (%s)\n",$cpt,"SF (publish)","Need ".$REQUIREMENTPUBLISH{"SF"});
|
||||
|
||||
|
||||
# Ask which target to build
|
||||
print "Choose one target number or several separated with space (0 - ".$cpt."): ";
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
if ($NUM_SCRIPT !~ /^[0-9\s]+$/)
|
||||
{
|
||||
@@ -286,11 +295,11 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
print "Error: You asked creation of several rpms. Because all rpm have same name, you must defined an environment variable DESTI to tell packager where it can create subdirs for each generated package.\n";
|
||||
exit;
|
||||
}
|
||||
$atleastonerpm=1;
|
||||
}
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
|
||||
$atleastonerpm=1;
|
||||
}
|
||||
foreach my $req (split(/[,\s]/,$REQUIREMENTTARGET{$target}))
|
||||
{
|
||||
# Test
|
||||
# Test
|
||||
print "Test requirement for target $target: Search '$req'... ";
|
||||
$newreq=$req; $newparam='';
|
||||
if ($newreq eq 'zip') { $newparam.='-h'; }
|
||||
@@ -299,12 +308,12 @@ foreach my $target (sort keys %CHOOSEDTARGET) {
|
||||
print "Test command ".$cmd."... ";
|
||||
$ret=`$cmd`;
|
||||
$coderetour=$?; $coderetour2=$coderetour>>8;
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/)) && $PROGPATH) {
|
||||
# Not found error, we try in PROGPATH
|
||||
$ret=`"$PROGPATH/$ALTERNATEPATH{$req}/$req\" 2>&1`;
|
||||
$coderetour=$?; $coderetour2=$coderetour>>8;
|
||||
$REQUIREMENTTARGET{$target}="$PROGPATH/$ALTERNATEPATH{$req}/$req";
|
||||
}
|
||||
}
|
||||
|
||||
if ($coderetour != 0 && (($coderetour2 == 1 && $OS =~ /windows/ && $ret !~ /Usage/i) || ($coderetour2 == 127 && $OS !~ /windows/))) {
|
||||
# Not found error
|
||||
@@ -333,7 +342,7 @@ $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')
|
||||
if ($target ne 'EXE' && $target ne 'EXEDOLIWAMP' && $target ne '-CHKSUM')
|
||||
{
|
||||
$nboftargetneedbuildroot++;
|
||||
}
|
||||
@@ -397,10 +406,10 @@ if ($nboftargetok) {
|
||||
print "Go to directory $SOURCE\n";
|
||||
$olddir=getcwd();
|
||||
chdir("$SOURCE");
|
||||
|
||||
|
||||
print "Clean $SOURCE/htdocs/includes/autoload.php\n";
|
||||
$ret=`rm -f $SOURCE/htdocs/includes/autoload.php`;
|
||||
|
||||
|
||||
$ret=`git ls-files . --exclude-standard --others`;
|
||||
if ($ret)
|
||||
{
|
||||
@@ -409,12 +418,16 @@ if ($nboftargetok) {
|
||||
print "Canceled.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_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;
|
||||
if ( !-d "$NEWDESTI/signatures" ) {
|
||||
use File::Path qw( make_path );
|
||||
make_path "$NEWDESTI/signatures" or die "Failed to create path: $NEWDESTI/signatures";
|
||||
}
|
||||
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";
|
||||
@@ -427,32 +440,32 @@ if ($nboftargetok) {
|
||||
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à)/)
|
||||
{
|
||||
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
|
||||
$QUESTIONOVERWRITETAG=<STDIN>;
|
||||
$QUESTIONOVERWRITETAG=<STDIN>;
|
||||
chomp($QUESTIONOVERWRITETAG);
|
||||
if ($QUESTIONOVERWRITETAG =~ /(o|y)/)
|
||||
{
|
||||
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||
print 'Run git push -f --tags'."\n";
|
||||
$ret=`git push -f --tags`;
|
||||
print 'Run git push $GITREMOTENAME -f --tags'."\n";
|
||||
$ret=`git push $GITREMOTENAME -f --tags`;
|
||||
#$ret=`git push -f origin "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
print 'Run git push $GITREMOTENAME --tags'."\n";
|
||||
$ret=`git push $GITREMOTENAME --tags`;
|
||||
#$ret=`git push origin "$MAJOR.$MINOR.$BUILD"`;
|
||||
}
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
|
||||
# Update buildroot if required
|
||||
#-----------------------------
|
||||
if ($nboftargetneedbuildroot)
|
||||
@@ -462,7 +475,7 @@ if ($nboftargetok) {
|
||||
|
||||
print "Delete directory $BUILDROOT\n";
|
||||
$ret=`rm -fr "$BUILDROOT"`;
|
||||
|
||||
|
||||
mkdir "$BUILDROOT";
|
||||
mkdir "$BUILDROOT/$PROJECT";
|
||||
print "Copy $SOURCE into $BUILDROOT/$PROJECT\n";
|
||||
@@ -488,7 +501,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/phpstan.neon`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/pom.xml`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/README-*.md`;
|
||||
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/build/html`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/Doli*-*`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
|
||||
@@ -557,20 +570,20 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot11.png`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
|
||||
|
||||
# Security to avoid to package data files
|
||||
# Security to avoid to package data files
|
||||
print "Remove documents dir\n";
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
|
||||
|
||||
|
||||
print "Remove subdir of custom dir\n";
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
|
||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
|
||||
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
|
||||
|
||||
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
||||
# Removed known external modules to avoid any error when packaging from env where external modules are tested
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/abricot*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/accountingexport*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
|
||||
@@ -596,15 +609,15 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/timesheet*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/webmail*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/common/fontawesome-5/svgs`;
|
||||
|
||||
|
||||
# Removed other test files
|
||||
$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`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
||||
|
||||
# Removed files installed by the awful composer
|
||||
|
||||
# Removed files installed by the awful composer
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||
@@ -639,7 +652,7 @@ if ($nboftargetok) {
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
||||
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/bin`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/bin`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/*/bin`;
|
||||
@@ -649,14 +662,14 @@ if ($nboftargetok) {
|
||||
|
||||
# Build package for each target
|
||||
#------------------------------
|
||||
foreach my $target (sort keys %CHOOSEDTARGET)
|
||||
foreach my $target (sort keys %CHOOSEDTARGET)
|
||||
{
|
||||
if ($CHOOSEDTARGET{$target} < 0) { next; }
|
||||
if ($target eq '-CHKSUM') { next; }
|
||||
|
||||
|
||||
print "\nBuild package for target $target\n";
|
||||
|
||||
if ($target eq 'SNAPSHOT')
|
||||
if ($target eq 'SNAPSHOT')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
|
||||
@@ -680,13 +693,13 @@ if ($nboftargetok) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'TGZ')
|
||||
if ($target eq 'TGZ')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
if ($NEWDESTI =~ /stable/)
|
||||
{
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
}
|
||||
|
||||
print "Remove target $FILENAMETGZ.tgz...\n";
|
||||
@@ -700,7 +713,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
|
||||
print "Compress $FILENAMETGZ into $FILENAMETGZ.tgz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMETGZ.tgz\" $FILENAMETGZ";
|
||||
print "$cmd\n";
|
||||
@@ -712,14 +725,14 @@ if ($nboftargetok) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'XZ')
|
||||
if ($target eq 'XZ')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
if ($NEWDESTI =~ /stable/)
|
||||
{
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
}
|
||||
}
|
||||
|
||||
print "Remove target $FILENAMEXZ.xz...\n";
|
||||
unlink("$NEWDESTI/$FILENAMEXZ.xz");
|
||||
@@ -732,7 +745,7 @@ if ($nboftargetok) {
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/build/exe`;
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMEXZ/htdocs/includes/ckeditor/_source`; # We can't remove it with exclude file, we need it for some tarball packages
|
||||
|
||||
|
||||
print "Compress $FILENAMEXZ into $FILENAMEXZ.xz...\n";
|
||||
|
||||
print "Go to directory $BUILDROOT\n";
|
||||
@@ -748,15 +761,15 @@ if ($nboftargetok) {
|
||||
$ret=`mv "$BUILDROOT/$FILENAMEXZ.xz" "$NEWDESTI/$FILENAMEXZ.xz"`;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'ZIP')
|
||||
|
||||
if ($target eq 'ZIP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
if ($NEWDESTI =~ /stable/)
|
||||
{
|
||||
mkdir($DESTI.'/standard');
|
||||
if (-d $DESTI.'/standard') { $NEWDESTI=$DESTI.'/standard'; }
|
||||
}
|
||||
}
|
||||
|
||||
print "Remove target $FILENAMEZIP.zip...\n";
|
||||
unlink("$NEWDESTI/$FILENAMEZIP.zip");
|
||||
@@ -779,14 +792,14 @@ if ($nboftargetok) {
|
||||
print $cmd."\n";
|
||||
$ret= `$cmd`;
|
||||
chdir("$olddir");
|
||||
|
||||
|
||||
# Move to final dir
|
||||
print "Move $FILENAMEZIP.zip to $NEWDESTI/$FILENAMEZIP.zip\n";
|
||||
$ret=`mv "$BUILDROOT/$FILENAMEZIP.zip" "$NEWDESTI/$FILENAMEZIP.zip"`;
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target =~ /RPM/) # Linux only
|
||||
|
||||
if ($target =~ /RPM/) # Linux only
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
$subdir="package_rpm_generic";
|
||||
@@ -797,7 +810,7 @@ if ($nboftargetok) {
|
||||
{
|
||||
mkdir($DESTI.'/'.$subdir);
|
||||
if (-d $DESTI.'/'.$subdir) { $NEWDESTI=$DESTI.'/'.$subdir; }
|
||||
}
|
||||
}
|
||||
|
||||
if ($RPMDIR eq "") { $RPMDIR=$ENV{'HOME'}."/rpmbuild"; }
|
||||
|
||||
@@ -810,7 +823,7 @@ if ($nboftargetok) {
|
||||
|
||||
print "Create directory $BUILDROOT/$FILENAMETGZ2\n";
|
||||
$ret=`rm -fr $BUILDROOT/$FILENAMETGZ2`;
|
||||
|
||||
|
||||
print "Copy $BUILDROOT/$PROJECT to $BUILDROOT/$FILENAMETGZ2\n";
|
||||
$cmd="cp -pr '$BUILDROOT/$PROJECT' '$BUILDROOT/$FILENAMETGZ2'";
|
||||
$ret=`$cmd`;
|
||||
@@ -827,6 +840,7 @@ if ($nboftargetok) {
|
||||
print "Compress $FILENAMETGZ2 into $FILENAMETGZ2.tgz...\n";
|
||||
$ret=`tar --exclude-from "$SOURCE/build/tgz/tar_exclude.txt" --directory "$BUILDROOT" -czvf "$BUILDROOT/$FILENAMETGZ2.tgz" $FILENAMETGZ2`;
|
||||
|
||||
if (! -d $RPMDIR . '/SOURCES') { mkdir($RPMDIR . '/SOURCES'); }
|
||||
print "Move $BUILDROOT/$FILENAMETGZ2.tgz to $RPMDIR/SOURCES/$FILENAMETGZ2.tgz\n";
|
||||
$cmd="mv $BUILDROOT/$FILENAMETGZ2.tgz $RPMDIR/SOURCES/$FILENAMETGZ2.tgz";
|
||||
$ret=`$cmd`;
|
||||
@@ -836,7 +850,7 @@ if ($nboftargetok) {
|
||||
if ($target =~ /FEDO/i) { $BUILDFICSRC="${FILENAME}_fedora.spec"; }
|
||||
if ($target =~ /MAND/i) { $BUILDFICSRC="${FILENAME}_mandriva.spec"; }
|
||||
if ($target =~ /OPEN/i) { $BUILDFICSRC="${FILENAME}_opensuse.spec"; }
|
||||
|
||||
|
||||
use Date::Language;
|
||||
$lang=Date::Language->new('English');
|
||||
$datestring = $lang->time2str("%a %b %e %Y", time);
|
||||
@@ -854,7 +868,7 @@ if ($nboftargetok) {
|
||||
}
|
||||
close SPECFROM;
|
||||
close SPECTO;
|
||||
|
||||
|
||||
print "Copy patch file to $RPMDIR/SOURCES\n";
|
||||
$ret=`cp "$SOURCE/build/rpm/dolibarr-forrpm.patch" "$RPMDIR/SOURCES"`;
|
||||
$ret=`chmod 644 $RPMDIR/SOURCES/dolibarr-forrpm.patch`;
|
||||
@@ -876,14 +890,14 @@ if ($nboftargetok) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($target eq 'DEB')
|
||||
if ($target eq 'DEB')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
if ($NEWDESTI =~ /stable/)
|
||||
{
|
||||
mkdir($DESTI.'/package_debian-ubuntu');
|
||||
if (-d $DESTI.'/package_debian-ubuntu') { $NEWDESTI=$DESTI.'/package_debian-ubuntu'; }
|
||||
}
|
||||
}
|
||||
|
||||
$olddir=getcwd();
|
||||
|
||||
@@ -964,13 +978,18 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/jquery/plugins/select2/LICENSE`;
|
||||
$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`;
|
||||
|
||||
|
||||
# Removed files we don't need (already removed)
|
||||
#$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/htdocs/includes/ckeditor/ckeditor/_source`;
|
||||
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/.codeclimate.yml`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/.pre-commit-config.yaml`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/.vscode`;
|
||||
$ret=`find $BUILDROOT/$PROJECT.tmp/ -type f -name '.editorconfig' -exec rm {} \\;`;
|
||||
$ret=`find $BUILDROOT/$PROJECT.tmp/ -type f -name '.travis.yml' -exec rm {} \\;`;
|
||||
|
||||
# Rename upstream changelog to match debian rules
|
||||
$ret=`mv $BUILDROOT/$PROJECT.tmp/ChangeLog $BUILDROOT/$PROJECT.tmp/changelog`;
|
||||
|
||||
|
||||
# Prepare source package (init debian dir)
|
||||
print "Create directory $BUILDROOT/$PROJECT.tmp/debian\n";
|
||||
$ret=`mkdir "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
@@ -1008,7 +1027,7 @@ if ($nboftargetok) {
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.postrm" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/dolibarr.templates" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
$ret=`cp -f "$SOURCE/build/debian/install.forced.php.install" "$BUILDROOT/$PROJECT.tmp/debian"`;
|
||||
|
||||
|
||||
# Set owners and permissions
|
||||
#print "Set owners on files/dir\n";
|
||||
#$ret=`chown -R root.root $BUILDROOT/$PROJECT.tmp`;
|
||||
@@ -1039,8 +1058,8 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
$cmd="find $BUILDROOT/$PROJECT.tmp/scripts -name '*.sh' -type f -exec chmod 755 {} \\; ";
|
||||
$ret=`$cmd`;
|
||||
|
||||
|
||||
|
||||
|
||||
print "Rename directory $BUILDROOT/$PROJECT.tmp into $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
$cmd="mv $BUILDROOT/$PROJECT.tmp $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||
$ret=`$cmd`;
|
||||
@@ -1048,14 +1067,14 @@ if ($nboftargetok) {
|
||||
|
||||
print "Go into directory $BUILDROOT\n";
|
||||
chdir("$BUILDROOT");
|
||||
|
||||
|
||||
# We need a tarball to be able to build "quilt" debian package (not required for native but we need patch so it is not a native)
|
||||
print "Compress $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build into $BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz...\n";
|
||||
$cmd="tar --exclude-vcs --exclude-from \"$BUILDROOT/$PROJECT/build/tgz/tar_exclude.txt\" --directory \"$BUILDROOT\" --mode=go-w --group=500 --owner=500 -czvf \"$BUILDROOT/$FILENAMEDEBNATIVE.orig.tar.gz\" $PROJECT-$MAJOR.$MINOR.$build";
|
||||
print $cmd."\n";
|
||||
$ret=`$cmd`;
|
||||
|
||||
# Creation of source package
|
||||
# Creation of source package
|
||||
print "Go into directory $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build\n";
|
||||
chdir("$BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build");
|
||||
#$cmd="dpkg-source -b $BUILDROOT/$PROJECT-$MAJOR.$MINOR.$build";
|
||||
@@ -1074,12 +1093,12 @@ if ($nboftargetok) {
|
||||
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
||||
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
|
||||
#$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`; # xz file is generated when build/debian/sources/option
|
||||
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
|
||||
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
if ($target eq 'EXEDOLIWAMP')
|
||||
{
|
||||
$NEWDESTI=$DESTI;
|
||||
@@ -1087,22 +1106,22 @@ if ($nboftargetok) {
|
||||
{
|
||||
mkdir($DESTI.'/package_windows');
|
||||
if (-d $DESTI.'/package_windows') { $NEWDESTI=$DESTI.'/package_windows'; }
|
||||
}
|
||||
}
|
||||
|
||||
print "Remove target $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe...\n";
|
||||
unlink "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe";
|
||||
|
||||
|
||||
if ($OS eq 'windows') {
|
||||
print "Check that ISCC.exe is in your PATH.\n";
|
||||
} else {
|
||||
print "Check that in your Wine setup, you have created a Z: drive that point to your / directory.\n";
|
||||
}
|
||||
|
||||
|
||||
$SOURCEBACK=$SOURCE;
|
||||
$SOURCEBACK =~ s/\//\\/g;
|
||||
|
||||
print "Prepare file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" from \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.iss\"\n";
|
||||
|
||||
|
||||
#$ret=`cat "$SOURCE/build/exe/doliwamp/doliwamp.iss" | sed -e 's/__FILENAMEEXEDOLIWAMP__/$FILENAMEEXEDOLIWAMP/g' > "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||
open(IN, '<' . $SOURCE."/build/exe/doliwamp/doliwamp.iss") or die $!;
|
||||
open(OUT, '>' . "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss") or die $!;
|
||||
@@ -1115,7 +1134,7 @@ if ($nboftargetok) {
|
||||
close(OUT);
|
||||
|
||||
print "Compil exe $FILENAMEEXEDOLIWAMP.exe file from iss file \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\" on OS $OS\n";
|
||||
|
||||
|
||||
if ($OS eq 'windows') {
|
||||
$cmd= "ISCC.exe \"$SOURCEBACK\\build\\exe\\doliwamp\\doliwamp.tmp.iss\"";
|
||||
} else {
|
||||
@@ -1129,26 +1148,26 @@ if ($nboftargetok) {
|
||||
print "Move \"$SOURCE\\build\\$FILENAMEEXEDOLIWAMP.exe\" to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
rename("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe","$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
|
||||
print "Move $SOURCE/build/$FILENAMEEXEDOLIWAMP.exe to $NEWDESTI/$FILENAMEEXEDOLIWAMP.exe\n";
|
||||
|
||||
|
||||
use File::Copy;
|
||||
|
||||
#$ret=`mv "$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe" "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe"`;
|
||||
$ret=move("$SOURCE/build/$FILENAMEEXEDOLIWAMP.exe", "$NEWDESTI/$FILENAMEEXEDOLIWAMP.exe");
|
||||
|
||||
|
||||
print "Remove tmp file $SOURCE/build/exe/doliwamp/doliwamp.tmp.iss\n";
|
||||
#$ret=`rm "$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss"`;
|
||||
$ret=unlink("$SOURCE/build/exe/doliwamp/doliwamp.tmp.iss");
|
||||
|
||||
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# Publish package for each target
|
||||
#--------------------------------
|
||||
foreach my $target (sort keys %CHOOSEDPUBLISH)
|
||||
foreach my $target (sort keys %CHOOSEDPUBLISH)
|
||||
{
|
||||
if ($CHOOSEDPUBLISH{$target} < 0) { next; }
|
||||
|
||||
|
||||
print "\nList of files to publish (BUILD=$BUILD)\n";
|
||||
%filestoscansf=(
|
||||
"$DESTI/signatures/filelist-$MAJOR.$MINOR.$BUILD.xml"=>'none', # none means it won't be published on SF
|
||||
@@ -1171,7 +1190,8 @@ if ($nboftargetok) {
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
|
||||
#"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
||||
@@ -1206,26 +1226,26 @@ if ($nboftargetok) {
|
||||
print "\n";
|
||||
}
|
||||
|
||||
if ($target eq 'SF' || $target eq 'ASSO')
|
||||
if ($target eq 'SF' || $target eq 'ASSO')
|
||||
{
|
||||
print "\n";
|
||||
|
||||
|
||||
if ($target eq 'SF') { $PUBLISH = $PUBLISHSTABLE; }
|
||||
if ($target eq 'ASSO' && $BUILD =~ /[a-z]/i) { $PUBLISH = $PUBLISHBETARC.'/lastbuild'; }
|
||||
if ($target eq 'ASSO' && $BUILD =~ /^[0-9]+$/) { $PUBLISH = $PUBLISHBETARC.'/stable'; }
|
||||
|
||||
|
||||
$NEWPUBLISH=$PUBLISH;
|
||||
print "Publish to target $NEWPUBLISH. Click enter or CTRL+C...\n";
|
||||
|
||||
# Ask which target to build
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
$NUM_SCRIPT=<STDIN>;
|
||||
chomp($NUM_SCRIPT);
|
||||
|
||||
print "Create empty dir /tmp/emptydir. We need it to create target dir using rsync.\n";
|
||||
$ret=`mkdir -p "/tmp/emptydir/"`;
|
||||
|
||||
|
||||
%filestoscan=%filestoscansf;
|
||||
|
||||
|
||||
foreach my $file (sort keys %filestoscan)
|
||||
{
|
||||
$found=0;
|
||||
@@ -1235,30 +1255,30 @@ if ($nboftargetok) {
|
||||
if ($target eq 'SF') {
|
||||
if ($filestoscan{$file} eq 'none') {
|
||||
next;
|
||||
}
|
||||
}
|
||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||
}
|
||||
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
|
||||
$destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}";
|
||||
}
|
||||
}
|
||||
elsif ($target eq 'ASSO' and $NEWPUBLISH !~ /stable/) {
|
||||
$destFolder="$NEWPUBLISH";
|
||||
}
|
||||
}
|
||||
else # No more used
|
||||
{
|
||||
$dirnameonly=$file;
|
||||
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
|
||||
$dirnameonly =~ s/.*\/([^\/]+)\/[^\/]+$/$1/;
|
||||
$filenameonly=$file;
|
||||
$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;
|
||||
$filenameonly =~ s/.*\/[^\/]+\/([^\/])+$/$1/;
|
||||
$destFolder="$NEWPUBLISH/$dirnameonly";
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print "Publish file ".$file." to ".$destFolder."\n";
|
||||
|
||||
# mkdir
|
||||
# mkdir
|
||||
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");
|
||||
#$ssh->login("$user","$pass");
|
||||
#$ssh->login("$user","$pass");
|
||||
#use String::ShellQuote qw( shell_quote );
|
||||
#$ssh->cmd('mkdir '.shell_quote($destFolder).' && exit');
|
||||
|
||||
@@ -1267,20 +1287,20 @@ if ($nboftargetok) {
|
||||
#$sftp->mkdir($destFolder)
|
||||
|
||||
#$command="ssh eldy,dolibarr\@frs.sourceforge.net mkdir -p \"$destFolder\"";
|
||||
#print "$command\n";
|
||||
#print "$command\n";
|
||||
#my $ret=`$command 2>&1`;
|
||||
|
||||
$command="rsync -s -e 'ssh' --recursive /tmp/emptydir/ \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
print "$command\n";
|
||||
my $ret=`$command 2>&1`;
|
||||
|
||||
$command="rsync -s -e 'ssh' \"$file\" \"".$destFolder."\"";
|
||||
print "$command\n";
|
||||
print "$command\n";
|
||||
my $ret2=`$command 2>&1`;
|
||||
print "$ret2\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print "\n----- Summary -----\n";
|
||||
|
||||
@@ -6,7 +6,7 @@ of Dolibarr. There is a chapter for BETA version and a chapter for RELEASE versi
|
||||
***** Prerequisites For Linux *****
|
||||
|
||||
Prerequisites to build tgz, debian and rpm packages:
|
||||
> apt-get install perl tar dpkg dpatch p7zip-full rpm zip php-cli
|
||||
> apt-get install perl tar dpkg p7zip-full rpm zip php-cli debhelper po-debconf
|
||||
|
||||
Prerequisites to build autoexe DoliWamp package from Linux (solution seems broken since Ubuntu 20.04):
|
||||
> apt-get install wine q4wine
|
||||
@@ -14,11 +14,11 @@ Prerequisites to build autoexe DoliWamp package from Linux (solution seems broke
|
||||
> Install InnoSetup
|
||||
For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
|
||||
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
||||
For example by running wampserver3.2.6_x64.exe (https://www.wampserver.com).
|
||||
For example by running wampserver3.2.6_x64.exe (https://www.wampserver.com).
|
||||
See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
||||
> Add path to ISCC into PATH windows var:
|
||||
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
||||
open file build/exe/doliwamp.iss and click on button "Compile".
|
||||
The .exe file will be build into directory build.
|
||||
|
||||
@@ -32,8 +32,8 @@ Prerequisites to build autoexe DoliWamp package from Windows:
|
||||
> Install Microsoft Visual C++ Redistributable 2017 (https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170)
|
||||
> Install WampServer-3.2.6-64.exe (Apache 2.4.51, PHP 7.4.26, MariaDB 10.6.5 for example. Version must match the values found into doliwamp.iss)
|
||||
> Install GIT for Windows (https://git-scm.com/ => You must choose option "Add Git bash profile", "Git commit as-is")
|
||||
> Install Dolibarr current version:
|
||||
git clone https://github.com/dolibarr/dolibarr or git clone --branch X.Y https://github.com/dolibarr/dolibarr
|
||||
> Install Dolibarr current version:
|
||||
git clone https://github.com/dolibarr/dolibarr or git clone --branch X.Y https://github.com/dolibarr/dolibarr
|
||||
|
||||
> Add the path of PHP (C:\wamp64\bin\php\php7.4.26) and InnoSetup (C:\Program Files (x86)\Inno Setup 5) into the %PATH% of Windows.
|
||||
|
||||
@@ -45,11 +45,10 @@ Prerequisites to build autoexe DoliWamp package from Windows:
|
||||
|
||||
***** Actions to do a BETA *****
|
||||
|
||||
This files describe steps made by Dolibarr packaging team to make a
|
||||
beta version of Dolibarr, step by step.
|
||||
This section describes steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
@@ -70,8 +69,7 @@ Recopy the content of the output file into the file ChangeLog.
|
||||
|
||||
***** Actions to do a RELEASE *****
|
||||
|
||||
This files describe steps made by Dolibarr packaging team to make a
|
||||
complete release of Dolibarr, step by step.
|
||||
This section describes steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step.
|
||||
|
||||
- Check all files are commited.
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
@@ -87,9 +85,9 @@ Recopy the content of the output file into the file ChangeLog.
|
||||
|
||||
- Check content of built packages.
|
||||
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
dolibarr foundation server (Dir /home/dolibarr/wwwroot/files/stable on www.dolibarr.org).
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
- Run makepack-dolibarr.pl again with option to publish files on
|
||||
sourceforge. This will also add official tag.
|
||||
- Edit symbolic links in directory "/home/dolibarr/wwwroot/files/stable/xxx"
|
||||
on server to point to new files (used by some web sites).
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
.git
|
||||
.gitignore
|
||||
.scrutinizer.yml
|
||||
.travis.yml
|
||||
.vscode
|
||||
.idea
|
||||
.editorconfig
|
||||
.codeclimate.yml
|
||||
.pre-commit-config.yaml
|
||||
.mailmap
|
||||
Thumbs.db
|
||||
build/exe
|
||||
build/html
|
||||
|
||||
@@ -22,3 +22,9 @@ dolibarr*.deb
|
||||
dolibarr*.zip
|
||||
cvschangelogbuilder_dolibarr*
|
||||
dolibarr_install.log
|
||||
.travis.yml
|
||||
.vscode
|
||||
.idea
|
||||
.editorconfig
|
||||
.codeclimate.yml
|
||||
.pre-commit-config.yaml
|
||||
|
||||
@@ -31,7 +31,7 @@ Replace:
|
||||
d.items&&
|
||||
With
|
||||
d&&d.items&&
|
||||
|
||||
|
||||
|
||||
ESCPOS:
|
||||
-------
|
||||
@@ -55,8 +55,8 @@ NUSOAP:
|
||||
* Line 1257 of file nusoap.php. Add:
|
||||
|
||||
libxml_disable_entity_loader(true); // Avoid load of external entities (security problem). Required only for libxml < 2.
|
||||
|
||||
|
||||
|
||||
|
||||
* Line 4346 of file nusoap.php
|
||||
|
||||
$rev = array();
|
||||
@@ -128,30 +128,43 @@ with
|
||||
if (!@TCPDF_STATIC::file_exists($file)) {
|
||||
// DOL CHANGE If we keep this, the image is not visible on pages after the first one.
|
||||
//var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file)));
|
||||
//return false;
|
||||
//return false;
|
||||
$tfile = str_replace(' ', '%20', $file);
|
||||
if (@TCPDF_STATIC::file_exists($tfile)) {
|
||||
$file = $tfile;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
* Replace in tcpdf.php:
|
||||
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
if ($imgsrc[0] === '@') {
|
||||
// data stream
|
||||
$imgsrc = '@'.base64_decode(substr($imgsrc, 1));
|
||||
$type = '';
|
||||
} else {
|
||||
if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
with
|
||||
// @CHANGE LDR Add support for src="file://..." links
|
||||
if (strpos($imgsrc, 'file://') === 0) {
|
||||
$imgsrc = str_replace('file://', '/', $imgsrc);
|
||||
$imgsrc = urldecode($imgsrc);
|
||||
$testscrtype = @parse_url($imgsrc);
|
||||
if (empty($testscrtype['query'])) {
|
||||
// convert URL to server path
|
||||
$imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
|
||||
} elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
|
||||
// convert URL to server path
|
||||
$imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
|
||||
}
|
||||
}
|
||||
elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
$reg = array(); // @CHANGE DOL support 'data:' URLs (tcpdf backport https://github.com/tecnickcom/TCPDF/pull/552)
|
||||
if ($imgsrc[0] === '@') {
|
||||
// data stream
|
||||
$imgsrc = '@'.base64_decode(substr($imgsrc, 1));
|
||||
$type = '';
|
||||
} elseif (preg_match('@^data:image/([^;]*);base64,(.*)@', $imgsrc, $reg)) { // @CHANGE DOL support 'data:' URLs (tcpdf backport https://github.com/tecnickcom/TCPDF/pull/552)
|
||||
$imgsrc = '@'.base64_decode($reg[2]); // @CHANGE DOL support 'data:' URLs (tcpdf backport https://github.com/tecnickcom/TCPDF/pull/552)
|
||||
$type = $reg[1]; // @CHANGE DOL support 'data:' URLs (tcpdf backport https://github.com/tecnickcom/TCPDF/pull/552)
|
||||
} else {
|
||||
// @CHANGE LDR Add support for src="file://..." links
|
||||
if (strpos($imgsrc, 'file://') === 0) {
|
||||
$imgsrc = str_replace('file://', '/', $imgsrc);
|
||||
$imgsrc = urldecode($imgsrc);
|
||||
$testscrtype = @parse_url($imgsrc);
|
||||
if (empty($testscrtype['query'])) {
|
||||
// convert URL to server path
|
||||
$imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc);
|
||||
} elseif (preg_match('|^https?://|', $imgsrc) !== 1) {
|
||||
// convert URL to server path
|
||||
$imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc);
|
||||
}
|
||||
} elseif (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) {
|
||||
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static.php, in function fopenLocal, replace:
|
||||
@@ -174,7 +187,7 @@ with
|
||||
imagesetpixel($imgalpha, $xpx, $ypx, $alpha);
|
||||
into
|
||||
imagesetpixel($imgalpha, $xpx, $ypx, (int) $alpha);
|
||||
|
||||
|
||||
* Removed useless directories ("examples", "tools")
|
||||
|
||||
* Optionnaly, removed all fonts except
|
||||
@@ -243,7 +256,7 @@ with:
|
||||
with
|
||||
foreach ($value[1] as $k => $v) {
|
||||
|
||||
* Fix by replacing
|
||||
* Fix by replacing
|
||||
if ($res[0] == PDF_TYPE_OBJECT)
|
||||
with
|
||||
if (isset($res[0]) && $res[0] == PDF_TYPE_OBJECT)
|
||||
@@ -261,11 +274,11 @@ with
|
||||
|
||||
* Replace
|
||||
vTmpDiv=this.newNode(vTmpCell, 'div', null, null, vTaskList[i].getResource());
|
||||
with
|
||||
with
|
||||
var vTmpNode=this.newNode(vTmpCell, 'div', null, '');
|
||||
vTmpNode=this.newNode(vTmpNode, 'a', null, '', vLangs[vLang]['moreinfo']);
|
||||
vTmpNode.setAttribute('href',vTaskList[i].getLink());
|
||||
|
||||
|
||||
* Replace '% Comp.' to have a smaller text column header
|
||||
'comp':'% Comp.'
|
||||
with
|
||||
@@ -307,19 +320,19 @@ RESTLER:
|
||||
// @CHANGE LDR
|
||||
if (!is_string($haystack)) return false;
|
||||
|
||||
* Replace
|
||||
* Replace
|
||||
|
||||
$loaders = array_unique(static::$rogueLoaders);
|
||||
|
||||
with
|
||||
|
||||
|
||||
with
|
||||
|
||||
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
|
||||
|
||||
|
||||
* Replace CommentParser.php line 423
|
||||
elseif (count($value) && is_numeric($value[0]))
|
||||
|
||||
|
||||
with
|
||||
|
||||
|
||||
elseif (count($value) && isset($value[0]) && is_numeric($value[0]))
|
||||
|
||||
* Add CommentParser.php line 406 & 407 to remove a warning on api request in php 8.1
|
||||
@@ -417,5 +430,3 @@ Edit CSS to restore line removed between 4.0.5 and 4.0.6. It generates this bug:
|
||||
.select2-hidden-accessible {
|
||||
margin: -10000px !important; /* line to restore */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
||||
|
||||
<rule ref="Generic.Functions.CallTimePassByReference" />
|
||||
<!-- <rule ref="Generic.Functions.CallTimePassByReference" /> -->
|
||||
|
||||
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ $tablib[32] = "DictionaryAccountancyCategory";
|
||||
|
||||
// Requests to extract data
|
||||
$tabsql = array();
|
||||
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
|
||||
$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")";
|
||||
|
||||
// Criteria to sort dictionaries
|
||||
$tabsqlsort = array();
|
||||
@@ -99,11 +99,11 @@ $tabfield[32] = "code,label,range_account,category_type,formula,position,country
|
||||
|
||||
// Name of editing fields for record modification
|
||||
$tabfieldvalue = array();
|
||||
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
|
||||
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id,entity";
|
||||
|
||||
// Name of the fields in the table for inserting a record
|
||||
$tabfieldinsert = array();
|
||||
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
|
||||
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country,entity";
|
||||
|
||||
// Name of the rowid if the field is not of type autoincrement
|
||||
// Example: "" if id field is "rowid" and has autoincrement on
|
||||
@@ -903,7 +903,7 @@ if ($resql) {
|
||||
// Active
|
||||
print '<td class="center" class="nowrap">';
|
||||
if ($canbedisabled) {
|
||||
print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||
print '<a href="'.$url.'action='.$acts[$obj->active].'&token='.newToken().'">'.$actl[$obj->active].'</a>';
|
||||
} else {
|
||||
print $langs->trans("AlwaysActive");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2024 Alexandre Spangaro <aspangaro@easya.solutions>
|
||||
/* Copyright (C) 2013-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -123,7 +123,7 @@ if ($result) {
|
||||
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', 'fiscalyear_card.php?action=create', '', $user->hasRight('accounting', 'fiscalyear', 'write'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewFiscalYear'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/accountancy/admin/fiscalyear_card.php?action=create', '', $user->hasRight('accounting', 'fiscalyear', 'write'));
|
||||
}
|
||||
|
||||
$title = $langs->trans('AccountingPeriods');
|
||||
|
||||
@@ -197,6 +197,9 @@ if (empty($reshook)) {
|
||||
$filter['t.reconciled_option'] = $search_not_reconciled;
|
||||
$param .= '&search_not_reconciled='.urlencode($search_not_reconciled);
|
||||
}
|
||||
if (!empty($show_subgroup)) {
|
||||
$param .= '&show_subgroup='.urlencode($show_subgroup);
|
||||
}
|
||||
|
||||
// param with type of list
|
||||
$url_param = substr($param, 1); // remove first "&"
|
||||
@@ -302,7 +305,7 @@ if ($action != 'export_csv') {
|
||||
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' (' . getDolGlobalString('ACCOUNTING_EXPORT_FORMAT').')" />';
|
||||
$newcardbutton .= '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' (' . getDolGlobalString('ACCOUNTING_EXPORT_FORMAT').')" />';
|
||||
|
||||
print '<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
|
||||
@@ -349,7 +349,7 @@ if (empty($reshook)) {
|
||||
$listofaccountsforgroup2 = array();
|
||||
if (is_array($listofaccountsforgroup)) {
|
||||
foreach ($listofaccountsforgroup as $tmpval) {
|
||||
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'";
|
||||
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['account_number'])."'";
|
||||
}
|
||||
}
|
||||
$filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2);
|
||||
|
||||
@@ -337,7 +337,7 @@ if (empty($reshook)) {
|
||||
$listofaccountsforgroup2 = array();
|
||||
if (is_array($listofaccountsforgroup)) {
|
||||
foreach ($listofaccountsforgroup as $tmpval) {
|
||||
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'";
|
||||
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['account_number'])."'";
|
||||
}
|
||||
}
|
||||
$filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2);
|
||||
|
||||
@@ -292,7 +292,7 @@ if (empty($reshook)) {
|
||||
$listofaccountsforgroup2 = array();
|
||||
if (is_array($listofaccountsforgroup)) {
|
||||
foreach ($listofaccountsforgroup as $tmpval) {
|
||||
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['id'])."'";
|
||||
$listofaccountsforgroup2[] = "'".$db->escape($tmpval['account_number'])."'";
|
||||
}
|
||||
}
|
||||
$filter['t.search_accounting_code_in'] = join(',', $listofaccountsforgroup2);
|
||||
@@ -676,7 +676,7 @@ if ($reshook < 0) {
|
||||
$newcardbutton = empty($hookmanager->resPrint) ? '' : $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook)) {
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param);
|
||||
if ($type == 'sub') {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?' . $url_param, '', 1, array('morecss' => 'marginleftonly'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('GroupBySubAccountAccounting'), '', 'fa fa-align-left vmirror paddingleft imgforviewmode', DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&' . $url_param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected'));
|
||||
@@ -976,6 +976,21 @@ $totalarray['val']['totaldebit'] = 0;
|
||||
$totalarray['val']['totalcredit'] = 0;
|
||||
$totalarray['val']['totalbalance']=0;
|
||||
|
||||
$colspan = 0; // colspan before field 'label of operation'
|
||||
$colspanend = 3; // colspan after debit/credit
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
$colspan++;
|
||||
$colspanend--;
|
||||
}
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
$line = $object->lines[$i];
|
||||
|
||||
@@ -1104,8 +1119,6 @@ while ($i < min($num, $limit)) {
|
||||
//if (empty($displayed_account_number)) $displayed_account_number='-';
|
||||
$sous_total_debit = 0;
|
||||
$sous_total_credit = 0;
|
||||
|
||||
$colspan = 0;
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@@ -968,7 +968,7 @@ class AccountancyExport
|
||||
|
||||
// We need to keep the 10 lastest number of invoice doc_ref not the beginning part that is the unusefull almost same part
|
||||
// $tab['num_piece3'] = str_pad(self::trunc($line->piece_num, 10), 10);
|
||||
$tab['num_piece3'] = substr(self::trunc($line->doc_ref, 20), -10);
|
||||
$tab['num_piece3'] = str_pad(substr(self::trunc($line->doc_ref, 20), -10), 10);
|
||||
$tab['reserved'] = str_repeat(' ', 10); // position 159
|
||||
$tab['currency_amount'] = str_repeat(' ', 13); // position 169
|
||||
// get document file
|
||||
|
||||
@@ -113,12 +113,12 @@ class AccountancyImport
|
||||
|
||||
|
||||
/**
|
||||
* Compute direction
|
||||
* Compute direction
|
||||
*
|
||||
* @param array $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]...
|
||||
* @param array $listfields Fields list to add
|
||||
* @param int $record_key Record key
|
||||
* @return mixed Value
|
||||
* @return string Value D or C or ""
|
||||
*/
|
||||
public function computeDirection(&$arrayrecord, $listfields, $record_key)
|
||||
{
|
||||
@@ -132,9 +132,9 @@ class AccountancyImport
|
||||
$sens = 'C';
|
||||
}
|
||||
|
||||
return "'" . $this->db->escape($sens) . "'";
|
||||
return $sens;
|
||||
}
|
||||
|
||||
return "''";
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2015-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 Jose MARTINEZ <jose.martinez@pichinov.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,6 +27,7 @@
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
@@ -327,7 +329,7 @@ class BookKeeping extends CommonObject
|
||||
$this->piece_num = 0;
|
||||
|
||||
// First check if line not yet already in bookkeeping.
|
||||
// Note that we must include 'doc_type - fk_doc - numero_compte - label' to be sure to have unicity of line (because we may have several lines
|
||||
// Note that we must include 'doc_type - fk_doc - numero_compte - label - subledger_account (if not empty)' to be sure to have unicity of line (because we may have several lines
|
||||
// with same doc_type, fk_doc, numero_compte for 1 invoice line when using localtaxes with same account)
|
||||
// WARNING: This is not reliable, label may have been modified. This is just a small protection.
|
||||
// The page that make transfer make the test on couple (doc_type - fk_doc) only.
|
||||
@@ -341,6 +343,9 @@ class BookKeeping extends CommonObject
|
||||
}
|
||||
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
|
||||
if (!empty($this->subledger_account)) {
|
||||
$sql .= " AND subledger_account = '".$this->db->escape($this->subledger_account)."'";
|
||||
}
|
||||
$sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -1008,7 +1013,7 @@ class BookKeeping extends CommonObject
|
||||
$line->multicurrency_amount = $obj->multicurrency_amount;
|
||||
$line->multicurrency_code = $obj->multicurrency_code;
|
||||
$line->lettering_code = $obj->lettering_code;
|
||||
$line->date_lettering = $obj->date_lettering;
|
||||
$line->date_lettering = $this->db->jdate($obj->date_lettering);
|
||||
$line->fk_user_author = $obj->fk_user_author;
|
||||
$line->import_key = $obj->import_key;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
@@ -1109,7 +1114,7 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} elseif ($key == 't.code_journal' && !empty($value)) {
|
||||
if (is_array($value)) {
|
||||
$sqlwhere[] = natural_search("t.code_journal", join(',', $value), 3, 1);
|
||||
$sqlwhere[] = natural_search("t.code_journal", (string) join(',', $value), 3, 1);
|
||||
} else {
|
||||
$sqlwhere[] = natural_search("t.code_journal", $value, 3, 1);
|
||||
}
|
||||
@@ -1160,7 +1165,7 @@ class BookKeeping extends CommonObject
|
||||
$line->amount = $obj->amount;
|
||||
$line->sens = $obj->sens;
|
||||
$line->lettering_code = $obj->lettering_code;
|
||||
$line->date_lettering = $obj->date_lettering;
|
||||
$line->date_lettering = $this->db->jdate($obj->date_lettering);
|
||||
$line->fk_user_author = $obj->fk_user_author;
|
||||
$line->import_key = $obj->import_key;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
@@ -1455,6 +1460,7 @@ class BookKeeping extends CommonObject
|
||||
*/
|
||||
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
$error = 0;
|
||||
|
||||
$sql_filter = $this->getCanModifyBookkeepingSQL();
|
||||
@@ -1467,6 +1473,7 @@ class BookKeeping extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||
$sql .= " SET ".$field." = ".(is_numeric($value) ? ((float) $value) : "'".$this->db->escape($value)."'");
|
||||
$sql .= " WHERE piece_num = ".((int) $piece_num);
|
||||
$sql .= " AND entity = " . ((int) $conf->entity);
|
||||
$sql .= $sql_filter;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2251,7 +2258,7 @@ class BookKeeping extends CommonObject
|
||||
dol_syslog(get_class($this)."::select_account", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = '';
|
||||
$obj = (object) array('label' => '');
|
||||
if ($this->db->num_rows($resql)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
}
|
||||
@@ -2692,10 +2699,8 @@ class BookKeeping extends CommonObject
|
||||
|
||||
$sql = 'SELECT';
|
||||
$sql .= " t.numero_compte,";
|
||||
$sql .= " t.label_compte,";
|
||||
if ($separate_auxiliary_account) {
|
||||
$sql .= " t.subledger_account,";
|
||||
$sql .= " t.subledger_label,";
|
||||
$sql .= " NULLIF(t.subledger_account, '') as subledger_account,"; // fix db issues with Null or "" values
|
||||
}
|
||||
$sql .= " aa.pcg_type,";
|
||||
$sql .= " (SUM(t.credit) - SUM(t.debit)) as opening_balance";
|
||||
@@ -2707,10 +2712,11 @@ class BookKeeping extends CommonObject
|
||||
$sql .= ' AND aa.pcg_type IN (' . $this->db->sanitize(implode(',', $pcg_type_filter), 1) . ')';
|
||||
$sql .= " AND DATE(t.doc_date) >= '" . $this->db->idate($fiscal_period->date_start) . "'";
|
||||
$sql .= " AND DATE(t.doc_date) <= '" . $this->db->idate($fiscal_period->date_end) . "'";
|
||||
$sql .= ' GROUP BY t.numero_compte, t.label_compte, aa.pcg_type';
|
||||
$sql .= ' GROUP BY t.numero_compte, aa.pcg_type';
|
||||
if ($separate_auxiliary_account) {
|
||||
$sql .= ' ,t.subledger_account, t.subledger_label';
|
||||
$sql .= " , NULLIF(t.subledger_account, '')";
|
||||
}
|
||||
$sql .= ' HAVING (SUM(t.credit) - SUM(t.debit)) != 0 '; // Exclude rows with opening_balance = 0
|
||||
$sql .= $this->db->order("t.numero_compte", "ASC");
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@@ -2732,23 +2738,38 @@ class BookKeeping extends CommonObject
|
||||
$bookkeeping = new BookKeeping($this->db);
|
||||
$bookkeeping->doc_date = $new_fiscal_period->date_start;
|
||||
$bookkeeping->date_lim_reglement = '';
|
||||
$bookkeeping->doc_ref = $new_fiscal_period->label;
|
||||
$bookkeeping->doc_ref = $fiscal_period->label;
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'closure';
|
||||
$bookkeeping->fk_doc = $new_fiscal_period->id;
|
||||
$bookkeeping->fk_doc = $fiscal_period->id;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = '';
|
||||
|
||||
if ($separate_auxiliary_account) {
|
||||
$bookkeeping->subledger_account = $obj->subledger_account;
|
||||
$bookkeeping->subledger_label = $obj->subledger_label;
|
||||
$sql = 'SELECT';
|
||||
$sql .= " subledger_label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||
$sql .= " WHERE subledger_account = '" . $this->db->escape($obj->subledger_account) . "'";
|
||||
$sql .= " ORDER BY doc_date DESC";
|
||||
$sql .= " LIMIT 1";
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$this->errors[] = 'Error: ' . $this->db->lasterror();
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
$objtmp = $this->db->fetch_object($result);
|
||||
$bookkeeping->subledger_label = $objtmp->subledger_label; // latest subledger label used
|
||||
} else {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->subledger_account = null;
|
||||
$bookkeeping->subledger_label = null;
|
||||
}
|
||||
|
||||
$bookkeeping->numero_compte = $obj->numero_compte;
|
||||
$bookkeeping->label_compte = $obj->label_compte;
|
||||
$accountingaccount = new AccountingAccount($this->db);
|
||||
$accountingaccount->fetch('', $obj->numero_compte);
|
||||
$bookkeeping->label_compte = $accountingaccount->label; // latest account label used
|
||||
|
||||
$bookkeeping->label_operation = $new_fiscal_period->label;
|
||||
$bookkeeping->montant = $mt;
|
||||
@@ -2779,20 +2800,32 @@ class BookKeeping extends CommonObject
|
||||
$bookkeeping = new BookKeeping($this->db);
|
||||
$bookkeeping->doc_date = $new_fiscal_period->date_start;
|
||||
$bookkeeping->date_lim_reglement = '';
|
||||
$bookkeeping->doc_ref = $new_fiscal_period->label;
|
||||
$bookkeeping->doc_ref = $fiscal_period->label;
|
||||
$bookkeeping->date_creation = $now;
|
||||
$bookkeeping->doc_type = 'closure';
|
||||
$bookkeeping->fk_doc = $new_fiscal_period->id;
|
||||
$bookkeeping->fk_doc = $fiscal_period->id;
|
||||
$bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add
|
||||
$bookkeeping->thirdparty_code = '';
|
||||
|
||||
if ($separate_auxiliary_account) {
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->subledger_account = $obj->subledger_account;
|
||||
$bookkeeping->subledger_label = $obj->subledger_label;
|
||||
$sql = 'SELECT';
|
||||
$sql .= " subledger_label";
|
||||
$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
|
||||
$sql .= " WHERE subledger_account = '" . $this->db->escape($obj->subledger_account) . "'";
|
||||
$sql .= " ORDER BY doc_date DESC";
|
||||
$sql .= " LIMIT 1";
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$this->errors[] = 'Error: ' . $this->db->lasterror();
|
||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
$objtmp = $this->db->fetch_object($result);
|
||||
$bookkeeping->subledger_label = $objtmp->subledger_label ?? null; // latest subledger label used
|
||||
} else {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->subledger_account = null;
|
||||
$bookkeeping->subledger_label = null;
|
||||
}
|
||||
|
||||
$bookkeeping->numero_compte = $accountingaccount->account_number;
|
||||
|
||||
@@ -586,7 +586,7 @@ class Lettering extends BookKeeping
|
||||
|
||||
$grouped_lines = array();
|
||||
foreach (self::$doc_type_infos as $doc_type => $doc_type_info) {
|
||||
if (!is_array($bookkeeping_lines_by_type[$doc_type])) {
|
||||
if (empty($bookkeeping_lines_by_type[$doc_type]) || !is_array($bookkeeping_lines_by_type[$doc_type])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -361,29 +361,32 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice
|
||||
}
|
||||
*/
|
||||
// New way, single query, load all unbound lines
|
||||
$sql = "
|
||||
SELECT
|
||||
fk_facture_fourn,
|
||||
COUNT(fd.rowid) as nb
|
||||
FROM
|
||||
llx_facture_fourn_det as fd
|
||||
WHERE
|
||||
fd.product_type <= 2
|
||||
AND fd.fk_code_ventilation <= 0
|
||||
AND fd.total_ttc <> 0
|
||||
AND fk_facture_fourn IN (".$db->sanitize(join(",", array_keys($tabfac))).")
|
||||
GROUP BY fk_facture_fourn
|
||||
";
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj->nb > 0) {
|
||||
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
|
||||
if (!empty($tabfac)) {
|
||||
$sql = "
|
||||
SELECT
|
||||
fk_facture_fourn,
|
||||
COUNT(fd.rowid) as nb
|
||||
FROM
|
||||
llx_facture_fourn_det as fd
|
||||
WHERE
|
||||
fd.product_type <= 2
|
||||
AND fd.fk_code_ventilation <= 0
|
||||
AND fd.total_ttc <> 0
|
||||
AND fk_facture_fourn IN (".$db->sanitize(join(",", array_keys($tabfac))).")
|
||||
GROUP BY fk_facture_fourn
|
||||
";
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj->nb > 0) {
|
||||
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
//var_dump($errorforinvoice);exit;
|
||||
|
||||
|
||||
@@ -225,6 +225,14 @@ if ($result) {
|
||||
$vatdata = $vatdata_cache[$tax_id];
|
||||
} else {
|
||||
$vatdata = getTaxesFromId($tax_id, $mysoc, $mysoc, 0);
|
||||
if (getDolGlobalString('SERVICE_ARE_ECOMMERCE_200238EC')) {
|
||||
$buyer = new Societe($db);
|
||||
$buyer->fetch($obj->socid);
|
||||
} else {
|
||||
$buyer = null; // We don't need the buyer in this case
|
||||
}
|
||||
$seller = $mysoc;
|
||||
$vatdata = getTaxesFromId($tax_id, $buyer, $seller, 0);
|
||||
$vatdata_cache[$tax_id] = $vatdata;
|
||||
}
|
||||
$compta_tva = (!empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
|
||||
@@ -382,29 +390,31 @@ foreach ($tabfac as $key => $val) { // Loop on each invoice
|
||||
*/
|
||||
// New way, single query, load all unbound lines
|
||||
|
||||
$sql = "
|
||||
SELECT
|
||||
fk_facture,
|
||||
COUNT(fd.rowid) as nb
|
||||
FROM
|
||||
".MAIN_DB_PREFIX."facturedet as fd
|
||||
WHERE
|
||||
fd.product_type <= 2
|
||||
AND fd.fk_code_ventilation <= 0
|
||||
AND fd.total_ttc <> 0
|
||||
AND fk_facture IN (".$db->sanitize(join(",", array_keys($tabfac))).")
|
||||
GROUP BY fk_facture
|
||||
";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj->nb > 0) {
|
||||
$errorforinvoice[$obj->fk_facture_fourn] = 'somelinesarenotbound';
|
||||
if (!empty($tabfac)) {
|
||||
$sql = "
|
||||
SELECT
|
||||
fk_facture,
|
||||
COUNT(fd.rowid) as nb
|
||||
FROM
|
||||
".MAIN_DB_PREFIX."facturedet as fd
|
||||
WHERE
|
||||
fd.product_type <= 2
|
||||
AND fd.fk_code_ventilation <= 0
|
||||
AND fd.total_ttc <> 0
|
||||
AND fk_facture IN (".$db->sanitize(join(",", array_keys($tabfac))).")
|
||||
GROUP BY fk_facture
|
||||
";
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj->nb > 0) {
|
||||
$errorforinvoice[$obj->fk_facture] = 'somelinesarenotbound';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
//var_dump($errorforinvoice);exit;
|
||||
|
||||
@@ -225,7 +225,7 @@ if (getDolGlobalString('MEMBER_ENABLE_PUBLIC')) {
|
||||
print '<tr class="oddeven drag" id="trforcenature"><td>';
|
||||
print $langs->trans("ForceMemberNature");
|
||||
print '</td><td>';
|
||||
$forcenature = getDolGlobalInt('MEMBER_NEWFORM_FORCEMORPHY', 0);
|
||||
$forcenature = getDolGlobalString('MEMBER_NEWFORM_FORCEMORPHY'); // 'phy' or 'mor'
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCEMORPHY", $morphys, $forcenature, 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
@@ -358,7 +358,13 @@ class Members extends DolibarrApi
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$member->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$member->array_options[$index] = $this->_checkValForAPI($field, $val, $member);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$member->$field = $this->_checkValForAPI($field, $value, $member);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -202,10 +202,15 @@ class MembersTypes extends DolibarrApi
|
||||
$membertype->context['caller'] = $request_data['caller'];
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$membertype->array_options[$index] = $this->_checkValForAPI($field, $val, $membertype);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
// Process the status separately because it must be updated using
|
||||
// the validate(), resiliate() and exclude() methods of the class AdherentType.
|
||||
$membertype->$field = $value;
|
||||
$membertype->$field = $this->_checkValForAPI($field, $value, $membertype);
|
||||
}
|
||||
|
||||
// If there is no error, update() returns the number of affected rows
|
||||
|
||||
@@ -196,7 +196,13 @@ class Subscriptions extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$subscription->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$subscription->array_options[$index] = $this->_checkValForAPI($field, $val, $subscription);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$subscription->$field = $this->_checkValForAPI($field, $value, $subscription);
|
||||
}
|
||||
|
||||
if ($subscription->update(DolibarrApiAccess::$user) > 0) {
|
||||
|
||||
@@ -2114,6 +2114,11 @@ if ($id > 0) {
|
||||
$canbemodified = 1;
|
||||
}
|
||||
|
||||
if ($tabname[$id] == "c_product_nature" && in_array($obj->code, array(0, 1))) {
|
||||
$canbedisabled = 0;
|
||||
$canbemodified = 0;
|
||||
$iserasable = 0;
|
||||
}
|
||||
// Build Url. The table is id=, the id of line is rowid=
|
||||
$rowidcol = empty($tabrowid[$id]) ? 'rowid' : $tabrowid[$id];
|
||||
// If rowidcol not defined
|
||||
|
||||
@@ -43,7 +43,7 @@ if (!$user->admin) {
|
||||
|
||||
$usersignature = $user->signature;
|
||||
// For action = test or send, we ensure that content is not html, even for signature, because for this we want a test with NO html.
|
||||
if ($action == 'test' || ($action == 'send' && $trackid = 'test')) {
|
||||
if ($action == 'test' || ($action == 'send' && $trackid == 'test')) {
|
||||
$usersignature = dol_string_nohtmltag($usersignature, 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -1103,6 +1103,10 @@ if ($num) {
|
||||
if (getDolGlobalString('MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES')) {
|
||||
$fieldsforcontent[] = 'content_lines';
|
||||
}
|
||||
|
||||
$parameters = array('fieldsforcontent' => &$fieldsforcontent, 'tabname' => $tabname[$id]);
|
||||
$hookmanager->executeHooks('editEmailTemplateFieldsForContent', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
foreach ($fieldsforcontent as $tmpfieldlist) {
|
||||
$showfield = 1;
|
||||
$css = "left";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2023 Juanjo Menent <jmenent@2byte.es>
|
||||
@@ -267,6 +267,30 @@ if ($action == 'install' && $allowonlineinstall) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (!$error) {
|
||||
if (GETPOST('checkforcompliance')) {
|
||||
$dir = $dirins;
|
||||
$file = $modulenameval;
|
||||
// $installedmodule
|
||||
try {
|
||||
$res = include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error.
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
if ($modName) {
|
||||
if (class_exists($modName)) {
|
||||
$objMod = new $modName($db);
|
||||
'@phan-var-force DolibarrModules $objMod';
|
||||
|
||||
//var_dump($objMod);
|
||||
}
|
||||
}
|
||||
} catch(Exception $e) {
|
||||
// Nothing done
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupIsReadyForUse", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules")), null, 'warnings');
|
||||
}
|
||||
@@ -837,11 +861,19 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
|| getDolGlobalString('CHECKLASTVERSION_EXTERNALMODULE')
|
||||
)
|
||||
) {
|
||||
$checkRes = $objMod->checkForUpdate();
|
||||
$checkRes = $objMod->checkForUpdate(); // Check for update version
|
||||
if ($checkRes > 0) {
|
||||
setEventMessage($objMod->getName().' : '.$versiontrans.' -> '.$objMod->lastVersion);
|
||||
} elseif ($checkRes < 0) {
|
||||
setEventMessage($objMod->getName().' '.$langs->trans('CheckVersionFail'), 'warnings');
|
||||
setEventMessage($objMod->getName().': '.$langs->trans('CheckVersionFail'), 'warnings');
|
||||
}
|
||||
}
|
||||
|
||||
if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
|
||||
$checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law
|
||||
if (!is_numeric($checkRes) && $checkRes != '') {
|
||||
$langs->load("errors");
|
||||
setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1305,7 +1337,7 @@ if ($mode == 'deploy') {
|
||||
$(document).ready(function() {
|
||||
jQuery("#fileinstall").on("change", function() {
|
||||
if(this.files[0].size > '.($maxmin * 1024).') {
|
||||
alert("'.dol_escape_js($langs->trans("ErrorFileSizeTooLarge")).'");
|
||||
alert("'.dol_escape_js($langs->transnoentitiesnoconv("ErrorFileSizeTooLarge")).'");
|
||||
this.value = "";
|
||||
}
|
||||
});
|
||||
|
||||
@@ -104,7 +104,9 @@ if ($action == "set") {
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
}
|
||||
} elseif (!$error) {
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.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
|
||||
@@ -197,14 +198,6 @@ class DolibarrApi
|
||||
unset($object->stats_mrptoconsume);
|
||||
unset($object->stats_mrptoproduce);
|
||||
|
||||
unset($object->element);
|
||||
unset($object->element_for_permission);
|
||||
unset($object->fk_element);
|
||||
unset($object->table_element);
|
||||
unset($object->table_element_line);
|
||||
unset($object->class_element_line);
|
||||
unset($object->picto);
|
||||
|
||||
unset($object->fieldsforcombobox);
|
||||
unset($object->regeximgext);
|
||||
|
||||
@@ -225,10 +218,18 @@ class DolibarrApi
|
||||
|
||||
unset($object->prefix_comm);
|
||||
|
||||
if (!isset($object->table_element) || $object->table_element != 'ticket') {
|
||||
if (!isset($object->table_element) || ! in_array($object->table_element, array('expensereport_det', 'ticket'))) {
|
||||
unset($object->comments);
|
||||
}
|
||||
|
||||
unset($object->element);
|
||||
unset($object->element_for_permission);
|
||||
unset($object->fk_element);
|
||||
unset($object->table_element);
|
||||
unset($object->table_element_line);
|
||||
unset($object->class_element_line);
|
||||
unset($object->picto);
|
||||
|
||||
// Remove the $oldcopy property because it is not supported by the JSON
|
||||
// encoder. The following error is generated when trying to serialize
|
||||
// it: "Error encoding/decoding JSON: Type is not supported"
|
||||
|
||||
@@ -87,7 +87,7 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
public function __isAllowed()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db, $user;
|
||||
global $conf, $db, $langs, $mysoc, $user;
|
||||
|
||||
$login = '';
|
||||
$stored_key = '';
|
||||
@@ -138,6 +138,56 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
// We must also reload global conf to get params from the entity
|
||||
dol_syslog("Entity was not set on http header with HTTP_DOLAPIENTITY (recommanded for performance purpose), so we switch now on entity of user (".$conf->entity.") and we have to reload configuration.", LOG_WARNING);
|
||||
$conf->setValues($this->db);
|
||||
|
||||
// set global mysoc after setting conf entity (the entity can be changed with the user logged)
|
||||
// see master.inc.php
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$fmysoc = new Societe($db);
|
||||
$fmysoc->setMysoc($conf);
|
||||
|
||||
// We set some specific default values according to country
|
||||
if ($fmysoc->country_code == 'DE' && !isset($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
|
||||
// For DE, we need to invert our address with customer address
|
||||
$conf->global->MAIN_INVERT_SENDER_RECIPIENT = 1;
|
||||
}
|
||||
if ($fmysoc->country_code == 'FR' && !isset($conf->global->INVOICE_CATEGORY_OF_OPERATION)) {
|
||||
// For FR, default value of option to show category of operations is on by default. Decret n°2099-1299 2022-10-07
|
||||
$conf->global->INVOICE_CATEGORY_OF_OPERATION = 1;
|
||||
}
|
||||
if ($fmysoc->country_code == 'FR' && !isset($conf->global->INVOICE_DISABLE_REPLACEMENT)) {
|
||||
// For FR, the replacement invoice type is not allowed.
|
||||
// From an accounting point of view, this creates holes in the numbering of the invoice.
|
||||
// This is very problematic during a fiscal control.
|
||||
$conf->global->INVOICE_DISABLE_REPLACEMENT = 1;
|
||||
}
|
||||
if ($fmysoc->country_code == 'GR' && !isset($conf->global->INVOICE_DISABLE_REPLACEMENT)) {
|
||||
// The replacement invoice type is not allowed in Greece.
|
||||
$conf->global->INVOICE_DISABLE_REPLACEMENT = 1;
|
||||
}
|
||||
if ($fmysoc->country_code == 'GR' && !isset($conf->global->INVOICE_DISABLE_DEPOSIT)) {
|
||||
// The deposit invoice type is not allowed in Greece.
|
||||
$conf->global->INVOICE_DISABLE_DEPOSIT = 1;
|
||||
}
|
||||
|
||||
if (($fmysoc->localtax1_assuj || $fmysoc->localtax2_assuj) && !isset($conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX)) {
|
||||
// For countries using the 2nd or 3rd tax, we disable input/edit of lines using the price including tax (because 2nb and 3rd tax not yet taken into account).
|
||||
// Work In Progress to support all taxes into unit price entry when MAIN_UNIT_PRICE_WITH_TAX_IS_FOR_ALL_TAXES is set.
|
||||
$conf->global->MAIN_NO_INPUT_PRICE_WITH_TAX = 1;
|
||||
}
|
||||
// Set also the global variable $mysoc
|
||||
$mysoc = $fmysoc;
|
||||
|
||||
// Reload langs
|
||||
$langcode = (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT);
|
||||
if (!empty($user->conf->MAIN_LANG_DEFAULT)) {
|
||||
$langcode = $user->conf->MAIN_LANG_DEFAULT;
|
||||
}
|
||||
if ($langs->getDefaultLang() != $langcode) {
|
||||
$langs->setDefaultLang($langcode);
|
||||
$langs->tab_translate = array();
|
||||
$langs->loadLangs(array('main'));
|
||||
}
|
||||
}
|
||||
} elseif ($nbrows > 1) {
|
||||
throw new RestException(503, 'Error when fetching user api_key : More than 1 user with this apikey');
|
||||
@@ -168,7 +218,7 @@ class DolibarrApiAccess implements iAuthenticate
|
||||
}
|
||||
|
||||
// Check if user status is enabled
|
||||
if ($fuser->statut != $fuser::STATUS_ENABLED) {
|
||||
if ($fuser->status != $fuser::STATUS_ENABLED) {
|
||||
// Status is disabled
|
||||
dol_syslog("functions_isallowed::check_user_api_key Authentication KO for '".$login."': The user has been disabled", LOG_NOTICE);
|
||||
sleep(1); // Anti brut force protection. Must be same delay when user and password are not valid.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2023 Romain Neil <contact@romain-neil.fr>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.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
|
||||
@@ -497,7 +498,7 @@ class Documents extends DolibarrApi
|
||||
} elseif ($modulepart == 'expensereport') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->expensereport->read && !DolibarrApiAccess::$user->rights->expensereport->read) {
|
||||
if (!DolibarrApiAccess::$user->rights->expensereport->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
|
||||
@@ -2130,7 +2130,7 @@ class Setup extends DolibarrApi
|
||||
|
||||
// Define qualified files (must be same than into generate_filelist_xml.php and in api_setup.class.php)
|
||||
$regextoinclude = '\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
|
||||
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$regextoexclude = '('.($includecustom ? '' : 'custom|').'documents|escpos-php\/doc|conf|install|dejavu-fonts-ttf-.*|public\/test|sabre\/sabre\/.*\/tests|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
|
||||
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
|
||||
|
||||
// Fill file_list with files in signature, new files, modified files
|
||||
|
||||
@@ -434,4 +434,50 @@ if (Luracast\Restler\Defaults::$returnResponse) {
|
||||
echo $result;
|
||||
}
|
||||
|
||||
if (getDolGlobalInt("API_ENABLE_COUNT_CALLS") && $api->r->responseCode == 200) {
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
$userid = DolibarrApiAccess::$user->id;
|
||||
|
||||
$sql = "SELECT up.value";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user_param as up";
|
||||
$sql .= " WHERE up.param = 'API_COUNT_CALL'";
|
||||
$sql .= " AND up.fk_user = ".((int) $userid);
|
||||
$sql .= " AND up.entity = ".((int) $conf->entity);
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$updateapi = false;
|
||||
$nbrows = $db->num_rows($result);
|
||||
if ($nbrows == 0) {
|
||||
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."user_param";
|
||||
$sql2 .= " (fk_user, entity, param, value)";
|
||||
$sql2 .= " VALUES (".((int) $userid).", ".((int) $conf->entity).", 'API_COUNT_CALL', 1)";
|
||||
} else {
|
||||
$updateapi = true;
|
||||
$sql2 = "UPDATE ".MAIN_DB_PREFIX."user_param as up";
|
||||
$sql2 .= " SET up.value = up.value + 1";
|
||||
$sql2 .= " WHERE up.param = 'API_COUNT_CALL'";
|
||||
$sql2 .= " AND up.fk_user = ".((int) $userid);
|
||||
$sql2 .= " AND up.entity = ".((int) $conf->entity);
|
||||
}
|
||||
|
||||
$result2 = $db->query($sql2);
|
||||
if (!$result2) {
|
||||
$modeapicall = $updateapi ? 'updating' : 'inserting';
|
||||
dol_syslog('Error while '.$modeapicall. ' API_COUNT_CALL for user '.$userid, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
dol_syslog('Error on select API_COUNT_CALL for user '.$userid, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
}
|
||||
|
||||
//session_destroy();
|
||||
|
||||
@@ -279,9 +279,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$disposal_type_form = $object->showInputField(null, 'fk_disposal_type', $fk_disposal_type, '', '', '', 0);
|
||||
$object->fields['fk_disposal_type']['visible'] = -2;
|
||||
|
||||
$object->fields['disposal_invoice_id'] = array('type' => 'integer:Facture:compta/facture/class/facture.class.php::entity IN (__SHARED_ENTITIES__)', 'enabled' => '1', 'notnull' => 1, 'visible' => 1, 'index' => 1, 'validate' => '1',);
|
||||
$disposal_invoice_form = $object->showInputField(null, 'disposal_invoice_id', $disposal_invoice_id, '', '', '', 0);
|
||||
unset($object->fields['disposal_invoice_id']);
|
||||
$disposal_invoice_form = $form->selectForForms('Facture:compta/facture/class/facture.class.php::(entity:IN:__SHARED_ENTITIES__)', 'disposal_invoice_id', $disposal_invoice_id);
|
||||
|
||||
// Create an array for form
|
||||
$formquestion = array(
|
||||
|
||||
@@ -939,13 +939,12 @@ class Asset extends CommonObject
|
||||
}
|
||||
|
||||
// Delete old lines
|
||||
$sql = "DELETE " . MAIN_DB_PREFIX . "asset_depreciation FROM " . MAIN_DB_PREFIX . "asset_depreciation";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab ON ab.doc_type = 'asset' AND ab.fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid";
|
||||
$sql .= " WHERE " . MAIN_DB_PREFIX . "asset_depreciation.fk_asset = " . (int) $this->id;
|
||||
$sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.depreciation_mode = '" . $this->db->escape($mode_key) . "'";
|
||||
$sql .= " AND ab.fk_docdet IS NULL";
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "asset_depreciation";
|
||||
$sql .= " WHERE fk_asset = " . (int) $this->id;
|
||||
$sql .= " AND depreciation_mode = '" . $this->db->escape($mode_key) . "'";
|
||||
$sql .= " AND NOT EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset' AND fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid)";
|
||||
if ($last_depreciation_date !== "") {
|
||||
$sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.ref != ''";
|
||||
$sql .= " AND ref <> ''";
|
||||
}
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
@@ -1010,9 +1009,9 @@ class Asset extends CommonObject
|
||||
|
||||
// futures depreciation lines
|
||||
//-----------------------------------------------------
|
||||
$nb_days_in_year = getDolGlobalString('ASSET_DEPRECIATION_DURATION_PER_YEAR') ? $conf->global->ASSET_DEPRECIATION_DURATION_PER_YEAR : 365;
|
||||
$nb_days_in_month = getDolGlobalString('ASSET_DEPRECIATION_DURATION_PER_MONTH') ? $conf->global->ASSET_DEPRECIATION_DURATION_PER_MONTH : 30;
|
||||
$period_amount = (float) price2num($depreciation_period_amount / $fields['duration'], 'MT');
|
||||
$nb_days_in_year = getDolGlobalInt('ASSET_DEPRECIATION_DURATION_PER_YEAR', 365);
|
||||
$nb_days_in_month = getDolGlobalInt('ASSET_DEPRECIATION_DURATION_PER_MONTH', 30);
|
||||
$period_amount = (float) ($fields['duration'] > 0 ? price2num($depreciation_period_amount / $fields['duration'], 'MT') : 0);
|
||||
$first_period_found = false;
|
||||
// TODO fix declaration of $begin_period
|
||||
// @phpstan-ignore-next-line
|
||||
|
||||
@@ -165,7 +165,7 @@ class AssetDepreciationOptions extends CommonObject
|
||||
// Unset required option (notnull) if field disabled
|
||||
if (!empty($field_info['enabled_field'])) {
|
||||
$info = explode(':', $field_info['enabled_field']);
|
||||
if ($this->deprecation_options[$info[0]][$info[1]] != $info[2] && isset($this->fields[$field_key]['notnull'])) {
|
||||
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $this->deprecation_options[$info[0]][$info[1]] != $info[2] && isset($this->fields[$field_key]['notnull'])) {
|
||||
unset($this->fields[$field_key]['notnull']);
|
||||
}
|
||||
}
|
||||
@@ -285,7 +285,7 @@ class AssetDepreciationOptions extends CommonObject
|
||||
foreach ($this->deprecation_options_fields as $mode_key => $mode_info) {
|
||||
if (!empty($mode_info['enabled_field'])) {
|
||||
$info = explode(':', $mode_info['enabled_field']);
|
||||
if ($deprecation_options[$info[0]][$info[1]] != $info[2]) {
|
||||
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $deprecation_options[$info[0]][$info[1]] != $info[2]) {
|
||||
unset($deprecation_options[$info[0]][$info[1]]);
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ class AssetDepreciationOptions extends CommonObject
|
||||
foreach ($this->deprecation_options_fields as $mode_key => $mode_info) {
|
||||
if (!empty($mode_info['enabled_field'])) {
|
||||
$info = explode(':', $mode_info['enabled_field']);
|
||||
if ($deprecation_options[$info[0]][$info[1]] != $info[2]) {
|
||||
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $deprecation_options[$info[0]][$info[1]] != $info[2]) {
|
||||
unset($deprecation_options[$info[0]][$info[1]]);
|
||||
}
|
||||
}
|
||||
@@ -471,7 +471,7 @@ class AssetDepreciationOptions extends CommonObject
|
||||
if (!$error && !empty($this->deprecation_options[$mode_key])) {
|
||||
if (!empty($mode_info['enabled_field'])) {
|
||||
$info = explode(':', $mode_info['enabled_field']);
|
||||
if ($this->deprecation_options[$info[0]][$info[1]] != $info[2]) {
|
||||
if (!empty($this->deprecation_options[$info[0]][$info[1]]) && $this->deprecation_options[$info[0]][$info[1]] != $info[2]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,7 +251,13 @@ class Boms extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->bom->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->bom->array_options[$index] = $this->_checkValForAPI($field, $val, $this->bom);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->bom->$field = $this->_checkValForAPI($field, $value, $this->bom);
|
||||
}
|
||||
|
||||
$this->checkRefNumbering();
|
||||
|
||||
@@ -1443,7 +1443,7 @@ class BOM extends CommonObject
|
||||
$this->error = $tmpproduct->error;
|
||||
return -1;
|
||||
}
|
||||
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
|
||||
$line->unit_cost = price2num(is_null($tmpproduct->cost_price) ? $tmpproduct->pmp : $tmpproduct->cost_price);
|
||||
if (empty($line->unit_cost)) {
|
||||
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
|
||||
if ($productFournisseur->fourn_remise_percent != "0") {
|
||||
|
||||
@@ -248,7 +248,13 @@ class Categories extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->category->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->category->array_options[$index] = $this->_checkValForAPI($field, $val, $this->category);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->category->$field = $this->_checkValForAPI($field, $value, $this->category);
|
||||
}
|
||||
|
||||
if ($this->category->update(DolibarrApiAccess::$user) > 0) {
|
||||
|
||||
@@ -2067,7 +2067,27 @@ if ($id > 0) {
|
||||
// related contact
|
||||
print '<tr><td>'.$langs->trans("ActionOnContact").'</td><td>';
|
||||
print '<div class="maxwidth200onsmartphone">';
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"').$form->selectcontacts(!getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? $object->socid : 0, array_keys($object->socpeopleassigned), 'socpeopleassigned[]', 1, '', '', 1, 'minwidth300 widthcentpercentminusx', false, 0, 0, array(), 'multiple', 'contactid');
|
||||
|
||||
$searchSocid = ($object->socid > 0) ? $object->socid : (getDolGlobalString('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT') ? 0 : -1);
|
||||
|
||||
print img_picto('', 'contact', 'class="paddingrightonly"');
|
||||
print $form->selectcontacts(
|
||||
$searchSocid,
|
||||
array_keys($object->socpeopleassigned),
|
||||
'socpeopleassigned[]',
|
||||
1,
|
||||
'',
|
||||
'',
|
||||
1,
|
||||
'minwidth300 widthcentpercentminusx',
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
array(),
|
||||
'multiple',
|
||||
'contactid'
|
||||
);
|
||||
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@@ -629,7 +629,7 @@ class ActionComm extends CommonObject
|
||||
foreach ($this->userassigned as $key => $val) {
|
||||
// Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val.
|
||||
if (!is_array($val)) { // For backward compatibility when $val='id'.
|
||||
$val = array('id'=>$val);
|
||||
$val = array('id' => $val);
|
||||
}
|
||||
|
||||
if ($val['id'] > 0) {
|
||||
@@ -1271,7 +1271,7 @@ class ActionComm extends CommonObject
|
||||
$already_inserted = array();
|
||||
foreach (array_keys($this->socpeopleassigned) as $key => $val) {
|
||||
if (!is_array($val)) { // For backward compatibility when val=id
|
||||
$val = array('id'=>$val);
|
||||
$val = array('id' => $val);
|
||||
}
|
||||
if (!empty($already_inserted[$val['id']])) {
|
||||
continue;
|
||||
@@ -2547,80 +2547,86 @@ class ActionComm extends CommonObject
|
||||
// Load event
|
||||
$res = $this->fetch($actionCommReminder->fk_actioncomm);
|
||||
if ($res > 0) {
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
$res2 = $this->fetch_thirdparty();
|
||||
if ($res2 >= 0) {
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, '', $this);
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $this);
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||
|
||||
// Content
|
||||
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
|
||||
// Content
|
||||
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
|
||||
|
||||
//Topic
|
||||
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder'));
|
||||
//Topic
|
||||
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder'));
|
||||
|
||||
// Recipient
|
||||
$recipient = new User($this->db);
|
||||
$res = $recipient->fetch($actionCommReminder->fk_user);
|
||||
if ($res > 0) {
|
||||
if (!empty($recipient->email)) {
|
||||
$to = $recipient->email;
|
||||
// Recipient
|
||||
$recipient = new User($this->db);
|
||||
$res = $recipient->fetch($actionCommReminder->fk_user);
|
||||
if ($res > 0) {
|
||||
if (!empty($recipient->email)) {
|
||||
$to = $recipient->email;
|
||||
} else {
|
||||
$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$errormesg = "Failed to send remind to user id=".$actionCommReminder->fk_user.". No email defined for user.";
|
||||
$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Sender
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
if (empty($from)) {
|
||||
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Errors Recipient
|
||||
$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
|
||||
// Mail Creation
|
||||
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
|
||||
|
||||
// Sending Mail
|
||||
if ($cMailFile->sendfile()) {
|
||||
$nbMailSend++;
|
||||
} else {
|
||||
$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.implode(',', $cMailFile->errors);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$actionCommReminder->status = $actionCommReminder::STATUS_DONE;
|
||||
|
||||
$res = $actionCommReminder->update($user);
|
||||
if ($res < 0) {
|
||||
$errorsMsg[] = "Failed to update status to done of ActionComm Reminder";
|
||||
$error++;
|
||||
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
|
||||
}
|
||||
} else {
|
||||
$actionCommReminder->status = $actionCommReminder::STATUS_ERROR;
|
||||
$actionCommReminder->lasterror = dol_trunc($errormesg, 128, 'right', 'UTF-8', 1);
|
||||
|
||||
$res = $actionCommReminder->update($user);
|
||||
if ($res < 0) {
|
||||
$errorsMsg[] = "Failed to update status to error of ActionComm Reminder";
|
||||
$error++;
|
||||
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
|
||||
} else {
|
||||
$errorsMsg[] = $errormesg;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$errormesg = "Failed to load recipient with user id=".$actionCommReminder->fk_user;
|
||||
$errorsMsg[] = 'Failed to fetch record thirdparty on actioncomm with ID = '.$actionCommReminder->fk_actioncomm;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Sender
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
if (empty($from)) {
|
||||
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Errors Recipient
|
||||
$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
|
||||
// Mail Creation
|
||||
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, array(), array(), array(), '', "", 0, 1, $errors_to, '', '', '', '', '');
|
||||
|
||||
// Sending Mail
|
||||
if ($cMailFile->sendfile()) {
|
||||
$nbMailSend++;
|
||||
} else {
|
||||
$errormesg = 'Failed to send email to: '.$to.' '.$cMailFile->error.join(',', $cMailFile->errors);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$actionCommReminder->status = $actionCommReminder::STATUS_DONE;
|
||||
|
||||
$res = $actionCommReminder->update($user);
|
||||
if ($res < 0) {
|
||||
$errorsMsg[] = "Failed to update status to done of ActionComm Reminder";
|
||||
$error++;
|
||||
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
|
||||
}
|
||||
} else {
|
||||
$actionCommReminder->status = $actionCommReminder::STATUS_ERROR;
|
||||
$actionCommReminder->lasterror = dol_trunc($errormesg, 128, 'right', 'UTF-8', 1);
|
||||
|
||||
$res = $actionCommReminder->update($user);
|
||||
if ($res < 0) {
|
||||
$errorsMsg[] = "Failed to update status to error of ActionComm Reminder";
|
||||
$error++;
|
||||
break; // This is to avoid to have this error on all the selected email. If we fails here for one record, it may fails for others. We must solve first.
|
||||
} else {
|
||||
$errorsMsg[] = $errormesg;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$errorsMsg[] = 'Failed to fetch record actioncomm with ID = '.$actionCommReminder->fk_actioncomm;
|
||||
$error++;
|
||||
|
||||
@@ -279,6 +279,12 @@ class AgendaEvents extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->actioncomm->array_options[$index] = $this->_checkValForAPI($field, $val, $this->actioncomm);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->actioncomm->$field = $this->_checkValForAPI($field, $value, $this->actioncomm);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,9 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$object = new ActionComm($db);
|
||||
$object->fetch($id);
|
||||
|
||||
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create'));
|
||||
|
||||
|
||||
@@ -65,8 +68,6 @@ $form = new Form($db);
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
$object = new ActionComm($db);
|
||||
$object->fetch($id);
|
||||
$object->info($object->id);
|
||||
|
||||
$head = actions_prepare_head($object);
|
||||
|
||||
@@ -443,20 +443,25 @@ if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
$sql .= " ,".MAIN_DB_PREFIX."c_actioncomm as c";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action";
|
||||
// We must filter on resource table
|
||||
if ($resourceid > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
|
||||
}
|
||||
// We must filter on assignement table
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
|
||||
}
|
||||
$sql .= " WHERE c.id = a.fk_action";
|
||||
$sql .= ' AND a.entity IN ('.getEntity('agenda').')';
|
||||
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
|
||||
// Condition on actioncode
|
||||
if (!empty($actioncode)) {
|
||||
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
|
||||
@@ -487,7 +492,7 @@ if (!empty($actioncode)) {
|
||||
}
|
||||
}
|
||||
if ($resourceid > 0) {
|
||||
$sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
|
||||
$sql .= " AND r.resource_id = ".((int) $resourceid);
|
||||
}
|
||||
if ($pid) {
|
||||
$sql .= " AND a.fk_project=".((int) $pid);
|
||||
@@ -498,10 +503,6 @@ if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
// We must filter on assignement table
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
if ($type) {
|
||||
$sql .= " AND c.id = ".((int) $type);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ if (isModEnabled('ficheinter')) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('companies', 'banks'));
|
||||
$langs->loadLangs(array('companies', 'banks', 'commercial'));
|
||||
|
||||
if (isModEnabled('contrat')) {
|
||||
$langs->load("contracts");
|
||||
@@ -871,9 +871,9 @@ if ($object->id > 0) {
|
||||
$filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
}
|
||||
if (is_array($file_list)) {
|
||||
if (is_array($file_list) && !empty($file_list)) {
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
if ($filedir) {
|
||||
@@ -983,9 +983,9 @@ if ($object->id > 0) {
|
||||
$filedir = $conf->commande->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
}
|
||||
if (is_array($file_list)) {
|
||||
if (is_array($file_list) && !empty($file_list)) {
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
if ($filedir) {
|
||||
@@ -1077,9 +1077,9 @@ if ($object->id > 0) {
|
||||
$filedir = $conf->expedition->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
}
|
||||
if (is_array($file_list)) {
|
||||
if (is_array($file_list) && !empty($file_list)) {
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
if ($filedir) {
|
||||
@@ -1183,9 +1183,9 @@ if ($object->id > 0) {
|
||||
$filedir = $conf->contrat->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
}
|
||||
if (is_array($file_list)) {
|
||||
if (is_array($file_list) && !empty($file_list)) {
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
if ($filedir) {
|
||||
@@ -1274,9 +1274,9 @@ if ($object->id > 0) {
|
||||
$filedir = $conf->ficheinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
}
|
||||
if (is_array($file_list)) {
|
||||
if (is_array($file_list) && !empty($file_list)) {
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
if ($filedir) {
|
||||
@@ -1486,9 +1486,9 @@ if ($object->id > 0) {
|
||||
$filedir = $conf->facture->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, dol_sanitizeFileName($objp->ref).'.pdf', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
}
|
||||
if (is_array($file_list)) {
|
||||
if (is_array($file_list) && !empty($file_list)) {
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
if ($filedir) {
|
||||
|
||||
@@ -37,7 +37,7 @@ if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if (!$sortfield) {
|
||||
$sortfield = "p.name";
|
||||
$sortfield = "p.lastname";
|
||||
}
|
||||
if ($page < 0) {
|
||||
$page = 0;
|
||||
@@ -81,7 +81,7 @@ if ($type == "f") {
|
||||
*/
|
||||
|
||||
$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm";
|
||||
$sql .= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
|
||||
$sql .= ", p.rowid as cidp, p.lastname, p.firstname, p.email, p.phone";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
|
||||
if (!$user->hasRight('societe', 'client', 'voir') && !$socid) {
|
||||
$sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
|
||||
@@ -106,7 +106,7 @@ if ($socid) {
|
||||
$sql .= " AND s.rowid = ".((int) $socid);
|
||||
}
|
||||
if (!empty($search_lastname)) {
|
||||
$sql .= " AND p.name LIKE '%".$db->escape($search_lastname)."%'";
|
||||
$sql .= " AND p.lastname LIKE '%".$db->escape($search_lastname)."%'";
|
||||
}
|
||||
if (!empty($search_firstname)) {
|
||||
$sql .= " AND p.firstname LIKE '%".$db->escape($search_firstname)."%'";
|
||||
@@ -115,8 +115,8 @@ if (!empty($search_company)) {
|
||||
$sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'";
|
||||
}
|
||||
if (!empty($contactname)) { // acces a partir du module de recherche
|
||||
$sql .= " AND (p.name LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
|
||||
$sortfield = "p.name";
|
||||
$sql .= " AND (p.lastname LIKE '%".$db->escape($contactname)."%' OR lower(p.firstname) LIKE '%".$db->escape($contactname)."%') ";
|
||||
$sortfield = "p.lastname";
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ if ($resql) {
|
||||
|
||||
print '<table class="liste centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.name", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Lastname", $_SERVER["PHP_SELF"], "p.lastname", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "p.firstname", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", $begin, $param, "", $sortfield, $sortorder);
|
||||
print_liste_field_titre("Email");
|
||||
|
||||
@@ -421,7 +421,7 @@ if (empty($reshook)) {
|
||||
dol_syslog("comm/mailing/card.php: error for #".$iforemailloop.($mail->error ? ' - '.$mail->error : ''), LOG_WARNING);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=-1, error_text='".$db->escape($mail->error)."', date_envoi='".$db->idate($now)."' WHERE rowid=".((int) $obj->rowid);
|
||||
$sql .= " SET statut=-1, error_text='".$db->escape(dol_trunc($mail->error, 250))."', date_envoi='".$db->idate($now)."' WHERE rowid=".((int) $obj->rowid);
|
||||
$resql2 = $db->query($sql);
|
||||
if (!$resql2) {
|
||||
dol_print_error($db);
|
||||
|
||||
@@ -255,7 +255,7 @@ class FormAdvTargetEmailing extends Form
|
||||
}
|
||||
}
|
||||
if (!empty($InfoFieldList[1])) {
|
||||
$sql .= " ORDER BY nom";
|
||||
$sql .= $this->db->order($InfoFieldList[1]);
|
||||
}
|
||||
// $sql.= ' WHERE entity = '.$conf->entity;
|
||||
|
||||
@@ -266,7 +266,7 @@ class FormAdvTargetEmailing extends Form
|
||||
if ($num) {
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$labeltoshow = dol_trunc($obj->$InfoFieldList[1], 90);
|
||||
$labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 90);
|
||||
$options_array[$obj->rowid] = $labeltoshow;
|
||||
$i++;
|
||||
}
|
||||
@@ -332,6 +332,20 @@ class FormAdvTargetEmailing extends Form
|
||||
global $conf, $langs;
|
||||
|
||||
$form = new Form($this->db);
|
||||
foreach ($options_array as $okey => $val) {
|
||||
if ((string) $okey == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$valarray = explode('|', $val);
|
||||
$val = $valarray[0];
|
||||
|
||||
if ($val) {
|
||||
$options_array[$okey] = $langs->trans($val);
|
||||
} else {
|
||||
$options_array[$okey] = $val;
|
||||
}
|
||||
}
|
||||
$return = $form->multiselectarray($htmlname, $options_array, $selected_array, 0, 0, '', 0, 295);
|
||||
return $return;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@ $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
$backurlforlist = DOL_URL_ROOT.'/comm/propal/list.php';
|
||||
|
||||
@@ -1622,7 +1621,20 @@ if (empty($reshook)) {
|
||||
$result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int'));
|
||||
} elseif ($action == 'setconditions' && $usercancreate) {
|
||||
// Terms of payment
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
|
||||
$sql = "SELECT code ";
|
||||
$sql .= "FROM " . $db->prefix() . "c_payment_term";
|
||||
$sql .= " WHERE rowid = " . ((int) GETPOST('cond_reglement_id', 'int'));
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$obj = $db->fetch_object($result);
|
||||
if ($obj->code == 'DEP30PCTDEL') {
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha'));
|
||||
} else {
|
||||
$object->deposit_percent = 0;
|
||||
$object->update($user);
|
||||
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), $object->deposit_percent);
|
||||
}
|
||||
}
|
||||
//} elseif ($action == 'setremisepercent' && $usercancreate) {
|
||||
// $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
|
||||
//} elseif ($action == 'setremiseabsolue' && $usercancreate) {
|
||||
@@ -1754,6 +1766,7 @@ if ($action == 'create') {
|
||||
$fk_account = GETPOST('fk_account', 'int');
|
||||
|
||||
// Load objectsrc
|
||||
$objectsrc = null;
|
||||
if (!empty($origin) && !empty($originid)) {
|
||||
// Parse element/subelement (ex: project_task)
|
||||
$element = $subelement = $origin;
|
||||
@@ -1765,6 +1778,14 @@ if ($action == 'create') {
|
||||
|
||||
if ($element == 'project') {
|
||||
$projectid = $originid;
|
||||
|
||||
// Fetch project and thirdparty
|
||||
$project = new Project($db);
|
||||
$project->fetch($projectid);
|
||||
if ($project->socid > 0) {
|
||||
$soc = new Societe($db);
|
||||
$soc->fetch($project->socid);
|
||||
}
|
||||
} else {
|
||||
// For compatibility
|
||||
if ($element == 'order' || $element == 'commande') {
|
||||
@@ -1796,9 +1817,9 @@ if ($action == 'create') {
|
||||
|
||||
$soc = $objectsrc->thirdparty;
|
||||
|
||||
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
|
||||
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
|
||||
$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
|
||||
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
|
||||
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
|
||||
$warehouse_id = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
|
||||
|
||||
// Replicate extrafields
|
||||
$objectsrc->fetch_optionals();
|
||||
@@ -1813,7 +1834,10 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
// Load default values from thirdparty
|
||||
if (!empty($soc)) {
|
||||
$cond_reglement_id = empty($soc->cond_reglement_id) ? $cond_reglement_id : $soc->cond_reglement_id;
|
||||
$deposit_percent = empty($soc->deposit_percent) ? $deposit_percent : $soc->deposit_percent;
|
||||
$mode_reglement_id = empty($soc->mode_reglement_id) ? $mode_reglement_id : $soc->mode_reglement_id;
|
||||
@@ -3145,7 +3169,7 @@ if ($action == 'create') {
|
||||
if ($object->statut != Propal::STATUS_DRAFT && $useonlinesignature) {
|
||||
print '<br><!-- Link to sign -->';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
|
||||
print showOnlineSignatureUrl('proposal', $object->ref).'<br>';
|
||||
print showOnlineSignatureUrl('proposal', $object->ref, $object).'<br>';
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
@@ -708,7 +708,13 @@ class Proposals extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->propal->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->propal->array_options[$index] = $this->_checkValForAPI($field, $val, $this->propal);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->propal->$field = $this->_checkValForAPI($field, $value, $this->propal);
|
||||
}
|
||||
|
||||
// update end of validity date
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Copyright (C) 2022 ATM Consulting <contact@atm-consulting.fr>
|
||||
* Copyright (C) 2022 OpenDSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2025 William Mead <william@m34d.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
|
||||
@@ -1770,12 +1771,14 @@ class Propal extends CommonObject
|
||||
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->statut) ? $this->statut : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->user_author_id) ? $this->user_author_id : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->user_validation_id) ? $this->user_validation_id : "null").",";
|
||||
$sql .= " fk_user_valid = ".(!empty($this->user_validation_id) ? (int) $this->user_validation_id : "null").",";
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
|
||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||
$sql .= " deposit_percent=".(!empty($this->deposit_percent) ? "'".$this->db->escape($this->deposit_percent)."'" : "null").",";
|
||||
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
||||
$sql .= " fk_input_reason=".(isset($this->demand_reason_id) ? $this->demand_reason_id : "null").",";
|
||||
$sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? (int) $this->shipping_method_id : "null").",";
|
||||
$sql .= " fk_availability=".(isset($this->availability_id) ? (int) $this->availability_id : "null").",";
|
||||
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
|
||||
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
|
||||
$sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").",";
|
||||
@@ -2066,7 +2069,6 @@ class Propal extends CommonObject
|
||||
|
||||
$this->ref = $num;
|
||||
$this->statut = self::STATUS_VALIDATED;
|
||||
$this->status = self::STATUS_VALIDATED;
|
||||
$this->user_validation_id = $user->id;
|
||||
$this->datev = $now;
|
||||
$this->date_validation = $now;
|
||||
@@ -4421,8 +4423,17 @@ class PropaleLigne extends CommonObjectLine
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::insert ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
} else {
|
||||
$this->error = $this->db->error()." sql=".$sql;
|
||||
$this->db->rollback();
|
||||
@@ -4628,8 +4639,17 @@ class PropaleLigne extends CommonObjectLine
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
|
||||
@@ -880,17 +880,17 @@ if (empty($reshook)) {
|
||||
|
||||
// Set unit price to use
|
||||
if (!empty($price_ht) || $price_ht === '0') {
|
||||
$pu_ht = price2num($price_ht, 'MU');
|
||||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||
$pu_ht = (float) price2num($price_ht, 'MU');
|
||||
$pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||
} elseif (!empty($price_ttc) || $price_ttc === '0') {
|
||||
$pu_ttc = price2num($price_ttc, 'MU');
|
||||
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
|
||||
$pu_ttc = (float) price2num($price_ttc, 'MU');
|
||||
$pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
|
||||
} elseif ($tmpvat != $tmpprodvat) {
|
||||
// Is this still used ?
|
||||
if ($price_base_type != 'HT') {
|
||||
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
|
||||
$pu_ht = (float) price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
|
||||
} else {
|
||||
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||
$pu_ttc = (float) price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -662,7 +662,13 @@ class Orders extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->commande->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->commande->array_options[$index] = $this->_checkValForAPI($field, $val, $this->commande);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->commande->$field = $this->_checkValForAPI($field, $value, $this->commande);
|
||||
}
|
||||
|
||||
// Update availability
|
||||
|
||||
@@ -3242,7 +3242,7 @@ class Commande extends CommonOrder
|
||||
$this->line->localtax1_type = empty($localtaxes_type[0]) ? '' : $localtaxes_type[0];
|
||||
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
|
||||
$this->line->remise_percent = $remise_percent;
|
||||
$this->line->subprice = $pu_ht;
|
||||
$this->line->subprice = (float) $pu_ht;
|
||||
$this->line->info_bits = $info_bits;
|
||||
$this->line->special_code = $special_code;
|
||||
$this->line->total_ht = $total_ht;
|
||||
|
||||
@@ -1507,9 +1507,6 @@ if (empty($reshook)) {
|
||||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
@@ -2213,8 +2210,8 @@ while ($i < $imaxinloop) {
|
||||
|
||||
// Alias name
|
||||
if (!empty($arrayfields['s.name_alias']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->alias;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->alias).'">';
|
||||
print dol_escape_htmltag($obj->alias);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -2244,8 +2241,8 @@ while ($i < $imaxinloop) {
|
||||
|
||||
// Town
|
||||
if (!empty($arrayfields['s.town']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->town;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->town).'">';
|
||||
print dol_escape_htmltag($obj->town);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -2254,8 +2251,8 @@ while ($i < $imaxinloop) {
|
||||
|
||||
// Zip
|
||||
if (!empty($arrayfields['s.zip']['checked'])) {
|
||||
print '<td class="nocellnopadd">';
|
||||
print $obj->zip;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).'">';
|
||||
print dol_escape_htmltag($obj->zip);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
@@ -2264,7 +2261,7 @@ while ($i < $imaxinloop) {
|
||||
|
||||
// State
|
||||
if (!empty($arrayfields['state.nom']['checked'])) {
|
||||
print "<td>".$obj->state_name."</td>\n";
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->state_name).'">'.dol_escape_htmltag($obj->state_name)."</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@@ -2655,7 +2652,7 @@ while ($i < $imaxinloop) {
|
||||
$productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
} else {
|
||||
$generic_product->stock_reel = $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$generic_commande->lines[$lig]->fk_product]['stock_reel'];
|
||||
}
|
||||
|
||||
if ($reliquat > $generic_product->stock_reel) {
|
||||
|
||||
@@ -2104,7 +2104,7 @@ if ($resql) {
|
||||
$productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
} else {
|
||||
$generic_product->stock_reel = $productstat_cache[$obj->fk_product]['stock_reel'];
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'] = $generic_product->stock_theorique;
|
||||
$generic_product->stock_theorique = $productstat_cachevirtual[$obj->fk_product]['stock_reel'];
|
||||
}
|
||||
|
||||
if ($reliquat > $generic_product->stock_reel) {
|
||||
|
||||
@@ -597,9 +597,9 @@ $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappr
|
||||
$sql .= " b.fk_account, b.fk_type, b.fk_bordereau,";
|
||||
$sql .= " ba.rowid as bankid, ba.ref as bankref";
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label'])) {
|
||||
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$extrafieldsobjectkey]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
@@ -612,8 +612,8 @@ if ($search_bid > 0) {
|
||||
}
|
||||
$sql .= " ".MAIN_DB_PREFIX."bank_account as ba,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."bank as b";
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['label']) && is_array($extrafields->attributes[$extrafieldsobjectkey]['label']) && count($extrafields->attributes[$extrafieldsobjectkey]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$extrafieldsobjectkey."_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||
}
|
||||
|
||||
// Add fields from hooks
|
||||
@@ -1831,6 +1831,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
$obj = $objp; // Because extrafield template use $obj and not $objp as object variable name
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters=array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
|
||||
@@ -345,6 +345,12 @@ class BankAccounts extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$account->array_options[$index] = $this->_checkValForAPI($field, $val, $account);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$account->$field = $this->_checkValForAPI($field, $value, $account);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,8 @@ if ($user->hasRight('banque', 'modifier') && $action == "update") {
|
||||
$sql .= " SET ";
|
||||
// Always opened
|
||||
if (GETPOSTISSET('value')) {
|
||||
$sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
|
||||
$type = GETPOST('value');
|
||||
$sql .= " fk_type='".$db->escape(empty($type) && $object->fk_type == 'SOLD' ? 'SOLD' : $type)."',";
|
||||
}
|
||||
if (GETPOSTISSET('num_chq')) {
|
||||
$sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";
|
||||
|
||||
@@ -196,6 +196,7 @@ class CashControl extends CommonObject
|
||||
$sql .= ", cash";
|
||||
$sql .= ", cheque";
|
||||
$sql .= ", card";
|
||||
$sql .= ", fk_user_creat";
|
||||
$sql .= ") VALUES (";
|
||||
//$sql .= "'(PROV)', ";
|
||||
$sql .= ((int) $conf->entity);
|
||||
@@ -210,6 +211,7 @@ class CashControl extends CommonObject
|
||||
$sql .= ", ".price2num($this->cash, 'MT');
|
||||
$sql .= ", ".price2num($this->cheque, 'MT');
|
||||
$sql .= ", ".price2num($this->card, 'MT');
|
||||
$sql .= ", ".((int) $user->id);
|
||||
$sql .= ")";
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@@ -253,7 +253,7 @@ if ($resql) {
|
||||
|
||||
// Date ope
|
||||
print '<td class="nowrap left">';
|
||||
print '<span id="dateoperation_'.$objp->rowid.'">'.dol_print_date($db->jdate($objp->do), "day")."</span>";
|
||||
print '<span id="dateoperation_'.$objp->facid.'">'.dol_print_date($db->jdate($objp->do), "day")."</span>";
|
||||
print "</td>\n";
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
@@ -93,7 +93,10 @@ $pagenext = $page + 1;
|
||||
$object = new FactureRec($db);
|
||||
if (($id > 0 || $ref) && $action != 'create' && $action != 'add') {
|
||||
$ret = $object->fetch($id, $ref);
|
||||
if (!$ret) {
|
||||
if ($ret < 0) {
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
exit;
|
||||
} elseif (! $ret) {
|
||||
setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors');
|
||||
}
|
||||
}
|
||||
@@ -1344,14 +1347,10 @@ if ($action == 'create') {
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td>';
|
||||
if ($object->type != Facture::TYPE_CREDIT_NOTE) {
|
||||
if ($action == 'editconditions') {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
} else {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
|
||||
}
|
||||
if ($action == 'editconditions') {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
} else {
|
||||
print ' ';
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
@@ -1781,6 +1780,7 @@ if ($action == 'create') {
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$morehtmlcenter = '';
|
||||
$somethingshown = $formactions->showactions($object, $object->element, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
|
||||
|
||||
print '</div>';
|
||||
|
||||
@@ -96,7 +96,7 @@ $origin = GETPOST('origin', 'alpha');
|
||||
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
|
||||
$fac_rec = GETPOST('fac_rec', 'int');
|
||||
$facid = GETPOST('facid', 'int');
|
||||
$ref_client = GETPOST('ref_client', 'int');
|
||||
$ref_client = GETPOST('ref_client', 'alpha');
|
||||
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
|
||||
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
|
||||
$selectedLines = GETPOST('toselect', 'array');
|
||||
@@ -643,7 +643,7 @@ if (empty($reshook)) {
|
||||
$object->setValueFrom('ref', GETPOST('ref'), '', null, '', '', $user, 'BILL_MODIFY');
|
||||
} elseif ($action == 'setref_client' && $usercancreate) {
|
||||
$object->fetch($id);
|
||||
$object->set_ref_client(GETPOST('ref_client'));
|
||||
$object->set_ref_client(GETPOST('ref_client', 'alpha'));
|
||||
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) {
|
||||
// Classify to validated
|
||||
$idwarehouse = GETPOST('idwarehouse', 'int');
|
||||
@@ -1537,6 +1537,9 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
foreach ($TTotalByTva as $tva => &$total) {
|
||||
if (empty($amountdeposit[$tva])) {
|
||||
$amountdeposit[$tva] = 0;
|
||||
}
|
||||
$coef = $total / $srcobject->total_ttc; // Calc coef
|
||||
$am = $amount * $coef;
|
||||
$amount_ttc_diff += $am;
|
||||
@@ -1561,6 +1564,9 @@ if (empty($reshook)) {
|
||||
if ($qualified) {
|
||||
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
|
||||
$tva_tx = $lines[$i]->tva_tx;
|
||||
if (empty($amountdeposit[$tva_tx])) {
|
||||
$amountdeposit[$tva_tx] = 0;
|
||||
}
|
||||
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
|
||||
}
|
||||
}
|
||||
@@ -1727,25 +1733,25 @@ if (empty($reshook)) {
|
||||
|
||||
// Date start
|
||||
$date_start = false;
|
||||
if ($lines[$i]->date_debut_prevue) {
|
||||
if (isset($lines[$i]->date_debut_prevue)) {
|
||||
$date_start = $lines[$i]->date_debut_prevue;
|
||||
}
|
||||
if ($lines[$i]->date_debut_reel) {
|
||||
if (isset($lines[$i]->date_debut_reel)) {
|
||||
$date_start = $lines[$i]->date_debut_reel;
|
||||
}
|
||||
if ($lines[$i]->date_start) {
|
||||
if (isset($lines[$i]->date_start)) {
|
||||
$date_start = $lines[$i]->date_start;
|
||||
}
|
||||
|
||||
// Date end
|
||||
$date_end = false;
|
||||
if ($lines[$i]->date_fin_prevue) {
|
||||
if (isset($lines[$i]->date_fin_prevue)) {
|
||||
$date_end = $lines[$i]->date_fin_prevue;
|
||||
}
|
||||
if ($lines[$i]->date_fin_reel) {
|
||||
if (isset($lines[$i]->date_fin_reel)) {
|
||||
$date_end = $lines[$i]->date_fin_reel;
|
||||
}
|
||||
if ($lines[$i]->date_end) {
|
||||
if (isset($lines[$i]->date_end)) {
|
||||
$date_end = $lines[$i]->date_end;
|
||||
}
|
||||
|
||||
@@ -3179,9 +3185,9 @@ if ($action == 'create') {
|
||||
$expesrc->fetch_optionals();
|
||||
$object->array_options = $expesrc->array_options;
|
||||
} else {
|
||||
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
|
||||
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
|
||||
$fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0));
|
||||
$cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : (!empty($cond_reglement_id) ? $cond_reglement_id : 0)));
|
||||
$mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : (!empty($mode_reglement_id) ? $mode_reglement_id : 0)));
|
||||
$fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : (!empty($fk_account) ? $fk_account : 0)));
|
||||
//$remise_percent = (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
|
||||
//$remise_absolue = (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));
|
||||
|
||||
@@ -4543,6 +4549,9 @@ if ($action == 'create') {
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
|
||||
$object->totalcreditnotes = $totalcreditnotes;
|
||||
$object->totaldeposits = $totaldeposits;
|
||||
$object->remaintopay = price2num($object->total_ttc - $object->totalpaid - $object->totalcreditnotes - $object->totaldeposits, 'MT');
|
||||
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '');
|
||||
|
||||
@@ -5086,6 +5095,7 @@ if ($action == 'create') {
|
||||
print '<td>'.$langs->trans('ListOfSituationInvoices').'</td>';
|
||||
print '<td></td>';
|
||||
print '<td class="center">'.$langs->trans('Situation').'</td>';
|
||||
|
||||
if (isModEnabled("banque")) {
|
||||
print '<td class="right"></td>';
|
||||
}
|
||||
@@ -5177,7 +5187,9 @@ if ($action == 'create') {
|
||||
$total_next_ht = $total_next_ttc = 0;
|
||||
|
||||
foreach ($object->tab_next_situation_invoice as $next_invoice) {
|
||||
$totalpaid = $next_invoice->getSommePaiement();
|
||||
$next_invoice_total_paid = $next_invoice->getSommePaiement(0);
|
||||
$next_invoice_totalcreditnotes = $next_invoice->getSumCreditNotesUsed(0);
|
||||
$next_invoice_totaldeposits = $next_invoice->getSumDepositsUsed(0);
|
||||
$total_next_ht += $next_invoice->total_ht;
|
||||
$total_next_ttc += $next_invoice->total_ttc;
|
||||
|
||||
@@ -5190,7 +5202,7 @@ if ($action == 'create') {
|
||||
}
|
||||
print '<td class="right"><span class="amount">'.price($next_invoice->total_ht).'</span></td>';
|
||||
print '<td class="right"><span class="amount">'.price($next_invoice->total_ttc).'</span></td>';
|
||||
print '<td class="right">'.$next_invoice->getLibStatut(3, $totalpaid).'</td>';
|
||||
print '<td class="right">'.$next_invoice->getLibStatut(3, $next_invoice_total_paid + $next_invoice_totalcreditnotes + $next_invoice_totaldeposits).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -5850,10 +5862,9 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
|
||||
// For situation invoice with excess received
|
||||
// For situation invoice
|
||||
if ($object->statut > Facture::STATUS_DRAFT
|
||||
&& $object->type == Facture::TYPE_SITUATION
|
||||
&& ($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits) > 0
|
||||
&& $usercancreate
|
||||
&& !$objectidnext
|
||||
&& $object->is_last_in_cycle()
|
||||
|
||||
@@ -336,6 +336,7 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
* @throws RestException 403 Access not allowed for login
|
||||
* @throws RestException 404
|
||||
* @throws RestException 405
|
||||
*/
|
||||
@@ -352,6 +353,9 @@ class Invoices extends DolibarrApi
|
||||
if (empty($orderid)) {
|
||||
throw new RestException(400, 'Order ID is mandatory');
|
||||
}
|
||||
if (!DolibarrApi::_checkAccessToResource('commande', $orderid)) {
|
||||
throw new RestException(403, 'Access not allowed on order for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
$order = new Commande($this->db);
|
||||
$result = $order->fetch($orderid);
|
||||
@@ -633,7 +637,13 @@ class Invoices extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->invoice->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->invoice->array_options[$index] = $this->_checkValForAPI($field, $val, $this->invoice);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->invoice->$field = $this->_checkValForAPI($field, $value, $this->invoice);
|
||||
}
|
||||
|
||||
// update bank account
|
||||
@@ -643,11 +653,11 @@ class Invoices extends DolibarrApi
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->invoice->update(DolibarrApiAccess::$user)) {
|
||||
if ($this->invoice->update(DolibarrApiAccess::$user) > 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
throw new RestException(500, $this->invoice->error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1486,8 +1496,8 @@ class Invoices extends DolibarrApi
|
||||
* Warning: Take care that all invoices are owned by the same customer.
|
||||
* Example of value for parameter arrayofamounts: {"1": {"amount": "99.99", "multicurrency_amount": ""}, "2": {"amount": "", "multicurrency_amount": "10"}}
|
||||
*
|
||||
* @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice
|
||||
* @param string $datepaye {@from body} Payment date {@type timestamp}
|
||||
* @param array $arrayofamounts {@from body} Array with id of invoices with amount to pay for each invoice
|
||||
* @param string $datepaye {@from body} Payment date {@type timestamp}
|
||||
* @param int $paymentid {@from body} Payment mode Id {@min 1}
|
||||
* @param string $closepaidinvoices {@from body} Close paid invoices {@choice yes,no}
|
||||
* @param int $accountid {@from body} Account Id {@min 1}
|
||||
@@ -1572,13 +1582,13 @@ class Invoices extends DolibarrApi
|
||||
$amount = price2num($amountarray["multicurrency_amount"], 'MT');
|
||||
}
|
||||
|
||||
if ($amount > $remainstopay && !$accepthigherpayment) {
|
||||
if (abs($amount) > abs($remainstopay) && !$accepthigherpayment) {
|
||||
$this->db->rollback();
|
||||
throw new RestException(400, 'Payment amount on invoice ID '.$id.' ('.$amount.') is higher than remain to pay ('.$remainstopay.')');
|
||||
}
|
||||
|
||||
if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
$amount = price2num(-1 * $amount, 'MT');
|
||||
$amount = price2num(-1 * abs($amount), 'MT');
|
||||
}
|
||||
|
||||
if ($is_multicurrency) {
|
||||
|
||||
@@ -136,6 +136,13 @@ class FactureRec extends CommonInvoice
|
||||
public $cond_reglement_code; // Code in llx_c_paiement
|
||||
public $mode_reglement_code; // Code in llx_c_paiement
|
||||
|
||||
public $fk_multicurrency;
|
||||
public $multicurrency_code;
|
||||
public $multicurrency_tx;
|
||||
public $multicurrency_total_ht;
|
||||
public $multicurrency_total_tva;
|
||||
public $multicurrency_total_ttc;
|
||||
|
||||
public $suspended; // status
|
||||
|
||||
public $auto_validate; // 0 to create in draft, 1 to create and validate the new invoice
|
||||
@@ -1358,6 +1365,14 @@ class FactureRec extends CommonInvoice
|
||||
$facture->multicurrency_tx = $facturerec->multicurrency_tx;
|
||||
}
|
||||
|
||||
if (isset($facture->array_options) && isset($facturerec->array_options)) {
|
||||
foreach ($facturerec->array_options as $key => $value) {
|
||||
if (isset($facture->array_options[$key])) {
|
||||
$facture->array_options[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$invoiceidgenerated = $facture->create($user);
|
||||
if ($invoiceidgenerated <= 0) {
|
||||
$this->errors = $facture->errors;
|
||||
@@ -1407,6 +1422,7 @@ class FactureRec extends CommonInvoice
|
||||
$nb_create++;
|
||||
$this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n";
|
||||
} else {
|
||||
$this->output .= $langs->trans("InvoiceGeneratedFromTemplateError", $facture->ref, $facturerec->ref, $this->error)."\n";
|
||||
$this->db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,11 @@ class Facture extends CommonInvoice
|
||||
*/
|
||||
public $table_element_line = 'facturedet';
|
||||
|
||||
/**
|
||||
* @var string Name of class line
|
||||
*/
|
||||
public $class_element_line = 'FactureLigne';
|
||||
|
||||
/**
|
||||
* @var string Fieldname with ID of parent key if this field has a parent
|
||||
*/
|
||||
@@ -463,8 +468,8 @@ class Facture extends CommonInvoice
|
||||
$this->ref_client = trim($this->ref_client);
|
||||
|
||||
$this->note = (isset($this->note) ? trim($this->note) : trim($this->note_private)); // deprecated
|
||||
$this->note_private = (isset($this->note_private) ? trim($this->note_private) : trim($this->note_private));
|
||||
$this->note_public = trim($this->note_public);
|
||||
$this->note_private = (isset($this->note_private) ? trim($this->note_private) : '');
|
||||
$this->note_public = (isset($this->note_public) ? trim($this->note_public) : '');
|
||||
if (!$this->cond_reglement_id) {
|
||||
$this->cond_reglement_id = 0;
|
||||
}
|
||||
@@ -974,11 +979,6 @@ class Facture extends CommonInvoice
|
||||
$fk_parent_line = 0;
|
||||
|
||||
foreach ($_facrec->lines as $i => $val) {
|
||||
if ($_facrec->lines[$i]->fk_product) {
|
||||
$prod = new Product($this->db);
|
||||
$res = $prod->fetch($_facrec->lines[$i]->fk_product);
|
||||
}
|
||||
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($_facrec->lines[$i]->product_type != 9 && empty($_facrec->lines[$i]->fk_parent_line)) || $_facrec->lines[$i]->product_type == 9) {
|
||||
$fk_parent_line = 0;
|
||||
@@ -986,6 +986,11 @@ class Facture extends CommonInvoice
|
||||
|
||||
// For line from template invoice, we use data from template invoice
|
||||
/*
|
||||
if ($_facrec->lines[$i]->fk_product) {
|
||||
$prod = new Product($this->db);
|
||||
$res = $prod->fetch($_facrec->lines[$i]->fk_product);
|
||||
}
|
||||
|
||||
$tva_tx = get_default_tva($mysoc,$soc,$prod->id);
|
||||
$tva_npr = get_default_npr($mysoc,$soc,$prod->id);
|
||||
if (empty($tva_tx)) $tva_npr=0;
|
||||
@@ -1243,7 +1248,7 @@ class Facture extends CommonInvoice
|
||||
$object->socid = $objsoc->id;
|
||||
$object->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
|
||||
$object->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
|
||||
$object->fk_project = '';
|
||||
$object->fk_project = null;
|
||||
$object->fk_delivery_address = '';
|
||||
}
|
||||
|
||||
@@ -1261,10 +1266,12 @@ class Facture extends CommonInvoice
|
||||
$object->fk_user_author = $user->id;
|
||||
$object->fk_user_valid = null;
|
||||
$object->fk_facture_source = 0;
|
||||
$object->fk_fac_rec_source = null;
|
||||
$object->date_creation = '';
|
||||
$object->date_modification = '';
|
||||
$object->date_validation = '';
|
||||
$object->ref_client = '';
|
||||
$object->ref_customer = '';
|
||||
$object->close_code = '';
|
||||
$object->close_note = '';
|
||||
if (getDolGlobalInt('MAIN_DONT_KEEP_NOTE_ON_CLONING') == 1) {
|
||||
@@ -2451,9 +2458,6 @@ class Facture extends CommonInvoice
|
||||
if (empty($this->type)) {
|
||||
$this->type = self::TYPE_STANDARD;
|
||||
}
|
||||
if (isset($this->subtype)) {
|
||||
$this->subtype = trim($this->subtype);
|
||||
}
|
||||
if (isset($this->ref)) {
|
||||
$this->ref = trim($this->ref);
|
||||
}
|
||||
@@ -2490,6 +2494,9 @@ class Facture extends CommonInvoice
|
||||
if (isset($this->retained_warranty)) {
|
||||
$this->retained_warranty = (float) $this->retained_warranty;
|
||||
}
|
||||
if (!isset($this->fk_user_author) && isset($this->user_author) ) {
|
||||
$this->fk_user_author = $this->user_author;
|
||||
}
|
||||
|
||||
|
||||
// Check parameters
|
||||
@@ -2517,8 +2524,8 @@ class Facture extends CommonInvoice
|
||||
$sql .= " total_ht=".(isset($this->total_ht) ? $this->total_ht : "null").",";
|
||||
$sql .= " total_ttc=".(isset($this->total_ttc) ? $this->total_ttc : "null").",";
|
||||
$sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? $this->db->escape($this->revenuestamp) : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->status) ? $this->db->escape($this->status) : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->user_author) ? $this->db->escape($this->user_author) : "null").",";
|
||||
$sql .= " fk_statut=".(isset($this->status) ? ((int) $this->status) : "null").",";
|
||||
$sql .= " fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) : "null").",";
|
||||
$sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? $this->db->escape($this->fk_user_valid) : "null").",";
|
||||
$sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? $this->db->escape($this->fk_facture_source) : "null").",";
|
||||
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->db->escape($this->fk_project) : "null").",";
|
||||
@@ -4051,7 +4058,7 @@ class Facture extends CommonInvoice
|
||||
* @param double $remise_percent Percentage discount of the line
|
||||
* @param int $date_start Date de debut de validite du service
|
||||
* @param int $date_end Date de fin de validite du service
|
||||
* @param double $txtva VAT Rate (Can be '8.5', '8.5 (ABC)')
|
||||
* @param double|string $txtva VAT Rate (Can be '8.5', '8.5 (ABC)')
|
||||
* @param double $txlocaltax1 Local tax 1 rate
|
||||
* @param double $txlocaltax2 Local tax 2 rate
|
||||
* @param string $price_base_type HT or TTC
|
||||
@@ -4207,6 +4214,11 @@ class Facture extends CommonInvoice
|
||||
$rangmax = $this->line_max($fk_parent_line);
|
||||
$this->line->rang = $rangmax + 1;
|
||||
}
|
||||
$apply_abs_price_on_credit_note=false;
|
||||
if ($this->type == self::TYPE_CREDIT_NOTE && !getDolGlobalInt('FACTURE_ENABLE_NEGATIVE_LINES') && !getDolGlobalInt('INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN')) {
|
||||
$apply_abs_price_on_credit_note = true;
|
||||
}
|
||||
|
||||
|
||||
$this->line->id = $rowid;
|
||||
$this->line->rowid = $rowid;
|
||||
@@ -4223,14 +4235,14 @@ class Facture extends CommonInvoice
|
||||
$this->line->localtax2_type = empty($localtaxes_type[2]) ? '' : $localtaxes_type[2];
|
||||
|
||||
$this->line->remise_percent = $remise_percent;
|
||||
$this->line->subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->subprice = ($apply_abs_price_on_credit_note ? -abs($pu_ht) : $pu_ht); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->date_start = $date_start;
|
||||
$this->line->date_end = $date_end;
|
||||
$this->line->total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_tva) : $total_tva);
|
||||
$this->line->total_ht = (($apply_abs_price_on_credit_note || $qty < 0) ? -abs($total_ht) : $total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_tva = (($apply_abs_price_on_credit_note || $qty < 0) ? -abs($total_tva) : $total_tva);
|
||||
$this->line->total_localtax1 = $total_localtax1;
|
||||
$this->line->total_localtax2 = $total_localtax2;
|
||||
$this->line->total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($total_ttc) : $total_ttc);
|
||||
$this->line->total_ttc = (($apply_abs_price_on_credit_note || $qty < 0) ? -abs($total_ttc) : $total_ttc);
|
||||
$this->line->info_bits = $info_bits;
|
||||
$this->line->special_code = $special_code;
|
||||
$this->line->product_type = $type;
|
||||
@@ -4243,10 +4255,10 @@ class Facture extends CommonInvoice
|
||||
$this->line->pa_ht = $pa_ht;
|
||||
|
||||
// Multicurrency
|
||||
$this->line->multicurrency_subprice = ($this->type == self::TYPE_CREDIT_NOTE ? -abs($pu_ht_devise) : $pu_ht_devise); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->multicurrency_total_ht = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ht) : $multicurrency_total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->multicurrency_total_tva = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_tva) : $multicurrency_total_tva);
|
||||
$this->line->multicurrency_total_ttc = (($this->type == self::TYPE_CREDIT_NOTE || $qty < 0) ? -abs($multicurrency_total_ttc) : $multicurrency_total_ttc);
|
||||
$this->line->multicurrency_subprice = ($apply_abs_price_on_credit_note ? -abs($pu_ht_devise) : $pu_ht_devise); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->multicurrency_total_ht = (($apply_abs_price_on_credit_note || $qty < 0) ? -abs($multicurrency_total_ht) : $multicurrency_total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->multicurrency_total_tva = (($apply_abs_price_on_credit_note || $qty < 0) ? -abs($multicurrency_total_tva) : $multicurrency_total_tva);
|
||||
$this->line->multicurrency_total_ttc = (($apply_abs_price_on_credit_note || $qty < 0) ? -abs($multicurrency_total_ttc) : $multicurrency_total_ttc);
|
||||
|
||||
if (is_array($array_options) && count($array_options) > 0) {
|
||||
// We replace values in this->line->array_options only for entries defined into $array_options
|
||||
@@ -5703,209 +5715,212 @@ class Facture extends CommonInvoice
|
||||
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
if (!$error) {
|
||||
// Load event
|
||||
$res = $tmpinvoice->fetch($obj->id);
|
||||
if ($res > 0) {
|
||||
$tmpinvoice->fetch_thirdparty();
|
||||
// Create a loopError that is reset at each loop, this counter is added to the global counter at the end of loop
|
||||
$loopError = 0;
|
||||
|
||||
$outputlangs = new Translate('', $conf);
|
||||
if ($tmpinvoice->thirdparty->default_lang) {
|
||||
$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "bills"));
|
||||
} else {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
// Load event
|
||||
$res = $tmpinvoice->fetch($obj->id);
|
||||
if ($res > 0) {
|
||||
$tmpinvoice->fetch_thirdparty();
|
||||
|
||||
// Select email template according to language of recipient
|
||||
$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
|
||||
if (is_numeric($arraymessage) && $arraymessage <= 0) {
|
||||
$langs->load("errors");
|
||||
$this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template);
|
||||
return 0;
|
||||
}
|
||||
$outputlangs = new Translate('', $conf);
|
||||
if ($tmpinvoice->thirdparty->default_lang) {
|
||||
$outputlangs->setDefaultLang($tmpinvoice->thirdparty->default_lang);
|
||||
$outputlangs->loadLangs(array("main", "bills"));
|
||||
} else {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
// Select email template according to language of recipient
|
||||
$arraymessage = $formmail->getEMailTemplate($this->db, 'facture_send', $user, $outputlangs, (is_numeric($template) ? $template : 0), 1, (is_numeric($template) ? '' : $template));
|
||||
if (is_numeric($arraymessage) && $arraymessage <= 0) {
|
||||
$langs->load("errors");
|
||||
$this->output .= $langs->trans('ErrorFailedToFindEmailTemplate', $template);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, '', $tmpinvoice);
|
||||
// PREPARE EMAIL
|
||||
$errormesg = '';
|
||||
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice);
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, '', $tmpinvoice);
|
||||
|
||||
// Topic
|
||||
$sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $tmpinvoice);
|
||||
|
||||
// Content
|
||||
$content = $outputlangs->transnoentitiesnoconv($arraymessage->content);
|
||||
// Topic
|
||||
$sendTopic = make_substitutions(empty($arraymessage->topic) ? $outputlangs->transnoentitiesnoconv('InformationMessage') : $arraymessage->topic, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
|
||||
// Content
|
||||
$content = $outputlangs->transnoentitiesnoconv($arraymessage->content);
|
||||
|
||||
// Recipient
|
||||
$to = array();
|
||||
if ($forcerecipient) { // If a recipient was forced
|
||||
$to = array($forcerecipient);
|
||||
} else {
|
||||
$res = $tmpinvoice->fetch_thirdparty();
|
||||
$recipient = $tmpinvoice->thirdparty;
|
||||
if ($res > 0) {
|
||||
$tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING');
|
||||
if (is_array($tmparraycontact) && count($tmparraycontact) > 0) {
|
||||
foreach ($tmparraycontact as $data_email) {
|
||||
if (!empty($data_email['email'])) {
|
||||
$to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email');
|
||||
}
|
||||
$sendContent = make_substitutions($content, $substitutionarray, $outputlangs, 1);
|
||||
|
||||
// Recipient
|
||||
$to = array();
|
||||
if ($forcerecipient) { // If a recipient was forced
|
||||
$to = array($forcerecipient);
|
||||
} else {
|
||||
$res = $tmpinvoice->fetch_thirdparty();
|
||||
$recipient = $tmpinvoice->thirdparty;
|
||||
if ($res > 0) {
|
||||
$tmparraycontact = $tmpinvoice->liste_contact(-1, 'external', 0, 'BILLING');
|
||||
if (is_array($tmparraycontact) && count($tmparraycontact) > 0) {
|
||||
foreach ($tmparraycontact as $data_email) {
|
||||
if (!empty($data_email['email'])) {
|
||||
$to[] = $tmpinvoice->thirdparty->contact_get_property($data_email['id'], 'email');
|
||||
}
|
||||
}
|
||||
if (empty($to) && !empty($recipient->email)) {
|
||||
$to[] = $recipient->email;
|
||||
}
|
||||
if (empty($to)) {
|
||||
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer.";
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid;
|
||||
$error++;
|
||||
}
|
||||
if (empty($to) && !empty($recipient->email)) {
|
||||
$to[] = $recipient->email;
|
||||
}
|
||||
if (empty($to)) {
|
||||
$errormesg = "Failed to send remind to thirdparty id=".$tmpinvoice->socid.". No email defined for invoice or customer.";
|
||||
$loopError++;
|
||||
}
|
||||
} else {
|
||||
$errormesg = "Failed to load recipient with thirdparty id=".$tmpinvoice->socid;
|
||||
$loopError++;
|
||||
}
|
||||
|
||||
// Sender
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
if (!empty($arraymessage->email_from)) { // If a sender is defined into template, we use it in priority
|
||||
$from = $arraymessage->email_from;
|
||||
}
|
||||
if (empty($from)) {
|
||||
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && !empty($to)) {
|
||||
$this->db->begin();
|
||||
|
||||
$to = implode(',', $to);
|
||||
if (!empty($arraymessage->email_to)) { // If a recipient is defined into template, we add it
|
||||
$to = $to.','.$arraymessage->email_to;
|
||||
}
|
||||
|
||||
// Errors Recipient
|
||||
$errors_to = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
|
||||
$trackid = 'inv'.$tmpinvoice->id;
|
||||
$sendcontext = 'standard';
|
||||
|
||||
$email_tocc = '';
|
||||
if (!empty($arraymessage->email_tocc)) { // If a CC is defined into template, we use it
|
||||
$email_tocc = $arraymessage->email_tocc;
|
||||
}
|
||||
|
||||
$email_tobcc = '';
|
||||
if (!empty($arraymessage->email_tobcc)) { // If a BCC is defined into template, we use it
|
||||
$email_tobcc = $arraymessage->email_tobcc;
|
||||
}
|
||||
|
||||
//join file is asked
|
||||
$joinFile = [];
|
||||
$joinFileName = [];
|
||||
$joinFileMime = [];
|
||||
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
|
||||
$joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc;
|
||||
$joinFileName[] = basename($tmpinvoice->last_main_doc);
|
||||
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc);
|
||||
}
|
||||
|
||||
// Mail Creation
|
||||
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, $email_tocc, $email_tobcc, 0, 1, $errors_to, '', $trackid, '', $sendcontext, '');
|
||||
|
||||
// Sending Mail
|
||||
if ($cMailFile->sendfile()) {
|
||||
$nbMailSend++;
|
||||
|
||||
// Add a line into event table
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
// Insert record of emails sent
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
|
||||
$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
|
||||
$actioncomm->contact_id = 0;
|
||||
|
||||
$actioncomm->code = 'AC_EMAIL';
|
||||
$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateOK (nbdays='.$nbdays.' paymentmode='.$paymentmode.' template='.$template.' datetouse='.$datetouse.' forcerecipient='.$forcerecipient.')';
|
||||
$actioncomm->note_private = $sendContent;
|
||||
$actioncomm->fk_project = $tmpinvoice->fk_project;
|
||||
$actioncomm->datep = dol_now();
|
||||
$actioncomm->datef = $actioncomm->datep;
|
||||
$actioncomm->percentage = -1; // Not applicable
|
||||
$actioncomm->authorid = $user->id; // User saving action
|
||||
$actioncomm->userownerid = $user->id; // Owner of action
|
||||
// Fields when action is an email (content should be added into note)
|
||||
$actioncomm->email_msgid = $cMailFile->msgid;
|
||||
$actioncomm->email_subject = $sendTopic;
|
||||
$actioncomm->email_from = $from;
|
||||
$actioncomm->email_sender = '';
|
||||
$actioncomm->email_to = $to;
|
||||
//$actioncomm->email_tocc = $sendtocc;
|
||||
//$actioncomm->email_tobcc = $sendtobcc;
|
||||
//$actioncomm->email_subject = $subject;
|
||||
$actioncomm->errors_to = $errors_to;
|
||||
|
||||
$actioncomm->elementtype = 'invoice';
|
||||
$actioncomm->fk_element = $tmpinvoice->id;
|
||||
|
||||
//$actioncomm->extraparams = $extraparams;
|
||||
|
||||
$actioncomm->create($user);
|
||||
} else {
|
||||
$errormesg = $cMailFile->error.' : '.$to;
|
||||
$error++;
|
||||
|
||||
// Add a line into event table
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
// Insert record of emails sent
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
|
||||
$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
|
||||
$actioncomm->contact_id = 0;
|
||||
|
||||
$actioncomm->code = 'AC_EMAIL';
|
||||
$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateKO';
|
||||
$actioncomm->note_private = $errormesg;
|
||||
$actioncomm->fk_project = $tmpinvoice->fk_project;
|
||||
$actioncomm->datep = dol_now();
|
||||
$actioncomm->datef = $actioncomm->datep;
|
||||
$actioncomm->percentage = -1; // Not applicable
|
||||
$actioncomm->authorid = $user->id; // User saving action
|
||||
$actioncomm->userownerid = $user->id; // Owner of action
|
||||
// Fields when action is an email (content should be added into note)
|
||||
$actioncomm->email_msgid = $cMailFile->msgid;
|
||||
$actioncomm->email_from = $from;
|
||||
$actioncomm->email_sender = '';
|
||||
$actioncomm->email_to = $to;
|
||||
//$actioncomm->email_tocc = $sendtocc;
|
||||
//$actioncomm->email_tobcc = $sendtobcc;
|
||||
//$actioncomm->email_subject = $subject;
|
||||
$actioncomm->errors_to = $errors_to;
|
||||
|
||||
//$actioncomm->extraparams = $extraparams;
|
||||
|
||||
$actioncomm->create($user);
|
||||
}
|
||||
|
||||
$this->db->commit(); // We always commit
|
||||
}
|
||||
|
||||
if ($errormesg) {
|
||||
$errorsMsg[] = $errormesg;
|
||||
}
|
||||
} else {
|
||||
$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Sender
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
if (!empty($arraymessage->email_from)) { // If a sender is defined into template, we use it in priority
|
||||
$from = $arraymessage->email_from;
|
||||
}
|
||||
if (empty($from)) {
|
||||
$errormesg = "Failed to get sender into global setup MAIN_MAIL_EMAIL_FROM";
|
||||
$loopError++;
|
||||
}
|
||||
|
||||
if (!$loopError && !empty($to)) {
|
||||
$this->db->begin();
|
||||
|
||||
$to = implode(',', $to);
|
||||
if (!empty($arraymessage->email_to)) { // If a recipient is defined into template, we add it
|
||||
$to = $to.','.$arraymessage->email_to;
|
||||
}
|
||||
|
||||
// Errors Recipient
|
||||
$errors_to = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
|
||||
$trackid = 'inv'.$tmpinvoice->id;
|
||||
$sendcontext = 'standard';
|
||||
|
||||
$email_tocc = '';
|
||||
if (!empty($arraymessage->email_tocc)) { // If a CC is defined into template, we use it
|
||||
$email_tocc = $arraymessage->email_tocc;
|
||||
}
|
||||
|
||||
$email_tobcc = '';
|
||||
if (!empty($arraymessage->email_tobcc)) { // If a BCC is defined into template, we use it
|
||||
$email_tobcc = $arraymessage->email_tobcc;
|
||||
}
|
||||
|
||||
//join file is asked
|
||||
$joinFile = [];
|
||||
$joinFileName = [];
|
||||
$joinFileMime = [];
|
||||
if ($arraymessage->joinfiles == 1 && !empty($tmpinvoice->last_main_doc)) {
|
||||
$joinFile[] = DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc;
|
||||
$joinFileName[] = basename($tmpinvoice->last_main_doc);
|
||||
$joinFileMime[] = dol_mimetype(DOL_DATA_ROOT.'/'.$tmpinvoice->last_main_doc);
|
||||
}
|
||||
|
||||
// Mail Creation
|
||||
$cMailFile = new CMailFile($sendTopic, $to, $from, $sendContent, $joinFile, $joinFileMime, $joinFileName, $email_tocc, $email_tobcc, 0, 1, $errors_to, '', $trackid, '', $sendcontext, '');
|
||||
|
||||
// Sending Mail
|
||||
if ($cMailFile->sendfile()) {
|
||||
$nbMailSend++;
|
||||
|
||||
// Add a line into event table
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
// Insert record of emails sent
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
|
||||
$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
|
||||
$actioncomm->contact_id = 0;
|
||||
|
||||
$actioncomm->code = 'AC_EMAIL';
|
||||
$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateOK (nbdays='.$nbdays.' paymentmode='.$paymentmode.' template='.$template.' datetouse='.$datetouse.' forcerecipient='.$forcerecipient.')';
|
||||
$actioncomm->note_private = $sendContent;
|
||||
$actioncomm->fk_project = $tmpinvoice->fk_project;
|
||||
$actioncomm->datep = dol_now();
|
||||
$actioncomm->datef = $actioncomm->datep;
|
||||
$actioncomm->percentage = -1; // Not applicable
|
||||
$actioncomm->authorid = $user->id; // User saving action
|
||||
$actioncomm->userownerid = $user->id; // Owner of action
|
||||
// Fields when action is an email (content should be added into note)
|
||||
$actioncomm->email_msgid = $cMailFile->msgid;
|
||||
$actioncomm->email_subject = $sendTopic;
|
||||
$actioncomm->email_from = $from;
|
||||
$actioncomm->email_sender = '';
|
||||
$actioncomm->email_to = $to;
|
||||
//$actioncomm->email_tocc = $sendtocc;
|
||||
//$actioncomm->email_tobcc = $sendtobcc;
|
||||
//$actioncomm->email_subject = $subject;
|
||||
$actioncomm->errors_to = $errors_to;
|
||||
|
||||
$actioncomm->elementtype = 'invoice';
|
||||
$actioncomm->fk_element = $tmpinvoice->id;
|
||||
|
||||
//$actioncomm->extraparams = $extraparams;
|
||||
|
||||
$actioncomm->create($user);
|
||||
} else {
|
||||
$errormesg = $cMailFile->error.' : '.$to;
|
||||
$loopError++;
|
||||
|
||||
// Add a line into event table
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
// Insert record of emails sent
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO'; // Event insert into agenda automatically
|
||||
$actioncomm->socid = $tmpinvoice->thirdparty->id; // To link to a company
|
||||
$actioncomm->contact_id = 0;
|
||||
|
||||
$actioncomm->code = 'AC_EMAIL';
|
||||
$actioncomm->label = 'sendEmailsRemindersOnInvoiceDueDateKO';
|
||||
$actioncomm->note_private = $errormesg;
|
||||
$actioncomm->fk_project = $tmpinvoice->fk_project;
|
||||
$actioncomm->datep = dol_now();
|
||||
$actioncomm->datef = $actioncomm->datep;
|
||||
$actioncomm->percentage = -1; // Not applicable
|
||||
$actioncomm->authorid = $user->id; // User saving action
|
||||
$actioncomm->userownerid = $user->id; // Owner of action
|
||||
// Fields when action is an email (content should be added into note)
|
||||
$actioncomm->email_msgid = $cMailFile->msgid;
|
||||
$actioncomm->email_from = $from;
|
||||
$actioncomm->email_sender = '';
|
||||
$actioncomm->email_to = $to;
|
||||
//$actioncomm->email_tocc = $sendtocc;
|
||||
//$actioncomm->email_tobcc = $sendtobcc;
|
||||
//$actioncomm->email_subject = $subject;
|
||||
$actioncomm->errors_to = $errors_to;
|
||||
|
||||
//$actioncomm->extraparams = $extraparams;
|
||||
|
||||
$actioncomm->create($user);
|
||||
}
|
||||
|
||||
$this->db->commit(); // We always commit
|
||||
}
|
||||
|
||||
if ($errormesg) {
|
||||
$errorsMsg[] = $errormesg;
|
||||
}
|
||||
} else {
|
||||
$errorsMsg[] = 'Failed to fetch record invoice with ID = '.$obj->id;
|
||||
$loopError++;
|
||||
}
|
||||
|
||||
$error += $loopError;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
@@ -6390,7 +6405,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
|
||||
// If fk_remise_except is defined, the discount is linked to the invoice
|
||||
// which flags it as "consumed".
|
||||
if ($this->fk_remise_except) {
|
||||
if ($this->fk_remise_except && empty($error)) {
|
||||
$discount = new DiscountAbsolute($this->db);
|
||||
$result = $discount->fetch($this->fk_remise_except);
|
||||
if ($result >= 0) {
|
||||
@@ -6427,7 +6442,7 @@ class FactureLigne extends CommonInvoiceLine
|
||||
}
|
||||
}
|
||||
|
||||
if (!$notrigger) {
|
||||
if (!$notrigger && empty($error)) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEBILL_INSERT', $user);
|
||||
if ($result < 0) {
|
||||
@@ -6437,8 +6452,17 @@ class FactureLigne extends CommonInvoiceLine
|
||||
// End call triggers
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::insert ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->db->rollback();
|
||||
@@ -6609,8 +6633,18 @@ class FactureLigne extends CommonInvoiceLine
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
|
||||
if (!$error) {
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1 * $error;
|
||||
} else {
|
||||
$this->error = $this->db->error();
|
||||
$this->db->rollback();
|
||||
|
||||
@@ -68,9 +68,9 @@ if (!$sortfield) {
|
||||
}
|
||||
|
||||
$object = new Facture($db);
|
||||
if ($object->fetch($id, $ref)) {
|
||||
if ($object->fetch($id, $ref) > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
$upload_dir = $conf->facture->dir_output."/".dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = $conf->facture->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||
}
|
||||
|
||||
$permissiontoadd = $user->hasRight('facture', 'creer');
|
||||
@@ -119,7 +119,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
if ($object->fetch($id, $ref) > 0) {
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$upload_dir = $conf->facture->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
$head = facture_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans('InvoiceCustomer'), -1, 'bill');
|
||||
|
||||
@@ -436,8 +436,8 @@ if ($action == 'makepayment_confirm' && $user->hasRight('facture', 'paiement'))
|
||||
$paiementAmount = $facture->getSommePaiement();
|
||||
$totalcreditnotes = $facture->getSumCreditNotesUsed();
|
||||
$totaldeposits = $facture->getSumDepositsUsed();
|
||||
$totalpay = $paiementAmount + $totalcreditnotes + $totaldeposits;
|
||||
$remaintopay = price2num($facture->total_ttc - $totalpay);
|
||||
$totalallpayments = $paiementAmount + $totalcreditnotes + $totaldeposits;
|
||||
$remaintopay = price2num($facture->total_ttc - $totalallpayments);
|
||||
if ($remaintopay != 0) {
|
||||
$resultBank = $facture->setBankAccount($bankid);
|
||||
if ($resultBank < 0) {
|
||||
@@ -2076,7 +2076,9 @@ if ($num > 0) {
|
||||
}
|
||||
|
||||
$filename = dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($obj->ref);
|
||||
$filepath = $conf->facture->multidir_output[$obj->entity] ?? $conf->facture->dir_output;
|
||||
$filedir = $filepath . '/' . $filename;
|
||||
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->id;
|
||||
print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
|
||||
print '</td>';
|
||||
|
||||
@@ -86,11 +86,21 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-statut right">';
|
||||
$totalallpayments = 0;
|
||||
$totalcalculated = false;
|
||||
if (method_exists($objectlink, 'getSommePaiement')) {
|
||||
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
|
||||
} else {
|
||||
print $objectlink->getLibStatut(3);
|
||||
$totalcalculated = true;
|
||||
$totalallpayments += $objectlink->getSommePaiement();
|
||||
}
|
||||
if (method_exists($objectlink, 'getSumDepositsUsed')) {
|
||||
$totalcalculated = true;
|
||||
$totalallpayments += $objectlink->getSumDepositsUsed();
|
||||
}
|
||||
if (method_exists($objectlink, 'getSumCreditNotesUsed')) {
|
||||
$totalcalculated = true;
|
||||
$totalallpayments += $objectlink->getSumCreditNotesUsed();
|
||||
}
|
||||
print $objectlink->getLibStatut(3, ($totalcalculated ? $totalallpayments : -1));
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -215,6 +215,9 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
$thirdpartystatic->code_compta = $obj->code_compta;
|
||||
//$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur;
|
||||
|
||||
$totalallpayments = $tmpinvoice->getSommePaiement(0);
|
||||
$totalallpayments += $tmpinvoice->getSumCreditNotesUsed(0);
|
||||
$totalallpayments += $tmpinvoice->getSumDepositsUsed(0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
|
||||
@@ -247,7 +250,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) {
|
||||
|
||||
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
|
||||
|
||||
print '<td>'.$tmpinvoice->getLibStatut(3, $obj->am).'</td>';
|
||||
print '<td>'.$tmpinvoice->getLibStatut(3, $totalallpayments).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@@ -377,6 +380,8 @@ if ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO
|
||||
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
|
||||
print '<td class="right" title="'.dol_escape_htmltag($langs->trans("DateModificationShort").' : '.dol_print_date($db->jdate($obj->tms), 'dayhour', 'tzuserrel')).'">'.dol_print_date($db->jdate($obj->tms), 'day', 'tzuserrel').'</td>';
|
||||
$alreadypaid = $facstatic->getSommePaiement();
|
||||
$alreadypaid += $facstatic->getSumCreditNotesUsed();
|
||||
$alreadypaid += $facstatic->getSumDepositsUsed();
|
||||
print '<td>'.$facstatic->getLibStatut(3, $alreadypaid).'</td>';
|
||||
print '</tr>';
|
||||
$total_ht += $obj->total_ht;
|
||||
|
||||
@@ -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-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Alexandre spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2025 Alexandre spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -120,6 +120,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = fd.fk_facture_fourn";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " WHERE f.fk_statut > 0 AND f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= " AND ct.entity IN (".getEntity('invoice').")";
|
||||
if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
||||
$sql .= " AND f.type IN (0,1,2)";
|
||||
} else {
|
||||
|
||||
@@ -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-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2025 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -130,6 +130,7 @@ $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 ct ON fd.tva_tx = ct.taux AND fd.info_bits = ct.recuperableonly AND ct.fk_pays = ".((int) $idpays);
|
||||
$sql .= " WHERE f.entity IN (".getEntity('invoice').")";
|
||||
$sql .= " AND ct.entity IN (".getEntity('invoice').")";
|
||||
$sql .= " AND f.fk_statut > 0";
|
||||
if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
|
||||
$sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".Facture::TYPE_SITUATION.")";
|
||||
|
||||
@@ -446,7 +446,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/localtax/quadri_detail.php?leftmenu=tax_vat&month='.$m.'&year='.$y.'">'.dol_print_date(dol_mktime(0, 0, 0, $m, 1, $y), "%b %Y").'</a></td>';
|
||||
print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/localtax/quadri_detail.php?leftmenu=tax_vat&month='.$m.'&year='.$y.'&localTaxType='.$localTaxType.'">'.dol_print_date(dol_mktime(0, 0, 0, (int) $m, 1, (int) $y), "%b %Y").'</a></td>';
|
||||
|
||||
$x_coll_sum = 0;
|
||||
foreach (array_keys($x_coll) as $rate) {
|
||||
|
||||
@@ -544,7 +544,7 @@ if ($action == 'new') {
|
||||
if (count($lines[$bid])) {
|
||||
foreach ($lines[$bid] as $lid => $value) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($value["date"], 'day').'</td>';
|
||||
print '<td>'.dol_print_date($value["paymentdate"], 'day').'</td>';
|
||||
print '<td>'.$value["numero"]."</td>\n";
|
||||
print '<td>'.$value["emetteur"]."</td>\n";
|
||||
print '<td>'.$value["banque"]."</td>\n";
|
||||
|
||||
@@ -1270,7 +1270,7 @@ class Paiement extends CommonObject
|
||||
$facturestatic = new Facture($this->db);
|
||||
foreach ($arraybill as $billid) {
|
||||
$facturestatic->fetch($billid);
|
||||
$label .= '<br> '.$facturestatic->getNomUrl(1, '', 0, 0, '', 1).' '.$facturestatic->getLibStatut(2, 1);
|
||||
$label .= '<br> '.$facturestatic->getNomUrl(1, '', 0, 0, '', 1).' '.$facturestatic->getLibStatut(2, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,6 +749,11 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Status
|
||||
if (!empty($arrayfields['p.statut']['checked'])) {
|
||||
print '<td class="right">';
|
||||
|
||||
@@ -51,7 +51,7 @@ $charge = new ChargeSociales($db);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'yes')) {
|
||||
if ($action == 'add_payment') {
|
||||
$error = 0;
|
||||
|
||||
if ($cancel) {
|
||||
@@ -89,7 +89,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
|
||||
}
|
||||
}
|
||||
|
||||
if (count($amounts) <= 0) {
|
||||
if (empty($amounts)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorNoPaymentDefined"), null, 'errors');
|
||||
$action = 'create';
|
||||
@@ -119,9 +119,9 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y
|
||||
|
||||
if (!$error) {
|
||||
$result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOST('accountid', 'int'), '', '');
|
||||
if (!($result > 0)) {
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
setEventMessages($paiement->error, null, 'errors');
|
||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ print '</span></td></tr></table></div><br>';
|
||||
/*
|
||||
* Invoices waiting for withdraw
|
||||
*/
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
|
||||
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut as status, f.paye, f.type,";
|
||||
$sql .= " pfd.date_demande, pfd.amount,";
|
||||
$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
|
||||
@@ -141,10 +141,13 @@ if ($resql) {
|
||||
|
||||
$invoicestatic->id = $obj->rowid;
|
||||
$invoicestatic->ref = $obj->ref;
|
||||
$invoicestatic->statut = $obj->fk_statut;
|
||||
$invoicestatic->statut = $obj->status;
|
||||
$invoicestatic->status = $obj->status;
|
||||
$invoicestatic->paye = $obj->paye;
|
||||
$invoicestatic->type = $obj->type;
|
||||
$alreadypayed = $invoicestatic->getSommePaiement();
|
||||
$totalallpayments = $invoicestatic->getSommePaiement(0);
|
||||
$totalallpayments += $invoicestatic->getSumCreditNotesUsed(0);
|
||||
$totalallpayments += $invoicestatic->getSumDepositsUsed(0);
|
||||
|
||||
$thirdpartystatic->id = $obj->socid;
|
||||
$thirdpartystatic->name = $obj->name;
|
||||
@@ -177,7 +180,7 @@ if ($resql) {
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
print $invoicestatic->getLibStatut(3, $alreadypayed);
|
||||
print $invoicestatic->getLibStatut(3, $totalallpayments);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@@ -168,7 +168,12 @@ if ($id) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $id.'</td></tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("WithdrawalsReceipts").'</td><td>';
|
||||
if ($type == 'bank-transfer') {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("BankTransfers").'</td><td>';
|
||||
} else {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("WithdrawalsReceipts").'</td><td>';
|
||||
}
|
||||
|
||||
print $bon->getNomUrl(1).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec, 'day').'</td></tr>';
|
||||
|
||||
@@ -472,7 +472,7 @@ while ($i < $imaxinloop) {
|
||||
print '<td>';
|
||||
print $line->LibStatut($obj->statut_ligne, 2);
|
||||
print " ";
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
|
||||
print substr('000000'.$obj->rowid_ligne, -6);
|
||||
print '</a></td>';
|
||||
|
||||
|
||||
@@ -152,7 +152,11 @@ if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $
|
||||
}
|
||||
$objectclass = 'BonPrelevement';
|
||||
$objectlabel = 'BonPrelevement';
|
||||
$uploaddir = $conf->prelevement->dir_output;
|
||||
if ($type == 'bank-transfer') {
|
||||
$uploaddir = $conf->paymentbybanktransfer->dir_output;
|
||||
} else {
|
||||
$uploaddir = $conf->prelevement->dir_output;
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
/*
|
||||
|
||||
@@ -162,7 +162,7 @@ if ($result) {
|
||||
|
||||
print '<td>';
|
||||
print $line->LibStatut($obj->statut, 2).' ';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.'">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid.($type == 'bank-transfer' ? '&type=bank-transfer' : '').'">';
|
||||
print substr('000000'.$obj->rowid, -6)."</a></td>";
|
||||
|
||||
if ($bon->checkIfSalaryBonPrelevement()) {
|
||||
|
||||
@@ -159,7 +159,9 @@ if ($id > 0) {
|
||||
print $fac->error."<br>";
|
||||
continue;
|
||||
}
|
||||
$totalpaid = $fac->getSommePaiement();
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$alreadypaid += $fac->getSumDepositsUsed();
|
||||
$alreadypaid += $fac->getSumCreditNotesUsed();
|
||||
|
||||
$userstatic->id = $objf->userid;
|
||||
$userstatic->login = $objf->login;
|
||||
@@ -169,7 +171,7 @@ if ($id > 0) {
|
||||
'date' => $fac->date,
|
||||
'datefieldforsort' => $fac->date.'-'.$fac->ref,
|
||||
'link' => $fac->getNomUrl(1),
|
||||
'status' => $fac->getLibStatut(2, $totalpaid),
|
||||
'status' => $fac->getLibStatut(2, $alreadypaid),
|
||||
'amount' => $fac->total_ttc,
|
||||
'author' => $userstatic->getLoginUrl(1)
|
||||
);
|
||||
|
||||
@@ -505,33 +505,37 @@ if ($modecompta == 'CREANCES-DETTES') {
|
||||
$yeartoprocess++;
|
||||
}
|
||||
|
||||
//var_dump($monthtoprocess.'_'.$yeartoprocess);
|
||||
if (isset($cpt['account_number'])) {
|
||||
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM = 0;
|
||||
if (($yeartoprocess == $start_year && ($k + 1) >= $date_startmonth && $k < $date_endmonth) ||
|
||||
($yeartoprocess == $start_year + 1 && ($k + 1) < $date_startmonth)
|
||||
) {
|
||||
//var_dump($monthtoprocess.'_'.$yeartoprocess);
|
||||
if (isset($cpt['account_number'])) {
|
||||
$return = $AccCat->getSumDebitCredit($cpt['account_number'], $date_start, $date_end, empty($cat['dc']) ? 0 : $cat['dc'], 'nofilter', $monthtoprocess, $yeartoprocess);
|
||||
if ($return < 0) {
|
||||
setEventMessages(null, $AccCat->errors, 'errors');
|
||||
$resultM = 0;
|
||||
} else {
|
||||
$resultM = $AccCat->sdc;
|
||||
}
|
||||
} else {
|
||||
$resultM = $AccCat->sdc;
|
||||
$resultM = 0;
|
||||
}
|
||||
if (empty($totCat['M'][$k])) {
|
||||
$totCat['M'][$k] = $resultM;
|
||||
} else {
|
||||
$totCat['M'][$k] += $resultM;
|
||||
}
|
||||
if (empty($sommes[$code]['M'][$k])) {
|
||||
$sommes[$code]['M'][$k] = $resultM;
|
||||
} else {
|
||||
$sommes[$code]['M'][$k] += $resultM;
|
||||
}
|
||||
if (isset($cpt['account_number'])) {
|
||||
$totPerAccount[$cpt['account_number']]['M'][$k] = $resultM;
|
||||
}
|
||||
} else {
|
||||
$resultM = 0;
|
||||
}
|
||||
if (empty($totCat['M'][$k])) {
|
||||
$totCat['M'][$k] = $resultM;
|
||||
} else {
|
||||
$totCat['M'][$k] += $resultM;
|
||||
}
|
||||
if (empty($sommes[$code]['M'][$k])) {
|
||||
$sommes[$code]['M'][$k] = $resultM;
|
||||
} else {
|
||||
$sommes[$code]['M'][$k] += $resultM;
|
||||
}
|
||||
if (isset($cpt['account_number'])) {
|
||||
$totPerAccount[$cpt['account_number']]['M'][$k] = $resultM;
|
||||
}
|
||||
|
||||
$resultN += $resultM;
|
||||
$resultN += $resultM;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($totCat)) {
|
||||
|
||||
@@ -598,7 +598,6 @@ class PaymentSocialContribution extends CommonObject
|
||||
$result = $this->update_fk_bank($bank_line_id);
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
// Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
|
||||
@@ -610,7 +609,7 @@ class PaymentSocialContribution extends CommonObject
|
||||
$result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
|
||||
if ($result <= 0) {
|
||||
$error++;
|
||||
dol_print_error($this->db);
|
||||
$this->setErrorsFromObject($acc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,7 +621,8 @@ class PaymentSocialContribution extends CommonObject
|
||||
$socialcontrib->fetch($key);
|
||||
$result = $acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib != $socialcontrib->type_label) ? ' ('.$socialcontrib->lib.')' : ''), 'sc');
|
||||
if ($result <= 0) {
|
||||
dol_print_error($this->db);
|
||||
$this->setErrorsFromObject($acc);
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($socialcontrib->fk_user) {
|
||||
@@ -639,14 +639,14 @@ class PaymentSocialContribution extends CommonObject
|
||||
);
|
||||
|
||||
if ($result <= 0) {
|
||||
$this->error = $acc->error;
|
||||
$this->setErrorsFromObject($acc);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->error = $acc->error;
|
||||
$this->setErrorsFromObject($acc);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,7 +724,8 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['t.status']['checked'])) {
|
||||
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>';
|
||||
$totalallpayments = $obj->alreadypayed;
|
||||
print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $totalallpayments) . '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@@ -767,9 +767,6 @@ if (empty($reshook)) {
|
||||
|
||||
$price_ht = price2num(GETPOST('elprice'), 'MU');
|
||||
$remise_percent = price2num(GETPOST('elremise_percent'), '', 2);
|
||||
if ($remise_percent > 0) {
|
||||
$remise = round(($price_ht * $remise_percent / 100), 2);
|
||||
}
|
||||
|
||||
$objectline->fk_product = GETPOST('idprod', 'int');
|
||||
$objectline->description = GETPOST('product_desc', 'restricthtml');
|
||||
@@ -1988,7 +1985,9 @@ if ($action == 'create') {
|
||||
if ($objp->fk_product > 0) {
|
||||
$product = new Product($db);
|
||||
$product->fetch($objp->fk_product);
|
||||
$dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
|
||||
if (!empty($product->duration_value) && !empty($product->duration_unit)) {
|
||||
$dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2282,7 +2281,7 @@ if ($action == 'create') {
|
||||
print '<br><!-- Link to sign -->';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
|
||||
|
||||
print showOnlineSignatureUrl('contract', $object->ref).'<br>';
|
||||
print showOnlineSignatureUrl('contract', $object->ref, $object).'<br>';
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
@@ -519,7 +519,13 @@ class Contracts extends DolibarrApi
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->contract->$field = $value;
|
||||
if ($field == 'array_options' && is_array($value)) {
|
||||
foreach ($value as $index => $val) {
|
||||
$this->contract->array_options[$index] = $this->_checkValForAPI($field, $val, $this->contract);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$this->contract->$field = $this->_checkValForAPI($field, $value, $this->contract);
|
||||
}
|
||||
|
||||
if ($this->contract->update(DolibarrApiAccess::$user) > 0) {
|
||||
|
||||
@@ -3273,7 +3273,7 @@ class ContratLigne extends CommonObjectLine
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref of contract line
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
* @return int Return integer <0 if KO, >0 if OK, 0 if not found
|
||||
*/
|
||||
public function fetch($id, $ref = '')
|
||||
{
|
||||
@@ -3291,7 +3291,7 @@ class ContratLigne extends CommonObjectLine
|
||||
$sql .= " t.label,"; // This field is not used. Only label of product
|
||||
$sql .= " p.ref as product_ref,";
|
||||
$sql .= " p.label as product_label,";
|
||||
$sql .= " p.description as product_desc,";
|
||||
$sql .= " p.description as product_description,";
|
||||
$sql .= " p.fk_product_type as product_type,";
|
||||
$sql .= " t.description,";
|
||||
$sql .= " t.date_commande,";
|
||||
@@ -3393,6 +3393,9 @@ class ContratLigne extends CommonObjectLine
|
||||
$this->rang = $obj->rang;
|
||||
|
||||
$this->fetch_optionals();
|
||||
} else {
|
||||
$this->db->free($resql);
|
||||
return 0;
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
@@ -3819,15 +3822,13 @@ class ContratLigne extends CommonObjectLine
|
||||
|
||||
$error = 0;
|
||||
|
||||
// statut actif : 4
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = ".((int) ContratLigne::STATUS_CLOSED).",";
|
||||
$sql .= " date_cloture = '".$this->db->idate($date_end_real)."',";
|
||||
$sql .= " fk_user_cloture = ".((int) $user->id).",";
|
||||
$sql .= " commentaire = '".$this->db->escape($comment)."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND statut = ".((int) ContratLigne::STATUS_OPEN);
|
||||
$sql .= " WHERE rowid = ".((int) $this->id)." AND statut <> ".((int) ContratLigne::STATUS_CLOSED);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@@ -376,7 +376,10 @@ if (!empty($filter_opcloture) && $filter_opcloture == ' BETWEEN ') {
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
//print $sql;
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
@@ -488,6 +491,10 @@ if ($filter_datecloture_start != '') {
|
||||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
|
||||
@@ -358,7 +358,7 @@ if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permission
|
||||
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
|
||||
$attribute = GETPOST('attribute', 'alphanohtml');
|
||||
$attribute = GETPOST('attribute', 'aZ09');
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user