forked from Wavyzz/dolibarr
Compare commits
835 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fdc1a9883 | ||
|
|
817920f282 | ||
|
|
c3f07dd2e0 | ||
|
|
430f833222 | ||
|
|
e165dce908 | ||
|
|
82651cd920 | ||
|
|
9e397206d3 | ||
|
|
583ea05567 | ||
|
|
06fe172669 | ||
|
|
8deb2eaa0c | ||
|
|
4c8664b297 | ||
|
|
2d88b69cf6 | ||
|
|
77341470e1 | ||
|
|
af93fc7484 | ||
|
|
1bac3a0ccf | ||
|
|
92a3faeaf7 | ||
|
|
d15c52db3b | ||
|
|
2dbb82fc76 | ||
|
|
12690666e2 | ||
|
|
a0bc26a923 | ||
|
|
779d7e9689 | ||
|
|
d62118dca8 | ||
|
|
a6996169d6 | ||
|
|
cdbb79a26c | ||
|
|
5655856ca5 | ||
|
|
7838b75ec9 | ||
|
|
c94689e9a9 | ||
|
|
f7d5172a74 | ||
|
|
ead2a764c7 | ||
|
|
2015268b7e | ||
|
|
e4afd4af00 | ||
|
|
847189805a | ||
|
|
252335318f | ||
|
|
e285b42a18 | ||
|
|
e0b272941f | ||
|
|
bd3647a9d7 | ||
|
|
b9c95a5a5c | ||
|
|
5bab9d59b2 | ||
|
|
df721a5fbc | ||
|
|
37fb70d983 | ||
|
|
02bedc49d3 | ||
|
|
e41b55af13 | ||
|
|
a69c3caf2c | ||
|
|
53caac13a9 | ||
|
|
179feebd80 | ||
|
|
f8fef61075 | ||
|
|
e317b0847a | ||
|
|
7af083f1ec | ||
|
|
275b9a9960 | ||
|
|
46a24ff28f | ||
|
|
cb24fa0f08 | ||
|
|
24be0b7305 | ||
|
|
61a57e619f | ||
|
|
53e476483c | ||
|
|
b96082a577 | ||
|
|
b1a3238c94 | ||
|
|
009424cd67 | ||
|
|
91bfa4be6c | ||
|
|
3523c2b3d2 | ||
|
|
e03d7eba8c | ||
|
|
2aa0956f15 | ||
|
|
bb09bcece4 | ||
|
|
e88b68f131 | ||
|
|
20309665e6 | ||
|
|
ba6f7d4b0a | ||
|
|
61a5be6e2a | ||
|
|
b81b6b651f | ||
|
|
7f797668c9 | ||
|
|
06189f8153 | ||
|
|
3d84adbd76 | ||
|
|
4e16f64af0 | ||
|
|
e85ec19018 | ||
|
|
b5a0e14ffe | ||
|
|
2cf51fbdf1 | ||
|
|
ceb85cfa45 | ||
|
|
4ddca02bb9 | ||
|
|
7dada7ae8e | ||
|
|
c7f54439ff | ||
|
|
bde30b85ad | ||
|
|
3bdf7d411d | ||
|
|
8866b8eb1d | ||
|
|
e4705669ba | ||
|
|
4341e367d2 | ||
|
|
d582f72bd9 | ||
|
|
1e986bc39a | ||
|
|
80ff7fa86f | ||
|
|
103c7e6d06 | ||
|
|
97b1589fb5 | ||
|
|
2ba7c07574 | ||
|
|
2f668ccc79 | ||
|
|
1daba56bbc | ||
|
|
bc632c9ab7 | ||
|
|
a6c6bbe16d | ||
|
|
3f2b3c0840 | ||
|
|
1c7cd19c1d | ||
|
|
c4143763be | ||
|
|
41709f07d0 | ||
|
|
2d13b5b59d | ||
|
|
d8ca9f2947 | ||
|
|
86a58def3b | ||
|
|
dab264c641 | ||
|
|
8fc2f7441c | ||
|
|
5d6d43d539 | ||
|
|
fed61930d5 | ||
|
|
95dfa1f7aa | ||
|
|
63fb82931c | ||
|
|
5d6cd381b9 | ||
|
|
e9d65ea751 | ||
|
|
09c92b7cc8 | ||
|
|
c586f2ecf7 | ||
|
|
b5cd722eb1 | ||
|
|
5fcfad5966 | ||
|
|
d42f00bca9 | ||
|
|
baf9d4a806 | ||
|
|
426eb178f2 | ||
|
|
8785d69548 | ||
|
|
4c21ad4e4e | ||
|
|
45ecb0258b | ||
|
|
77e7932671 | ||
|
|
7eaa2011ba | ||
|
|
b996237142 | ||
|
|
60321aabd8 | ||
|
|
7590df85e6 | ||
|
|
aa59c380ad | ||
|
|
e57ceab5de | ||
|
|
b65b545e0f | ||
|
|
2e2cc55350 | ||
|
|
95e3c5a4b1 | ||
|
|
6b0b975ffd | ||
|
|
1a1f0fbc62 | ||
|
|
131ddd6984 | ||
|
|
b25c7e44d3 | ||
|
|
0a581e48d4 | ||
|
|
545133960e | ||
|
|
eb224e43a5 | ||
|
|
734ecbc9b5 | ||
|
|
be21405d21 | ||
|
|
c9222adf6d | ||
|
|
4d72573484 | ||
|
|
4c3f9d6d5e | ||
|
|
7de812d2ed | ||
|
|
5f8346f854 | ||
|
|
492b1e7169 | ||
|
|
f2cfb928e8 | ||
|
|
2e9f5d1c94 | ||
|
|
3dd11e1eaf | ||
|
|
dd259043cd | ||
|
|
dc7a1610e7 | ||
|
|
630e38072b | ||
|
|
b42c87256c | ||
|
|
842c6168a2 | ||
|
|
20c50e809d | ||
|
|
19008531bb | ||
|
|
f76df85aec | ||
|
|
b958311819 | ||
|
|
8b4b786969 | ||
|
|
2f79a12c6b | ||
|
|
8d52c4f919 | ||
|
|
7bb9615cff | ||
|
|
6245f25deb | ||
|
|
46e94af594 | ||
|
|
3657857d21 | ||
|
|
f3003fa542 | ||
|
|
942e2f40bf | ||
|
|
886ad9d4b6 | ||
|
|
f2b1aa00b9 | ||
|
|
5c024ceb54 | ||
|
|
b5d7206519 | ||
|
|
82708705c7 | ||
|
|
d975dd507b | ||
|
|
b1f1ddc6d0 | ||
|
|
ab85fa8721 | ||
|
|
e5df7e206b | ||
|
|
d179cafa9c | ||
|
|
ecd84f6c45 | ||
|
|
4c87cbf644 | ||
|
|
e18190565c | ||
|
|
c044d9ab58 | ||
|
|
e1585ef7e3 | ||
|
|
882863ab48 | ||
|
|
bf27ca1b11 | ||
|
|
e4635c9401 | ||
|
|
c7789d2038 | ||
|
|
11897976c3 | ||
|
|
1870598734 | ||
|
|
9a210c1a91 | ||
|
|
dd835c4868 | ||
|
|
bcecc25401 | ||
|
|
90f1ab8af4 | ||
|
|
64dafbc37f | ||
|
|
37e4da30d0 | ||
|
|
e29476428c | ||
|
|
6b3c17680f | ||
|
|
bfed1b9db1 | ||
|
|
79c34f4d69 | ||
|
|
50a3b73a6f | ||
|
|
3ec295935c | ||
|
|
ecdb56606d | ||
|
|
e1bd605604 | ||
|
|
4fae1e3236 | ||
|
|
8d4126274a | ||
|
|
ef2c6a0ed4 | ||
|
|
58535993c1 | ||
|
|
7bf9801b80 | ||
|
|
cd2f6616be | ||
|
|
def28be0ab | ||
|
|
eec99b436e | ||
|
|
0f3d2cc8df | ||
|
|
ae34fa6fbd | ||
|
|
d7da83ebc5 | ||
|
|
9fafefa0d7 | ||
|
|
0518218aed | ||
|
|
6f526eb780 | ||
|
|
b732844e91 | ||
|
|
628b437e28 | ||
|
|
c392b9b8ef | ||
|
|
75bc3d17e6 | ||
|
|
ab43d9d675 | ||
|
|
804703c9c9 | ||
|
|
e1c83df086 | ||
|
|
560038fa18 | ||
|
|
c2eb2bf10e | ||
|
|
edb59c05dc | ||
|
|
e642535389 | ||
|
|
6731e238a3 | ||
|
|
7d7c0624d2 | ||
|
|
c958a4f865 | ||
|
|
a95bc76afb | ||
|
|
bc7623d383 | ||
|
|
2c76a6cd80 | ||
|
|
96e26100f0 | ||
|
|
7cdc1c8bef | ||
|
|
809b2a91ed | ||
|
|
1fd5dba118 | ||
|
|
307ede8b22 | ||
|
|
5621d1f8ea | ||
|
|
848d76ee78 | ||
|
|
b1469ba761 | ||
|
|
2b135dc951 | ||
|
|
39758625b7 | ||
|
|
0e986b8f97 | ||
|
|
a89983ef5c | ||
|
|
1c581c6fff | ||
|
|
11446fb2f7 | ||
|
|
46d2b4d62d | ||
|
|
9f67bb0aa3 | ||
|
|
5efb94b06f | ||
|
|
ed2d9f179b | ||
|
|
1feb22ea9c | ||
|
|
7d5c3a5c4f | ||
|
|
2094c48b7f | ||
|
|
cad7bdc74b | ||
|
|
04199c2b4b | ||
|
|
f371f80de3 | ||
|
|
32ce42610a | ||
|
|
f3be6045f9 | ||
|
|
e801b5a431 | ||
|
|
6b2490f4e4 | ||
|
|
af09a3714b | ||
|
|
f82bedb36c | ||
|
|
dcd3387a30 | ||
|
|
51229a602f | ||
|
|
6c7a5cebdf | ||
|
|
d045dca003 | ||
|
|
34145ed443 | ||
|
|
95e7062ca3 | ||
|
|
d5d6939fd9 | ||
|
|
f98ca2e31a | ||
|
|
03f7df88c6 | ||
|
|
c755d5f58d | ||
|
|
c2397fad60 | ||
|
|
c008853842 | ||
|
|
faef7a2e0c | ||
|
|
fd36ade61a | ||
|
|
1d571c4159 | ||
|
|
9eeb80151e | ||
|
|
53ce297ab3 | ||
|
|
6d0c4deb6e | ||
|
|
884b74a6bb | ||
|
|
8b9041b93e | ||
|
|
4caefbe926 | ||
|
|
94de6efa4b | ||
|
|
3284ebdcf1 | ||
|
|
dd208348c4 | ||
|
|
cb27eb98e1 | ||
|
|
f9f37c52de | ||
|
|
5971cd8e59 | ||
|
|
ebb4da8417 | ||
|
|
60f8ca1283 | ||
|
|
57d6417095 | ||
|
|
6bb91dd5d2 | ||
|
|
aab0a33f40 | ||
|
|
ce2fc28d80 | ||
|
|
ee4fcba4f2 | ||
|
|
4d05bff780 | ||
|
|
27100df927 | ||
|
|
64dd6439e7 | ||
|
|
286d62edb8 | ||
|
|
c698558d9e | ||
|
|
b20ae45265 | ||
|
|
2d252e85e6 | ||
|
|
d300b943e1 | ||
|
|
b4b185abe0 | ||
|
|
36cc1c6ca9 | ||
|
|
1d6baf5f2b | ||
|
|
cbf12b779d | ||
|
|
b276a8186e | ||
|
|
7f419a29e7 | ||
|
|
01c2971f4f | ||
|
|
9690e68bfb | ||
|
|
b8736f5103 | ||
|
|
a698ba0b56 | ||
|
|
85e5ac678f | ||
|
|
6c8e7494f0 | ||
|
|
276f2dce77 | ||
|
|
67ee443b34 | ||
|
|
4056b87a74 | ||
|
|
7321829732 | ||
|
|
ea071b7680 | ||
|
|
671b4a399d | ||
|
|
2e1727e323 | ||
|
|
5535daf84a | ||
|
|
7c583227fb | ||
|
|
033b898106 | ||
|
|
49bad95d31 | ||
|
|
63987fa32e | ||
|
|
bfd46f62ea | ||
|
|
6fe69d4a60 | ||
|
|
15ab37b46e | ||
|
|
b21feca9d7 | ||
|
|
147b35d62e | ||
|
|
cf5c972c65 | ||
|
|
483bfb096b | ||
|
|
c28d87252b | ||
|
|
d0fdf700d7 | ||
|
|
0d00c51c2a | ||
|
|
94a76a1393 | ||
|
|
27c55635f3 | ||
|
|
23ee6748f7 | ||
|
|
fa2fddcdc1 | ||
|
|
c690dfb258 | ||
|
|
144c13998a | ||
|
|
1052213c97 | ||
|
|
ef05171641 | ||
|
|
24cc687724 | ||
|
|
448fcae02f | ||
|
|
abb7e651d1 | ||
|
|
4d6f87e544 | ||
|
|
d731857fd0 | ||
|
|
12f1e4c04b | ||
|
|
d3d3bcaca5 | ||
|
|
f88874c1f7 | ||
|
|
5c59f5c63b | ||
|
|
67ce71bc48 | ||
|
|
2817ace0d2 | ||
|
|
a5814ce779 | ||
|
|
b074f580db | ||
|
|
39cd63e2d4 | ||
|
|
371b168db1 | ||
|
|
3f17c92aa3 | ||
|
|
c988d3f1cc | ||
|
|
2e3bb4a585 | ||
|
|
414093f94f | ||
|
|
8156374005 | ||
|
|
a26bb2d884 | ||
|
|
6254e20c67 | ||
|
|
9b56555962 | ||
|
|
d989483d2b | ||
|
|
783dc18cd0 | ||
|
|
2081aefc84 | ||
|
|
bb93b98260 | ||
|
|
2d4624a1be | ||
|
|
839de65012 | ||
|
|
ae9c7ad6b6 | ||
|
|
906a9eaa5a | ||
|
|
dbe45d03d3 | ||
|
|
e5cb2be618 | ||
|
|
c4277c1e54 | ||
|
|
f3700b66c6 | ||
|
|
fd8f89c708 | ||
|
|
8ee1186492 | ||
|
|
d5b7184c8d | ||
|
|
a161ca37ff | ||
|
|
c1e6d88442 | ||
|
|
2114e6ba4e | ||
|
|
c9e7e6d925 | ||
|
|
c434136ba5 | ||
|
|
464ee6f9d6 | ||
|
|
13106d34a6 | ||
|
|
38d735341c | ||
|
|
2147bd23e6 | ||
|
|
cba0447cf1 | ||
|
|
c80fa48225 | ||
|
|
bdfbe462df | ||
|
|
8102883356 | ||
|
|
d2b81c23c0 | ||
|
|
3c281ccefa | ||
|
|
ba58578d60 | ||
|
|
cdb63bada3 | ||
|
|
1834be79a0 | ||
|
|
5b917c039e | ||
|
|
92cace6747 | ||
|
|
40b63be4b9 | ||
|
|
47d0b6583e | ||
|
|
c0e719e3d8 | ||
|
|
d3c0414b4f | ||
|
|
2c0eeaf8de | ||
|
|
1da7b154c1 | ||
|
|
54fb59d8db | ||
|
|
e66b266432 | ||
|
|
f339719ae9 | ||
|
|
adb70e0456 | ||
|
|
53ac13c792 | ||
|
|
c0481be8d8 | ||
|
|
19c616756a | ||
|
|
f2ae3ee41d | ||
|
|
054d98a2ba | ||
|
|
1420149b95 | ||
|
|
4874d08062 | ||
|
|
4c0dc21ca0 | ||
|
|
bc7bd77cea | ||
|
|
5d4eda68e0 | ||
|
|
94b1d59f2b | ||
|
|
f307fecaf6 | ||
|
|
6feacab4f5 | ||
|
|
4c8af0ff50 | ||
|
|
b154357683 | ||
|
|
3b9aee7d4c | ||
|
|
9f6118ed52 | ||
|
|
c947502efa | ||
|
|
7406d3c7ee | ||
|
|
dbb9caa196 | ||
|
|
bcbbcc1c66 | ||
|
|
764646634d | ||
|
|
0ae02d76a3 | ||
|
|
e9bf6ed4ce | ||
|
|
54228b4f98 | ||
|
|
58589b8454 | ||
|
|
387dd967e2 | ||
|
|
5adeaf9d76 | ||
|
|
205e715b7f | ||
|
|
79562f8d5b | ||
|
|
b5fe953a64 | ||
|
|
df22a311c2 | ||
|
|
9253fed754 | ||
|
|
c8c550cd33 | ||
|
|
8000777864 | ||
|
|
0bd45dc64b | ||
|
|
d99535d9da | ||
|
|
7ce7c0d5e5 | ||
|
|
0f51aa15d8 | ||
|
|
22d92c0540 | ||
|
|
a1ac285a25 | ||
|
|
e66847d5c3 | ||
|
|
7e8fda2d71 | ||
|
|
301f509611 | ||
|
|
550fc37e62 | ||
|
|
a14a3db2e9 | ||
|
|
e4d37c3e23 | ||
|
|
b2feac9d90 | ||
|
|
762ab74940 | ||
|
|
9471495dca | ||
|
|
58470e0913 | ||
|
|
f6ff6610e4 | ||
|
|
c7798d11ce | ||
|
|
25390e5f73 | ||
|
|
2e6c036ad8 | ||
|
|
61efda4cbd | ||
|
|
1331e8add7 | ||
|
|
0abe19c30d | ||
|
|
bbcf70cf4e | ||
|
|
70e75753f8 | ||
|
|
3ac413084f | ||
|
|
3d4e6c9169 | ||
|
|
56bc0dbd25 | ||
|
|
31b5d9df52 | ||
|
|
de305cb3b2 | ||
|
|
59a89b250d | ||
|
|
1c7b99d3dc | ||
|
|
b650ba21c4 | ||
|
|
b70dd36ffa | ||
|
|
6a62e13960 | ||
|
|
62f895e2ec | ||
|
|
4a5988accb | ||
|
|
b1ce3fc5c8 | ||
|
|
4ba039d229 | ||
|
|
ae7f8c3fe4 | ||
|
|
dc930dd6c5 | ||
|
|
3f6b3b51ca | ||
|
|
6900771c70 | ||
|
|
ca8ae3c723 | ||
|
|
b1f98b5903 | ||
|
|
2821459894 | ||
|
|
dd8ef47a25 | ||
|
|
a020dbf3d7 | ||
|
|
aaadc6e001 | ||
|
|
0db03cfbcc | ||
|
|
ab558ee5fa | ||
|
|
a2f4afbf88 | ||
|
|
46770178d2 | ||
|
|
ef9468f78a | ||
|
|
48499fb506 | ||
|
|
f2e429e28f | ||
|
|
4017d09613 | ||
|
|
fd85088a6c | ||
|
|
1d9d8980a9 | ||
|
|
d3150ede42 | ||
|
|
f18edd5787 | ||
|
|
7e69a31dd6 | ||
|
|
3a181a5d28 | ||
|
|
59aa49076c | ||
|
|
e4725f4248 | ||
|
|
033016da7f | ||
|
|
12d0928244 | ||
|
|
3db4d10fc0 | ||
|
|
60fc500fa8 | ||
|
|
3ddc582edd | ||
|
|
5128ad6e24 | ||
|
|
eb03f8f08e | ||
|
|
b671edb116 | ||
|
|
09d3db145b | ||
|
|
8dc3d7323d | ||
|
|
9b9b5adf66 | ||
|
|
08abb1490a | ||
|
|
8a5c53550b | ||
|
|
049a038f56 | ||
|
|
e526162e8e | ||
|
|
1b16eb731d | ||
|
|
1bdffa961f | ||
|
|
6de3a40546 | ||
|
|
5f71165020 | ||
|
|
04327189f7 | ||
|
|
c4b2c3e697 | ||
|
|
8e1a9064cb | ||
|
|
95fa183fac | ||
|
|
bfc476a118 | ||
|
|
c90ece1188 | ||
|
|
c70dff89dd | ||
|
|
340287f073 | ||
|
|
365639a6c0 | ||
|
|
44e5566ee5 | ||
|
|
38be224665 | ||
|
|
29568287ef | ||
|
|
5fae19b4d6 | ||
|
|
c7d0e917fb | ||
|
|
9cafb08759 | ||
|
|
03fd69c3b9 | ||
|
|
a832bbb348 | ||
|
|
5308acdcde | ||
|
|
b2effa7cc8 | ||
|
|
b7f26ea788 | ||
|
|
d2135fd139 | ||
|
|
acd2d0121d | ||
|
|
9fa6bfd1a5 | ||
|
|
359e82fd3e | ||
|
|
dbde97f25f | ||
|
|
f04af6c1b3 | ||
|
|
c194538609 | ||
|
|
883c9dbf99 | ||
|
|
d0ab117488 | ||
|
|
3071796bc3 | ||
|
|
fa1bb9d672 | ||
|
|
a9e4fcfdca | ||
|
|
780e8ce470 | ||
|
|
2e9952439e | ||
|
|
5fef6478a5 | ||
|
|
61798d1af0 | ||
|
|
4cbcf5189a | ||
|
|
38c770ffb3 | ||
|
|
07cd1fb3c2 | ||
|
|
2493c2468d | ||
|
|
306dcf3600 | ||
|
|
c2f84309db | ||
|
|
2f2b0630e2 | ||
|
|
314c30f489 | ||
|
|
1e4844fd1c | ||
|
|
e1344eb97c | ||
|
|
219e58d0e4 | ||
|
|
356f36c5bf | ||
|
|
9a75cb466a | ||
|
|
dc5127e619 | ||
|
|
a9bfe0f48f | ||
|
|
5d6555b9dd | ||
|
|
3f360601af | ||
|
|
35182066a8 | ||
|
|
a6e4e4ddb0 | ||
|
|
c3c14277e1 | ||
|
|
42b7d80567 | ||
|
|
fde33594a2 | ||
|
|
7f28c9fff6 | ||
|
|
57a6ada2a3 | ||
|
|
5741d4d67d | ||
|
|
4b90510b82 | ||
|
|
924cf871a7 | ||
|
|
77b6ef7396 | ||
|
|
388b90a94c | ||
|
|
f789714f14 | ||
|
|
e195cf0b95 | ||
|
|
a2c80a704f | ||
|
|
b5196b7164 | ||
|
|
1a5bbef266 | ||
|
|
05683bbf61 | ||
|
|
90615a8682 | ||
|
|
36b4d50cff | ||
|
|
d421b90376 | ||
|
|
356525730d | ||
|
|
d29233f553 | ||
|
|
5703c704f9 | ||
|
|
50ed463b9f | ||
|
|
3889941406 | ||
|
|
0d38e154cf | ||
|
|
22a3721dda | ||
|
|
2636c2470b | ||
|
|
1ea6df14d0 | ||
|
|
fe3ce78ae4 | ||
|
|
27ace14fb7 | ||
|
|
7f1adc6a6a | ||
|
|
6eb2204c2b | ||
|
|
1d9873e1a9 | ||
|
|
bc9b816719 | ||
|
|
825ceeaa8d | ||
|
|
864af9cc3b | ||
|
|
d453961afc | ||
|
|
7d4b43f368 | ||
|
|
d3a0cff30a | ||
|
|
52421406ce | ||
|
|
eb4a5f6570 | ||
|
|
e992e4bea5 | ||
|
|
13667e4850 | ||
|
|
b58df17545 | ||
|
|
a291919cf7 | ||
|
|
03544f783a | ||
|
|
6ea69f421f | ||
|
|
310bf4bde4 | ||
|
|
ec3a07cd52 | ||
|
|
63a363080e | ||
|
|
323a0d7d0d | ||
|
|
b7cf434ebd | ||
|
|
555b37411f | ||
|
|
bd68b94411 | ||
|
|
141df52dd6 | ||
|
|
fb3f1ef667 | ||
|
|
4755197503 | ||
|
|
59df957181 | ||
|
|
192dc43b87 | ||
|
|
91fbb4da41 | ||
|
|
a6879775bb | ||
|
|
01a3787664 | ||
|
|
3db101ffdd | ||
|
|
2b966e630b | ||
|
|
892798bf79 | ||
|
|
007783cf76 | ||
|
|
0de1b878bd | ||
|
|
777d2f7027 | ||
|
|
78645c718f | ||
|
|
0b271cca46 | ||
|
|
985a268477 | ||
|
|
cd5e43483e | ||
|
|
02f47b5a91 | ||
|
|
4feecbeab8 | ||
|
|
0630542e20 | ||
|
|
783efd1a71 | ||
|
|
5313d61847 | ||
|
|
92c33b76dc | ||
|
|
7c1d6251f7 | ||
|
|
9178d80349 | ||
|
|
bc8127d685 | ||
|
|
8e18d5906d | ||
|
|
f02e731c67 | ||
|
|
9bcf01bf3f | ||
|
|
fed0f3d09e | ||
|
|
07b25e457b | ||
|
|
78e3c63ead | ||
|
|
6b7c59635e | ||
|
|
61909d842d | ||
|
|
4c5bb7660c | ||
|
|
bbc13b8ac9 | ||
|
|
71622b9f86 | ||
|
|
82231b77a2 | ||
|
|
67208b111d | ||
|
|
c48721e008 | ||
|
|
0efd118d43 | ||
|
|
d9d4b6e06d | ||
|
|
f4a95f89ac | ||
|
|
a7655b69e8 | ||
|
|
ce6d1d306d | ||
|
|
5f89b4427f | ||
|
|
9427b2f4b1 | ||
|
|
1d0c93c0b6 | ||
|
|
08e83983d0 | ||
|
|
26e3593c98 | ||
|
|
eaafe83ae4 | ||
|
|
58584d8784 | ||
|
|
76aa2df807 | ||
|
|
da93081f47 | ||
|
|
ba434617dc | ||
|
|
97b694b59c | ||
|
|
c258e229c8 | ||
|
|
611f5f638d | ||
|
|
79279caa2e | ||
|
|
745c4625a6 | ||
|
|
be0cd601a9 | ||
|
|
703d4a6aee | ||
|
|
6b0d060289 | ||
|
|
4325363084 | ||
|
|
c387436a68 | ||
|
|
fba3adbc5e | ||
|
|
030cea6a0f | ||
|
|
b70808eca7 | ||
|
|
16c212c9fd | ||
|
|
8ac7dd8e9a | ||
|
|
1afbf75cbc | ||
|
|
da8fe06301 | ||
|
|
cad44ee68a | ||
|
|
8baad70f6c | ||
|
|
735f06fd83 | ||
|
|
75580f253e | ||
|
|
08d5ff4736 | ||
|
|
a1217d61b6 | ||
|
|
fbc3be84e3 | ||
|
|
efaa0b1e2a | ||
|
|
f7556e7ad2 | ||
|
|
5afd2695fb | ||
|
|
d4ade7b935 | ||
|
|
d7113a3602 | ||
|
|
8da7f789d8 | ||
|
|
9c3805c0d5 | ||
|
|
83440f5bbc | ||
|
|
b0c68ddc61 | ||
|
|
cb089987ee | ||
|
|
93d16bf4d7 | ||
|
|
3793ae323a | ||
|
|
7ee64fc0d4 | ||
|
|
3e43e164ae | ||
|
|
74b401b70d | ||
|
|
8626d6279a | ||
|
|
df53870c01 | ||
|
|
4382642099 | ||
|
|
b124c7f16d | ||
|
|
000c1bddb2 | ||
|
|
6b557fd92f | ||
|
|
6ba7fe26a7 | ||
|
|
50cacfee3d | ||
|
|
aa1ff189e1 | ||
|
|
235817c581 | ||
|
|
81e7f45200 | ||
|
|
5998f60764 | ||
|
|
5937fba373 | ||
|
|
626fea3f7a | ||
|
|
b3f17dc614 | ||
|
|
dac99c7745 | ||
|
|
a4b4eab2ae | ||
|
|
bec985a551 | ||
|
|
b491d22c16 | ||
|
|
5a4480bd1d | ||
|
|
807724e0f0 | ||
|
|
11614af2c2 | ||
|
|
5f021990b4 | ||
|
|
5f22afa450 | ||
|
|
647c4036cf | ||
|
|
857b59409c | ||
|
|
c3ada19892 | ||
|
|
558f261b60 | ||
|
|
20d4ba9ddd | ||
|
|
5ab88e629b | ||
|
|
463441c808 | ||
|
|
2fd0ffbfec | ||
|
|
8d3df7ea57 | ||
|
|
1e7676d26f | ||
|
|
cd814d420b | ||
|
|
68ec8ef313 | ||
|
|
e717bfc04b | ||
|
|
538c7579ba | ||
|
|
b4018846e8 | ||
|
|
220b37133b | ||
|
|
cfce9f7171 | ||
|
|
d59d7887bb | ||
|
|
7e999603fc | ||
|
|
f8771c2214 | ||
|
|
1b04c4beb7 | ||
|
|
fa7a277d64 | ||
|
|
f2ad205538 | ||
|
|
6d5c2bf7b2 | ||
|
|
913a5d1df2 | ||
|
|
fd796723f2 | ||
|
|
b213c7ed24 | ||
|
|
2a76cc6f54 | ||
|
|
dce71d6e7d | ||
|
|
19de053054 | ||
|
|
ec9c355791 | ||
|
|
257fe68f13 | ||
|
|
21bb799e7b | ||
|
|
8513ddb9b4 | ||
|
|
346c17b649 | ||
|
|
56acb2c08c | ||
|
|
37b1b161f9 | ||
|
|
123c9d2315 | ||
|
|
29a6c7e6ba | ||
|
|
d4488cb040 | ||
|
|
2fe0736b87 | ||
|
|
5018bf1baf | ||
|
|
5383df5246 | ||
|
|
0608778b9c | ||
|
|
d5b7b7ec52 | ||
|
|
18cbe31a84 | ||
|
|
c88f5c560c | ||
|
|
4638ebac8a | ||
|
|
49a29a16e6 | ||
|
|
c3152a6343 | ||
|
|
04466651d6 | ||
|
|
e1dd85d261 | ||
|
|
4cab48a000 | ||
|
|
f876833b9a | ||
|
|
ce534491fd | ||
|
|
843172ccc8 | ||
|
|
794d638ded | ||
|
|
6b4cecd0a8 | ||
|
|
ba283377b9 | ||
|
|
eec10660ab | ||
|
|
4d560a8e03 | ||
|
|
ff2b2e5b64 | ||
|
|
8d1c8e2da7 | ||
|
|
f8ad108da6 | ||
|
|
98208b9963 | ||
|
|
8eba418715 | ||
|
|
ea616114a9 | ||
|
|
166b5da560 | ||
|
|
c8172d2b49 | ||
|
|
ec5b304634 | ||
|
|
e19de25297 | ||
|
|
9b74a632e1 | ||
|
|
5f6c63948e | ||
|
|
0b5adc7795 | ||
|
|
2f6fe2c65e | ||
|
|
6ac08c3bee |
1
.gitignore
vendored
Executable file → Normal file
1
.gitignore
vendored
Executable file → Normal file
@@ -12,6 +12,7 @@ dolibarr_install.log
|
|||||||
upgrade.log
|
upgrade.log
|
||||||
doxygen_warnings.log
|
doxygen_warnings.log
|
||||||
/.project
|
/.project
|
||||||
|
/.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
|||||||
@@ -63,6 +63,14 @@ matrix:
|
|||||||
- php: nightly
|
- php: nightly
|
||||||
# We exclude some combinations not usefull to save Travis CPU
|
# We exclude some combinations not usefull to save Travis CPU
|
||||||
exclude:
|
exclude:
|
||||||
|
- php: '5.4'
|
||||||
|
env: DB=mariadb
|
||||||
|
- php: '5.5'
|
||||||
|
env: DB=mariadb
|
||||||
|
- php: '5.6'
|
||||||
|
env: DB=mariadb
|
||||||
|
- php: '7.0'
|
||||||
|
env: DB=mariadb
|
||||||
- php: '5.4'
|
- php: '5.4'
|
||||||
env: DB=postgresql
|
env: DB=postgresql
|
||||||
- php: '5.5'
|
- php: '5.5'
|
||||||
|
|||||||
172
ChangeLog
172
ChangeLog
@@ -2,9 +2,158 @@
|
|||||||
English Dolibarr ChangeLog
|
English Dolibarr ChangeLog
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.8 compared to 6.0.7 *****
|
||||||
|
FIX: #8762
|
||||||
|
FIX: #9032
|
||||||
|
FIX: case when we valid form with keyboard
|
||||||
|
FIX: clause must not be there
|
||||||
|
FIX: dol_delete_file must work in a context without db handler loaded
|
||||||
|
FIX: entity test must be on product_fourn_price table and not product table
|
||||||
|
FIX: Fetch shipping will now fetch project id
|
||||||
|
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||||
|
FIX: getEntity project and not projet
|
||||||
|
FIX: If we enable 3 steps for supplier order approbation, we must no…
|
||||||
|
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
|
||||||
|
FIX: Keep supplier proposal price for supplier order
|
||||||
|
FIX: langs fr
|
||||||
|
FIX: missing filters during ordering
|
||||||
|
FIX: missing filters during reordering
|
||||||
|
FIX: need to filter on aa.entity for same accounting accounts available in several entities
|
||||||
|
FIX: page must always be 0 when we search
|
||||||
|
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
|
||||||
|
FIX: PDF address: handle when contact thirdparty different from document thirdparty
|
||||||
|
FIX: propal: correctly preset project when creating with origin/originid
|
||||||
|
FIX: pu_ht_devise was not converted to numeric so decimals were lost
|
||||||
|
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
|
||||||
|
FIX: remain to pay for credit note was wrong on invoice list
|
||||||
|
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
|
||||||
|
FIX: showOptionals: column mismatches
|
||||||
|
FIX: sometimes amounts are identical but php find them different.
|
||||||
|
FIX: test is_erasable() must be done before call function delete()
|
||||||
|
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
|
||||||
|
FIX: we must see number of all shared projects
|
||||||
|
FIX: wrong var name
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
|
||||||
|
FIX: #8023
|
||||||
|
FIX: #8259 can't update contact birthday with REST API
|
||||||
|
FIX: #8478 !empty instead of count to avoid warning
|
||||||
|
FIX: #8488
|
||||||
|
FIX: actioncomm export: type filtering not working
|
||||||
|
FIX: addline on invoice supplier manage rank on its own if not provided
|
||||||
|
FIX: issue #8037
|
||||||
|
FIX: label in getnomurl projectlist
|
||||||
|
FIX: payment term doc-specific label was not used
|
||||||
|
FIX: payment term doc-specific label was not used (issue #8414)
|
||||||
|
FIX: project category is type 6 not 5 !!
|
||||||
|
FIX: some localtaxes errors
|
||||||
|
FIX: weird password autocompletion in Google Chrome (issue #8479)
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.6 compared to 6.0.5 *****
|
||||||
|
FIX: #7974 Contract - Invalid reference on the document
|
||||||
|
FIX: #8139
|
||||||
|
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
|
||||||
|
FIX: #8151
|
||||||
|
FIX: #8200
|
||||||
|
FIX: add planned delivery to order exports
|
||||||
|
FIX: a discount is a percent, not an amount, so we use vatrate not price
|
||||||
|
FIX: Avoid empty value to fk_multicurrency attribute
|
||||||
|
FIX: Bad localtaxes assignment in cashdesk
|
||||||
|
FIX: check shipping on delete order
|
||||||
|
FIX: check verif exped on delete order
|
||||||
|
FIX: creer into lire
|
||||||
|
FIX: Delete tasks on project delete will now trigger TASK_DELETE
|
||||||
|
FIX: Global on $user parameter reset the variable
|
||||||
|
FIX: if we make a mistake with situation_percent, now we can correct…
|
||||||
|
FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back
|
||||||
|
FIX: Import process must stop after ending line nb to import
|
||||||
|
FIX: migration script for product photo
|
||||||
|
FIX: natural search double quote
|
||||||
|
FIX: reverse field to have object loaded in doaction
|
||||||
|
FIX: Saving wrong localtax on order addline
|
||||||
|
FIX: show status on societe banner
|
||||||
|
FIX: solve column mismatch in user card's usergroup list + code cleanup
|
||||||
|
FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup
|
||||||
|
FIX: unset categorie
|
||||||
|
FIX: update_extras on fourn card
|
||||||
|
FIX: warning when adding ECM files using old photo path
|
||||||
|
FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page
|
||||||
|
NEW: Add sale representative einstein_pdf_modules
|
||||||
|
NEW_einstein_pdf_modules
|
||||||
|
NEW: field commerciaux and categ export CustomersInvoicesAndPayments
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
|
||||||
|
FIX: security vulnerability reported by ADLab of Venustech
|
||||||
|
CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900
|
||||||
|
FIX: #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO variable
|
||||||
|
FIX: #7903
|
||||||
|
FIX: #7933
|
||||||
|
FIX: #8029 Unable to make leave request in holyday module
|
||||||
|
FIX: #8093
|
||||||
|
FIX: Bad name alias showing in name of third column
|
||||||
|
FIX: Cashdesk should not sell to inactive third parties
|
||||||
|
FIX: Edit accountancy account and warning message on loan
|
||||||
|
FIX: $accounts[$bid] is a label !
|
||||||
|
FIX: $oldvatrateclean & $newvatrateclean must be set if preg_match === false
|
||||||
|
FIX: product best price on product list
|
||||||
|
FIX: search on contact list
|
||||||
|
FIX: stats trad for customerinvoice
|
||||||
|
FIX: translate unactivate on contractline
|
||||||
|
FIX: email sent was not in HTML
|
||||||
|
FIX: missing hook invoice index
|
||||||
|
FIX: subject mail sepa
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.4 compared to 6.0.3 *****
|
||||||
|
FIX: #7737
|
||||||
|
FIX: #7751
|
||||||
|
FIX: #7756 Add better error message
|
||||||
|
FIX: #7786
|
||||||
|
FIX: #7806
|
||||||
|
FIX: #7824
|
||||||
|
FIX: add line bad price and ref
|
||||||
|
FIX: A lot of several fix on local taxes and NPR tax
|
||||||
|
FIX: createfromorder
|
||||||
|
FIX: CSS for IE10
|
||||||
|
FIX: external user cannot be set as internal
|
||||||
|
FIX: Filter type on actioncomm with multiselect doesn't work
|
||||||
|
FIX: list of donation not filtered on multicompany
|
||||||
|
FIX: list of module not complete when module mb_strlen not available
|
||||||
|
FIX: Locatax were not propagated when cloning order or proposal
|
||||||
|
FIX: Searching translation should not be case sensitive
|
||||||
|
FIX: Search into language is ok for file into external modules two.
|
||||||
|
FIX: test for filter fk_status
|
||||||
|
FIX: too much users on holiday list
|
||||||
|
FIX: Wrong alias sql
|
||||||
|
|
||||||
|
***** ChangeLog for 6.0.3 compared to 6.0.2 *****
|
||||||
|
FIX: #7211 Update qty dispatched on qty change
|
||||||
|
FIX: #7458
|
||||||
|
FIX: #7593
|
||||||
|
FIX: #7616
|
||||||
|
FIX: #7619
|
||||||
|
FIX: #7626
|
||||||
|
FIX: #7648
|
||||||
|
FIX: #7675
|
||||||
|
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
|
||||||
|
FIX: API to get object does not return data of linked objects
|
||||||
|
FIX: Bad localtax apply
|
||||||
|
FIX: Bad ressource list in popup in gantt view
|
||||||
|
FIX: bankentries search conciliated if val 0
|
||||||
|
FIX: hook formObjectOptions() must use $expe and not $object
|
||||||
|
FIX: make of link to other object during creation
|
||||||
|
FIX: Missing function getLinesArray
|
||||||
|
FIX: old batch not shown in multi shipping
|
||||||
|
FIX: paid supplier invoices are shown as abandoned
|
||||||
|
FIX: selection of thirdparty was lost on stats page of invoices
|
||||||
|
FIX: sql syntax error because of old field accountancy_journal
|
||||||
|
FIX: Stats on invoices show nothing
|
||||||
|
FIX: substitution in ODT of thirdparties documents
|
||||||
|
FIX: wrong key in selectarray
|
||||||
|
FIX: wrong personnal project time spent
|
||||||
|
|
||||||
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
|
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
|
||||||
|
|
||||||
FIX: #7148
|
FIX: #7148
|
||||||
FIX: #7288
|
FIX: #7288
|
||||||
FIX: #7366 renaming table with pgsql
|
FIX: #7366 renaming table with pgsql
|
||||||
@@ -38,7 +187,6 @@ FIX: wrong basePath in the swagger view
|
|||||||
FIX: Implementation of a Luracast recommandation for the REST api server
|
FIX: Implementation of a Luracast recommandation for the REST api server
|
||||||
|
|
||||||
***** ChangeLog for 6.0.1 compared to 6.0.* *****
|
***** ChangeLog for 6.0.1 compared to 6.0.* *****
|
||||||
|
|
||||||
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
||||||
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
||||||
FIX: #7330
|
FIX: #7330
|
||||||
@@ -80,7 +228,6 @@ FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-142
|
|||||||
CVE-2017-14242
|
CVE-2017-14242
|
||||||
|
|
||||||
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
***** ChangeLog for 6.0.0 compared to 5.0.* *****
|
||||||
|
|
||||||
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
|
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
|
||||||
NEW: Add a payment module for Stripe.
|
NEW: Add a payment module for Stripe.
|
||||||
NEW: Add module "Product variant" (like red, blue for the product shoes)
|
NEW: Add module "Product variant" (like red, blue for the product shoes)
|
||||||
@@ -222,6 +369,8 @@ Following changes may create regression for some external modules, but were nece
|
|||||||
* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode. So, if you set var
|
* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode. So, if you set var
|
||||||
$multicompany_transverse_mode to 1 into your conf file, you must remove this line and a new key into
|
$multicompany_transverse_mode to 1 into your conf file, you must remove this line and a new key into
|
||||||
the Home - setup - other admin page.
|
the Home - setup - other admin page.
|
||||||
|
* If you use Multicompany transverse mode, it will be necessary to check the activation of the modules in the children
|
||||||
|
entities and to review completely the rights of the groups and the users.
|
||||||
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
|
||||||
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
|
||||||
retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
|
||||||
@@ -229,6 +378,23 @@ Following changes may create regression for some external modules, but were nece
|
|||||||
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
|
||||||
hook specifications so you must return output into "resprint".
|
hook specifications so you must return output into "resprint".
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 5.0.7 compared to 5.0.6 *****
|
||||||
|
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
|
||||||
|
FIX: #7148
|
||||||
|
FIX: #7325 Default VAT rate when editing template invoices is 0%
|
||||||
|
FIX: #7366 renaming table with pgsql
|
||||||
|
FIX: #7391
|
||||||
|
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
|
||||||
|
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
|
||||||
|
FIX: Bad link to unpayed suppliers invoices
|
||||||
|
FIX: bankentries search conciliated if val 0
|
||||||
|
FIX: multicompany better accuracy in rounding and with revenue stamp.
|
||||||
|
FIX: PDF output was sharing 2 different currencies in same total
|
||||||
|
FIX: Upgrade missing on field
|
||||||
|
FIX: wrong key in selectarray
|
||||||
|
FIX: wrong personnal project time spent
|
||||||
|
|
||||||
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
|
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
|
||||||
FIX: Removed a bad symbolic link into custom directory.
|
FIX: Removed a bad symbolic link into custom directory.
|
||||||
FIX: Renaming a resource ref rename also the directory of attached files.
|
FIX: Renaming a resource ref rename also the directory of attached files.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# DOLIBARR ERP & CRM
|
# DOLIBARR ERP & CRM
|
||||||
|
|
||||||
 
|
 
|
||||||
|
|
||||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).
|
||||||
|
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// TODO Copy file or ask to install package ?
|
// TODO Copy file or ask to install package ?
|
||||||
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
//CustomMessage('YouWillInstallDoliWamp')+#13#13
|
||||||
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
|
MsgBox('The Visual C++ Redistributable package should be installed, it seems it is not. Please install the 32-bit version from http://www.microsoft.com/en-us/download/details.aspx?id=30679, then restart the DoliWAMP installation/upgrade.',mbInformation,MB_OK);
|
||||||
end;
|
end;
|
||||||
// Pb seems similar with msvcp110.dll
|
// Pb seems similar with msvcp110.dll
|
||||||
//vcredist_x64.exe
|
//vcredist_x64.exe
|
||||||
|
|||||||
@@ -17,11 +17,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \file build/generate_filecheck_xml.php
|
* \file build/generate_filelist_xml.php
|
||||||
* \ingroup dev
|
* \ingroup dev
|
||||||
* \brief This script create a xml checksum file
|
* \brief This script create a xml checksum file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
|
||||||
|
|
||||||
$sapi_type = php_sapi_name();
|
$sapi_type = php_sapi_name();
|
||||||
$script_file = basename(__FILE__);
|
$script_file = basename(__FILE__);
|
||||||
$path=dirname(__FILE__).'/';
|
$path=dirname(__FILE__).'/';
|
||||||
@@ -45,7 +47,7 @@ $includeconstants=array();
|
|||||||
|
|
||||||
if (empty($argv[1]))
|
if (empty($argv[1]))
|
||||||
{
|
{
|
||||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
|
||||||
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
@@ -68,11 +70,20 @@ while ($i < $argc)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If release is auto, we take current version
|
||||||
|
$tmpver=explode('-', $release, 2);
|
||||||
|
if ($tmpver[0] == 'auto')
|
||||||
|
{
|
||||||
|
$release=DOL_VERSION;
|
||||||
|
if ($tmpver[1]) $release.='-'.$tmpver[1];
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($includecustom))
|
if (empty($includecustom))
|
||||||
{
|
{
|
||||||
if (DOL_VERSION != $release)
|
$tmpver=explode('-', $release, 2);
|
||||||
|
if (DOL_VERSION != $tmpver[0])
|
||||||
{
|
{
|
||||||
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n";
|
print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n";
|
||||||
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
@@ -131,7 +142,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
|
|||||||
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
|
||||||
*/
|
*/
|
||||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
|
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|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');
|
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
|
||||||
$dir='';
|
$dir='';
|
||||||
$needtoclose=0;
|
$needtoclose=0;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ use Term::ANSIColor;
|
|||||||
# Change this to defined target for option 98 and 99
|
# Change this to defined target for option 98 and 99
|
||||||
$PROJECT="dolibarr";
|
$PROJECT="dolibarr";
|
||||||
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
|
||||||
$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
|
||||||
|
|
||||||
|
|
||||||
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
|
||||||
@@ -466,10 +466,12 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.xz`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.xz`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
|
||||||
@@ -556,9 +558,6 @@ if ($nboftargetok) {
|
|||||||
$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/.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`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||||
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
|
||||||
@@ -571,6 +570,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
|
||||||
@@ -579,6 +579,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
||||||
@@ -590,6 +591,8 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||||
|
|
||||||
|
|
||||||
print "Remove subdir of custom dir\n";
|
print "Remove subdir of custom dir\n";
|
||||||
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
|
||||||
@@ -848,6 +851,8 @@ if ($nboftargetok) {
|
|||||||
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
|
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
|
||||||
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
|
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
|
||||||
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz");
|
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz");
|
||||||
|
print "Remove target ${FILENAMEDEB}.debian.tar.xz...\n";
|
||||||
|
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.xz");
|
||||||
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
|
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
|
||||||
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
|
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
|
||||||
|
|
||||||
@@ -1023,7 +1028,7 @@ if ($nboftargetok) {
|
|||||||
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
|
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
|
||||||
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
|
||||||
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
|
||||||
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
|
$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`;
|
||||||
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
@@ -1167,7 +1172,7 @@ if ($nboftargetok) {
|
|||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF
|
||||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
||||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
||||||
@@ -1180,8 +1185,7 @@ if ($nboftargetok) {
|
|||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
|
"$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}_amd64.changes"=>'package_debian-ubuntu',
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu',
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
|
||||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
||||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
||||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ JQUERYFILETREE:
|
|||||||
RESTLER:
|
RESTLER:
|
||||||
--------
|
--------
|
||||||
|
|
||||||
* Add 2 lines into function
|
* Add 2 lines into file AutoLoader.php to complete function
|
||||||
private function alias($className, $currentClass)
|
private function alias($className, $currentClass)
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
@@ -111,3 +111,24 @@ to get
|
|||||||
if ($className == 'Luracast\Restler\mixed') return;
|
if ($className == 'Luracast\Restler\mixed') return;
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
PARSEDOWN
|
||||||
|
---------
|
||||||
|
|
||||||
|
* Fix to avoid fatal error when mb_strlen not available:
|
||||||
|
|
||||||
|
// @CHANGE LDR Fix when mb_strlen is not available
|
||||||
|
//$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
|
||||||
|
if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
|
||||||
|
else $len = strlen($line);
|
||||||
|
$shortage = 4 - $len % 4;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
JEDITABLE.JS
|
||||||
|
------------
|
||||||
|
|
||||||
|
* <button type="submit" /> => <button class="button" type="submit" />
|
||||||
|
* <button type="cancel" /> => <button class="button" type="cancel" />
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ export list="
|
|||||||
--ignore-table=$base.llx_bt_webseedfiles
|
--ignore-table=$base.llx_bt_webseedfiles
|
||||||
--ignore-table=$base.llx_c_civilite
|
--ignore-table=$base.llx_c_civilite
|
||||||
--ignore-table=$base.llx_c_dolicloud_plans
|
--ignore-table=$base.llx_c_dolicloud_plans
|
||||||
|
--ignore-table=$base.llx_c_pays
|
||||||
--ignore-table=$base.llx_c_source
|
--ignore-table=$base.llx_c_source
|
||||||
--ignore-table=$base.llx_cabinetmed_c_banques
|
--ignore-table=$base.llx_cabinetmed_c_banques
|
||||||
--ignore-table=$base.llx_cabinetmed_c_ccam
|
--ignore-table=$base.llx_cabinetmed_c_ccam
|
||||||
|
|||||||
@@ -160,10 +160,10 @@ $pcgver = $conf->global->CHARTOFACCOUNTS;
|
|||||||
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
|
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
|
||||||
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity;
|
||||||
// Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid
|
// Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid
|
||||||
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)";
|
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER) AND a2.entity = " . $conf->entity;
|
||||||
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)";
|
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED) AND a2.entity = " . $conf->entity;
|
||||||
$sql .= " WHERE asy.rowid = " . $pcgver;
|
$sql .= " WHERE asy.rowid = " . $pcgver;
|
||||||
|
|
||||||
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ $tablib[35]= "DictionaryAccountancyJournal";
|
|||||||
|
|
||||||
// Requests to extract data
|
// Requests to extract data
|
||||||
$tabsql=array();
|
$tabsql=array();
|
||||||
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a";
|
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity;
|
||||||
|
|
||||||
// Criteria to sort dictionaries
|
// Criteria to sort dictionaries
|
||||||
$tabsqlsort=array();
|
$tabsqlsort=array();
|
||||||
@@ -102,7 +102,7 @@ $tabfieldvalue[35]= "code,label,nature";
|
|||||||
|
|
||||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
// Nom des champs dans la table pour insertion d'un enregistrement
|
||||||
$tabfieldinsert=array();
|
$tabfieldinsert=array();
|
||||||
$tabfieldinsert[35]= "code,label,nature";
|
$tabfieldinsert[35]= "code,label,nature,entity";
|
||||||
|
|
||||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
// Nom du rowid si le champ n'est pas de type autoincrement
|
||||||
// Example: "" if id field is "rowid" and has autoincrement on
|
// Example: "" if id field is "rowid" and has autoincrement on
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ require '../../main.inc.php';
|
|||||||
|
|
||||||
// Class
|
// Class
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
|
||||||
|
|
||||||
|
|||||||
@@ -631,7 +631,7 @@ if ($action == 'create') {
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($total_debit != $total_credit)
|
if (price2num($total_debit) != price2num($total_credit))
|
||||||
{
|
{
|
||||||
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings');
|
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,7 +322,6 @@ if ($resql) {
|
|||||||
}
|
}
|
||||||
else print $row[1];
|
else print $row[1];
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left">' . $row[1] . '</td>';
|
|
||||||
for($i = 2; $i <= 12; $i ++) {
|
for($i = 2; $i <= 12; $i ++) {
|
||||||
print '<td align="right">' . price($row[$i]) . '</td>';
|
print '<td align="right">' . price($row[$i]) . '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ print '<script type="text/javascript">
|
|||||||
/*
|
/*
|
||||||
* Customer Invoice lines
|
* Customer Invoice lines
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,";
|
$sql = "SELECT f.rowid as factid, f.facnumber, f.type, f.datef, f.ref_client,";
|
||||||
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
|
||||||
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
|
||||||
@@ -302,7 +302,7 @@ if ($result) {
|
|||||||
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
|
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
|
||||||
|
|
||||||
$facture_static->ref = $objp->facnumber;
|
$facture_static->ref = $objp->facnumber;
|
||||||
$facture_static->id = $objp->rowid;
|
$facture_static->id = $objp->factid;
|
||||||
|
|
||||||
$product_static->ref = $objp->product_ref;
|
$product_static->ref = $objp->product_ref;
|
||||||
$product_static->id = $objp->product_id;
|
$product_static->id = $objp->product_id;
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ if ($user->societe_id > 0)
|
|||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('accountancycustomerlist'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
|
||||||
@@ -98,26 +101,33 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOU
|
|||||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||||
|
|
||||||
// Purge search criteria
|
$parameters=array();
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$search_lineid = '';
|
// Purge search criteria
|
||||||
$search_ref = '';
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||||
$search_invoice = '';
|
{
|
||||||
$search_label = '';
|
$search_lineid = '';
|
||||||
$search_desc = '';
|
$search_ref = '';
|
||||||
$search_amount = '';
|
$search_invoice = '';
|
||||||
$search_account = '';
|
$search_label = '';
|
||||||
$search_vat = '';
|
$search_desc = '';
|
||||||
|
$search_amount = '';
|
||||||
|
$search_account = '';
|
||||||
|
$search_vat = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
|
$objectclass='AccountingAccount';
|
||||||
|
$permtoread = $user->rights->accounting->read;
|
||||||
|
$permtodelete = $user->rights->accounting->delete;
|
||||||
|
$uploaddir = $conf->accounting->dir_output;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mass actions
|
|
||||||
$objectclass='Skeleton';
|
|
||||||
$objectlabel='Skeleton';
|
|
||||||
$permtoread = $user->rights->accounting->read;
|
|
||||||
$permtodelete = $user->rights->accounting->delete;
|
|
||||||
$uploaddir = $conf->accounting->dir_output;
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil') {
|
||||||
$msg='';
|
$msg='';
|
||||||
@@ -182,10 +192,13 @@ $sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
|
|||||||
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||||
$sql .= " aa.rowid as aarowid";
|
$sql .= " aa.rowid as aarowid";
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON (p.accountancy_code_sell = aa.account_number AND aa.entity = ".$conf->entity.")";
|
||||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_system as accsys ON accsys.pcg_version = aa.fk_pcg_version";
|
||||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||||
$sql .= " AND product_type <= 2";
|
$sql .= " AND product_type <= 2";
|
||||||
@@ -223,6 +236,11 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
|||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
|
|||||||
@@ -135,9 +135,9 @@ if ($result) {
|
|||||||
$compta_fees = $obj->compte;
|
$compta_fees = $obj->compte;
|
||||||
|
|
||||||
$vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0);
|
$vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0);
|
||||||
$compta_tva = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $account_vat);
|
$compta_tva = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat);
|
||||||
$compta_localtax1 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
|
$compta_localtax1 = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||||
$compta_localtax2 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva);
|
$compta_localtax2 = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
|
||||||
|
|
||||||
// Define array to display all VAT rates that use this accounting account $compta_tva
|
// Define array to display all VAT rates that use this accounting account $compta_tva
|
||||||
if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code))
|
if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code))
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ if ($result) {
|
|||||||
// Situation invoices handling
|
// Situation invoices handling
|
||||||
$line = new FactureLigne($db);
|
$line = new FactureLigne($db);
|
||||||
$line->fetch($obj->fdid);
|
$line->fetch($obj->fdid);
|
||||||
$prev_progress = $line->get_prev_progress($obj->fdid);
|
$prev_progress = $line->get_prev_progress($obj->rowid);
|
||||||
if ($obj->type == Facture::TYPE_SITUATION) {
|
if ($obj->type == Facture::TYPE_SITUATION) {
|
||||||
// Avoid divide by 0
|
// Avoid divide by 0
|
||||||
if ($obj->situation_percent == 0) {
|
if ($obj->situation_percent == 0) {
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ if ($user->societe_id > 0)
|
|||||||
if (! $user->rights->accounting->bind->write)
|
if (! $user->rights->accounting->bind->write)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('accountancysupplierlist'));
|
||||||
|
|
||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$accounting = new AccountingAccount($db);
|
$accounting = new AccountingAccount($db);
|
||||||
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
// TODO: we should need to check if result is a really exist accountaccount rowid.....
|
||||||
@@ -99,26 +102,32 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN
|
|||||||
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
|
||||||
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
|
||||||
|
|
||||||
// Purge search criteria
|
$parameters=array();
|
||||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
{
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
$search_lineid = '';
|
|
||||||
$search_ref = '';
|
|
||||||
$search_invoice = '';
|
|
||||||
$search_label = '';
|
|
||||||
$search_desc = '';
|
|
||||||
$search_amount = '';
|
|
||||||
$search_account = '';
|
|
||||||
$search_vat = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mass actions
|
if (empty($reshook))
|
||||||
$objectclass='Skeleton';
|
{
|
||||||
$objectlabel='Skeleton';
|
// Purge search criteria
|
||||||
$permtoread = $user->rights->accounting->read;
|
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
|
||||||
$permtodelete = $user->rights->accounting->delete;
|
{
|
||||||
$uploaddir = $conf->accounting->dir_output;
|
$search_lineid = '';
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
$search_ref = '';
|
||||||
|
$search_invoice = '';
|
||||||
|
$search_label = '';
|
||||||
|
$search_desc = '';
|
||||||
|
$search_amount = '';
|
||||||
|
$search_account = '';
|
||||||
|
$search_vat = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
|
$objectclass='AccountingAccount';
|
||||||
|
$permtoread = $user->rights->accounting->read;
|
||||||
|
$permtodelete = $user->rights->accounting->delete;
|
||||||
|
$uploaddir = $conf->accounting->dir_output;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
}
|
||||||
|
|
||||||
if ($massaction == 'ventil') {
|
if ($massaction == 'ventil') {
|
||||||
$msg='';
|
$msg='';
|
||||||
@@ -184,6 +193,9 @@ $sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_lab
|
|||||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||||
$sql.= " aa.rowid as aarowid";
|
$sql.= " aa.rowid as aarowid";
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||||
@@ -220,6 +232,11 @@ if (strlen(trim($search_vat))) {
|
|||||||
}
|
}
|
||||||
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
|
||||||
|
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql .= $db->order($sortfield, $sortorder);
|
$sql .= $db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
// Count total nb of records
|
// Count total nb of records
|
||||||
|
|||||||
@@ -15,6 +15,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
|
||||||
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
|
||||||
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;
|
||||||
|
|||||||
@@ -14,8 +14,15 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_CREATE.TPL.PHP DEFAULT -->
|
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_CREATE.TPL.PHP DEFAULT -->
|
||||||
|
|||||||
@@ -14,9 +14,16 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$contact = $GLOBALS['objcanvas']->control->object;
|
$contact = $GLOBALS['objcanvas']->control->object;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -14,10 +14,18 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$contact = $GLOBALS['objcanvas']->control->object;
|
$contact = $GLOBALS['objcanvas']->control->object;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->
|
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->
|
||||||
|
|||||||
@@ -1730,8 +1730,8 @@ else
|
|||||||
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
|
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
|
||||||
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
|
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
|
||||||
$genallowed = $user->rights->adherent->creer;
|
$genallowed = $user->rights->adherent->lire;
|
||||||
$delallowed = $user->rights->adherent->supprimer;
|
$delallowed = $user->rights->adherent->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
|
||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
|
|||||||
@@ -193,12 +193,11 @@ class Subscription extends CommonObject
|
|||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
$accountline=new AccountLine($this->db);
|
|
||||||
|
|
||||||
// It subscription is linked to a bank transaction, we get it
|
// It subscription is linked to a bank transaction, we get it
|
||||||
if ($this->fk_bank > 0)
|
if ($this->fk_bank > 0)
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
$accountline=new AccountLine($this->db);
|
||||||
$result=$accountline->fetch($this->fk_bank);
|
$result=$accountline->fetch($this->fk_bank);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ $fieldstosearchall = array(
|
|||||||
'd.note_public'=>'NotePublic',
|
'd.note_public'=>'NotePublic',
|
||||||
'd.note_private'=>'NotePrivate',
|
'd.note_private'=>'NotePrivate',
|
||||||
);
|
);
|
||||||
|
if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||||
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@@ -819,7 +819,6 @@ if ($rowid > 0)
|
|||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$subscriptionstatic=new Subscription($db);
|
$subscriptionstatic=new Subscription($db);
|
||||||
$accountstatic=new Account($db);
|
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@@ -838,6 +837,8 @@ if ($rowid > 0)
|
|||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$accountstatic=new Account($db);
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$objp = $db->fetch_object($result);
|
$objp = $db->fetch_object($result);
|
||||||
@@ -849,20 +850,23 @@ if ($rowid > 0)
|
|||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n";
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
|
||||||
print '<td align="right">'.price($objp->subscription).'</td>';
|
print '<td align="right">'.price($objp->subscription).'</td>';
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($objp->bid)
|
if ($objp->bid)
|
||||||
{
|
{
|
||||||
$accountstatic->label=$objp->label;
|
$accountstatic->label=$objp->label;
|
||||||
$accountstatic->id=$objp->baid;
|
$accountstatic->id=$objp->baid;
|
||||||
$accountstatic->number=$objp->number;
|
$accountstatic->number=$objp->number;
|
||||||
$accountstatic->account_number=$objp->account_number;
|
$accountstatic->account_number=$objp->account_number;
|
||||||
|
|
||||||
$accountingjournal = new AccountingJournal($db);
|
if (! empty($conf->accounting->enabled))
|
||||||
$accountingjournal->fetch($objp->fk_accountancy_journal);
|
{
|
||||||
|
$accountingjournal = new AccountingJournal($db);
|
||||||
|
$accountingjournal->fetch($objp->fk_accountancy_journal);
|
||||||
|
|
||||||
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
|
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
|
||||||
|
}
|
||||||
|
|
||||||
$accountstatic->ref=$objp->ref;
|
$accountstatic->ref=$objp->ref;
|
||||||
print $accountstatic->getNomUrl(1);
|
print $accountstatic->getNomUrl(1);
|
||||||
@@ -1093,12 +1097,12 @@ if ($rowid > 0)
|
|||||||
print '</a>)';
|
print '</a>)';
|
||||||
}
|
}
|
||||||
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0);
|
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0);
|
||||||
if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
|
if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
|
||||||
{
|
{
|
||||||
$prodtmp=new Product($db);
|
$prodtmp=new Product($db);
|
||||||
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
// Add invoice with payments
|
// Add invoice with payments
|
||||||
@@ -1118,12 +1122,12 @@ if ($rowid > 0)
|
|||||||
print '</a>)';
|
print '</a>)';
|
||||||
}
|
}
|
||||||
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0);
|
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0);
|
||||||
if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
|
if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
|
||||||
{
|
{
|
||||||
$prodtmp=new Product($db);
|
$prodtmp=new Product($db);
|
||||||
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||||
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
@@ -25,7 +25,9 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
if (! empty($conf->banque->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@@ -231,20 +233,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
|||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
|
||||||
if ($object->fk_bank)
|
if ($object->fk_bank)
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$result=$bankline->fetch($object->fk_bank);
|
$result=$bankline->fetch($object->fk_bank);
|
||||||
print $bankline->getNomUrl(1,0,'showall');
|
print $bankline->getNomUrl(1,0,'showall');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("NoneF");
|
print $langs->trans("NoneF");
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@@ -326,27 +328,26 @@ if ($rowid && $action != 'edit')
|
|||||||
// Amount
|
// Amount
|
||||||
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
|
||||||
|
|
||||||
// Bank line
|
// Bank line
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
|
||||||
{
|
{
|
||||||
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
|
||||||
if ($object->fk_bank)
|
if ($object->fk_bank)
|
||||||
{
|
{
|
||||||
$bankline=new AccountLine($db);
|
$bankline=new AccountLine($db);
|
||||||
$result=$bankline->fetch($object->fk_bank);
|
$result=$bankline->fetch($object->fk_bank);
|
||||||
print $bankline->getNomUrl(1,0,'showall');
|
print $bankline->getNomUrl(1,0,'showall');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $langs->trans("NoneF");
|
print $langs->trans("NoneF");
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@@ -389,8 +390,8 @@ if ($rowid && $action != 'edit')
|
|||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
|
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
|
||||||
$genallowed = $user->rights->facture->creer;
|
$genallowed = $user->rights->facture->lire;
|
||||||
$delallowed = $user->rights->facture->supprimer;
|
$delallowed = $user->rights->facture->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ $langs->load("users");
|
|||||||
if (!$user->rights->adherent->lire)
|
if (!$user->rights->adherent->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
$rowid=GETPOST("rowid",'int');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -44,10 +44,10 @@ $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
|
|||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
|
|
||||||
llxHeader();
|
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
llxHeader();
|
||||||
|
|
||||||
$object = new Subscription($db);
|
$object = new Subscription($db);
|
||||||
$result = $object->fetch($rowid);
|
$result = $object->fetch($rowid);
|
||||||
|
|
||||||
|
|||||||
@@ -304,22 +304,22 @@ if ($result)
|
|||||||
print dol_trunc($obj->note,32);
|
print dol_trunc($obj->note,32);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Banque
|
// Banque
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
if ($obj->fk_account)
|
if ($obj->fk_account > 0)
|
||||||
{
|
{
|
||||||
$accountstatic->id=$obj->fk_account;
|
$accountstatic->id=$obj->fk_account;
|
||||||
$accountstatic->fetch($obj->fk_account);
|
$accountstatic->fetch($obj->fk_account);
|
||||||
//$accountstatic->label=$obj->label;
|
//$accountstatic->label=$obj->label;
|
||||||
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
print '<td>'.$accountstatic->getNomUrl(1).'</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";
|
||||||
|
|||||||
@@ -15,8 +15,15 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE -->
|
<!-- BEGIN PHP TEMPLATE -->
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
|
|||||||
$object->label = trim($label);
|
$object->label = trim($label);
|
||||||
$object->subscription = (int) trim($subscription);
|
$object->subscription = (int) trim($subscription);
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
$object->mail_valid = (boolean) trim($mail_valid);
|
$object->mail_valid = trim($mail_valid);
|
||||||
$object->vote = (boolean) trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
@@ -134,7 +134,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||||||
$object->label = trim($label);
|
$object->label = trim($label);
|
||||||
$object->subscription = (int) trim($subscription);
|
$object->subscription = (int) trim($subscription);
|
||||||
$object->note = trim($comment);
|
$object->note = trim($comment);
|
||||||
$object->mail_valid = (boolean) trim($mail_valid);
|
$object->mail_valid = trim($mail_valid);
|
||||||
$object->vote = (boolean) trim($vote);
|
$object->vote = (boolean) trim($vote);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ if ($mode == 'desc')
|
|||||||
if ($mode == 'feature')
|
if ($mode == 'feature')
|
||||||
{
|
{
|
||||||
$text.='<br><strong>'.$langs->trans("DependsOn").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("DependsOn").':</strong> ';
|
||||||
if (count($objMod->requiredby)) $text.=join(',', $objMod->depends);
|
if (count($objMod->depends)) $text.=join(',', $objMod->depends);
|
||||||
else $text.=$langs->trans("None");
|
else $text.=$langs->trans("None");
|
||||||
$text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
|
$text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
|
||||||
if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby);
|
if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby);
|
||||||
|
|||||||
@@ -179,24 +179,30 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
|||||||
// TODO We add/delete permission here until permission can have a condition on a global var
|
// TODO We add/delete permission here until permission can have a condition on a global var
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
|
||||||
$newmodule=new modFournisseur($db);
|
$newmodule=new modFournisseur($db);
|
||||||
// clear default rights array
|
|
||||||
$newmodule->rights=array();
|
|
||||||
// add new right
|
|
||||||
$r=0;
|
|
||||||
$newmodule->rights[$r][0] = 1190;
|
|
||||||
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
|
|
||||||
$newmodule->rights[$r][2] = 'w';
|
|
||||||
$newmodule->rights[$r][3] = 0;
|
|
||||||
$newmodule->rights[$r][4] = 'commande';
|
|
||||||
$newmodule->rights[$r][5] = 'approve2';
|
|
||||||
|
|
||||||
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
|
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
|
||||||
{
|
{
|
||||||
|
// clear default rights array
|
||||||
|
$newmodule->rights=array();
|
||||||
|
// add new right
|
||||||
|
$r=0;
|
||||||
|
$newmodule->rights[$r][0] = 1190;
|
||||||
|
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
|
||||||
|
$newmodule->rights[$r][2] = 'w';
|
||||||
|
$newmodule->rights[$r][3] = 0;
|
||||||
|
$newmodule->rights[$r][4] = 'commande';
|
||||||
|
$newmodule->rights[$r][5] = 'approve2';
|
||||||
|
|
||||||
|
// Insert
|
||||||
$newmodule->insert_permissions(1);
|
$newmodule->insert_permissions(1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Remove all rights with Permission1190
|
||||||
$newmodule->delete_permissions();
|
$newmodule->delete_permissions();
|
||||||
|
|
||||||
|
// Add all right without Permission1190
|
||||||
|
$newmodule->insert_permissions(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ if ($xml)
|
|||||||
|
|
||||||
// Defined qualified files (must be same than into generate_filelist_xml.php)
|
// Defined qualified files (must be same than into generate_filelist_xml.php)
|
||||||
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
|
||||||
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
|
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|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);
|
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
|
||||||
|
|
||||||
// Fill file_list with files in signature, new files, modified files
|
// Fill file_list with files in signature, new files, modified files
|
||||||
|
|||||||
@@ -338,6 +338,9 @@ if ($mode == 'searchkey')
|
|||||||
|
|
||||||
$recordtoshow=array();
|
$recordtoshow=array();
|
||||||
|
|
||||||
|
// Search modules dirs
|
||||||
|
$modulesdir = dolGetModulesDirs();
|
||||||
|
|
||||||
$nbempty=0;
|
$nbempty=0;
|
||||||
/*var_dump($langcode);
|
/*var_dump($langcode);
|
||||||
var_dump($transkey);
|
var_dump($transkey);
|
||||||
@@ -351,29 +354,38 @@ if ($mode == 'searchkey')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Load all translations keys
|
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
|
||||||
foreach($conf->file->dol_document_root as $keydir => $searchdir)
|
foreach($modulesdir as $keydir => $tmpsearchdir)
|
||||||
{
|
{
|
||||||
// Directory of translation files
|
$searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
|
||||||
$dir_lang = $searchdir."/langs/".$langcode;
|
|
||||||
$dir_lang_osencoded=dol_osencode($dir_lang);
|
|
||||||
|
|
||||||
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
// Directory of translation files
|
||||||
|
$dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
|
||||||
|
$dir_lang_osencoded=dol_osencode($dir_lang);
|
||||||
|
|
||||||
foreach($filearray as $file)
|
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||||
{
|
foreach($filearray as $file)
|
||||||
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
{
|
||||||
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
|
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
|
||||||
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
|
//Detect if trans coming from extranl module
|
||||||
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
foreach ($conf->file->dol_document_root as $keyconf=>$dirconfalt) {
|
||||||
}
|
if (($keyconf!='main') && (preg_match('$'.preg_quote($dirconfalt).'$i', $file['fullname']))) {
|
||||||
|
//In this case load modulename@nmodulename
|
||||||
|
$tmpfile=$tmpfile.'@'.$tmpfile;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
|
||||||
|
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
|
||||||
|
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now search into translation array
|
// Now search into translation array
|
||||||
foreach($newlang->tab_translate as $key => $val)
|
foreach($newlang->tab_translate as $key => $val)
|
||||||
{
|
{
|
||||||
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/', $key)) continue;
|
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/i', $key)) continue;
|
||||||
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/', $val)) continue;
|
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/i', $val)) continue;
|
||||||
$recordtoshow[$key]=$val;
|
$recordtoshow[$key]=$val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
*/
|
*/
|
||||||
public function __isAllowed()
|
public function __isAllowed()
|
||||||
{
|
{
|
||||||
global $db;
|
global $conf, $db;
|
||||||
|
|
||||||
$login = '';
|
$login = '';
|
||||||
$stored_key = '';
|
$stored_key = '';
|
||||||
@@ -100,10 +100,13 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
|
|
||||||
if ($api_key)
|
if ($api_key)
|
||||||
{
|
{
|
||||||
|
$userentity = 0;
|
||||||
|
|
||||||
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
$sql = "SELECT u.login, u.datec, u.api_key, ";
|
||||||
$sql.= " u.tms as date_modification, u.entity";
|
$sql.= " u.tms as date_modification, u.entity";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||||
$sql.= " WHERE u.api_key = '".$db->escape($api_key)."'";
|
$sql.= " WHERE u.api_key = '".$db->escape($api_key)."'";
|
||||||
|
// TODO Check if 2 users has same API key.
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@@ -113,24 +116,34 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$login = $obj->login;
|
$login = $obj->login;
|
||||||
$stored_key = $obj->api_key;
|
$stored_key = $obj->api_key;
|
||||||
|
$userentity = $obj->entity;
|
||||||
|
|
||||||
|
if (! defined("DOLENTITY") && $conf->entity != ($obj->entity?$obj->entity:1)) // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
|
||||||
|
{
|
||||||
|
$conf->entity = ($obj->entity?$obj->entity:1);
|
||||||
|
// 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($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($stored_key != $api_key) {
|
if ($stored_key != $api_key) { // This should not happen since we did a search on api_key
|
||||||
$userClass::setCacheIdentifier($api_key);
|
$userClass::setCacheIdentifier($api_key);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $login)
|
if (! $login)
|
||||||
{
|
{
|
||||||
throw new RestException(503, 'Error when searching logn user fro mapi key');
|
throw new RestException(503, 'Error when searching login user from api key');
|
||||||
}
|
}
|
||||||
$fuser = new User($db);
|
$fuser = new User($db);
|
||||||
if(! $fuser->fetch('',$login)) {
|
$result = $fuser->fetch('', $login, '', 0, (empty($userentity) ? -1 : $conf->entity)); // If user is not entity 0, we search in working entity $conf->entity (that may have been forced to a different value than user entity)
|
||||||
throw new RestException(503, 'Error when fetching user :'.$fuser->error);
|
if ($result <= 0) {
|
||||||
|
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
|
||||||
}
|
}
|
||||||
$fuser->getrights();
|
$fuser->getrights();
|
||||||
static::$user = $fuser;
|
static::$user = $fuser;
|
||||||
@@ -143,14 +156,14 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new RestException(401, "Failed to login to API. No parameter 'DOLAPIKEY' on HTTP header (neither in URL).");
|
throw new RestException(401, "Failed to login to API. No parameter 'HTTP_DOLAPIKEY' on HTTP header (and no parameter DOLAPIKEY in URL).");
|
||||||
}
|
}
|
||||||
|
|
||||||
$userClass::setCacheIdentifier(static::$role);
|
$userClass::setCacheIdentifier(static::$role);
|
||||||
Resources::$accessControlFunction = 'DolibarrApiAccess::verifyAccess';
|
Resources::$accessControlFunction = 'DolibarrApiAccess::verifyAccess';
|
||||||
$requirefortest = static::$requires;
|
$requirefortest = static::$requires;
|
||||||
if (! is_array($requirefortest)) $requirefortest=explode(',',$requirefortest);
|
if (! is_array($requirefortest)) $requirefortest=explode(',',$requirefortest);
|
||||||
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Login
|
|||||||
*
|
*
|
||||||
* Request the API token for a couple username / password.
|
* Request the API token for a couple username / password.
|
||||||
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
|
||||||
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
|
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: Tha API key (DOLAPIKEY) can be found/set on the user page.
|
||||||
*
|
*
|
||||||
* @param string $login User login
|
* @param string $login User login
|
||||||
* @param string $password User password
|
* @param string $password User password
|
||||||
|
|||||||
@@ -37,6 +37,10 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not lo
|
|||||||
if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
|
||||||
|
|
||||||
|
|
||||||
|
// Force entity if a value is provided into HTTP header. Otherwise, will use the entity of user of token used.
|
||||||
|
if (! empty($_SERVER['HTTP_DOLAPIENTITY'])) define("DOLENTITY", (int) $_SERVER['HTTP_DOLAPIENTITY']);
|
||||||
|
|
||||||
|
|
||||||
$res=0;
|
$res=0;
|
||||||
if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php';
|
if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php';
|
||||||
if (! $res) die("Include of main fails");
|
if (! $res) die("Include of main fails");
|
||||||
@@ -124,7 +128,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
|
|||||||
foreach ($modulesdir as $dir)
|
foreach ($modulesdir as $dir)
|
||||||
{
|
{
|
||||||
// Search available module
|
// Search available module
|
||||||
dol_syslog("Scan directory ".$dir." for module descriptor to after search for API files");
|
dol_syslog("Scan directory ".$dir." for module descriptor files, then search for API files");
|
||||||
|
|
||||||
$handle=@opendir(dol_osencode($dir));
|
$handle=@opendir(dol_osencode($dir));
|
||||||
if (is_resource($handle))
|
if (is_resource($handle))
|
||||||
@@ -135,14 +139,14 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
|
|||||||
{
|
{
|
||||||
$module = strtolower($regmod[1]);
|
$module = strtolower($regmod[1]);
|
||||||
$moduledirforclass = getModuleDirForApiClass($module);
|
$moduledirforclass = getModuleDirForApiClass($module);
|
||||||
$moduleforperm = $module;
|
$modulenameforenabled = $module;
|
||||||
if ($module == 'propale') { $moduleforperm='propal'; }
|
if ($module == 'propale') { $modulenameforenabled='propal'; }
|
||||||
|
|
||||||
//dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
|
dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
|
||||||
|
|
||||||
// Defined if module is enabled
|
// Defined if module is enabled
|
||||||
$enabled=true;
|
$enabled=true;
|
||||||
if (empty($conf->$moduleforperm->enabled)) $enabled=false;
|
if (empty($conf->$modulenameforenabled->enabled)) $enabled=false;
|
||||||
|
|
||||||
if ($enabled)
|
if ($enabled)
|
||||||
{
|
{
|
||||||
@@ -231,7 +235,13 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
|
|||||||
if ($module == 'order') { $classname='Commande'; }
|
if ($module == 'order') { $classname='Commande'; }
|
||||||
//var_dump($classfile);var_dump($classname);exit;
|
//var_dump($classfile);var_dump($classname);exit;
|
||||||
|
|
||||||
require_once $dir_part_file;
|
$res = include_once $dir_part_file;
|
||||||
|
if (! $res)
|
||||||
|
{
|
||||||
|
print 'API not found (failed to include API file)';
|
||||||
|
header('HTTP/1.1 501 API not found (failed to include API file)');
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/');
|
if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -242,7 +252,14 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
|
|||||||
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
|
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
|
||||||
$classname=ucwords($module);
|
$classname=ucwords($module);
|
||||||
|
|
||||||
require_once $dir_part_file;
|
$res = include_once $dir_part_file;
|
||||||
|
if (! $res)
|
||||||
|
{
|
||||||
|
print 'API not found (failed to include API file)';
|
||||||
|
header('HTTP/1.1 501 API not found (failed to include API file)');
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (class_exists($classname)) $api->r->addAPIClass($classname);
|
if (class_exists($classname)) $api->r->addAPIClass($classname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -143,7 +144,7 @@ if ($action == 'initbarcodeproducts')
|
|||||||
$nextvalue=$modBarCodeProduct->getNextValue($productstatic,'');
|
$nextvalue=$modBarCodeProduct->getNextValue($productstatic,'');
|
||||||
|
|
||||||
//print 'Set value '.$nextvalue.' to product '.$productstatic->id." ".$productstatic->ref." ".$productstatic->type."<br>\n";
|
//print 'Set value '.$nextvalue.' to product '.$productstatic->id." ".$productstatic->ref." ".$productstatic->type."<br>\n";
|
||||||
$result=$productstatic->setValueFrom('barcode', $nextvalue, '', '', 'date', '', $user, 'PRODUCT_MODIFY');
|
$result=$productstatic->setValueFrom('barcode', $nextvalue, '', '', 'text', '', $user, 'PRODUCT_MODIFY');
|
||||||
|
|
||||||
$nbtry++;
|
$nbtry++;
|
||||||
if ($result > 0) $nbok++;
|
if ($result > 0) $nbok++;
|
||||||
|
|||||||
@@ -108,6 +108,17 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($this->element === 'invoice_supplier') {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||||
|
|
||||||
|
$object = new FactureFournisseur($this->db);
|
||||||
|
if($object->fetch($this->fk_object)>0) {
|
||||||
|
return $object->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if($this->element === 'payment') {
|
else if($this->element === 'payment') {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||||
|
|
||||||
@@ -119,6 +130,17 @@ class BlockedLog
|
|||||||
$this->error++;
|
$this->error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if($this->element === 'payment_supplier') {
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||||
|
|
||||||
|
$object = new PaiementFourn($this->db);
|
||||||
|
if($object->fetch($this->fk_object)>0) {
|
||||||
|
return $object->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object);
|
return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object);
|
||||||
|
|
||||||
@@ -153,7 +175,7 @@ class BlockedLog
|
|||||||
*/
|
*/
|
||||||
public function setObjectData(&$object) {
|
public function setObjectData(&$object) {
|
||||||
|
|
||||||
if($object->element=='payment') {
|
if($object->element=='payment' || $object->element=='payment_supplier') {
|
||||||
$this->date_object = $object->datepaye;
|
$this->date_object = $object->datepaye;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -183,13 +205,28 @@ class BlockedLog
|
|||||||
$this->object_data->note_private= (double) $object->note_private;
|
$this->object_data->note_private= (double) $object->note_private;
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($this->element==='payment'){
|
if($this->element === 'invoice_supplier') {
|
||||||
|
if(empty($object->thirdparty))$object->fetch_thirdparty();
|
||||||
|
$this->object_data->thirdparty = new stdClass();
|
||||||
|
|
||||||
|
foreach($object->thirdparty as $key=>$value) {
|
||||||
|
if(!is_object($value)) $this->object_data->thirdparty->{$key} = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->object_data->total_ht = (double) $object->total_ht;
|
||||||
|
$this->object_data->total_tva = (double) $object->total_tva;
|
||||||
|
$this->object_data->total_ttc = (double) $object->total_ttc;
|
||||||
|
$this->object_data->total_localtax1= (double) $object->total_localtax1;
|
||||||
|
$this->object_data->total_localtax2= (double) $object->total_localtax2;
|
||||||
|
$this->object_data->note_public = (double) $object->note_public;
|
||||||
|
$this->object_data->note_private= (double) $object->note_private;
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif($this->element==='payment'|| $object->element=='payment_supplier'){
|
||||||
|
|
||||||
$this->object_data->amounts = $object->amounts;
|
$this->object_data->amounts = $object->amounts;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -511,6 +548,15 @@ class BlockedLog
|
|||||||
$this->amounts = (double) $obj->amount;
|
$this->amounts = (double) $obj->amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($this->element === 'payment_supplier') {
|
||||||
|
$sql="SELECT amount FROM ".MAIN_DB_PREFIX."paiementfourn WHERE rowid=".$this->fk_object;
|
||||||
|
|
||||||
|
$res = $this->db->query($sql);
|
||||||
|
|
||||||
|
if($res && $obj = $this->db->fetch_object($res)) {
|
||||||
|
$this->amounts = (double) $obj->amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
elseif($this->element === 'facture') {
|
elseif($this->element === 'facture') {
|
||||||
$sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object;
|
$sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -103,7 +103,7 @@ print "</tr>\n";
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0);
|
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',1,0,1,array(),0);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||||
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
|
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||||
|
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -114,10 +115,13 @@ switch($action)
|
|||||||
{
|
{
|
||||||
if (count($prodcustprice->lines) > 0)
|
if (count($prodcustprice->lines) > 0)
|
||||||
{
|
{
|
||||||
$pu_ht = price($prodcustprice->lines [0]->price);
|
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$tva_tx = $prodcustprice->lines [0]->tva_tx;
|
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||||
|
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||||
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -147,7 +151,8 @@ switch($action)
|
|||||||
$obj_facturation->id($ret['rowid']);
|
$obj_facturation->id($ret['rowid']);
|
||||||
$obj_facturation->ref($ret['ref']);
|
$obj_facturation->ref($ret['ref']);
|
||||||
$obj_facturation->stock($ret['reel']);
|
$obj_facturation->stock($ret['reel']);
|
||||||
$obj_facturation->prix($ret['price']);
|
//$obj_facturation->prix($ret['price']);
|
||||||
|
$obj_facturation->prix($pu_ht);
|
||||||
|
|
||||||
|
|
||||||
$vatrate = $tva_tx;
|
$vatrate = $tva_tx;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -105,7 +105,7 @@ print '<td>';
|
|||||||
$disabled=0;
|
$disabled=0;
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
|
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
|
||||||
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1);
|
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',!$disabled,$disabled,1);
|
||||||
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@@ -19,6 +19,14 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($langs) || ! is_object($langs))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("cashdesk");
|
$langs->load("cashdesk");
|
||||||
|
|||||||
@@ -17,6 +17,14 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($langs) || ! is_object($langs))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
|
||||||
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
|
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -19,6 +19,14 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($langs) || ! is_object($langs))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
@@ -71,7 +79,7 @@ print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname
|
|||||||
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
|
||||||
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
|
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
|
||||||
print $langs->trans("CashDeskThirdParty").': ';
|
print $langs->trans("CashDeskThirdParty").': ';
|
||||||
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3)', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3) AND s.status = 1', '', 0, 0, null, 0, 'valignmiddle inline-block');
|
||||||
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
|
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
|
||||||
//print $companyLink;
|
//print $companyLink;
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@@ -16,6 +16,15 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($langs) || ! is_object($langs))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
|
|||||||
@@ -16,6 +16,14 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($langs) || ! is_object($langs))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("banks");
|
$langs->load("banks");
|
||||||
|
|||||||
@@ -17,6 +17,14 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($langs) || ! is_object($langs))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$langs->load("main");
|
$langs->load("main");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ if ($action == 'mupdate')
|
|||||||
|
|
||||||
// Actions to delete doc
|
// Actions to delete doc
|
||||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete));
|
$permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
|
|
||||||
|
|
||||||
@@ -1329,6 +1329,8 @@ if ($id > 0)
|
|||||||
print '</div>';
|
print '</div>';
|
||||||
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
|
||||||
{
|
{
|
||||||
|
//var_dump($object->userassigned);
|
||||||
|
//var_dump($listofuserid);
|
||||||
print '<div class="myavailability">';
|
print '<div class="myavailability">';
|
||||||
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@@ -1483,8 +1485,8 @@ if ($id > 0)
|
|||||||
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
|
||||||
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||||
|
|
||||||
$genallowed=$user->rights->agenda->myactions->create;
|
$genallowed=$user->rights->agenda->myactions->read;
|
||||||
$delallowed=$user->rights->agenda->myactions->delete;
|
$delallowed=$user->rights->agenda->myactions->create;
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -225,11 +225,11 @@ class ActionComm extends CommonObject
|
|||||||
if ($this->elementtype=='commande') $this->elementtype='order';
|
if ($this->elementtype=='commande') $this->elementtype='order';
|
||||||
if ($this->elementtype=='contrat') $this->elementtype='contract';
|
if ($this->elementtype=='contrat') $this->elementtype='contract';
|
||||||
|
|
||||||
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility
|
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array
|
||||||
{
|
{
|
||||||
$tmpid=$this->userassigned;
|
$tmpid=$this->userassigned;
|
||||||
$this->userassigned=array();
|
$this->userassigned=array();
|
||||||
$this->userassigned[$tmpid]=array('id'=>$tmpid);
|
$this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
|
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
|
||||||
@@ -240,7 +240,7 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
|
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
|
||||||
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
|
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
|
||||||
$this->userassigned = array($userownerid=>array('id'=>$userownerid));
|
$this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency));
|
||||||
|
|
||||||
if (! $this->type_id || ! $this->type_code)
|
if (! $this->type_id || ! $this->type_code)
|
||||||
{
|
{
|
||||||
@@ -1333,6 +1333,7 @@ class ActionComm extends CommonObject
|
|||||||
{
|
{
|
||||||
// Note: Output of sql request is encoded in $conf->file->character_set_client
|
// Note: Output of sql request is encoded in $conf->file->character_set_client
|
||||||
// This assignment in condition is not a bug. It allows walking the results.
|
// This assignment in condition is not a bug. It allows walking the results.
|
||||||
|
$diff = 0;
|
||||||
while ($obj=$this->db->fetch_object($resql))
|
while ($obj=$this->db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$qualified=true;
|
$qualified=true;
|
||||||
@@ -1367,8 +1368,9 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
if ($qualified && $datestart)
|
if ($qualified && $datestart)
|
||||||
{
|
{
|
||||||
$eventarray[$datestart]=$event;
|
$eventarray[$datestart+$diff]=$event;
|
||||||
}
|
}
|
||||||
|
$diff++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ if (! $sortorder) $sortorder="ASC";
|
|||||||
if (! $sortfield) $sortfield="name";
|
if (! $sortfield) $sortfield="name";
|
||||||
|
|
||||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
$modulepart='contract';
|
$modulepart='actions';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -297,7 +297,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||||
|
if(is_array($actioncode)) {
|
||||||
|
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||||
|
} else $param.="&actioncode=".$actioncode;
|
||||||
|
}
|
||||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
@@ -482,7 +486,14 @@ if (! empty($actioncode))
|
|||||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
|
if (is_array($actioncode))
|
||||||
|
{
|
||||||
|
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -523,8 +534,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
|
|||||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||||
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
|
||||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
|
||||||
// We must filter on assignement table
|
// We must filter on assignement table
|
||||||
if ($filtert > 0 || $usergroup > 0)
|
if ($filtert > 0 || $usergroup > 0)
|
||||||
{
|
{
|
||||||
@@ -1232,7 +1243,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
|
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
|
||||||
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
|
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
|
||||||
|
|
||||||
$nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ...
|
$nextindextouse=is_array($colorindexused)?count($colorindexused):0; // At first run this is 0, so fist user has 0, next 1, ...
|
||||||
//print $nextindextouse;
|
//print $nextindextouse;
|
||||||
|
|
||||||
foreach ($eventarray as $daykey => $notused)
|
foreach ($eventarray as $daykey => $notused)
|
||||||
|
|||||||
@@ -169,7 +169,11 @@ $listofextcals=array();
|
|||||||
$param='';
|
$param='';
|
||||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||||
if ($actioncode != '') $param.="&actioncode=".$actioncode;
|
if ($actioncode != '') {
|
||||||
|
if(is_array($actioncode)) {
|
||||||
|
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||||
|
} else $param.="&actioncode=".$actioncode;
|
||||||
|
}
|
||||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||||
if ($status != '' && $status > -1) $param.="&status=".$status;
|
if ($status != '' && $status > -1) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
@@ -227,7 +231,14 @@ if (! empty($actioncode))
|
|||||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
|
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND c.code IN ('".implode("','", explode(',',$actioncode))."')";
|
if (is_array($actioncode))
|
||||||
|
{
|
||||||
|
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,8 +253,8 @@ if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
|||||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||||
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||||
if ($status == '100') { $sql.= " AND a.percent = 100"; }
|
if ($status == '100') { $sql.= " AND a.percent = 100"; }
|
||||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
|
||||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
|
||||||
if ($search_title) $sql.=natural_search("a.label", $search_title);
|
if ($search_title) $sql.=natural_search("a.label", $search_title);
|
||||||
// We must filter on assignement table
|
// We must filter on assignement table
|
||||||
if ($filtert > 0 || $usergroup > 0)
|
if ($filtert > 0 || $usergroup > 0)
|
||||||
|
|||||||
@@ -427,8 +427,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
|
|||||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||||
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
|
||||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
|
||||||
// We must filter on assignement table
|
// We must filter on assignement table
|
||||||
if ($filtert > 0 || $usergroup > 0)
|
if ($filtert > 0 || $usergroup > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -203,7 +203,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
if ($status == 'todo') $title=$langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param='';
|
$param='';
|
||||||
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
|
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
|
||||||
|
if(is_array($actioncode)) {
|
||||||
|
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
|
||||||
|
} else $param.="&actioncode=".$actioncode;
|
||||||
|
}
|
||||||
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
|
||||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
|
||||||
if ($filter) $param.="&filter=".$filter;
|
if ($filter) $param.="&filter=".$filter;
|
||||||
@@ -394,7 +398,14 @@ if (! empty($actioncode))
|
|||||||
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
|
if (is_array($actioncode))
|
||||||
|
{
|
||||||
|
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -435,8 +446,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
|
|||||||
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
if ($status == '0') { $sql.= " AND a.percent = 0"; }
|
||||||
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
|
||||||
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
|
||||||
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
|
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
|
||||||
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
|
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
|
||||||
// We must filter on assignement table
|
// We must filter on assignement table
|
||||||
if ($filtert > 0 || $usergroup > 0)
|
if ($filtert > 0 || $usergroup > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
$_socid = $_GET["id"];
|
$id = GETPOST('id','int');
|
||||||
|
$_socid = GETPOST("id",'int');
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
@@ -45,10 +46,10 @@ if ($user->societe_id > 0)
|
|||||||
if ($_POST["action"] == 'setpricelevel')
|
if ($_POST["action"] == 'setpricelevel')
|
||||||
{
|
{
|
||||||
$soc = New Societe($db);
|
$soc = New Societe($db);
|
||||||
$soc->fetch($_GET["id"]);
|
$soc->fetch($id);
|
||||||
$soc->set_price_level($_POST["price_level"],$user);
|
$soc->set_price_level($_POST["price_level"],$user);
|
||||||
|
|
||||||
header("Location: multiprix.php?id=".$_GET["id"]);
|
header("Location: multiprix.php?id=".$id);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ $originid = GETPOST('originid', 'int');
|
|||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
$lineid = GETPOST('lineid', 'int');
|
$lineid = GETPOST('lineid', 'int');
|
||||||
$contactid = GETPOST('contactid','int');
|
$contactid = GETPOST('contactid','int');
|
||||||
|
$projectid = GETPOST('projectid','int');
|
||||||
|
|
||||||
// PDF
|
// PDF
|
||||||
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
|
||||||
@@ -611,7 +612,7 @@ if (empty($reshook))
|
|||||||
// prevent browser refresh from closing proposal several times
|
// prevent browser refresh from closing proposal several times
|
||||||
if ($object->statut == Propal::STATUS_VALIDATED)
|
if ($object->statut == Propal::STATUS_VALIDATED)
|
||||||
{
|
{
|
||||||
$result=$object->cloture($user, GETPOST('statut'), GETPOST('note'));
|
$result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note','none'));
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
@@ -805,6 +806,9 @@ if (empty($reshook))
|
|||||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
|
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
|
||||||
|
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||||
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -864,13 +868,33 @@ if (empty($reshook))
|
|||||||
// Add custom code and origin country into description
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
|
||||||
{
|
{
|
||||||
$tmptxt = '(';
|
// Define output language
|
||||||
if (! empty($prod->customcode))
|
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
$outputlangs = $langs;
|
||||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
$newlang = '';
|
||||||
$tmptxt .= ' - ';
|
if (empty($newlang) && GETPOST('lang_id','alpha'))
|
||||||
if (! empty($prod->country_code))
|
$newlang = GETPOST('lang_id','alpha');
|
||||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
if (empty($newlang))
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
if (! empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
|
}
|
||||||
|
if (! empty($prod->customcode))
|
||||||
|
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||||
|
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||||
|
$tmptxt .= ' - ';
|
||||||
|
if (! empty($prod->country_code))
|
||||||
|
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||||
|
} else {
|
||||||
|
if (! empty($prod->customcode))
|
||||||
|
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||||
|
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||||
|
$tmptxt .= ' - ';
|
||||||
|
if (! empty($prod->country_code))
|
||||||
|
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||||
|
}
|
||||||
$tmptxt .= ')';
|
$tmptxt .= ')';
|
||||||
$desc = dol_concatdesc($desc, $tmptxt);
|
$desc = dol_concatdesc($desc, $tmptxt);
|
||||||
}
|
}
|
||||||
@@ -1297,7 +1321,7 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
$objectsrc->fetch_thirdparty();
|
$objectsrc->fetch_thirdparty();
|
||||||
|
|
||||||
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
|
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
|
||||||
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
|
||||||
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
|
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
|
||||||
|
|
||||||
@@ -1427,7 +1451,7 @@ if ($action == 'create')
|
|||||||
// Bank Account
|
// Bank Account
|
||||||
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
|
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
|
||||||
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
|
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
|
||||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1465,9 +1489,6 @@ if ($action == 'create')
|
|||||||
// Project
|
// Project
|
||||||
if (! empty($conf->projet->enabled) && $socid > 0)
|
if (! empty($conf->projet->enabled) && $socid > 0)
|
||||||
{
|
{
|
||||||
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
|
|
||||||
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
|
|
||||||
|
|
||||||
$langs->load("projects");
|
$langs->load("projects");
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>' . $langs->trans("Project") . '</td><td>';
|
print '<td>' . $langs->trans("Project") . '</td><td>';
|
||||||
@@ -2173,7 +2194,7 @@ if ($action == 'create')
|
|||||||
// Show object lines
|
// Show object lines
|
||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
@@ -2355,8 +2376,8 @@ if ($action == 'create')
|
|||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->propal->creer;
|
$genallowed = $user->rights->propal->lire;
|
||||||
$delallowed = $user->rights->propal->supprimer;
|
$delallowed = $user->rights->propal->creer;
|
||||||
|
|
||||||
$var = true;
|
$var = true;
|
||||||
|
|
||||||
|
|||||||
@@ -280,14 +280,14 @@ class Proposals extends DolibarrApi
|
|||||||
$request_data->date_end,
|
$request_data->date_end,
|
||||||
$request_data->array_options,
|
$request_data->array_options,
|
||||||
$request_data->fk_unit,
|
$request_data->fk_unit,
|
||||||
$this->element,
|
$request_data->origin,
|
||||||
$request_data->id,
|
$request_data->origin_id,
|
||||||
$request_data->multicurrency_subprice,
|
$request_data->multicurrency_subprice,
|
||||||
$request_data->fk_remise_except
|
$request_data->fk_remise_except
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes > 0) {
|
if ($updateRes > 0) {
|
||||||
return $this->get($id)->line->rowid;
|
return $updateRes;
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -371,12 +371,12 @@ class Propal extends CommonObject
|
|||||||
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
|
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
|
||||||
* and desc must already have the right value (it's up to the caller to manage multilanguage)
|
* and desc must already have the right value (it's up to the caller to manage multilanguage)
|
||||||
*
|
*
|
||||||
* @param string $desc Description de la ligne
|
* @param string $desc Description of line
|
||||||
* @param float $pu_ht Prix unitaire
|
* @param float $pu_ht Unit price
|
||||||
* @param float $qty Quantite
|
* @param float $qty Quantity
|
||||||
* @param float $txtva Taux de tva
|
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||||
* @param float $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||||
* @param float $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||||
* @param int $fk_product Id du produit/service predefini
|
* @param int $fk_product Id du produit/service predefini
|
||||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||||
* @param string $price_base_type HT or TTC
|
* @param string $price_base_type HT or TTC
|
||||||
@@ -417,6 +417,7 @@ class Propal extends CommonObject
|
|||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht=price2num($pu_ht);
|
||||||
|
$pu_ht_devise=price2num($pu_ht_devise);
|
||||||
$pu_ttc=price2num($pu_ttc);
|
$pu_ttc=price2num($pu_ttc);
|
||||||
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
|
||||||
$txlocaltax1=price2num($txlocaltax1);
|
$txlocaltax1=price2num($txlocaltax1);
|
||||||
@@ -590,6 +591,11 @@ class Propal extends CommonObject
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -633,6 +639,7 @@ class Propal extends CommonObject
|
|||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu = price2num($pu);
|
$pu = price2num($pu);
|
||||||
|
$pu_ht_devise=price2num($pu_ht_devise);
|
||||||
$txtva = price2num($txtva);
|
$txtva = price2num($txtva);
|
||||||
$txlocaltax1=price2num($txlocaltax1);
|
$txlocaltax1=price2num($txlocaltax1);
|
||||||
$txlocaltax2=price2num($txlocaltax2);
|
$txlocaltax2=price2num($txlocaltax2);
|
||||||
@@ -831,8 +838,9 @@ class Propal extends CommonObject
|
|||||||
if (empty($this->availability_id)) $this->availability_id=0;
|
if (empty($this->availability_id)) $this->availability_id=0;
|
||||||
if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
|
if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
|
||||||
|
|
||||||
// Multicurrency
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
|
||||||
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
{
|
{
|
||||||
$this->multicurrency_code = $conf->currency;
|
$this->multicurrency_code = $conf->currency;
|
||||||
@@ -955,9 +963,51 @@ class Propal extends CommonObject
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) $error++;
|
if (! $resql) $error++;
|
||||||
|
|
||||||
|
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
|
||||||
|
{
|
||||||
|
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add object linked
|
||||||
|
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||||
|
{
|
||||||
|
foreach($this->linked_objects as $origin => $tmp_origin_id)
|
||||||
|
{
|
||||||
|
if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...))
|
||||||
|
{
|
||||||
|
foreach($tmp_origin_id as $origin_id)
|
||||||
|
{
|
||||||
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
|
if (! $ret)
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
|
||||||
|
{
|
||||||
|
$origin_id = $tmp_origin_id;
|
||||||
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
|
if (! $ret)
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add linked object (deprecated, use ->linkedObjectsIds instead)
|
||||||
|
if (! $error && $this->origin && $this->origin_id)
|
||||||
|
{
|
||||||
|
$ret = $this->add_object_linked();
|
||||||
|
if (! $ret) dol_print_error($this->db);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insertion du detail des produits dans la base
|
* Insertion du detail des produits dans la base
|
||||||
*/
|
*/
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$fk_parent_line=0;
|
$fk_parent_line=0;
|
||||||
@@ -970,11 +1020,15 @@ class Propal extends CommonObject
|
|||||||
$fk_parent_line = 0;
|
$fk_parent_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Complete vat rate with code
|
||||||
|
$vatrate = $this->lines[$i]->tva_tx;
|
||||||
|
if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')';
|
||||||
|
|
||||||
$result = $this->addline(
|
$result = $this->addline(
|
||||||
$this->lines[$i]->desc,
|
$this->lines[$i]->desc,
|
||||||
$this->lines[$i]->subprice,
|
$this->lines[$i]->subprice,
|
||||||
$this->lines[$i]->qty,
|
$this->lines[$i]->qty,
|
||||||
$this->lines[$i]->tva_tx,
|
$vatrate,
|
||||||
$this->lines[$i]->localtax1_tx,
|
$this->lines[$i]->localtax1_tx,
|
||||||
$this->lines[$i]->localtax2_tx,
|
$this->lines[$i]->localtax2_tx,
|
||||||
$this->lines[$i]->fk_product,
|
$this->lines[$i]->fk_product,
|
||||||
@@ -1011,13 +1065,6 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add linked object
|
|
||||||
if (! $error && $this->origin && $this->origin_id)
|
|
||||||
{
|
|
||||||
$ret = $this->add_object_linked();
|
|
||||||
if (! $ret) dol_print_error($this->db);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set delivery address
|
// Set delivery address
|
||||||
if (! $error && $this->fk_delivery_address)
|
if (! $error && $this->fk_delivery_address)
|
||||||
{
|
{
|
||||||
@@ -1186,7 +1233,6 @@ class Propal extends CommonObject
|
|||||||
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
|
||||||
|
|
||||||
// Create clone
|
// Create clone
|
||||||
|
|
||||||
$result=$clonedObj->create($user);
|
$result=$clonedObj->create($user);
|
||||||
if ($result < 0) $error++;
|
if ($result < 0) $error++;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -31,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
$langs->load('other');
|
$langs->load('other');
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,6 +28,9 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load('propal');
|
$langs->load('propal');
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
|
|||||||
@@ -83,12 +83,14 @@ $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
|
|||||||
$search_day=GETPOST("search_day","int");
|
$search_day=GETPOST("search_day","int");
|
||||||
$search_month=GETPOST("search_month","int");
|
$search_month=GETPOST("search_month","int");
|
||||||
$search_year=GETPOST("search_year","int");
|
$search_year=GETPOST("search_year","int");
|
||||||
|
$search_btn=GETPOST('button_search','alpha');
|
||||||
|
$search_remove_btn=GETPOST('button_removefilter','alpha');
|
||||||
|
|
||||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@@ -384,6 +386,7 @@ if ($resql)
|
|||||||
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
|
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
|
||||||
if ($socid > 0) $param.='&socid='.urlencode($socid);
|
if ($socid > 0) $param.='&socid='.urlencode($socid);
|
||||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||||
|
if ($search_product_category != '') $param.='&search_product_category='.$search_product_category;
|
||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
@@ -1031,7 +1034,7 @@ if ($resql)
|
|||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->propal->lire;
|
$genallowed=$user->rights->propal->lire;
|
||||||
$delallowed=$user->rights->propal->lire;
|
$delallowed=$user->rights->propal->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
|
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,6 +29,9 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load('propal');
|
$langs->load('propal');
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
|
|||||||
@@ -22,6 +22,14 @@
|
|||||||
* \ingroup propal
|
* \ingroup propal
|
||||||
* \brief Template to show objects linked to proposals
|
* \brief Template to show objects linked to proposals
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE -->
|
<!-- BEGIN PHP TEMPLATE -->
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ if ($socid > 0)
|
|||||||
$facturestatic->id=$obj->fk_facture_source;
|
$facturestatic->id=$obj->fk_facture_source;
|
||||||
$facturestatic->ref=$obj->ref;
|
$facturestatic->ref=$obj->ref;
|
||||||
$facturestatic->type=$obj->type;
|
$facturestatic->type=$obj->type;
|
||||||
print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1);
|
print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("ExcessReceived"),$obj->description).' '.$facturestatic->getNomURl(1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -766,10 +766,13 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if (count($prodcustprice->lines) > 0)
|
if (count($prodcustprice->lines) > 0)
|
||||||
{
|
{
|
||||||
$pu_ht = price($prodcustprice->lines [0]->price);
|
$pu_ht = price($prodcustprice->lines[0]->price);
|
||||||
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
|
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||||
$price_base_type = $prodcustprice->lines [0]->price_base_type;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$tva_tx = $prodcustprice->lines [0]->tva_tx;
|
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||||
|
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||||
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -821,12 +824,33 @@ if (empty($reshook))
|
|||||||
// Add custom code and origin country into description
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||||
$tmptxt = '(';
|
$tmptxt = '(';
|
||||||
if (! empty($prod->customcode))
|
// Define output language
|
||||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
$outputlangs = $langs;
|
||||||
$tmptxt .= ' - ';
|
$newlang = '';
|
||||||
if (! empty($prod->country_code))
|
if (empty($newlang) && GETPOST('lang_id','alpha'))
|
||||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
$newlang = GETPOST('lang_id','alpha');
|
||||||
|
if (empty($newlang))
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
if (! empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
|
}
|
||||||
|
if (! empty($prod->customcode))
|
||||||
|
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||||
|
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||||
|
$tmptxt .= ' - ';
|
||||||
|
if (! empty($prod->country_code))
|
||||||
|
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||||
|
} else {
|
||||||
|
if (! empty($prod->customcode))
|
||||||
|
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||||
|
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||||
|
$tmptxt .= ' - ';
|
||||||
|
if (! empty($prod->country_code))
|
||||||
|
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||||
|
}
|
||||||
$tmptxt .= ')';
|
$tmptxt .= ')';
|
||||||
$desc = dol_concatdesc($desc, $tmptxt);
|
$desc = dol_concatdesc($desc, $tmptxt);
|
||||||
}
|
}
|
||||||
@@ -2389,7 +2413,7 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
*/
|
*/
|
||||||
$result = $object->getLinesArray();
|
$result = $object->getLinesArray();
|
||||||
|
|
||||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
@@ -2576,8 +2600,8 @@ if ($action == 'create' && $user->rights->commande->creer)
|
|||||||
$relativepath = $comref . '/' . $comref . '.pdf';
|
$relativepath = $comref . '/' . $comref . '.pdf';
|
||||||
$filedir = $conf->commande->dir_output . '/' . $comref;
|
$filedir = $conf->commande->dir_output . '/' . $comref;
|
||||||
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
|
||||||
$genallowed = $user->rights->commande->creer;
|
$genallowed = $user->rights->commande->lire;
|
||||||
$delallowed = $user->rights->commande->supprimer;
|
$delallowed = $user->rights->commande->creer;
|
||||||
print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ class Orders extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get properties of a commande object
|
* Get properties of an order object
|
||||||
*
|
*
|
||||||
* Return an array with commande informations
|
* Return an array with order informations
|
||||||
*
|
*
|
||||||
* @param int $id ID of order
|
* @param int $id ID of order
|
||||||
* @return array|mixed data without useless information
|
* @return array|mixed data without useless information
|
||||||
@@ -176,7 +176,7 @@ class Orders extends DolibarrApi
|
|||||||
* Create order object
|
* Create order object
|
||||||
*
|
*
|
||||||
* @param array $request_data Request data
|
* @param array $request_data Request data
|
||||||
* @return int ID of commande
|
* @return int ID of order
|
||||||
*/
|
*/
|
||||||
function post($request_data = NULL)
|
function post($request_data = NULL)
|
||||||
{
|
{
|
||||||
@@ -196,6 +196,7 @@ class Orders extends DolibarrApi
|
|||||||
}
|
}
|
||||||
$this->commande->lines = $lines;
|
$this->commande->lines = $lines;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if ($this->commande->create(DolibarrApiAccess::$user) < 0) {
|
if ($this->commande->create(DolibarrApiAccess::$user) < 0) {
|
||||||
throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors));
|
throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors));
|
||||||
}
|
}
|
||||||
@@ -236,8 +237,8 @@ class Orders extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Add a line to given order
|
* Add a line to given order
|
||||||
*
|
*
|
||||||
* @param int $id Id of commande to update
|
* @param int $id Id of order to update
|
||||||
* @param array $request_data Orderline data
|
* @param array $request_data OrderLine data
|
||||||
*
|
*
|
||||||
* @url POST {id}/lines
|
* @url POST {id}/lines
|
||||||
*
|
*
|
||||||
@@ -281,12 +282,13 @@ class Orders extends DolibarrApi
|
|||||||
$request_data->label,
|
$request_data->label,
|
||||||
$request_data->array_options,
|
$request_data->array_options,
|
||||||
$request_data->fk_unit,
|
$request_data->fk_unit,
|
||||||
$this->element,
|
$request_data->origin,
|
||||||
$request_data->id
|
$request_data->origin_id,
|
||||||
|
$request_data->multicurrency_subprice
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes > 0) {
|
if ($updateRes > 0) {
|
||||||
return $this->get($id)->line->rowid;
|
return $updateRes;
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -295,9 +297,9 @@ class Orders extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Update a line to given order
|
* Update a line to given order
|
||||||
*
|
*
|
||||||
* @param int $id Id of commande to update
|
* @param int $id Id of order to update
|
||||||
* @param int $lineid Id of line to update
|
* @param int $lineid Id of line to update
|
||||||
* @param array $request_data Orderline data
|
* @param array $request_data OrderLine data
|
||||||
*
|
*
|
||||||
* @url PUT {id}/lines/{lineid}
|
* @url PUT {id}/lines/{lineid}
|
||||||
*
|
*
|
||||||
@@ -310,7 +312,7 @@ class Orders extends DolibarrApi
|
|||||||
|
|
||||||
$result = $this->commande->fetch($id);
|
$result = $this->commande->fetch($id);
|
||||||
if( ! $result ) {
|
if( ! $result ) {
|
||||||
throw new RestException(404, 'Commande not found');
|
throw new RestException(404, 'Order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
|
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
|
||||||
@@ -338,7 +340,8 @@ class Orders extends DolibarrApi
|
|||||||
$request_data->label,
|
$request_data->label,
|
||||||
$request_data->special_code,
|
$request_data->special_code,
|
||||||
$request_data->array_options,
|
$request_data->array_options,
|
||||||
$request_data->fk_unit
|
$request_data->fk_unit,
|
||||||
|
$request_data->multicurrency_subprice
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes > 0) {
|
if ($updateRes > 0) {
|
||||||
@@ -353,7 +356,7 @@ class Orders extends DolibarrApi
|
|||||||
* Delete a line to given order
|
* Delete a line to given order
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param int $id Id of commande to update
|
* @param int $id Id of order to update
|
||||||
* @param int $lineid Id of line to delete
|
* @param int $lineid Id of line to delete
|
||||||
*
|
*
|
||||||
* @url DELETE {id}/lines/{lineid}
|
* @url DELETE {id}/lines/{lineid}
|
||||||
@@ -384,7 +387,7 @@ class Orders extends DolibarrApi
|
|||||||
/**
|
/**
|
||||||
* Update order general fields (won't touch lines of order)
|
* Update order general fields (won't touch lines of order)
|
||||||
*
|
*
|
||||||
* @param int $id Id of commande to update
|
* @param int $id Id of order to update
|
||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
@@ -396,7 +399,7 @@ class Orders extends DolibarrApi
|
|||||||
|
|
||||||
$result = $this->commande->fetch($id);
|
$result = $this->commande->fetch($id);
|
||||||
if( ! $result ) {
|
if( ! $result ) {
|
||||||
throw new RestException(404, 'Commande not found');
|
throw new RestException(404, 'Order not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
|
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
|
||||||
|
|||||||
@@ -709,7 +709,7 @@ class Commande extends CommonOrder
|
|||||||
// $date_commande is deprecated
|
// $date_commande is deprecated
|
||||||
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
$date = ($this->date_commande ? $this->date_commande : $this->date);
|
||||||
|
|
||||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
|
||||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
@@ -821,11 +821,15 @@ class Commande extends CommonOrder
|
|||||||
$fk_parent_line = 0;
|
$fk_parent_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Complete vat rate with code
|
||||||
|
$vatrate = $line->tva_tx;
|
||||||
|
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
|
||||||
|
|
||||||
$result = $this->addline(
|
$result = $this->addline(
|
||||||
$line->desc,
|
$line->desc,
|
||||||
$line->subprice,
|
$line->subprice,
|
||||||
$line->qty,
|
$line->qty,
|
||||||
$line->tva_tx,
|
$vatrate,
|
||||||
$line->localtax1_tx,
|
$line->localtax1_tx,
|
||||||
$line->localtax2_tx,
|
$line->localtax2_tx,
|
||||||
$line->fk_product,
|
$line->fk_product,
|
||||||
@@ -875,6 +879,11 @@ class Commande extends CommonOrder
|
|||||||
{
|
{
|
||||||
$this->ref = $initialref;
|
$this->ref = $initialref;
|
||||||
|
|
||||||
|
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
|
||||||
|
{
|
||||||
|
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
|
||||||
|
}
|
||||||
|
|
||||||
// Add object linked
|
// Add object linked
|
||||||
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||||
{
|
{
|
||||||
@@ -887,7 +896,7 @@ class Commande extends CommonOrder
|
|||||||
$ret = $this->add_object_linked($origin, $origin_id);
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
if (! $ret)
|
if (! $ret)
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -898,7 +907,7 @@ class Commande extends CommonOrder
|
|||||||
$ret = $this->add_object_linked($origin, $origin_id);
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
if (! $ret)
|
if (! $ret)
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1206,9 +1215,9 @@ class Commande extends CommonOrder
|
|||||||
* @param string $desc Description of line
|
* @param string $desc Description of line
|
||||||
* @param float $pu_ht Unit price (without tax)
|
* @param float $pu_ht Unit price (without tax)
|
||||||
* @param float $qty Quantite
|
* @param float $qty Quantite
|
||||||
* @param float $txtva Taux de tva force, sinon -1
|
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||||
* @param float $txlocaltax1 Local tax 1 rate
|
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||||
* @param float $txlocaltax2 Local tax 2 rate
|
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||||
* @param int $fk_product Id of product
|
* @param int $fk_product Id of product
|
||||||
* @param float $remise_percent Pourcentage de remise de la ligne
|
* @param float $remise_percent Pourcentage de remise de la ligne
|
||||||
* @param int $info_bits Bits de type de lignes
|
* @param int $info_bits Bits de type de lignes
|
||||||
@@ -1260,6 +1269,7 @@ class Commande extends CommonOrder
|
|||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht=price2num($pu_ht);
|
||||||
|
$pu_ht_devise=price2num($pu_ht_devise);
|
||||||
$pu_ttc=price2num($pu_ttc);
|
$pu_ttc=price2num($pu_ttc);
|
||||||
$pa_ht=price2num($pa_ht);
|
$pa_ht=price2num($pa_ht);
|
||||||
$txtva = price2num($txtva);
|
$txtva = price2num($txtva);
|
||||||
@@ -1431,10 +1441,10 @@ class Commande extends CommonOrder
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
|
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
|
||||||
return -3;
|
return -3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2806,6 +2816,7 @@ class Commande extends CommonOrder
|
|||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu = price2num($pu);
|
$pu = price2num($pu);
|
||||||
$pa_ht=price2num($pa_ht);
|
$pa_ht=price2num($pa_ht);
|
||||||
|
$pu_ht_devise=price2num($pu_ht_devise);
|
||||||
$txtva=price2num($txtva);
|
$txtva=price2num($txtva);
|
||||||
$txlocaltax1=price2num($txlocaltax1);
|
$txlocaltax1=price2num($txlocaltax1);
|
||||||
$txlocaltax2=price2num($txlocaltax2);
|
$txlocaltax2=price2num($txlocaltax2);
|
||||||
@@ -3118,6 +3129,12 @@ class Commande extends CommonOrder
|
|||||||
// End call triggers
|
// End call triggers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->nb_expedition() != 0)
|
||||||
|
{
|
||||||
|
$this->errors[] = $langs->trans('SomeShipmentExists');
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail
|
//TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@@ -4025,7 +4042,7 @@ class OrderLine extends CommonOrderLine
|
|||||||
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
|
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
|
||||||
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
|
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
|
||||||
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);
|
||||||
$sql.= ", ".$this->fk_multicurrency;
|
$sql.= ", ".(! empty($this->fk_multicurrency) ? $this->fk_multicurrency : 'NULL');
|
||||||
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
|
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
|
||||||
$sql.= ", ".$this->multicurrency_subprice;
|
$sql.= ", ".$this->multicurrency_subprice;
|
||||||
$sql.= ", ".$this->multicurrency_total_ht;
|
$sql.= ", ".$this->multicurrency_total_ht;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -31,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$langs->load('companies');
|
$langs->load('companies');
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -26,6 +27,9 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
if (!$user->rights->commande->lire) accessforbidden();
|
if (!$user->rights->commande->lire) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ $search_total_ht=GETPOST('search_total_ht','alpha');
|
|||||||
$optioncss = GETPOST('optioncss','alpha');
|
$optioncss = GETPOST('optioncss','alpha');
|
||||||
$billed = GETPOST('billed','int');
|
$billed = GETPOST('billed','int');
|
||||||
$viewstatut=GETPOST('viewstatut');
|
$viewstatut=GETPOST('viewstatut');
|
||||||
|
$search_btn=GETPOST('button_search','alpha');
|
||||||
|
$search_remove_btn=GETPOST('button_removefilter','alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
|
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
|
||||||
@@ -86,7 +88,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@@ -627,6 +629,13 @@ if ($resql)
|
|||||||
if ($show_files) $param.='&show_files=' .$show_files;
|
if ($show_files) $param.='&show_files=' .$show_files;
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
if ($billed != '') $param.='&billed='.$billed;
|
if ($billed != '') $param.='&billed='.$billed;
|
||||||
|
if ($search_town != '')$param .= '&search_town='.$search_town;
|
||||||
|
if ($search_zip != '')$param .= '&search_zip='.$search_zip;
|
||||||
|
if ($search_state != '')$param .= '&search_state='.$search_state;
|
||||||
|
if ($search_country != '')$param .= '&search_country='.$search_country;
|
||||||
|
if ($search_type_thirdparty != '')$param .= '&search_type_thirdparty='.$search_type_thirdparty;
|
||||||
|
if ($search_product_category != '')$param .= '&search_product_category='.$search_product_category;
|
||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
@@ -1452,7 +1461,7 @@ if ($resql)
|
|||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->commande->lire;
|
$genallowed=$user->rights->commande->lire;
|
||||||
$delallowed=$user->rights->commande->supprimer;
|
$delallowed=$user->rights->commande->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,6 +28,9 @@
|
|||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
|
||||||
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
|
||||||
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2012-2018 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@@ -285,6 +285,13 @@ if (($action == 'create' || $action == 'add') && !$error)
|
|||||||
{
|
{
|
||||||
$fk_parent_line = 0;
|
$fk_parent_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extrafields
|
||||||
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
|
||||||
|
$lines[$i]->fetch_optionals($lines[$i]->rowid);
|
||||||
|
$array_options = $lines[$i]->array_options;
|
||||||
|
}
|
||||||
|
|
||||||
$result = $object->addline(
|
$result = $object->addline(
|
||||||
$desc,
|
$desc,
|
||||||
$lines[$i]->subprice,
|
$lines[$i]->subprice,
|
||||||
@@ -309,7 +316,8 @@ if (($action == 'create' || $action == 'add') && !$error)
|
|||||||
$fk_parent_line,
|
$fk_parent_line,
|
||||||
$lines[$i]->fk_fournprice,
|
$lines[$i]->fk_fournprice,
|
||||||
$lines[$i]->pa_ht,
|
$lines[$i]->pa_ht,
|
||||||
$lines[$i]->label
|
$lines[$i]->label,
|
||||||
|
$array_options
|
||||||
);
|
);
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,8 +15,15 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE -->
|
<!-- BEGIN PHP TEMPLATE -->
|
||||||
|
|||||||
@@ -376,6 +376,8 @@ if (dol_strlen($search_dv_end) > 0) $param .= '&search_end_dvmonth=' . GETPOST
|
|||||||
if ($search_req_nb) $param.='&req_nb='.urlencode($search_req_nb);
|
if ($search_req_nb) $param.='&req_nb='.urlencode($search_req_nb);
|
||||||
if (GETPOST("thirdparty")) $param.='&thirdparty='.urlencode(GETPOST("thirdparty"));
|
if (GETPOST("thirdparty")) $param.='&thirdparty='.urlencode(GETPOST("thirdparty"));
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
if(!empty($search_conciliated) || $search_conciliated === 0) $param.='&search_conciliated='.$search_conciliated;
|
||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ if ($action == 'add')
|
|||||||
$object->owner_address = trim($_POST["owner_address"]);
|
$object->owner_address = trim($_POST["owner_address"]);
|
||||||
|
|
||||||
$account_number = GETPOST('account_number','alpha');
|
$account_number = GETPOST('account_number','alpha');
|
||||||
if ($account_number <= 0) { $object->account_number = ''; } else { $object->account_number = $account_number; }
|
if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; } else { $object->account_number = $account_number; }
|
||||||
$fk_accountancy_journal = GETPOST('fk_accountancy_journal','int');
|
$fk_accountancy_journal = GETPOST('fk_accountancy_journal','int');
|
||||||
if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
|
if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
|
||||||
|
|
||||||
@@ -656,7 +656,7 @@ else
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if (! empty($conf->accounting->enabled)) {
|
if (! empty($conf->accounting->enabled)) {
|
||||||
$accountingaccount = new AccountingAccount($db);
|
$accountingaccount = new AccountingAccount($db);
|
||||||
$accountingaccount->fetch('',$object->account_number);
|
$accountingaccount->fetch('',$object->account_number, 1);
|
||||||
|
|
||||||
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
print $accountingaccount->getNomUrl(0,1,1,'',1);
|
||||||
} else {
|
} else {
|
||||||
@@ -845,11 +845,11 @@ else
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?GETPOST("ref"):$object->ref).'"></td></tr>';
|
print '<td><input size="8" type="text" class="flat" name="ref" value="'.dol_escape_htmltag(isset($_POST["ref"])?GETPOST("ref"):$object->ref).'"></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||||
print '<td><input type="text" class="flat minwidth300" name="label" value="'.(isset($_POST["label"])?GETPOST("label"):$object->label).'"></td></tr>';
|
print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(isset($_POST["label"])?GETPOST("label"):$object->label).'"></td></tr>';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ $hookmanager->initHooks(array($contextpage));
|
|||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
|
|
||||||
// fetch optionals attributes and labels
|
// fetch optionals attributes and labels
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label('bankaccount');
|
$extralabels = $extrafields->fetch_name_optionals_label('bank_account');
|
||||||
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
|
||||||
|
|
||||||
// List of fields to search into when doing a "search in all"
|
// List of fields to search into when doing a "search in all"
|
||||||
@@ -143,7 +143,7 @@ $title=$langs->trans('BankAccounts');
|
|||||||
// Load array of financial accounts (opened by default)
|
// Load array of financial accounts (opened by default)
|
||||||
$accounts = array();
|
$accounts = array();
|
||||||
|
|
||||||
$sql = "SELECT rowid, label, courant, rappro, account_number, fk_accountancy_journal, datec as date_creation, tms as date_update";
|
$sql = "SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.datec as date_creation, b.tms as date_update";
|
||||||
// Add fields from extrafields
|
// Add fields from extrafields
|
||||||
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
|
||||||
// Add fields from hooks
|
// Add fields from hooks
|
||||||
@@ -151,7 +151,7 @@ $parameters=array();
|
|||||||
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
|
||||||
$sql.=$hookmanager->resPrint;
|
$sql.=$hookmanager->resPrint;
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
|
||||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)";
|
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account_extrafields as ef on (b.rowid = ef.fk_object)";
|
||||||
$sql.= " WHERE entity IN (".getEntity('bank_account').")";
|
$sql.= " WHERE entity IN (".getEntity('bank_account').")";
|
||||||
if ($statut == 'opened') $sql.= " AND clos = 0";
|
if ($statut == 'opened') $sql.= " AND clos = 0";
|
||||||
if ($statut == 'closed') $sql.= " AND clos = 1";
|
if ($statut == 'closed') $sql.= " AND clos = 1";
|
||||||
|
|||||||
@@ -47,10 +47,11 @@ $langs->load("companies");
|
|||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
$id=GETPOST('account');
|
$id=GETPOST('account','int');
|
||||||
$ref=GETPOST('ref');
|
$ref=GETPOST('ref','alpha');
|
||||||
$dvid=GETPOST('dvid');
|
$dvid=GETPOST('dvid','alpha');
|
||||||
$numref=GETPOST('num');
|
$numref=GETPOST('num','alpha');
|
||||||
|
$ve=GETPOST("ve",'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldid = (! empty($ref)?$ref:$id);
|
$fieldid = (! empty($ref)?$ref:$id);
|
||||||
@@ -95,6 +96,62 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Initialize technical object to manage context to save list fields
|
// Initialize technical object to manage context to save list fields
|
||||||
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
|
||||||
|
|
||||||
|
|
||||||
|
// Define number of receipt to show (current, previous or next one ?)
|
||||||
|
$found=false;
|
||||||
|
if ($_GET["rel"] == 'prev')
|
||||||
|
{
|
||||||
|
// Recherche valeur pour num = numero releve precedent
|
||||||
|
$sql = "SELECT DISTINCT(b.num_releve) as num";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||||
|
$sql.= " WHERE b.num_releve < '".$db->escape($numref)."'";
|
||||||
|
$sql.= " AND b.fk_account = ".$object->id;
|
||||||
|
$sql.= " ORDER BY b.num_releve DESC";
|
||||||
|
|
||||||
|
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$numrows = $db->num_rows($resql);
|
||||||
|
if ($numrows > 0)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$numref = $obj->num;
|
||||||
|
$found=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif ($_GET["rel"] == 'next')
|
||||||
|
{
|
||||||
|
// Recherche valeur pour num = numero releve precedent
|
||||||
|
$sql = "SELECT DISTINCT(b.num_releve) as num";
|
||||||
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||||
|
$sql.= " WHERE b.num_releve > '".$db->escape($numref)."'";
|
||||||
|
$sql.= " AND b.fk_account = ".$object->id;
|
||||||
|
$sql.= " ORDER BY b.num_releve ASC";
|
||||||
|
|
||||||
|
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
|
||||||
|
$resql = $db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$numrows = $db->num_rows($resql);
|
||||||
|
if ($numrows > 0)
|
||||||
|
{
|
||||||
|
$obj = $db->fetch_object($resql);
|
||||||
|
$numref = $obj->num;
|
||||||
|
$found=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// On veut le releve num
|
||||||
|
$found=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
|
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
|
||||||
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
|
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
|
||||||
$sql.= " b.fk_bordereau,";
|
$sql.= " b.fk_bordereau,";
|
||||||
@@ -104,7 +161,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
|
|||||||
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
|
$sql.= ", ".MAIN_DB_PREFIX."bank as b";
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
|
||||||
$sql.= " WHERE b.num_releve='".$db->escape($numref)."'";
|
$sql.= " WHERE b.num_releve='".$db->escape($numref)."'";
|
||||||
if (!isset($numref)) $sql.= " OR b.num_releve is null";
|
if (empty($numref)) $sql.= " OR b.num_releve is null";
|
||||||
$sql.= " AND b.fk_account = ".$object->id;
|
$sql.= " AND b.fk_account = ".$object->id;
|
||||||
$sql.= " AND b.fk_account = ba.rowid";
|
$sql.= " AND b.fk_account = ba.rowid";
|
||||||
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
|
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
|
||||||
@@ -420,58 +477,6 @@ else
|
|||||||
/**
|
/**
|
||||||
* Show list of bank statements
|
* Show list of bank statements
|
||||||
*/
|
*/
|
||||||
$ve=$_GET["ve"];
|
|
||||||
|
|
||||||
// Define number of receipt to show (current, previous or next one ?)
|
|
||||||
$found=false;
|
|
||||||
if ($_GET["rel"] == 'prev')
|
|
||||||
{
|
|
||||||
// Recherche valeur pour num = numero releve precedent
|
|
||||||
$sql = "SELECT DISTINCT(b.num_releve) as num";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
|
||||||
$sql.= " WHERE b.num_releve < '".$db->escape($numref)."'";
|
|
||||||
$sql.= " AND b.fk_account = ".$object->id;
|
|
||||||
$sql.= " ORDER BY b.num_releve DESC";
|
|
||||||
|
|
||||||
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$numrows = $db->num_rows($resql);
|
|
||||||
if ($numrows > 0)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
$numref = $obj->num;
|
|
||||||
$found=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
elseif ($_GET["rel"] == 'next')
|
|
||||||
{
|
|
||||||
// Recherche valeur pour num = numero releve precedent
|
|
||||||
$sql = "SELECT DISTINCT(b.num_releve) as num";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
|
||||||
$sql.= " WHERE b.num_releve > '".$db->escape($numref)."'";
|
|
||||||
$sql.= " AND b.fk_account = ".$object->id;
|
|
||||||
$sql.= " ORDER BY b.num_releve ASC";
|
|
||||||
|
|
||||||
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
|
|
||||||
$resql = $db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$numrows = $db->num_rows($resql);
|
|
||||||
if ($numrows > 0)
|
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
|
||||||
$numref = $obj->num;
|
|
||||||
$found=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// On veut le releve num
|
|
||||||
$found=true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$mesprevnext='';
|
$mesprevnext='';
|
||||||
$mesprevnext.='<div class="pagination"><ul>';
|
$mesprevnext.='<div class="pagination"><ul>';
|
||||||
@@ -713,6 +718,7 @@ else
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
if ($objp->amount < 0)
|
if ($objp->amount < 0)
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ if ($action == 'add_confirm')
|
|||||||
$accountto=new Account($db);
|
$accountto=new Account($db);
|
||||||
$accountto->fetch(GETPOST('account_to','int'));
|
$accountto->fetch(GETPOST('account_to','int'));
|
||||||
|
|
||||||
|
if ($accountto->currency_code != $accountfrom->currency_code) {
|
||||||
|
$error++;
|
||||||
|
setEventMessages($langs->trans("ErrorTransferBetweenDifferentCurrencyNotPossible"), null, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
if ($accountto->id != $accountfrom->id)
|
if ($accountto->id != $accountfrom->id)
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
|
||||||
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
|
||||||
$sql.= " pct.code as payment_code,";
|
$sql.= " pct.code as payment_code,";
|
||||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
|
||||||
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
|
||||||
@@ -256,7 +256,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
|
|
||||||
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,";
|
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,";
|
||||||
$sql.= " pct.code as payment_code,";
|
$sql.= " pct.code as payment_code,";
|
||||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as pv";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
@@ -470,7 +470,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
|
|||||||
|
|
||||||
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
|
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
|
||||||
$sql.= " pct.code as payment_code,";
|
$sql.= " pct.code as payment_code,";
|
||||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel";
|
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
|
||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
|
||||||
|
|||||||
@@ -186,13 +186,17 @@ if (empty($reshook))
|
|||||||
$qualified_for_stock_change = $object->hasProductsOrServices(1);
|
$qualified_for_stock_change = $object->hasProductsOrServices(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $object->delete($user, 0, $idwarehouse);
|
if ($object->is_erasable()) {
|
||||||
if ($result > 0) {
|
|
||||||
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
|
$result = $object->delete($user, 0, $idwarehouse);
|
||||||
exit();
|
if ($result > 0) {
|
||||||
} else {
|
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
exit();
|
||||||
$action='';
|
} else {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +218,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
@@ -401,7 +406,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
//var_dump($object->getRemainToPay(0));
|
//var_dump($object->getRemainToPay(0));
|
||||||
//var_dump($discount->amount_ttc);exit;
|
//var_dump($discount->amount_ttc);exit;
|
||||||
if ($discount->amount_ttc > $object->getRemainToPay(0))
|
if (price2num($discount->amount_ttc) > price2num($object->getRemainToPay(0)))
|
||||||
{
|
{
|
||||||
// TODO Split the discount in 2 automatically
|
// TODO Split the discount in 2 automatically
|
||||||
$error++;
|
$error++;
|
||||||
@@ -485,6 +490,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
$model=$object->modelpdf;
|
$model=$object->modelpdf;
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
@@ -571,6 +577,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
$model=$object->modelpdf;
|
$model=$object->modelpdf;
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
@@ -636,7 +643,7 @@ if (empty($reshook))
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($object->lines as $line)
|
foreach ($object->lines as $line)
|
||||||
{
|
{
|
||||||
if ($line->total_ht!=0)
|
if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9
|
||||||
{ // no need to create discount if amount is null
|
{ // no need to create discount if amount is null
|
||||||
$amount_ht[$line->tva_tx] += $line->total_ht;
|
$amount_ht[$line->tva_tx] += $line->total_ht;
|
||||||
$amount_tva[$line->tva_tx] += $line->total_tva;
|
$amount_tva[$line->tva_tx] += $line->total_tva;
|
||||||
@@ -849,6 +856,12 @@ if (empty($reshook))
|
|||||||
|
|
||||||
foreach($facture_source->lines as $line)
|
foreach($facture_source->lines as $line)
|
||||||
{
|
{
|
||||||
|
// Extrafields
|
||||||
|
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, 'fetch_optionals')) {
|
||||||
|
// load extrafields
|
||||||
|
$line->fetch_optionals();
|
||||||
|
}
|
||||||
|
|
||||||
// Reset fk_parent_line for no child products and special product
|
// Reset fk_parent_line for no child products and special product
|
||||||
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
|
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
|
||||||
$fk_parent_line = 0;
|
$fk_parent_line = 0;
|
||||||
@@ -1075,6 +1088,7 @@ if (empty($reshook))
|
|||||||
$TTotalByTva = array();
|
$TTotalByTva = array();
|
||||||
foreach ($srcobject->lines as &$line)
|
foreach ($srcobject->lines as &$line)
|
||||||
{
|
{
|
||||||
|
if(! empty($line->special_code)) continue;
|
||||||
$TTotalByTva[$line->tva_tx] += $line->total_ttc ;
|
$TTotalByTva[$line->tva_tx] += $line->total_ttc ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1352,11 +1366,26 @@ if (empty($reshook))
|
|||||||
$object->origin = $origin;
|
$object->origin = $origin;
|
||||||
$object->origin_id = $originid;
|
$object->origin_id = $originid;
|
||||||
|
|
||||||
foreach ($object->lines as &$line)
|
foreach ($object->lines as $i => &$line)
|
||||||
{
|
{
|
||||||
$line->origin = $object->origin;
|
$line->origin = $object->origin;
|
||||||
$line->origin_id = $line->id;
|
$line->origin_id = $line->id;
|
||||||
$line->fetch_optionals($line->id);
|
$line->fetch_optionals($line->id);
|
||||||
|
|
||||||
|
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
|
||||||
|
if ($line->fk_remise_except)
|
||||||
|
{
|
||||||
|
$discount=new DiscountAbsolute($line->db);
|
||||||
|
$result=$discount->fetch($line->fk_remise_except);
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
|
// Check if discount not already affected to another invoice
|
||||||
|
if ($discount->fk_facture_line > 0)
|
||||||
|
{
|
||||||
|
$line->fk_remise_except = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1411,6 +1440,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
$model=$object->modelpdf;
|
$model=$object->modelpdf;
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
@@ -1588,6 +1618,9 @@ if (empty($reshook))
|
|||||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||||
|
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||||
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1628,6 +1661,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
|
|
||||||
$desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description;
|
$desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description;
|
||||||
@@ -1640,12 +1674,33 @@ if (empty($reshook))
|
|||||||
// Add custom code and origin country into description
|
// Add custom code and origin country into description
|
||||||
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
||||||
$tmptxt = '(';
|
$tmptxt = '(';
|
||||||
if (! empty($prod->customcode))
|
// Define output language
|
||||||
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
||||||
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
$outputlangs = $langs;
|
||||||
$tmptxt .= ' - ';
|
$newlang = '';
|
||||||
if (! empty($prod->country_code))
|
if (empty($newlang) && GETPOST('lang_id','alpha'))
|
||||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
$newlang = GETPOST('lang_id','alpha');
|
||||||
|
if (empty($newlang))
|
||||||
|
$newlang = $object->thirdparty->default_lang;
|
||||||
|
if (! empty($newlang)) {
|
||||||
|
$outputlangs = new Translate("", $conf);
|
||||||
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
|
}
|
||||||
|
if (! empty($prod->customcode))
|
||||||
|
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||||
|
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||||
|
$tmptxt .= ' - ';
|
||||||
|
if (! empty($prod->country_code))
|
||||||
|
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||||
|
} else {
|
||||||
|
if (! empty($prod->customcode))
|
||||||
|
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
||||||
|
if (! empty($prod->customcode) && ! empty($prod->country_code))
|
||||||
|
$tmptxt .= ' - ';
|
||||||
|
if (! empty($prod->country_code))
|
||||||
|
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||||
|
}
|
||||||
$tmptxt .= ')';
|
$tmptxt .= ')';
|
||||||
$desc = dol_concatdesc($desc, $tmptxt);
|
$desc = dol_concatdesc($desc, $tmptxt);
|
||||||
}
|
}
|
||||||
@@ -1696,6 +1751,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
$model=$object->modelpdf;
|
$model=$object->modelpdf;
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
@@ -1874,6 +1930,7 @@ if (empty($reshook))
|
|||||||
if (! empty($newlang)) {
|
if (! empty($newlang)) {
|
||||||
$outputlangs = new Translate("", $conf);
|
$outputlangs = new Translate("", $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = $object->fetch($id); // Reload to get new records
|
$ret = $object->fetch($id); // Reload to get new records
|
||||||
@@ -2510,10 +2567,10 @@ if ($action == 'create')
|
|||||||
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
|
||||||
print $desc;
|
print $desc;
|
||||||
|
|
||||||
print '<div id="credit_note_options" class="clearboth">';
|
print '<div id="credit_note_options" class="clearboth">';
|
||||||
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
print ' <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
|
||||||
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
print '<br> <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
}
|
}
|
||||||
@@ -2843,12 +2900,12 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$resteapayer = 0;
|
$resteapayer = 0;
|
||||||
$resteapayeraffiche = $resteapayer;
|
$resteapayeraffiche = $resteapayer;
|
||||||
|
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this
|
||||||
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||||
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
|
||||||
} else {
|
} else {
|
||||||
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%'))";
|
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))";
|
||||||
$filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'";
|
$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
|
||||||
}
|
}
|
||||||
|
|
||||||
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
|
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
|
||||||
@@ -2871,9 +2928,9 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Confirmation de la conversion de l'avoir en reduc
|
// Confirmation de la conversion de l'avoir en reduc
|
||||||
if ($action == 'converttoreduc') {
|
if ($action == 'converttoreduc') {
|
||||||
if($object->type == 0) $type_fac = 'ExcessReceived';
|
if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived';
|
||||||
elseif($object->type == 2) $type_fac = 'CreditNote';
|
elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote';
|
||||||
elseif($object->type == 3) $type_fac = 'Deposit';
|
elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit';
|
||||||
$text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac)));
|
$text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac)));
|
||||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
|
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
|
||||||
}
|
}
|
||||||
@@ -4010,7 +4067,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
|
||||||
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
|
||||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
|
||||||
<input type="hidden" name="mode" value="">
|
<input type="hidden" name="mode" value="">
|
||||||
@@ -4291,8 +4348,8 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$filename = dol_sanitizeFileName($object->ref);
|
$filename = dol_sanitizeFileName($object->ref);
|
||||||
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
|
||||||
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
|
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
|
||||||
$genallowed = $user->rights->facture->creer;
|
$genallowed = $user->rights->facture->lire;
|
||||||
$delallowed = $user->rights->facture->supprimer;
|
$delallowed = $user->rights->facture->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
|
||||||
$somethingshown = $formfile->numoffiles;
|
$somethingshown = $formfile->numoffiles;
|
||||||
@@ -4362,6 +4419,7 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
$outputlangs = new Translate('', $conf);
|
$outputlangs = new Translate('', $conf);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
$outputlangs->load('bills');
|
$outputlangs->load('bills');
|
||||||
|
$outputlangs->load('products');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build document if it not exists
|
// Build document if it not exists
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Luracast\Restler\RestException;
|
use Luracast\Restler\RestException;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API class for invoices
|
* API class for invoices
|
||||||
@@ -75,6 +75,7 @@ class Invoices extends DolibarrApi
|
|||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->invoice->fetchObjectLinked();
|
||||||
return $this->_cleanObjectDatas($this->invoice);
|
return $this->_cleanObjectDatas($this->invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,6 +211,190 @@ class Invoices extends DolibarrApi
|
|||||||
return $this->invoice->id;
|
return $this->invoice->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get lines of an invoice
|
||||||
|
*
|
||||||
|
* @param int $id Id of invoice
|
||||||
|
*
|
||||||
|
* @url GET {id}/lines
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
function getLines($id) {
|
||||||
|
if(! DolibarrApiAccess::$user->rights->facture->lire) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->invoice->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Invoice not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
$this->invoice->getLinesArray();
|
||||||
|
$result = array();
|
||||||
|
foreach ($this->invoice->lines as $line) {
|
||||||
|
array_push($result,$this->_cleanObjectDatas($line));
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a line to a given invoice
|
||||||
|
*
|
||||||
|
* @param int $id Id of invoice to update
|
||||||
|
* @param array $request_data InvoiceLine data
|
||||||
|
*
|
||||||
|
* @url POST {id}/lines
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
function postLine($id, $request_data = NULL) {
|
||||||
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->invoice->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Invoice not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
$request_data = (object) $request_data;
|
||||||
|
$updateRes = $this->invoice->addline(
|
||||||
|
$request_data->desc,
|
||||||
|
$request_data->subprice,
|
||||||
|
$request_data->qty,
|
||||||
|
$request_data->tva_tx,
|
||||||
|
$request_data->localtax1_tx,
|
||||||
|
$request_data->localtax2_tx,
|
||||||
|
$request_data->fk_product,
|
||||||
|
$request_data->remise_percent,
|
||||||
|
$request_data->date_start,
|
||||||
|
$request_data->date_end,
|
||||||
|
0,
|
||||||
|
$request_data->info_bits,
|
||||||
|
$request_data->fk_remise_except,
|
||||||
|
'HT',
|
||||||
|
0,
|
||||||
|
$request_data->product_type,
|
||||||
|
$request_data->rang,
|
||||||
|
$request_data->special_code,
|
||||||
|
$request_data->origin,
|
||||||
|
$request_data->origin_id,
|
||||||
|
$fk_parent_line,
|
||||||
|
$request_data->fk_fournprice,
|
||||||
|
$request_data->pa_ht,
|
||||||
|
$request_data->label,
|
||||||
|
$request_data->array_options,
|
||||||
|
$request_data->situation_percent,
|
||||||
|
$request_data->prev_id,
|
||||||
|
$request_data->fk_unit,
|
||||||
|
$request_data->multicurrency_subprice
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($updateRes > 0) {
|
||||||
|
return $updateRes;
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update a line to a given invoice
|
||||||
|
*
|
||||||
|
* @param int $id Id of invoice to update
|
||||||
|
* @param int $lineid Id of line to update
|
||||||
|
* @param array $request_data InvoiceLine data
|
||||||
|
*
|
||||||
|
* @url PUT {id}/lines/{lineid}
|
||||||
|
*
|
||||||
|
* @return object
|
||||||
|
*/
|
||||||
|
function putLine($id, $lineid, $request_data = NULL) {
|
||||||
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->invoice->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Invoice not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
$request_data = (object) $request_data;
|
||||||
|
$updateRes = $this->invoice->updateline(
|
||||||
|
$lineid,
|
||||||
|
$request_data->desc,
|
||||||
|
$request_data->subprice,
|
||||||
|
$request_data->qty,
|
||||||
|
$request_data->remise_percent,
|
||||||
|
$request_data->date_start,
|
||||||
|
$request_data->date_end,
|
||||||
|
$request_data->tva_tx,
|
||||||
|
$request_data->localtax1_tx,
|
||||||
|
$request_data->localtax2_tx,
|
||||||
|
'HT',
|
||||||
|
$request_data->info_bits,
|
||||||
|
$request_data->product_type,
|
||||||
|
$request_data->fk_parent_line,
|
||||||
|
0,
|
||||||
|
$request_data->fk_fournprice,
|
||||||
|
$request_data->pa_ht,
|
||||||
|
$request_data->label,
|
||||||
|
$request_data->special_code,
|
||||||
|
$request_data->array_options,
|
||||||
|
$request_data->situation_percent,
|
||||||
|
$request_data->fk_unit,
|
||||||
|
$request_data->multicurrency_subprice
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($updateRes > 0) {
|
||||||
|
$result = $this->get($id);
|
||||||
|
unset($result->line);
|
||||||
|
return $this->_cleanObjectDatas($result);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a line to a given invoice
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param int $id Id of invoice to update
|
||||||
|
* @param int $lineid Id of line to delete
|
||||||
|
*
|
||||||
|
* @url DELETE {id}/lines/{lineid}
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
function delLine($id, $lineid) {
|
||||||
|
if(! DolibarrApiAccess::$user->rights->facture->creer) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->invoice->fetch($id);
|
||||||
|
if( ! $result ) {
|
||||||
|
throw new RestException(404, 'Invoice not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
|
||||||
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
|
}
|
||||||
|
$request_data = (object) $request_data;
|
||||||
|
$updateRes = $this->invoice->deleteline($lineid);
|
||||||
|
if ($updateRes > 0) {
|
||||||
|
return $this->get($id);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update invoice
|
* Update invoice
|
||||||
*
|
*
|
||||||
@@ -277,9 +462,9 @@ class Invoices extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate an order
|
* Validate an invoice
|
||||||
*
|
*
|
||||||
* @param int $id Order ID
|
* @param int $id Invoice ID
|
||||||
* @param int $idwarehouse Warehouse ID
|
* @param int $idwarehouse Warehouse ID
|
||||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -201,19 +201,40 @@ class FactureRec extends CommonInvoice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add object linked
|
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
|
||||||
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
{
|
||||||
{
|
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
|
||||||
foreach($this->linked_objects as $origin => $origin_id)
|
}
|
||||||
{
|
|
||||||
$ret = $this->add_object_linked($origin, $origin_id);
|
// Add object linked
|
||||||
if (! $ret)
|
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||||
{
|
{
|
||||||
$this->error=$this->db->lasterror();
|
foreach($this->linked_objects as $origin => $tmp_origin_id)
|
||||||
$error++;
|
{
|
||||||
}
|
if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...))
|
||||||
}
|
{
|
||||||
}
|
foreach($tmp_origin_id as $origin_id)
|
||||||
|
{
|
||||||
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
|
if (! $ret)
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
|
||||||
|
{
|
||||||
|
$origin_id = $tmp_origin_id;
|
||||||
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
|
if (! $ret)
|
||||||
|
{
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ class Facture extends CommonInvoice
|
|||||||
$this->brouillon = 1;
|
$this->brouillon = 1;
|
||||||
if (empty($this->entity)) $this->entity = $conf->entity;
|
if (empty($this->entity)) $this->entity = $conf->entity;
|
||||||
|
|
||||||
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
|
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
|
||||||
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
|
||||||
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
|
||||||
if (empty($this->fk_multicurrency))
|
if (empty($this->fk_multicurrency))
|
||||||
@@ -442,6 +442,11 @@ class Facture extends CommonInvoice
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if (! $resql) $error++;
|
if (! $resql) $error++;
|
||||||
|
|
||||||
|
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
|
||||||
|
{
|
||||||
|
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
|
||||||
|
}
|
||||||
|
|
||||||
// Add object linked
|
// Add object linked
|
||||||
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
|
||||||
{
|
{
|
||||||
@@ -454,7 +459,7 @@ class Facture extends CommonInvoice
|
|||||||
$ret = $this->add_object_linked($origin, $origin_id);
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
if (! $ret)
|
if (! $ret)
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -465,7 +470,7 @@ class Facture extends CommonInvoice
|
|||||||
$ret = $this->add_object_linked($origin, $origin_id);
|
$ret = $this->add_object_linked($origin, $origin_id);
|
||||||
if (! $ret)
|
if (! $ret)
|
||||||
{
|
{
|
||||||
dol_print_error($this->db);
|
$this->error=$this->db->lasterror();
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -534,6 +539,15 @@ class Facture extends CommonInvoice
|
|||||||
}
|
}
|
||||||
|
|
||||||
$newinvoiceline->fk_parent_line=$fk_parent_line;
|
$newinvoiceline->fk_parent_line=$fk_parent_line;
|
||||||
|
|
||||||
|
if($this->type === Facture::TYPE_REPLACEMENT && $newinvoiceline->fk_remise_except){
|
||||||
|
$discount = new DiscountAbsolute($this->db);
|
||||||
|
$discount->fetch($newinvoiceline->fk_remise_except);
|
||||||
|
|
||||||
|
$discountId = $soc->set_remise_except($discount->amount_ht, $user, $discount->description, $discount->tva_tx);
|
||||||
|
$newinvoiceline->fk_remise_except = $discountId;
|
||||||
|
}
|
||||||
|
|
||||||
$result=$newinvoiceline->insert();
|
$result=$newinvoiceline->insert();
|
||||||
|
|
||||||
// Defined the new fk_parent_line
|
// Defined the new fk_parent_line
|
||||||
@@ -570,11 +584,15 @@ class Facture extends CommonInvoice
|
|||||||
$fk_parent_line = 0;
|
$fk_parent_line = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Complete vat rate with code
|
||||||
|
$vatrate = $line->tva_tx;
|
||||||
|
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
|
||||||
|
|
||||||
$result = $this->addline(
|
$result = $this->addline(
|
||||||
$line->desc,
|
$line->desc,
|
||||||
$line->subprice,
|
$line->subprice,
|
||||||
$line->qty,
|
$line->qty,
|
||||||
$line->tva_tx,
|
$vatrate,
|
||||||
$line->localtax1_tx,
|
$line->localtax1_tx,
|
||||||
$line->localtax2_tx,
|
$line->localtax2_tx,
|
||||||
$line->fk_product,
|
$line->fk_product,
|
||||||
@@ -930,7 +948,8 @@ class Facture extends CommonInvoice
|
|||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
@@ -980,6 +999,8 @@ class Facture extends CommonInvoice
|
|||||||
$line->special_code = $object->lines[$i]->special_code;
|
$line->special_code = $object->lines[$i]->special_code;
|
||||||
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
|
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
|
||||||
$line->fk_unit = $object->lines[$i]->fk_unit;
|
$line->fk_unit = $object->lines[$i]->fk_unit;
|
||||||
|
$line->date_start = $object->lines[$i]->date_start;
|
||||||
|
$line->date_end = $object->lines[$i]->date_end;
|
||||||
|
|
||||||
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
|
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
|
||||||
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
|
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
|
||||||
@@ -2185,6 +2206,7 @@ class Facture extends CommonInvoice
|
|||||||
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
$error++;
|
$error++;
|
||||||
|
$this->error = $mouvP->error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2261,9 +2283,12 @@ class Facture extends CommonInvoice
|
|||||||
$final = ($this->lines[$i]->situation_percent == 100);
|
$final = ($this->lines[$i]->situation_percent == 100);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if ($final) {
|
|
||||||
$this->setFinal($user);
|
if (empty($final)) $this->situation_final = 0;
|
||||||
}
|
else $this->situation_final = 1;
|
||||||
|
|
||||||
|
$this->setFinal($user);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2422,8 +2447,8 @@ class Facture extends CommonInvoice
|
|||||||
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
|
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
|
||||||
* @param double $qty Quantity
|
* @param double $qty Quantity
|
||||||
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
|
||||||
* @param double $txlocaltax1 Local tax 1 rate (deprecated)
|
* @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
|
||||||
* @param double $txlocaltax2 Local tax 2 rate (deprecated)
|
* @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
|
||||||
* @param int $fk_product Id of predefined product/service
|
* @param int $fk_product Id of predefined product/service
|
||||||
* @param double $remise_percent Percent of discount on line
|
* @param double $remise_percent Percent of discount on line
|
||||||
* @param int $date_start Date start of service
|
* @param int $date_start Date start of service
|
||||||
@@ -2487,6 +2512,7 @@ class Facture extends CommonInvoice
|
|||||||
$remise_percent=price2num($remise_percent);
|
$remise_percent=price2num($remise_percent);
|
||||||
$qty=price2num($qty);
|
$qty=price2num($qty);
|
||||||
$pu_ht=price2num($pu_ht);
|
$pu_ht=price2num($pu_ht);
|
||||||
|
$pu_ht_devise=price2num($pu_ht_devise);
|
||||||
$pu_ttc=price2num($pu_ttc);
|
$pu_ttc=price2num($pu_ttc);
|
||||||
$pa_ht=price2num($pa_ht);
|
$pa_ht=price2num($pa_ht);
|
||||||
$txtva=price2num($txtva);
|
$txtva=price2num($txtva);
|
||||||
@@ -2638,6 +2664,11 @@ class Facture extends CommonInvoice
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2705,6 +2736,7 @@ class Facture extends CommonInvoice
|
|||||||
$remise_percent = price2num($remise_percent);
|
$remise_percent = price2num($remise_percent);
|
||||||
$qty = price2num($qty);
|
$qty = price2num($qty);
|
||||||
$pu = price2num($pu);
|
$pu = price2num($pu);
|
||||||
|
$pu_ht_devise = price2num($pu_ht_devise);
|
||||||
$pa_ht = price2num($pa_ht);
|
$pa_ht = price2num($pa_ht);
|
||||||
$txtva = price2num($txtva);
|
$txtva = price2num($txtva);
|
||||||
$txlocaltax1 = price2num($txlocaltax1);
|
$txlocaltax1 = price2num($txlocaltax1);
|
||||||
@@ -2901,6 +2933,9 @@ class Facture extends CommonInvoice
|
|||||||
$line->total_ttc = $tabprice[2];
|
$line->total_ttc = $tabprice[2];
|
||||||
$line->total_localtax1 = $tabprice[9];
|
$line->total_localtax1 = $tabprice[9];
|
||||||
$line->total_localtax2 = $tabprice[10];
|
$line->total_localtax2 = $tabprice[10];
|
||||||
|
$line->multicurrency_total_ht = $tabprice[16];
|
||||||
|
$line->multicurrency_total_tva = $tabprice[17];
|
||||||
|
$line->multicurrency_total_ttc = $tabprice[18];
|
||||||
$line->update($user);
|
$line->update($user);
|
||||||
$this->update_price(1);
|
$this->update_price(1);
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@@ -4076,7 +4111,6 @@ class Facture extends CommonInvoice
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$this->situation_final = 1;
|
|
||||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id;
|
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id;
|
||||||
|
|
||||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||||
@@ -4800,7 +4834,7 @@ class FactureLigne extends CommonInvoiceLine
|
|||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql && $resql->num_rows > 0) {
|
if ($resql && $resql->num_rows > 0) {
|
||||||
$res = $this->db->fetch_array($resql);
|
$res = $this->db->fetch_array($resql);
|
||||||
return $res['situation_percent'];
|
return floatval($res['situation_percent']);
|
||||||
} else {
|
} else {
|
||||||
$this->error = $this->db->error();
|
$this->error = $this->db->error();
|
||||||
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ class FactureStats extends Stats
|
|||||||
$this->where.=" AND f.fk_soc = ".$this->socid;
|
$this->where.=" AND f.fk_soc = ".$this->socid;
|
||||||
}
|
}
|
||||||
if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid;
|
if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid;
|
||||||
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2)";
|
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2,5)";
|
||||||
else $this->where.= " AND f.type IN (0,1,2,3)";
|
else $this->where.= " AND f.type IN (0,1,2,3,5)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
|
||||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
|
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -32,6 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load('propal');
|
$langs->load('propal');
|
||||||
$langs->load('compta');
|
$langs->load('compta');
|
||||||
@@ -189,6 +194,6 @@ else
|
|||||||
print $langs->trans("ErrorUnknown");
|
print $langs->trans("ErrorUnknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
|
$db->close();
|
||||||
|
|||||||
@@ -530,6 +530,9 @@ if (empty($reshook))
|
|||||||
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
|
||||||
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
$price_base_type = $prodcustprice->lines[0]->price_base_type;
|
||||||
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
$tva_tx = $prodcustprice->lines[0]->tva_tx;
|
||||||
|
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
|
||||||
|
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
|
||||||
|
if (empty($tva_tx)) $tva_npr=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -27,6 +28,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ $year = GETPOST('year','int');
|
|||||||
$day_lim = GETPOST('day_lim','int');
|
$day_lim = GETPOST('day_lim','int');
|
||||||
$month_lim = GETPOST('month_lim','int');
|
$month_lim = GETPOST('month_lim','int');
|
||||||
$year_lim = GETPOST('year_lim','int');
|
$year_lim = GETPOST('year_lim','int');
|
||||||
|
$search_btn=GETPOST('button_search','alpha');
|
||||||
|
$search_remove_btn=GETPOST('button_removefilter','alpha');
|
||||||
|
|
||||||
$option = GETPOST('option');
|
$option = GETPOST('option');
|
||||||
if ($option == 'late') {
|
if ($option == 'late') {
|
||||||
@@ -104,7 +106,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
|
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
|
||||||
if (! $sortorder) $sortorder='DESC';
|
if (! $sortorder) $sortorder='DESC';
|
||||||
@@ -552,17 +554,20 @@ if ($resql)
|
|||||||
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
|
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
|
||||||
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
|
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
|
||||||
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
|
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
|
||||||
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
|
if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
|
||||||
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
|
||||||
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
|
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
|
||||||
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
|
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
|
||||||
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
|
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
|
||||||
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
|
||||||
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
|
||||||
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
|
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
|
||||||
if ($show_files) $param.='&show_files=' .$show_files;
|
if ($show_files) $param.='&show_files=' .$show_files;
|
||||||
if ($option) $param.="&option=".$option;
|
if ($option) $param.="&option=".$option;
|
||||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||||
|
if ($search_town)$param .= '&search_town='.urlencode($search_town);
|
||||||
|
if ($search_zip)$param .= '&search_zip='.urlencode($search_zip);
|
||||||
|
|
||||||
// Add $param from extra fields
|
// Add $param from extra fields
|
||||||
foreach ($search_array_options as $key => $val)
|
foreach ($search_array_options as $key => $val)
|
||||||
{
|
{
|
||||||
@@ -785,7 +790,8 @@ if ($resql)
|
|||||||
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
|
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
|
||||||
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
|
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
|
||||||
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
|
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
|
||||||
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
||||||
|
Facture::TYPE_SITUATION=>$langs->trans("InvoiceSituation"),
|
||||||
);
|
);
|
||||||
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
|
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
|
||||||
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
|
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
|
||||||
@@ -1008,6 +1014,9 @@ if ($resql)
|
|||||||
$facturestatic->ref=$obj->ref;
|
$facturestatic->ref=$obj->ref;
|
||||||
$facturestatic->type=$obj->type;
|
$facturestatic->type=$obj->type;
|
||||||
$facturestatic->statut=$obj->fk_statut;
|
$facturestatic->statut=$obj->fk_statut;
|
||||||
|
$facturestatic->total_ttc=$obj->total_ttc;
|
||||||
|
$facturestatic->paye=$obj->paye;
|
||||||
|
$facturestatic->fk_soc=$obj->fk_soc;
|
||||||
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
|
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
|
||||||
$facturestatic->note_public=$obj->note_public;
|
$facturestatic->note_public=$obj->note_public;
|
||||||
$facturestatic->note_private=$obj->note_private;
|
$facturestatic->note_private=$obj->note_private;
|
||||||
@@ -1016,7 +1025,13 @@ if ($resql)
|
|||||||
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
|
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
|
||||||
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
$totaldeposits = $facturestatic->getSumDepositsUsed();
|
||||||
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
|
||||||
$remaintopay = $obj->total_ttc - $totalpay;
|
$remaintopay = $facturestatic->total_ttc - $totalpay;
|
||||||
|
if($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) {
|
||||||
|
$discount = new DiscountAbsolute($db);
|
||||||
|
$remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
|
||||||
|
$remaintopay = -$remaincreditnote;
|
||||||
|
$totalpay = $facturestatic->total_ttc - $remaintopay;
|
||||||
|
}
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
if (! empty($arrayfields['f.facnumber']['checked']))
|
if (! empty($arrayfields['f.facnumber']['checked']))
|
||||||
@@ -1332,7 +1347,7 @@ if ($resql)
|
|||||||
|
|
||||||
$filedir=$diroutputmassaction;
|
$filedir=$diroutputmassaction;
|
||||||
$genallowed=$user->rights->facture->lire;
|
$genallowed=$user->rights->facture->lire;
|
||||||
$delallowed=$user->rights->facture->lire;
|
$delallowed=$user->rights->facture->creer;
|
||||||
|
|
||||||
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,6 +29,9 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -30,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
|
||||||
|
if (! empty($conf->projet->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
|
||||||
|
}
|
||||||
|
|
||||||
if (!$user->rights->facture->lire) accessforbidden();
|
if (!$user->rights->facture->lire) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ dol_mkdir($dir);
|
|||||||
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
|
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
|
||||||
if ($mode == 'customer')
|
if ($mode == 'customer')
|
||||||
{
|
{
|
||||||
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||||
}
|
}
|
||||||
if ($mode == 'supplier')
|
if ($mode == 'supplier')
|
||||||
{
|
{
|
||||||
@@ -227,12 +227,13 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type);
|
|||||||
|
|
||||||
dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
|
dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
|
||||||
|
|
||||||
$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1);
|
// We use select_thirdparty_list instead of select_company so we can use $filter and share same code for customer and supplier.
|
||||||
|
$tmp_companies = $form->select_thirdparty_list($socid, 'socid', $filter, 1, 0, 0, array(), '', 1);
|
||||||
//Array passed as an argument to Form::selectarray to build a proper select input
|
//Array passed as an argument to Form::selectarray to build a proper select input
|
||||||
$companies = array();
|
$companies = array();
|
||||||
|
|
||||||
foreach ($tmp_companies as $value) {
|
foreach ($tmp_companies as $value) {
|
||||||
$companies[$value['value']] = $value['label'];
|
$companies[$value['key']] = $value['label'];
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<div class="fichecenter"><div class="fichethirdleft">';
|
print '<div class="fichecenter"><div class="fichethirdleft">';
|
||||||
|
|||||||
@@ -15,8 +15,15 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE -->
|
<!-- BEGIN PHP TEMPLATE -->
|
||||||
|
|||||||
@@ -15,8 +15,15 @@
|
|||||||
*
|
*
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Protection to avoid direct call of template
|
||||||
|
if (empty($conf) || ! is_object($conf))
|
||||||
|
{
|
||||||
|
print "Error, template page can't be called as URL";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- BEGIN PHP TEMPLATE -->
|
<!-- BEGIN PHP TEMPLATE -->
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ if ($user->societe_id > 0)
|
|||||||
|
|
||||||
$max=3;
|
$max=3;
|
||||||
|
|
||||||
|
$hookmanager->initHooks(array('invoiceindex'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@@ -152,6 +153,10 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
{
|
{
|
||||||
$sql .= " AND f.fk_soc = $socid";
|
$sql .= " AND f.fk_soc = $socid";
|
||||||
}
|
}
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerDraft',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
@@ -228,7 +233,10 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$sql.= " AND f.entity = ".$conf->entity;
|
$sql.= " AND f.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierDraft',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ( $resql )
|
if ( $resql )
|
||||||
@@ -310,6 +318,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$sql.= " AND f.entity = ".$conf->entity;
|
$sql.= " AND f.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
||||||
$sql.= " ORDER BY f.tms DESC ";
|
$sql.= " ORDER BY f.tms DESC ";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
@@ -419,6 +432,11 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$sql.= " AND ff.entity = ".$conf->entity;
|
$sql.= " AND ff.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierLastModified',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid, s.code_fournisseur";
|
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid, s.code_fournisseur";
|
||||||
$sql.= " ORDER BY ff.tms DESC ";
|
$sql.= " ORDER BY ff.tms DESC ";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
@@ -498,6 +516,11 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
|
|||||||
$sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
|
$sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||||
$sql.= " WHERE d.entity = ".$conf->entity;
|
$sql.= " WHERE d.entity = ".$conf->entity;
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereLastDonations',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= $db->order("d.tms","DESC");
|
$sql.= $db->order("d.tms","DESC");
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
|
|
||||||
@@ -569,6 +592,11 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
|||||||
$sql.= " WHERE c.fk_type = cc.id";
|
$sql.= " WHERE c.fk_type = cc.id";
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
$sql.= " AND c.entity = ".$conf->entity;
|
||||||
$sql.= " AND c.paye = 0";
|
$sql.= " AND c.paye = 0";
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereSocialContributions',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
|
$sql.= " GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@@ -652,6 +680,11 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
|
|||||||
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
|
||||||
$sql.= " AND c.fk_statut = 3";
|
$sql.= " AND c.fk_statut = 3";
|
||||||
$sql.= " AND c.facture = 0";
|
$sql.= " AND c.facture = 0";
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
|
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@@ -756,6 +789,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
|||||||
$sql.= " AND f.entity = ".$conf->entity;
|
$sql.= " AND f.entity = ".$conf->entity;
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
|
||||||
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
|
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
|
||||||
|
|
||||||
@@ -879,6 +917,11 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
|||||||
$sql.= " AND ff.fk_statut = 1";
|
$sql.= " AND ff.fk_statut = 1";
|
||||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||||
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
||||||
|
// Add where from hooks
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierUnpaid',$parameters);
|
||||||
|
$sql.=$hookmanager->resPrint;
|
||||||
|
|
||||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
|
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
|
||||||
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
|
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
|
||||||
$sql.= " ORDER BY ff.date_lim_reglement ASC";
|
$sql.= " ORDER BY ff.date_lim_reglement ASC";
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ if (empty($reshook))
|
|||||||
$tmpinvoice=new Facture($db);
|
$tmpinvoice=new Facture($db);
|
||||||
foreach ($_POST as $key => $value)
|
foreach ($_POST as $key => $value)
|
||||||
{
|
{
|
||||||
if (substr($key,0,7) == 'amount_')
|
if (substr($key,0,7) == 'amount_' && GETPOST($key) != '')
|
||||||
{
|
{
|
||||||
$cursorfacid = substr($key,7);
|
$cursorfacid = substr($key,7);
|
||||||
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
|
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ $confirm=GETPOST('confirm', 'alpha');
|
|||||||
// Security check
|
// Security check
|
||||||
$fieldname = (! empty($ref)?'ref':'rowid');
|
$fieldname = (! empty($ref)?'ref':'rowid');
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldname);
|
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','fk_user_author',$fieldname);
|
||||||
|
|
||||||
$sortfield=GETPOST('sortfield', 'alpha');
|
$sortfield=GETPOST('sortfield', 'alpha');
|
||||||
$sortorder=GETPOST('sortorder', 'alpha');
|
$sortorder=GETPOST('sortorder', 'alpha');
|
||||||
$page=GETPOST('page', 'int');
|
$page=GETPOST('page', 'int');
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield) $sortfield="b.dateo,b.rowid";
|
if (! $sortfield) $sortfield="b.dateo,b.rowid";
|
||||||
if ($page < 0) { $page = 0 ; }
|
if (empty($page) || $page == -1) { $page = 0; }
|
||||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
@@ -490,53 +490,55 @@ if ($action == 'new')
|
|||||||
|
|
||||||
if (count($lines[$bid]))
|
if (count($lines[$bid]))
|
||||||
{
|
{
|
||||||
foreach ($lines[$bid] as $lid => $value)
|
foreach ($lines[$bid] as $lid => $value)
|
||||||
{
|
{
|
||||||
$account_id = $bid;
|
//$account_id = $bid; FIXME not used
|
||||||
if (! isset($accounts[$bid]))
|
|
||||||
$accounts[$bid]=0;
|
|
||||||
$accounts[$bid] += 1;
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
// FIXME $accounts[$bid] is a label !
|
||||||
print '<td>'.dol_print_date($value["date"],'day').'</td>';
|
/*if (! isset($accounts[$bid]))
|
||||||
print '<td>'.$value["numero"]."</td>\n";
|
$accounts[$bid]=0;
|
||||||
print '<td>'.$value["emetteur"]."</td>\n";
|
$accounts[$bid] += 1;*/
|
||||||
print '<td>'.$value["banque"]."</td>\n";
|
|
||||||
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
|
|
||||||
|
|
||||||
// Link to payment
|
print '<tr class="oddeven">';
|
||||||
print '<td align="center">';
|
print '<td>'.dol_print_date($value["date"],'day').'</td>';
|
||||||
$paymentstatic->id=$value["paymentid"];
|
print '<td>'.$value["numero"]."</td>\n";
|
||||||
$paymentstatic->ref=$value["paymentid"];
|
print '<td>'.$value["emetteur"]."</td>\n";
|
||||||
if ($paymentstatic->id)
|
print '<td>'.$value["banque"]."</td>\n";
|
||||||
{
|
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
|
||||||
print $paymentstatic->getNomUrl(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
// Link to bank transaction
|
|
||||||
print '<td align="center">';
|
|
||||||
$accountlinestatic->rowid=$value["id"];
|
|
||||||
if ($accountlinestatic->rowid)
|
|
||||||
{
|
|
||||||
print $accountlinestatic->getNomUrl(1);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
print '<td align="center">';
|
// Link to payment
|
||||||
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
|
print '<td align="center">';
|
||||||
print '</td>' ;
|
$paymentstatic->id=$value["paymentid"];
|
||||||
print '</tr>';
|
$paymentstatic->ref=$value["paymentid"];
|
||||||
|
if ($paymentstatic->id)
|
||||||
|
{
|
||||||
|
print $paymentstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
// Link to bank transaction
|
||||||
|
print '<td align="center">';
|
||||||
|
$accountlinestatic->rowid=$value["id"];
|
||||||
|
if ($accountlinestatic->rowid)
|
||||||
|
{
|
||||||
|
print $accountlinestatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print ' ';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
$i++;
|
print '<td align="center">';
|
||||||
}
|
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
|
||||||
|
print '</td>' ;
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@@ -688,10 +690,12 @@ else
|
|||||||
{
|
{
|
||||||
while ($objp = $db->fetch_object($resql))
|
while ($objp = $db->fetch_object($resql))
|
||||||
{
|
{
|
||||||
$account_id = $objp->bid;
|
//$account_id = $objp->bid; FIXME not used
|
||||||
if (! isset($accounts[$objp->bid]))
|
|
||||||
|
// FIXME $accounts[$objp->bid] is a label
|
||||||
|
/*if (! isset($accounts[$objp->bid]))
|
||||||
$accounts[$objp->bid]=0;
|
$accounts[$objp->bid]=0;
|
||||||
$accounts[$objp->bid] += 1;
|
$accounts[$objp->bid] += 1;*/
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td align="center">'.$i.'</td>';
|
print '<td align="center">'.$i.'</td>';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user