Compare commits
466 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
192510316b | ||
|
|
6f83c8c6f3 | ||
|
|
8213756c37 | ||
|
|
a254412c61 | ||
|
|
cc1a3080d0 | ||
|
|
b5f887b3e4 | ||
|
|
694357d48e | ||
|
|
c4f80b4e71 | ||
|
|
ece9f3037a | ||
|
|
8dd44246b0 | ||
|
|
76470c9548 | ||
|
|
19be5f662d | ||
|
|
3eebbc0b14 | ||
|
|
d27c0b31fc | ||
|
|
a1534955a1 | ||
|
|
79371f66b0 | ||
|
|
4569cb82b2 | ||
|
|
04d33f4594 | ||
|
|
af6e95aa79 | ||
|
|
5d942c9d1a | ||
|
|
cc57d3dbc1 | ||
|
|
87b187bded | ||
|
|
df0b20aad3 | ||
|
|
e085c3989a | ||
|
|
e67c208b57 | ||
|
|
e13038dc30 | ||
|
|
744b84cb09 | ||
|
|
5c3b0847c2 | ||
|
|
f1af7ca2f2 | ||
|
|
035bc32323 | ||
|
|
a70d45b3ab | ||
|
|
1574254dcf | ||
|
|
1c129fd3ea | ||
|
|
97575854d0 | ||
|
|
2e744a4517 | ||
|
|
1ad8700810 | ||
|
|
1c8c98ac0f | ||
|
|
92cb95a184 | ||
|
|
96c7a9f77c | ||
|
|
3ebdb89133 | ||
|
|
d819d427c3 | ||
|
|
db81b32a5d | ||
|
|
793e43c7c6 | ||
|
|
d9bac75a63 | ||
|
|
e4c1978e12 | ||
|
|
a0154503f4 | ||
|
|
a9c76f2e44 | ||
|
|
5b6133ad62 | ||
|
|
90c3c90864 | ||
|
|
cacff0c2d4 | ||
|
|
22f6d204a2 | ||
|
|
b110ca6ead | ||
|
|
400f6b244b | ||
|
|
cde290c78a | ||
|
|
b23b82bd6f | ||
|
|
7dfb369a98 | ||
|
|
265aeb76e6 | ||
|
|
5ee74d7c07 | ||
|
|
1541e20870 | ||
|
|
53709cf509 | ||
|
|
10e32c056e | ||
|
|
8728ad2eff | ||
|
|
5de6c193ff | ||
|
|
1f6e9a1a9e | ||
|
|
26c6908f66 | ||
|
|
08685cc6b0 | ||
|
|
7bdfc998bf | ||
|
|
76a0caf116 | ||
|
|
c57dc82eaa | ||
|
|
f16166c47c | ||
|
|
d82c1f34e0 | ||
|
|
0a72aed3d7 | ||
|
|
856b010a45 | ||
|
|
9d6ddced56 | ||
|
|
36ba158a8b | ||
|
|
140cca7596 | ||
|
|
a5b8d0cd4b | ||
|
|
d149596043 | ||
|
|
cf05f38e54 | ||
|
|
57ebcf94c0 | ||
|
|
826bde0656 | ||
|
|
d84d09556c | ||
|
|
7937a798b7 | ||
|
|
ce8312c744 | ||
|
|
cf4beafb68 | ||
|
|
9a72f147d1 | ||
|
|
f5343c55c3 | ||
|
|
1361abffe5 | ||
|
|
9d2fb782fa | ||
|
|
632147ad88 | ||
|
|
1129222064 | ||
|
|
7cb657c991 | ||
|
|
efb9d184e4 | ||
|
|
44d4ab6f9c | ||
|
|
8f96383186 | ||
|
|
db975bbcc2 | ||
|
|
23249751d5 | ||
|
|
7af883abc1 | ||
|
|
e365a14b5a | ||
|
|
e188855dca | ||
|
|
9aa5c94612 | ||
|
|
ba724204a4 | ||
|
|
8518c772fb | ||
|
|
33e40c12c8 | ||
|
|
19b9412c13 | ||
|
|
23749b57ec | ||
|
|
3959d12a39 | ||
|
|
dd8d4e9e98 | ||
|
|
9247bbcc1d | ||
|
|
01c6de1085 | ||
|
|
6d918ad1c7 | ||
|
|
ff696e0dad | ||
|
|
3dcd1aa05d | ||
|
|
8dfe4fe05f | ||
|
|
65d59405da | ||
|
|
0e2e8fe27f | ||
|
|
7232e38dbe | ||
|
|
f2c282305e | ||
|
|
54b81312b5 | ||
|
|
1336d3e791 | ||
|
|
eb8d7f92c3 | ||
|
|
c998abe54e | ||
|
|
181991ee47 | ||
|
|
c8bcd01a10 | ||
|
|
983e28691b | ||
|
|
29950a6afa | ||
|
|
00b617d17f | ||
|
|
fc0c4295bd | ||
|
|
17773f8414 | ||
|
|
e1af439a6d | ||
|
|
bd52613331 | ||
|
|
3875d26a2f | ||
|
|
db3d16f080 | ||
|
|
bc230dbfc2 | ||
|
|
371c75e76a | ||
|
|
3a32787f15 | ||
|
|
57052e2fba | ||
|
|
2da16ade6c | ||
|
|
68ac62d09c | ||
|
|
5910d10021 | ||
|
|
eba377cdf0 | ||
|
|
10f0434116 | ||
|
|
6d00097c89 | ||
|
|
fc4a16b356 | ||
|
|
d0508d557b | ||
|
|
422191def1 | ||
|
|
620d7109b5 | ||
|
|
332fa77d90 | ||
|
|
c3d539abff | ||
|
|
6abe6462e6 | ||
|
|
505517d142 | ||
|
|
1c43a83a8b | ||
|
|
571d130c3c | ||
|
|
88cd8fface | ||
|
|
87bb971d75 | ||
|
|
65c4a21898 | ||
|
|
9d89e48d15 | ||
|
|
68bc85124b | ||
|
|
456f25d57e | ||
|
|
74f3b98ea9 | ||
|
|
cd09099409 | ||
|
|
d09d036f06 | ||
|
|
b28180d759 | ||
|
|
a0378549b8 | ||
|
|
bdf8c3ddc6 | ||
|
|
35e48f3a27 | ||
|
|
9d285ea232 | ||
|
|
35ebaf7b79 | ||
|
|
16c290f735 | ||
|
|
f88abb9a6f | ||
|
|
0d467972cd | ||
|
|
dd70d68b4c | ||
|
|
eba55d0cf2 | ||
|
|
dad251493a | ||
|
|
ab8f78f29a | ||
|
|
8da328b183 | ||
|
|
3964bd28db | ||
|
|
e637a1e59a | ||
|
|
087e269103 | ||
|
|
b610cc1c6c | ||
|
|
08f21e3fc4 | ||
|
|
108a5ff7cb | ||
|
|
864a8b4b3e | ||
|
|
9d234a8541 | ||
|
|
a983dc7506 | ||
|
|
b77ec22590 | ||
|
|
f4ed3941a7 | ||
|
|
12b2ba64eb | ||
|
|
ca6dd8850a | ||
|
|
262dd1600b | ||
|
|
c9a46ab0cc | ||
|
|
bd731d9213 | ||
|
|
cd63ede35a | ||
|
|
97e829c7de | ||
|
|
7acebd28ca | ||
|
|
712f0b897d | ||
|
|
a7cef1aa15 | ||
|
|
e93a362a0d | ||
|
|
90fa36b46a | ||
|
|
0fe46b53d8 | ||
|
|
14f52f2871 | ||
|
|
be62c2f7f4 | ||
|
|
a345d38320 | ||
|
|
026f38fe06 | ||
|
|
eea90cef56 | ||
|
|
d03cbd88ae | ||
|
|
a7f850dafb | ||
|
|
cc54ba1866 | ||
|
|
3c5bc3fef4 | ||
|
|
246f7b054e | ||
|
|
8772c53723 | ||
|
|
ce18eff133 | ||
|
|
e2c4a14939 | ||
|
|
80759541b4 | ||
|
|
0472ab4690 | ||
|
|
fa28a02d74 | ||
|
|
c3cbd29542 | ||
|
|
90be70be58 | ||
|
|
7eddf43aef | ||
|
|
c9d4ccd40a | ||
|
|
9c657206b3 | ||
|
|
56212508e7 | ||
|
|
de57769d92 | ||
|
|
c8326c1365 | ||
|
|
51eaecdc6b | ||
|
|
98a0959b64 | ||
|
|
e4056b8a1d | ||
|
|
ce9dbfccd7 | ||
|
|
96da2a6a37 | ||
|
|
50bc832532 | ||
|
|
9769e33eab | ||
|
|
5b8a6f1d71 | ||
|
|
eeef78760a | ||
|
|
657972b79b | ||
|
|
745ad8b403 | ||
|
|
564a3b66c2 | ||
|
|
33553f3347 | ||
|
|
c8a41fab11 | ||
|
|
819aa108e9 | ||
|
|
1d9310055e | ||
|
|
e81023c35a | ||
|
|
6078267f86 | ||
|
|
dcca3011ee | ||
|
|
e41a3a2f42 | ||
|
|
5117be4b36 | ||
|
|
0f91c4cfa2 | ||
|
|
65f8405ca4 | ||
|
|
6bf9a72dab | ||
|
|
06201fa9bb | ||
|
|
4e66e134bd | ||
|
|
41d9324600 | ||
|
|
a8f11fec31 | ||
|
|
057d91698f | ||
|
|
794b10ec54 | ||
|
|
0315f45198 | ||
|
|
3f72f9b544 | ||
|
|
96656ff148 | ||
|
|
c44a368213 | ||
|
|
24f8b6386e | ||
|
|
5d6735f364 | ||
|
|
92b20d3595 | ||
|
|
b7ba9df6b4 | ||
|
|
8a46fd376f | ||
|
|
0c6f3a2616 | ||
|
|
f5be9b6244 | ||
|
|
9ed7a3a5c5 | ||
|
|
729c12a8e4 | ||
|
|
4d5aa723d4 | ||
|
|
08186fdff1 | ||
|
|
b216c81c60 | ||
|
|
c37c371392 | ||
|
|
0a23cf029d | ||
|
|
5d9aa40065 | ||
|
|
4b6fb7dd47 | ||
|
|
a4f3792cec | ||
|
|
37433ffee7 | ||
|
|
e64c27e1c3 | ||
|
|
1aca7efce3 | ||
|
|
36accba5c9 | ||
|
|
d1d305e470 | ||
|
|
9b0605f979 | ||
|
|
164fe9fb4a | ||
|
|
aafb074b41 | ||
|
|
f875bcfe09 | ||
|
|
c91b9d613a | ||
|
|
3ebe6eb014 | ||
|
|
3187c096c3 | ||
|
|
1753e980b8 | ||
|
|
5c3923240d | ||
|
|
9c83bdff51 | ||
|
|
b3a6bcd34f | ||
|
|
1d5b8cbb19 | ||
|
|
2ac9099e7d | ||
|
|
6d637bf1e1 | ||
|
|
60176f7f5e | ||
|
|
7d223beae5 | ||
|
|
3359ae93d8 | ||
|
|
04e9f2c988 | ||
|
|
93558d5bbb | ||
|
|
865ecf7a94 | ||
|
|
e8d9e9e697 | ||
|
|
90443e26ac | ||
|
|
5fd4da66cb | ||
|
|
e2e6d4ba14 | ||
|
|
4bb18db905 | ||
|
|
57732d4265 | ||
|
|
90d159fbc3 | ||
|
|
6b12dd4143 | ||
|
|
6170b28c3b | ||
|
|
df2297bca3 | ||
|
|
a865f49d72 | ||
|
|
c54e010126 | ||
|
|
cb9db6e3a8 | ||
|
|
a3aba28c95 | ||
|
|
547f1dd370 | ||
|
|
985301939d | ||
|
|
5305a983c7 | ||
|
|
f923c70f38 | ||
|
|
2637f9af63 | ||
|
|
fd6147578a | ||
|
|
892a38e681 | ||
|
|
592cfb5e93 | ||
|
|
b8b2928dd1 | ||
|
|
5a15dbf545 | ||
|
|
6a2afabcac | ||
|
|
fc22565532 | ||
|
|
829f6520bd | ||
|
|
7af0bda3a5 | ||
|
|
1cbe0e3f2d | ||
|
|
db32f882e8 | ||
|
|
acadef72c1 | ||
|
|
c577d1c51e | ||
|
|
56d78cf12a | ||
|
|
8dc1e1cb33 | ||
|
|
3683461c40 | ||
|
|
b5c88d5817 | ||
|
|
c2fa19a0b4 | ||
|
|
82400ca2a5 | ||
|
|
9971aee835 | ||
|
|
8fb474c687 | ||
|
|
2fda3b1b46 | ||
|
|
f6f4968af6 | ||
|
|
824a601014 | ||
|
|
9ce23ac6b2 | ||
|
|
a4d93424dc | ||
|
|
63292255cc | ||
|
|
139ae3db00 | ||
|
|
6574e54a41 | ||
|
|
17cb441569 | ||
|
|
540e4f3d2e | ||
|
|
e6b4f1eab6 | ||
|
|
33a20ae9a1 | ||
|
|
6e4962bb39 | ||
|
|
6c1e0919c8 | ||
|
|
27e2c69e4e | ||
|
|
0d4eaca3e8 | ||
|
|
08c85a88c8 | ||
|
|
81b964db45 | ||
|
|
5e98d99321 | ||
|
|
749aeeb233 | ||
|
|
4174ebd9c0 | ||
|
|
965eb2d639 | ||
|
|
68415322ec | ||
|
|
0a871546ee | ||
|
|
e8c2085abd | ||
|
|
ea19747bc6 | ||
|
|
2e9cf8d00b | ||
|
|
9513f25a36 | ||
|
|
c7f38c4cf0 | ||
|
|
098582d7a7 | ||
|
|
b3f8a6758e | ||
|
|
804eac55e9 | ||
|
|
7a6edfd61f | ||
|
|
e9b8e81773 | ||
|
|
5a6d3b7c88 | ||
|
|
f66c506011 | ||
|
|
3d3fb17da3 | ||
|
|
c5775cc902 | ||
|
|
2ab17c44e9 | ||
|
|
ce022ab36c | ||
|
|
ee96fb6470 | ||
|
|
e2d7e84072 | ||
|
|
74345c4f21 | ||
|
|
318a783237 | ||
|
|
8c428081ab | ||
|
|
ff8aae1209 | ||
|
|
5b6439ca5e | ||
|
|
37f44f4a07 | ||
|
|
f8fcf7c16b | ||
|
|
e8bf09862f | ||
|
|
9ddd1cf8cd | ||
|
|
c35c15e782 | ||
|
|
91bf759242 | ||
|
|
7df09b6e9e | ||
|
|
bd88806982 | ||
|
|
a0e423f1b8 | ||
|
|
5e9ce734a7 | ||
|
|
1880cb92a4 | ||
|
|
ddaaabfb7a | ||
|
|
521dec7792 | ||
|
|
b6faa6b605 | ||
|
|
14a62442c4 | ||
|
|
b4f638602a | ||
|
|
6057d8aabd | ||
|
|
eabe5ae616 | ||
|
|
8c08b3945b | ||
|
|
b9a91f92ea | ||
|
|
56ae51375d | ||
|
|
30543bda71 | ||
|
|
4f693b86c2 | ||
|
|
af593099df | ||
|
|
d5865dbfcc | ||
|
|
2df54d5da7 | ||
|
|
2de2f1ce4d | ||
|
|
d89d0782c9 | ||
|
|
26dc897042 | ||
|
|
cb4c047aa3 | ||
|
|
d852816101 | ||
|
|
b3757a6f69 | ||
|
|
a29a9e5435 | ||
|
|
66bbc7f54f | ||
|
|
971b97d78f | ||
|
|
b5edfdf6f6 | ||
|
|
a5f6ee5889 | ||
|
|
631aad94e7 | ||
|
|
d905d92434 | ||
|
|
fede7b7a15 | ||
|
|
815a7683a2 | ||
|
|
7a2e28497d | ||
|
|
43836836e4 | ||
|
|
c209d9b45e | ||
|
|
b798535af9 | ||
|
|
7cb10eae2e | ||
|
|
8b555d33e7 | ||
|
|
20c30bade8 | ||
|
|
5c7685c1b8 | ||
|
|
67c6577177 | ||
|
|
cbb7751a15 | ||
|
|
c0c9ac439f | ||
|
|
e5d8267786 | ||
|
|
1ad04bb67a | ||
|
|
98c7814fa3 | ||
|
|
6aa929cbf8 | ||
|
|
7543b63a6e | ||
|
|
6de6782458 | ||
|
|
eda0b4dc37 | ||
|
|
672a07fdac | ||
|
|
c41b59b14c | ||
|
|
bf775855f6 | ||
|
|
5fd341bbd3 | ||
|
|
ef789376e7 | ||
|
|
d20ba5a665 | ||
|
|
861b583668 | ||
|
|
5afc0e33c9 | ||
|
|
8bfa7565bd | ||
|
|
2cc635fd09 | ||
|
|
5c0fba26e2 | ||
|
|
549136efeb | ||
|
|
99a17cadb7 | ||
|
|
8e8efce7d1 | ||
|
|
9db211b1a7 | ||
|
|
d59ee06438 | ||
|
|
eee936b91c | ||
|
|
c010cab47e | ||
|
|
9b0659c50a | ||
|
|
71a2c20d4b |
@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co
|
||||
* %f will be replaced by a list of field names.
|
||||
* (%t and %f only applies to DefaultQueryTable)
|
||||
*/
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
|
||||
$cfg['DefaultQueryDatabase'] = '';
|
||||
|
||||
/**
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
"vendor-dir" : "htdocs/includes"
|
||||
},
|
||||
"require" : {
|
||||
"php" : ">=5.5.0",
|
||||
"php" : ">=5.6.0",
|
||||
"ext-curl" : "*",
|
||||
"ckeditor/ckeditor" : "4.12.1",
|
||||
"mike42/escpos-php" : "2.2",
|
||||
|
||||
@ -175,6 +175,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
||||
- protected $default_monospaced_font = 'courier';
|
||||
+ protected $default_monospaced_font = 'freemono';
|
||||
|
||||
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
|
||||
of the function, replace:
|
||||
|
||||
$roman = '';
|
||||
|
||||
with:
|
||||
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -17,8 +17,6 @@ on Internet on web following sites:<br>
|
||||
<br>
|
||||
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
|
||||
<br>
|
||||
* <a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
|
||||
<br>
|
||||
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
|
||||
|
||||
</body>
|
||||
|
||||
@ -19,7 +19,7 @@ Download
|
||||
Install
|
||||
--------------------------------
|
||||
|
||||
* For a Quick guide, take a look at README file into root directory.
|
||||
* For a Quick guide, take a look at README.md file into root directory.
|
||||
|
||||
* More complete documentations are also available on line on the Dolibarr Wiki:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -22,7 +22,7 @@ Download / Herunterladen
|
||||
Installation
|
||||
--------------------------------
|
||||
|
||||
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
|
||||
* Für eine kurze Einleitung, schau auf die README.md Datei im Hauptverzeichnis.
|
||||
|
||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||
|
||||
@ -19,9 +19,7 @@ https://www.dolistore.org
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
* Pour une prise en main et installation rapide, consultez le fichier README-FR.md à la racine.
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -4,4 +4,5 @@ User guide
|
||||
--------------------------------
|
||||
|
||||
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
||||
|
||||
https://www.dolibarr.org
|
||||
|
||||
@ -3,9 +3,6 @@ README (french)
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
La documentation utilisateur francophone est disponible en ligne sur le site Web de Dolibarr à l'adresse:
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le site Web de Dolibarr à l'adresse:
|
||||
https://www.dolibarr.fr
|
||||
|
||||
@ -158,11 +158,11 @@ if ($action == 'export_csv')
|
||||
|
||||
foreach ($object->lines as $line)
|
||||
{
|
||||
print length_accountg($line->numero_compte).$sep;
|
||||
print $object->get_compte_desc($line->numero_compte).$sep;
|
||||
print price($line->debit).$sep;
|
||||
print price($line->credit).$sep;
|
||||
print price($line->debit - $line->credit).$sep;
|
||||
print '"'.length_accountg($line->numero_compte).'"'.$sep;
|
||||
print '"'.$object->get_compte_desc($line->numero_compte).'"'.$sep;
|
||||
print '"'.price($line->debit).'"'.$sep;
|
||||
print '"'.price($line->credit).'"'.$sep;
|
||||
print '"'.price($line->debit - $line->credit).'"'.$sep;
|
||||
print "\n";
|
||||
}
|
||||
|
||||
|
||||
@ -45,14 +45,14 @@ $search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
|
||||
//var_dump($search_date_start);exit;
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
|
||||
@ -40,7 +40,7 @@ $langs->loadLangs(array("accountancy"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
|
||||
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -439,33 +439,43 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : CIEL
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
*
|
||||
* If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
|
||||
* use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportCiel(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
$i = 1;
|
||||
$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
if (!empty($data->subledger_account))
|
||||
$code_compta = $data->subledger_account;
|
||||
$code_compta = length_accountg($data->numero_compte);
|
||||
if (!empty($data->subledger_account)) {
|
||||
$code_compta = length_accounta($data->subledger_account);
|
||||
}
|
||||
|
||||
$date_document = dol_print_date($data->doc_date, '%Y%m%d');
|
||||
$date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($i, 5);
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(abs($data->montant), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->montant)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
@ -519,9 +529,8 @@ class AccountancyExport
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
|
||||
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
|
||||
if (!empty($data->date_echeance))
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy
|
||||
if (!empty($data->date_lim_reglement))
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // elarifr: format must be ddmmyy
|
||||
else
|
||||
$Tab['date_echeance'] = '000000';
|
||||
|
||||
@ -617,9 +626,8 @@ class AccountancyExport
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
if (!empty($data->date_echeance))
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
|
||||
if (!empty($data->date_lim_reglement))
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y');
|
||||
else
|
||||
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
|
||||
|
||||
|
||||
@ -121,9 +121,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@ -93,87 +93,88 @@ if ($conf->accounting->enabled)
|
||||
print '<div class="'.($helpisexpanded ? '' : 'hideobject').'" id="idfaq">'; // hideobject is to start hidden
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancyAreaDescIntro")."</span><br>\n";
|
||||
print "<br>\n"; print "<br>\n";
|
||||
if (!empty($user->rights->accounting->chartofaccount)){
|
||||
print "<br>\n"; print "<br>\n";
|
||||
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n";
|
||||
print '<hr>';
|
||||
print "<br>\n";
|
||||
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
// STEPS
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
print $langs->trans("AccountancyAreaDescActionOnceBis");
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
||||
print "<br>\n";
|
||||
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
$step++;
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
||||
print "<br>\n";
|
||||
if (!empty($conf->tax->enabled))
|
||||
{
|
||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
||||
print "<br>\n";
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->adherents->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
/*if (! empty($conf->salaries->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
// htdocs/admin/salaries.php
|
||||
print "<br>\n";
|
||||
print "<br>\n";
|
||||
}*/
|
||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
||||
print "<br>\n";
|
||||
}
|
||||
/*
|
||||
if (! empty($conf->loan->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->don->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}
|
||||
if (! empty($conf->adherents->enabled))
|
||||
{
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print "<br>\n";
|
||||
}*/
|
||||
|
||||
$step++;
|
||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Step A - E
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -608,7 +608,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -92,7 +92,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
$sql .= " p.accountancy_code_buy , aa.rowid as fk_compte, aa.account_number as compte, aa.label as label_compte";
|
||||
@ -628,7 +628,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
@ -694,9 +694,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$date.'"'.$sep;
|
||||
print '"'.$val["refsologest"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
|
||||
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
|
||||
@ -867,7 +867,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -586,7 +586,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$val["ref"].'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER.'"'.$sep;
|
||||
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
|
||||
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
|
||||
print '"'.$langs->trans("Thirdparty").'"'.$sep;
|
||||
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
|
||||
@ -803,7 +803,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined')
|
||||
{
|
||||
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
|
||||
|
||||
@ -123,9 +123,9 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det as l";
|
||||
$sql1 .= " SET l.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE l.rowid IN ('.implode(',', $changeaccount).')';
|
||||
$sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0');
|
||||
$sql1 .= ' WHERE rowid IN ('.implode(',', $changeaccount).')';
|
||||
|
||||
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1);
|
||||
$resql1 = $db->query($sql1);
|
||||
|
||||
@ -58,9 +58,9 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
}
|
||||
else
|
||||
{
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
}
|
||||
|
||||
|
||||
@ -326,7 +326,7 @@ if (empty($reshook))
|
||||
$object->public = GETPOST("public", 'alpha');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
// Check if we need to also synchronize user information
|
||||
|
||||
@ -1380,7 +1380,7 @@ class Adherent extends CommonObject
|
||||
$this->first_subscription_amount = $obj->subscription;
|
||||
}
|
||||
$this->last_subscription_date = $this->db->jdate($obj->datec);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
|
||||
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_amount = $obj->subscription;
|
||||
|
||||
|
||||
@ -865,7 +865,7 @@ while ($i < min($num, $limit))
|
||||
else
|
||||
{
|
||||
print '<td class="nowrap left">';
|
||||
if ($obj->subscription == 'yes')
|
||||
if (!empty($obj->subscription))
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($obj->statut > 0) print " ".img_warning();
|
||||
|
||||
@ -175,7 +175,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
||||
$object->vote = (boolean) trim($vote);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$ret = $object->update($user);
|
||||
@ -510,7 +510,7 @@ if ($rowid > 0)
|
||||
$sql .= " AND t.rowid = ".$object->id;
|
||||
if ($sall)
|
||||
{
|
||||
$sql .= natural_search(array("f.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
|
||||
$sql .= natural_search(array("d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
|
||||
}
|
||||
if ($status != '')
|
||||
{
|
||||
@ -709,7 +709,7 @@ if ($rowid > 0)
|
||||
else
|
||||
{
|
||||
print '<td class="nowrap left">';
|
||||
if ($objp->subscription == 'yes')
|
||||
if (!empty($objp->subscription))
|
||||
{
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($objp->statut > 0) print " ".img_warning();
|
||||
|
||||
@ -781,7 +781,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) {
|
||||
$sql .= (int) GETPOST($keycode, 'int');
|
||||
}
|
||||
else {
|
||||
else {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
|
||||
}
|
||||
|
||||
@ -1048,6 +1048,7 @@ if ($id)
|
||||
elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code);
|
||||
elseif ($search_code != '' && $id == 10) $sql .= natural_search("t.code", $search_code);
|
||||
elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code);
|
||||
|
||||
if ($sortfield)
|
||||
|
||||
@ -257,7 +257,7 @@ if (empty($reshook))
|
||||
$sql = "INSERT INTO ".$tabname[$id]." (";
|
||||
// List of fields
|
||||
$sql .= $tabfieldinsert[$id];
|
||||
$sql .= ",active)";
|
||||
$sql .= ",active,enabled)";
|
||||
$sql .= " VALUES(";
|
||||
|
||||
// List of values
|
||||
@ -289,7 +289,7 @@ if (empty($reshook))
|
||||
|
||||
$i++;
|
||||
}
|
||||
$sql .= ", 1)";
|
||||
$sql .= ", 1, 1)";
|
||||
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
|
||||
@ -197,7 +197,7 @@ if ($action == 'delete')
|
||||
$form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
|
||||
$wikihelp = 'EN:Setup Translation|FR:Paramétrage traduction|ES:Configuración';
|
||||
$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
|
||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
|
||||
$param = '&mode='.$mode;
|
||||
|
||||
@ -154,7 +154,7 @@ if ($action == 'update' && $user->rights->asset->write)
|
||||
$object->note = trim($comment);
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
$ret = $object->update($user);
|
||||
|
||||
@ -53,7 +53,7 @@ function printDropdownBookmarksList()
|
||||
{
|
||||
foreach ($_POST as $key => $val)
|
||||
{
|
||||
if (preg_match('/^search_/', $key) && $val != '') $tmpurl .= ($tmpurl ? '&' : '').$key.'='.$val;
|
||||
if (preg_match('/^search_/', $key) && $val != '') $tmpurl .= ($tmpurl ? '&' : '').http_build_query(array($key => $val));
|
||||
}
|
||||
}
|
||||
$url .= ($tmpurl ? '?'.$tmpurl : '');
|
||||
|
||||
@ -102,7 +102,7 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
||||
}
|
||||
if (!$error && empty($object->error))
|
||||
{
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error && $object->update($user) > 0)
|
||||
|
||||
@ -529,7 +529,7 @@ if (empty($reshook) && $action == 'update')
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
|
||||
@ -763,6 +763,7 @@ class ActionComm extends CommonObject
|
||||
$this->elementid = $obj->elementid;
|
||||
$this->elementtype = $obj->elementtype;
|
||||
|
||||
$this->fetch_optionals();
|
||||
$this->fetchResources();
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -66,7 +66,7 @@ class AgendaEvents extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->myactions->read) {
|
||||
throw new RestException(401, "Insufficient rights to read an event");
|
||||
}
|
||||
if ($id == 0) {
|
||||
if ($id === 0) {
|
||||
$result = $this->actioncomm->initAsSpecimen();
|
||||
} else {
|
||||
$result = $this->actioncomm->fetch($id);
|
||||
|
||||
@ -839,7 +839,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
{
|
||||
$langs->load("orders");
|
||||
|
||||
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||
$sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.fk_statut, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed";
|
||||
$sql .= ", s.code_client";
|
||||
$sql .= ", s.entity";
|
||||
$sql .= ", s.email";
|
||||
@ -877,6 +877,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
|
||||
$orderstatic->id = $obj->commandeid;
|
||||
$orderstatic->ref = $obj->ref;
|
||||
$orderstatic->statut = $obj->fk_statut;
|
||||
$orderstatic->ref_client = $obj->ref_client;
|
||||
$orderstatic->total_ht = $obj->total_ht;
|
||||
$orderstatic->total_tva = $obj->total_tva;
|
||||
|
||||
@ -66,6 +66,8 @@ $modulesdir = dolGetModulesDirs('/mailings');
|
||||
$object = new Mailing($db);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ciblescard', 'globalcard'));
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -471,6 +473,10 @@ if ($object->fetch($id) >= 0)
|
||||
}
|
||||
} // End foreach dir
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
@ -595,6 +595,10 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
if ($arrayquery['options_'.$key] != '') {
|
||||
$sqlwhere[] = " (te.".$key." = ".$arrayquery['options_'.$key].")";
|
||||
}
|
||||
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
|
||||
if ($arrayquery['options_'.$key] > 0) {
|
||||
$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery['options_'.$key]).")";
|
||||
}
|
||||
} else {
|
||||
if (is_array($arrayquery['options_'.$key])) {
|
||||
$sqlwhere[] = " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key])."'))";
|
||||
@ -621,7 +625,6 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->thirdparty_lines[$i] = $obj->rowid;
|
||||
|
||||
$i++;
|
||||
|
||||
@ -424,11 +424,16 @@ class Mailing extends CommonObject
|
||||
/**
|
||||
* Delete emailing
|
||||
*
|
||||
* @param int $rowid id du mailing a supprimer
|
||||
* @return int 1 en cas de succes
|
||||
* @param int $rowid Id if emailing to delete
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function delete($rowid)
|
||||
public function delete($rowid, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
|
||||
$sql .= " WHERE rowid = ".$rowid;
|
||||
|
||||
@ -436,13 +441,31 @@ class Mailing extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
return $this->delete_targets();
|
||||
$res = $this->delete_targets();
|
||||
if(empty($res)){
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!$notrigger){
|
||||
$result = $this->call_trigger('MAILING_DELETE', $user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -327,7 +327,7 @@ if (empty($reshook))
|
||||
$duration = GETPOST('duree_validite', 'int');
|
||||
|
||||
if (empty($datep)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors');
|
||||
$action = 'create';
|
||||
$error++;
|
||||
}
|
||||
@ -1622,7 +1622,7 @@ if ($action == 'create')
|
||||
}
|
||||
|
||||
// Date
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans('DatePropal').'</td><td>';
|
||||
print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -2051,7 +2051,7 @@ if ($action == 'create')
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Date');
|
||||
print $langs->trans('DatePropal');
|
||||
print '</td>';
|
||||
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
|
||||
@ -162,7 +162,7 @@ $arrayfields = array(
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
||||
'p.date'=>array('label'=>"Date", 'checked'=>1),
|
||||
'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
|
||||
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
|
||||
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
|
||||
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
|
||||
|
||||
@ -216,6 +216,8 @@ if (empty($reshook))
|
||||
$result = $object->deleteline($user, $lineid);
|
||||
if ($result > 0)
|
||||
{
|
||||
// reorder lines
|
||||
$object->line_order(true);
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
|
||||
@ -2271,6 +2271,7 @@ class Commande extends CommonOrder
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
|
||||
$sql .= ', '.MAIN_DB_PREFIX.'element_element as el';
|
||||
$sql .= ' WHERE el.fk_source = '.$this->id;
|
||||
$sql .= " AND el.sourcetype = 'commande'";
|
||||
$sql .= " AND el.fk_target = e.rowid";
|
||||
$sql .= " AND el.targettype = 'shipping'";
|
||||
|
||||
@ -4053,7 +4054,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
return max($this->date, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -78,6 +78,7 @@ class CommandeStats extends Stats
|
||||
$this->field = 'total_ht';
|
||||
$this->field_line = 'total_ht';
|
||||
$this->where .= " c.fk_statut > 0"; // Not draft and not cancelled
|
||||
$this->categ_link=MAIN_DB_PREFIX.'categorie_societe';
|
||||
}
|
||||
elseif ($mode == 'supplier')
|
||||
{
|
||||
@ -87,6 +88,7 @@ class CommandeStats extends Stats
|
||||
$this->field = 'total_ht';
|
||||
$this->field_line = 'total_ht';
|
||||
$this->where .= " c.fk_statut > 2"; // Only approved & ordered
|
||||
$this->categ_link=MAIN_DB_PREFIX.'categorie_fournisseur';
|
||||
}
|
||||
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
||||
$this->where .= ' AND c.entity IN ('.getEntity('commande').')';
|
||||
@ -106,7 +108,7 @@ class CommandeStats extends Stats
|
||||
|
||||
if ($categid)
|
||||
{
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.$this->categ_link.' as cats ON cats.fk_soc = c.fk_soc';
|
||||
$this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie';
|
||||
$this->where .= ' AND cat.rowid = '.$categid;
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ if ($action == 'update')
|
||||
if (!$error)
|
||||
{
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
|
||||
@ -243,6 +243,8 @@ if (empty($reshook))
|
||||
|
||||
$result = $object->deleteline(GETPOST('lineid'));
|
||||
if ($result > 0) {
|
||||
// reorder lines
|
||||
$object->line_order(true);
|
||||
// Define output language
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
@ -318,8 +320,8 @@ if (empty($reshook))
|
||||
//var_dump($array_of_total_ht_per_vat_rate);exit;
|
||||
foreach ($array_of_total_ht_per_vat_rate as $vatrate => $tmpvalue)
|
||||
{
|
||||
$tmp_total_ht = $array_of_total_ht_per_vat_rate[$vatrate];
|
||||
$tmp_total_ht_devise = $array_of_total_ht_devise_per_vat_rate[$vatrate];
|
||||
$tmp_total_ht = price2num($array_of_total_ht_per_vat_rate[$vatrate]);
|
||||
$tmp_total_ht_devise = price2num($array_of_total_ht_devise_per_vat_rate[$vatrate]);
|
||||
|
||||
if (($tmp_total_ht < 0 || $tmp_total_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
|
||||
{
|
||||
@ -1668,6 +1670,11 @@ if (empty($reshook))
|
||||
$discount->tva_tx = $lines[$i]->tva_tx;
|
||||
$discount->fk_user = $user->id;
|
||||
$discount->description = $desc;
|
||||
$discount->multicurrency_subprice = abs($lines[$i]->multicurrency_subprice);
|
||||
$discount->multicurrency_amount_ht = abs($lines[$i]->multicurrency_total_ht);
|
||||
$discount->multicurrency_amount_tva = abs($lines[$i]->multicurrency_total_tva);
|
||||
$discount->multicurrency_amount_ttc = abs($lines[$i]->multicurrency_total_ttc);
|
||||
|
||||
$discountid = $discount->create($user);
|
||||
if ($discountid > 0) {
|
||||
$result = $object->insert_discount($discountid); // This include link_to_invoice
|
||||
@ -2822,6 +2829,7 @@ if (empty($reshook))
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
@ -3749,6 +3757,15 @@ if ($action == 'create')
|
||||
}
|
||||
elseif ($id > 0 || !empty($ref))
|
||||
{
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
|
||||
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Show object in view mode
|
||||
*/
|
||||
@ -5206,7 +5223,8 @@ elseif ($id > 0 || !empty($ref))
|
||||
// Reopen a standard paid invoice
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
|
||||
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
|
||||
{
|
||||
@ -5353,7 +5371,7 @@ elseif ($id > 0 || !empty($ref))
|
||||
}
|
||||
|
||||
// Create a credit note
|
||||
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
|
||||
if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) ) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
|
||||
{
|
||||
if (!$objectidnext)
|
||||
{
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
/* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@ -86,6 +86,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -43,6 +43,14 @@ $ref = GETPOST("ref", 'alpha');
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
* Copyright (C) 2015-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2017 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -105,12 +105,30 @@ $search_country = GETPOST("search_country", 'int');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_user = GETPOST('search_user', 'int');
|
||||
$search_sale = GETPOST('search_sale', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_valid_start = dol_mktime(0, 0, 0, GETPOST('search_date_valid_startmonth', 'int'), GETPOST('search_date_valid_startday', 'int'), GETPOST('search_date_valid_startyear', 'int'));
|
||||
$search_date_valid_end = dol_mktime(23, 59, 59, GETPOST('search_date_valid_endmonth', 'int'), GETPOST('search_date_valid_endday', 'int'), GETPOST('search_date_valid_endyear', 'int'));
|
||||
$search_datelimit_start = dol_mktime(0, 0, 0, GETPOST('search_datelimit_startmonth', 'int'), GETPOST('search_datelimit_startday', 'int'), GETPOST('search_datelimit_startyear', 'int'));
|
||||
$search_datelimit_end = dol_mktime(23, 59, 59, GETPOST('search_datelimit_endmonth', 'int'), GETPOST('search_datelimit_endday', 'int'), GETPOST('search_datelimit_endyear', 'int'));
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_valid_startday = GETPOST('search_date_valid_startday', 'int');
|
||||
$search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int');
|
||||
$search_date_valid_startyear = GETPOST('search_date_valid_startyear', 'int');
|
||||
$search_date_valid_endday = GETPOST('search_date_valid_endday', 'int');
|
||||
$search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int');
|
||||
$search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int');
|
||||
$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear);
|
||||
$search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear);
|
||||
$search_datelimit_startday = GETPOST('search_datelimit_startday', 'int');
|
||||
$search_datelimit_startmonth = GETPOST('search_datelimit_startmonth', 'int');
|
||||
$search_datelimit_startyear = GETPOST('search_datelimit_startyear', 'int');
|
||||
$search_datelimit_endday = GETPOST('search_datelimit_endday', 'int');
|
||||
$search_datelimit_endmonth = GETPOST('search_datelimit_endmonth', 'int');
|
||||
$search_datelimit_endyear = GETPOST('search_datelimit_endyear', 'int');
|
||||
$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
|
||||
$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
|
||||
$search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
|
||||
$search_btn = GETPOST('button_search', 'alpha');
|
||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||
@ -273,10 +291,28 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
|
||||
$search_type = '';
|
||||
$search_country = '';
|
||||
$search_type_thirdparty = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startyear = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_valid_startday = '';
|
||||
$search_date_valid_startmonth = '';
|
||||
$search_date_valid_startyear = '';
|
||||
$search_date_valid_endday = '';
|
||||
$search_date_valid_endmonth = '';
|
||||
$search_date_valid_endyear = '';
|
||||
$search_date_valid_start = '';
|
||||
$search_date_valid_end = '';
|
||||
$search_datelimit_startday = '';
|
||||
$search_datelimit_startmonth = '';
|
||||
$search_datelimit_startyear = '';
|
||||
$search_datelimit_endday = '';
|
||||
$search_datelimit_endmonth = '';
|
||||
$search_datelimit_endyear = '';
|
||||
$search_datelimit_start = '';
|
||||
$search_datelimit_end = '';
|
||||
$option = '';
|
||||
@ -494,7 +530,6 @@ if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
|
||||
if ($search_state) $sql .= natural_search("state.nom", $search_state);
|
||||
if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')';
|
||||
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
|
||||
if ($search_company) $sql .= natural_search('s.nom', $search_company);
|
||||
if ($search_montant_ht != '') $sql .= natural_search('f.total', $search_montant_ht, 1);
|
||||
if ($search_montant_vat != '') $sql .= natural_search('f.tva', $search_montant_vat, 1);
|
||||
if ($search_montant_localtax1 != '') $sql .= natural_search('f.localtax1', $search_montant_localtax1, 1);
|
||||
@ -623,12 +658,24 @@ if ($resql)
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
|
||||
if ($sall) $param .= '&sall='.urlencode($sall);
|
||||
if ($search_date_start) $param .= '&search_date_start='.urlencode($search_date_start);
|
||||
if ($search_date_end) $param .= '&search_date_end='.urlencode($search_date_end);
|
||||
if ($search_date_valid_start) $param .= '&search_date_valid_start='.urlencode($search_date_valid_start);
|
||||
if ($search_date_valid_end) $param .= '&search_date_valid_end='.urlencode($search_date_valid_end);
|
||||
if ($search_datelimit_start) $param .= '&search_datelimit_start='.urlencode($search_datelimit_start);
|
||||
if ($search_datelimit_end) $param .= '&search_datelimit_end='.urlencode($search_datelimit_end);
|
||||
if ($search_date_startday) $param .= '&search_date_startday='.urlencode($search_date_startday);
|
||||
if ($search_date_startmonth) $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
|
||||
if ($search_date_startyear) $param .= '&search_date_startyear='.urlencode($search_date_startyear);
|
||||
if ($search_date_endday) $param .= '&search_date_endday='.urlencode($search_date_endday);
|
||||
if ($search_date_endmonth) $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
|
||||
if ($search_date_endyear) $param .= '&search_date_endyear='.urlencode($search_date_endyear);
|
||||
if ($search_date_valid_startday) $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday);
|
||||
if ($search_date_valid_startmonth) $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth);
|
||||
if ($search_date_valid_startyear) $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear);
|
||||
if ($search_date_valid_endday) $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday);
|
||||
if ($search_date_valid_endmonth) $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth);
|
||||
if ($search_date_valid_endyear) $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear);
|
||||
if ($search_datelimit_startday) $param .= '&search_datelimit_startday='.urlencode($search_datelimit_startday);
|
||||
if ($search_datelimit_startmonth) $param .= '&search_datelimit_startmonth='.urlencode($search_datelimit_startmonth);
|
||||
if ($search_datelimit_startyear) $param .= '&search_datelimit_startyear='.urlencode($search_datelimit_startyear);
|
||||
if ($search_datelimit_endday) $param .= '&search_datelimit_endday='.urlencode($search_datelimit_endday);
|
||||
if ($search_datelimit_endmonth) $param .= '&search_datelimit_endmonth='.urlencode($search_datelimit_endmonth);
|
||||
if ($search_datelimit_endyear) $param .= '&search_datelimit_endyear='.urlencode($search_datelimit_endyear);
|
||||
if ($search_ref) $param .= '&search_ref='.urlencode($search_ref);
|
||||
if ($search_refcustomer) $param .= '&search_refcustomer='.urlencode($search_refcustomer);
|
||||
if ($search_project_ref) $param .= '&search_project_ref='.urlencode($search_project_ref);
|
||||
|
||||
@ -64,6 +64,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
|
||||
* View
|
||||
*/
|
||||
|
||||
if (empty($object->id)) {
|
||||
llxHeader();
|
||||
$langs->load('errors');
|
||||
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
|
||||
llxFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
|
||||
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
@ -92,17 +92,23 @@ print load_fiche_titre($title, '', $picto);
|
||||
dol_mkdir($dir);
|
||||
|
||||
$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0));
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
if ($mode == 'customer') {
|
||||
if ($object_status != '' && $object_status >= 0) {
|
||||
$stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if (is_array($custcats) && !empty($custcats)) {
|
||||
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cat ON (f.fk_soc = cat.fk_soc)';
|
||||
$stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')';
|
||||
}
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
if ($mode == 'supplier') {
|
||||
if ($object_status != '' && $object_status >= 0) {
|
||||
$stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
|
||||
}
|
||||
if (is_array($custcats) && !empty($custcats)) {
|
||||
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)';
|
||||
$stats->where .= ' AND cat.fk_categorie IN ('.implode(',', $custcats).')';
|
||||
}
|
||||
}
|
||||
|
||||
// Build graphic number of object
|
||||
@ -283,7 +289,7 @@ if (! empty($conf->category->enabled)) {
|
||||
$cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier"));
|
||||
}
|
||||
print '<tr><td>'.$cat_label.'</td><td>';
|
||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, null, 'parent', null, null, 1);
|
||||
$cate_arbo = $form->select_all_categories($cat_type, null, 'parent', null, null, 1);
|
||||
print $form->multiselectarray('custcats', $cate_arbo, GETPOST('custcats', 'array'), null, null, null, null, "90%");
|
||||
//print $formother->select_categories($cat_type, $categ_id, 'categ_id', true);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -85,7 +85,14 @@ foreach ($linkedObjectBlock as $key => $objectlink)
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
|
||||
print '<td class="linkedcol-statut right">';
|
||||
if (method_exists($objectlink, 'getSommePaiement')) {
|
||||
print $objectlink->getLibStatut(3, $objectlink->getSommePaiement());
|
||||
}
|
||||
else {
|
||||
print $objectlink->getLibStatut(3);
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="linkedcol-action right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
@ -109,28 +109,70 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
|
||||
$object->fetch($id);
|
||||
if ($object->valide($user) > 0)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
// Loop on each invoice linked to this payment to rebuild PDF
|
||||
$factures = array();
|
||||
foreach ($factures as $id)
|
||||
{
|
||||
$fac = new Facture($db);
|
||||
$fac->fetch($id);
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
if (!empty($_REQUEST['lang_id']))
|
||||
{
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
}
|
||||
|
||||
$outputlangs = $langs;
|
||||
if (!empty($_REQUEST['lang_id']))
|
||||
{
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$fac->generateDocument($fac->modelpdf, $outputlangs);
|
||||
}
|
||||
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
|
||||
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
|
||||
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
|
||||
|
||||
$sql = 'SELECT f.rowid as facid';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
|
||||
$sql .= ' WHERE pf.fk_facture = f.rowid';
|
||||
$sql .= ' AND f.fk_soc = s.rowid';
|
||||
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
|
||||
$sql .= ' AND pf.fk_paiement = '.$object->id;
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
$invoice = new Facture($db);
|
||||
|
||||
if ($invoice->fetch($objp->facid) <= 0) {
|
||||
$errors++;
|
||||
setEventMessage($invoice->error, $invoice->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
|
||||
$errors++;
|
||||
setEventMessage($invoice->error, $invoice->errors, 'errors');
|
||||
break;
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors++;
|
||||
setEventMessage($db->error, $db->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
if (! $errors) {
|
||||
$db->commit();
|
||||
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -401,11 +443,13 @@ if ($resql)
|
||||
print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
if ($objp->paye == 1) // If at least one invoice is paid, disable delete
|
||||
{
|
||||
|
||||
// If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production
|
||||
if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) {
|
||||
$disable_delete = 1;
|
||||
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
|
||||
}
|
||||
|
||||
$total = $total + $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -426,8 +426,13 @@ class Paiement extends CommonObject
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
|
||||
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
|
||||
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
|
||||
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
|
||||
|
||||
$ret = $invoice->fetch($facid); // Reload to get new records
|
||||
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
|
||||
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result < 0) {
|
||||
setEventMessages($invoice->error, $invoice->errors, 'errors');
|
||||
$error++;
|
||||
|
||||
@ -248,7 +248,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr>';
|
||||
print '<td class="tdtop">'.$langs->trans("Comments").'</td>';
|
||||
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'"></textarea></td>';
|
||||
print '<td class="tdtop"><textarea name="note" wrap="soft" cols="60" rows="'.ROWS_3.'">'.GETPOST('note', 'alphanohtml').'</textarea></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -296,6 +296,7 @@ if ($action == 'create')
|
||||
print '<td class="right">'.price($objp->amount - $sumpaid)."</td>";
|
||||
|
||||
print '<td class="center">';
|
||||
|
||||
if ($sumpaid < $objp->amount)
|
||||
{
|
||||
$namef = "amount_".$objp->id;
|
||||
@ -304,7 +305,7 @@ if ($action == 'create')
|
||||
print img_picto("Auto fill", 'rightarrow', "class='AutoFillAmount' data-rowid='".$namef."' data-value='".($objp->amount - $sumpaid)."'");
|
||||
$remaintopay = $objp->amount - $sumpaid;
|
||||
print '<input type=hidden class="sum_remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'">';
|
||||
print '<input type="text" size="8" name="'.$namef.'" id="'.$namef.'" value="'.GETPOST('amount_'.$objp->id, 'alpha').'">';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -45,7 +45,7 @@ $langs->loadLangs(array('compta', 'bills', 'banks'));
|
||||
$id = GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm');
|
||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
||||
$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0);
|
||||
|
||||
$dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear'));
|
||||
$dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear'));
|
||||
@ -91,7 +91,7 @@ if ($action == 'reopen' && $user->rights->tax->charges->creer) {
|
||||
if ($action == 'classin' && $user->rights->tax->charges->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid'));
|
||||
$object->setProject(GETPOST('fk_project'));
|
||||
}
|
||||
|
||||
if ($action == 'setlib' && $user->rights->tax->charges->creer)
|
||||
@ -343,7 +343,7 @@ if ($action == 'create')
|
||||
print $langs->trans("Date");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1);
|
||||
print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1, 1);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -375,21 +375,21 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
|
||||
$numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
|
||||
$numproject = $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Payment Mode
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
|
||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
|
||||
$form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id');
|
||||
print '</td></tr>';
|
||||
|
||||
// Bank Account
|
||||
if (!empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
|
||||
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
|
||||
$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ if ($id > 0)
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
@ -546,11 +546,11 @@ if ($id > 0)
|
||||
if ($action == 'edit')
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td>";
|
||||
print '<input type="text" name="amount" size="12" class="flat" value="'.$object->amount.'">';
|
||||
print '<input type="text" name="amount" size="12" class="flat" value="'.price($object->amount).'">';
|
||||
print "</td></tr>";
|
||||
}
|
||||
else {
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount).'</td></tr>';
|
||||
}
|
||||
|
||||
// Mode of payment
|
||||
|
||||
@ -375,7 +375,7 @@ if ($modecompta == 'CREANCES-DETTES')
|
||||
$_SERVER["PHP_SELF"],
|
||||
"amount",
|
||||
"",
|
||||
$classslink,
|
||||
$paramslink,
|
||||
'class="right"',
|
||||
$sortfield,
|
||||
$sortorder
|
||||
|
||||
@ -421,7 +421,7 @@ if (empty($reshook))
|
||||
$object->roles = GETPOST("roles", 'array');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if (!$error)
|
||||
@ -843,7 +843,7 @@ else
|
||||
print '<tr><td>'.$langs->trans("ContactByDefaultFor").'</td>';
|
||||
print '<td colspan="3">';
|
||||
$contactType = $object->listeTypeContacts('external', '', 1);
|
||||
print $form->multiselectarray('roles', $contactType);
|
||||
print $form->multiselectarray('roles', $contactType, array(), 0, 0, 'minwidth500');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -744,38 +744,32 @@ class Contact extends CommonObject
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// Mis a jour alerte birthday
|
||||
if ($this->birthday_alert)
|
||||
{
|
||||
//check existing
|
||||
$sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
|
||||
$result_check = $this->db->query($sql_check);
|
||||
if (!$result_check || ($this->db->num_rows($result_check) < 1))
|
||||
{
|
||||
//insert
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_alert(type,fk_contact,fk_user) ";
|
||||
$sql .= "VALUES (1,".$this->db->escape($id).",".$user->id.")";
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
if ($user) {
|
||||
// Mis a jour alerte birthday
|
||||
if ($this->birthday_alert) {
|
||||
//check existing
|
||||
$sql_check = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user_alert WHERE type=1 AND fk_contact=" . $this->db->escape($id) . " AND fk_user=" . $user->id;
|
||||
$result_check = $this->db->query($sql_check);
|
||||
if (!$result_check || ($this->db->num_rows($result_check) < 1)) {
|
||||
//insert
|
||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_alert(type,fk_contact,fk_user) ";
|
||||
$sql .= "VALUES (1," . $this->db->escape($id) . "," . $user->id . ")";
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
} else {
|
||||
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_alert ";
|
||||
$sql .= "WHERE type=1 AND fk_contact=" . $this->db->escape($id) . " AND fk_user=" . $user->id;
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert ";
|
||||
$sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result)
|
||||
{
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1700,7 +1694,7 @@ class Contact extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_soc=".$this->socid." AND fk_socpeople=".$this->id; ;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_soc=".((int) $this->socid)." AND fk_socpeople=".$this->id;
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -1718,11 +1712,10 @@ class Contact extends CommonObject
|
||||
$sql .= "fk_socpeople) ";
|
||||
$sql .= " VALUES (".$conf->entity.",";
|
||||
$sql .= "'".$this->db->idate(dol_now())."',";
|
||||
$sql .= $this->socid.", ";
|
||||
$sql .= ((int) $this->socid).", ";
|
||||
$sql .= $valRoles." , ";
|
||||
$sql .= $this->id;
|
||||
$sql .= ")";
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result)
|
||||
|
||||
@ -175,7 +175,7 @@ $arrayfields = array(
|
||||
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'position'=>32, 'checked'=>1),
|
||||
'p.fax'=>array('label'=>"Fax", 'position'=>33, 'checked'=>0),
|
||||
'p.email'=>array('label'=>"EMail", 'position'=>40, 'checked'=>1),
|
||||
'p.no_email'=>array('label'=>"No_Email", 'position'=>41, 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled))),
|
||||
'unsubscribed'=>array('label'=>"No_Email", 'position'=>41, 'checked'=>0, 'enabled'=>(!empty($conf->mailing->enabled))),
|
||||
'p.thirdparty'=>array('label'=>"ThirdParty", 'position'=>50, 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
|
||||
'p.priv'=>array('label'=>"ContactVisibility", 'checked'=>1, 'position'=>200),
|
||||
'p.datec'=>array('label'=>"DateCreationShort", 'checked'=>0, 'position'=>500),
|
||||
@ -298,7 +298,7 @@ $contactstatic = new Contact($db);
|
||||
$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
|
||||
$sql = "SELECT s.rowid as socid, s.nom as name,";
|
||||
$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email, p.no_email,";
|
||||
$sql .= " p.rowid, p.lastname as lastname, p.statut, p.firstname, p.zip, p.town, p.poste, p.email,";
|
||||
$sql .= " p.socialnetworks, p.photo,";
|
||||
$sql .= " p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.fk_pays, p.priv, p.datec as date_creation, p.tms as date_update,";
|
||||
$sql .= " co.label as country, co.code as country_code";
|
||||
@ -306,6 +306,9 @@ $sql .= " co.label as country, co.code as country_code";
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
}
|
||||
if(!empty($conf->mailing->enabled)) {
|
||||
$sql .= ", (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) as unsubscribed";
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -374,8 +377,8 @@ if (strlen($search_town)) $sql .= natural_search("p.town", $search_town);
|
||||
if (count($search_roles) > 0) {
|
||||
$sql .= " AND p.rowid IN (SELECT sc.fk_socpeople FROM ".MAIN_DB_PREFIX."societe_contacts as sc WHERE sc.fk_c_type_contact IN (".implode(',', $search_roles)."))";
|
||||
}
|
||||
|
||||
if ($search_no_email != '' && $search_no_email >= 0) $sql .= " AND p.no_email = ".$db->escape($search_no_email);
|
||||
if ($search_no_email != -1 && $search_no_email > 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) > 0";
|
||||
if ($search_no_email != -1 && $search_no_email == 0) $sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = p.email) = 0";
|
||||
if ($search_status != '' && $search_status >= 0) $sql .= " AND p.statut = ".$db->escape($search_status);
|
||||
if ($search_import_key) $sql .= natural_search("p.import_key", $search_import_key);
|
||||
if ($type == "o") // filtre sur type
|
||||
@ -662,7 +665,7 @@ if (!empty($arrayfields['p.email']['checked']))
|
||||
print '<input class="flat" type="text" name="search_email" size="6" value="'.dol_escape_htmltag($search_email).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['p.no_email']['checked']))
|
||||
if (!empty($arrayfields['unsubscribed']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectarray('search_no_email', array('-1'=>'', '0'=>$langs->trans('No'), '1'=>$langs->trans('Yes')), $search_no_email);
|
||||
@ -751,7 +754,7 @@ if (!empty($arrayfields['p.phone_perso']['checked'])) print_liste_field_
|
||||
if (!empty($arrayfields['p.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['p.phone_mobile']['label'], $_SERVER["PHP_SELF"], "p.phone_mobile", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.fax']['checked'])) print_liste_field_titre($arrayfields['p.fax']['label'], $_SERVER["PHP_SELF"], "p.fax", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.email']['checked'])) print_liste_field_titre($arrayfields['p.email']['label'], $_SERVER["PHP_SELF"], "p.email", $begin, $param, '', $sortfield, $sortorder);
|
||||
if (!empty($arrayfields['p.no_email']['checked'])) print_liste_field_titre($arrayfields['p.no_email']['label'], $_SERVER["PHP_SELF"], "p.no_email", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($arrayfields['unsubscribed']['checked'])) print_liste_field_titre($arrayfields['unsubscribed']['label'], $_SERVER["PHP_SELF"], "unsubscribed", $begin, $param, '', $sortfield, $sortorder, 'center ');
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
if ($value['active'] && !empty($arrayfields['p.'.$key]['checked'])) {
|
||||
@ -905,9 +908,9 @@ while ($i < min($num, $limit))
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// No EMail
|
||||
if (!empty($arrayfields['p.no_email']['checked']))
|
||||
if (!empty($arrayfields['unsubscribed']['checked']))
|
||||
{
|
||||
print '<td class="center">'.yn($obj->no_email).'</td>';
|
||||
print '<td class="center">'.yn(($obj->unsubscribed > 0) ? 1 : 0).'</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
|
||||
@ -250,6 +250,8 @@ if ($search_email) $sql .= natural_search('s.email', $search_email);
|
||||
if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
|
||||
if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
|
||||
if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
|
||||
if ($search_zip) $sql .= natural_search(array('s.zip'), $search_zip);
|
||||
if ($search_town) $sql .= natural_search(array('s.town'), $search_town);
|
||||
if ($search_sale > 0)
|
||||
{
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
|
||||
|
||||
@ -262,7 +262,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete))
|
||||
// Remove a line
|
||||
if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissiontoadd))
|
||||
{
|
||||
if (method_exists('deleteline', $object)) {
|
||||
if (method_exists($object, 'deleteline')) {
|
||||
$result = $object->deleteline($user, $lineid); // For backward compatibility
|
||||
} else {
|
||||
$result = $object->deleteLine($user, $lineid);
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -1167,7 +1167,38 @@ if (!$error && $massaction == 'validate' && $permissiontoadd)
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
else $nbok++;
|
||||
else {
|
||||
// validate() rename pdf but do not regenerate
|
||||
// Define output language
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||
$outputlangs = $langs;
|
||||
$newlang = '';
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
|
||||
$newlang = GETPOST('lang_id', 'aZ09');
|
||||
}
|
||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
|
||||
$newlang = $objecttmp->thirdparty->default_lang;
|
||||
}
|
||||
if (!empty($newlang)) {
|
||||
$outputlangs = new Translate("", $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
$outputlangs->load('products');
|
||||
}
|
||||
$model = $objecttmp->model_pdf;
|
||||
$ret = $objecttmp->fetch($objecttmp->id); // Reload to get new records
|
||||
// To be sure vars is defined
|
||||
$hidedetails = !empty($hidedetails) ? $hidedetails : 0;
|
||||
$hidedesc = !empty($hidedesc) ? $hidedesc : 0;
|
||||
$hideref = !empty($hideref) ? $hideref : 0;
|
||||
$moreparams = !empty($moreparams) ? $moreparams : null;
|
||||
|
||||
$result = $objecttmp->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
if ($result < 0) {
|
||||
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
|
||||
}
|
||||
}
|
||||
$nbok++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1249,6 +1280,12 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($objectclass == 'Holiday' && ! in_array($objecttmp->statut, array(Holiday::STATUS_DRAFT, Holiday::STATUS_CANCELED, Holiday::STATUS_REFUSED))) {
|
||||
$nbignored++;
|
||||
setEventMessage($langs->trans('ErrorLeaveRequestMustBeDraftCanceledOrRefusedToBeDeleted', $objecttmp->ref));
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
|
||||
{
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
|
||||
@ -1283,7 +1320,8 @@ if (!$error && ($massaction == 'delete' || ($action == 'delete' && $confirm == '
|
||||
if (!$error)
|
||||
{
|
||||
if ($nbok > 1) setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||
elseif ($nbok > 0) setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
|
||||
$db->commit();
|
||||
}
|
||||
else
|
||||
|
||||
@ -80,5 +80,9 @@ if (($action == 'set') && !empty($id)) {
|
||||
|
||||
$format = 'int';
|
||||
|
||||
$object->table_element = $tablename;
|
||||
$object->id = $id;
|
||||
$object->fields[$field] = array('type' => $format, 'enabled' => 1);
|
||||
|
||||
$object->setValueFrom($field, $value, $tablename, $id, $format, '', $user, $triggerkey);
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ class box_produits_alerte_stock extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center"',
|
||||
'text' => $objp->total_stock.' / '.$objp->seuil_stock_alerte,
|
||||
'text' => price2num($objp->total_stock, 'MS').' / '.$objp->seuil_stock_alerte,
|
||||
'text2'=>img_warning($langs->transnoentitiesnoconv("StockLowerThanLimit", $objp->seuil_stock_alerte)),
|
||||
);
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ class CSMSFile
|
||||
return -1;
|
||||
}
|
||||
|
||||
dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".$conf->global->MAIN_SMS_SENDMODE." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".count($msg), LOG_DEBUG);
|
||||
dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".$conf->global->MAIN_SMS_SENDMODE." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".strlen($msg), LOG_DEBUG);
|
||||
dol_syslog("CSMSFile::CSMSFile: deferred=".$deferred." priority=".$priority." class=".$class, LOG_DEBUG);
|
||||
|
||||
// Action according to choosed sending method
|
||||
|
||||
@ -450,8 +450,8 @@ abstract class CommonObject
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To know object to delete on cascade.
|
||||
* If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||
* If name is like '@ClassName:FilePathClass:ParentFkFieldName', it will
|
||||
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object.
|
||||
*/
|
||||
protected $childtablesoncascade = array();
|
||||
|
||||
@ -1356,6 +1356,8 @@ abstract class CommonObject
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
if ($num > 0) {
|
||||
$langs->loadLangs(array("propal", "orders", "bills", "suppliers", "contracts", "supplier_proposal"));
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$modulename = $obj->element;
|
||||
if (strpos($obj->element, 'project') !== false) {
|
||||
@ -1371,11 +1373,15 @@ abstract class CommonObject
|
||||
}
|
||||
if ($conf->{$modulename}->enabled) {
|
||||
$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
|
||||
$transkey = "TypeContact_".$obj->element."_".$source."_".$obj->code;
|
||||
$tmpelement = $obj->element;
|
||||
$transkey = "TypeContact_".$tmpelement."_".$source."_".$obj->code;
|
||||
$libelle_type = ($langs->trans($transkey) != $transkey ? $langs->trans($transkey) : $obj->libelle);
|
||||
if (empty($option))
|
||||
if (empty($option)) {
|
||||
$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
|
||||
else $tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
|
||||
}
|
||||
else {
|
||||
$tab[$obj->rowid] = $libelle_element.' - '.$libelle_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2184,14 +2190,16 @@ abstract class CommonObject
|
||||
$this->updateline(
|
||||
$line->id, ($line->description ? $line->description : $line->desc), $line->subprice, $line->qty, $line->remise_percent,
|
||||
$line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false,
|
||||
$line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice
|
||||
$line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice,
|
||||
$line->ref_supplier
|
||||
);
|
||||
break;
|
||||
case 'invoice_supplier':
|
||||
$this->updateline(
|
||||
$line->id, ($line->description ? $line->description : $line->desc), $line->subprice, $line->tva_tx, $line->localtax1_tx,
|
||||
$line->localtax2_tx, $line->qty, 0, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, false,
|
||||
$line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice
|
||||
$line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice,
|
||||
$line->ref_supplier
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -603,6 +603,8 @@ class ExtraFields
|
||||
*/
|
||||
public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0)
|
||||
{
|
||||
global $hookmanager;
|
||||
|
||||
if ($elementtype == 'thirdparty') $elementtype = 'societe';
|
||||
if ($elementtype == 'contact') $elementtype = 'socpeople';
|
||||
|
||||
@ -643,6 +645,18 @@ class ExtraFields
|
||||
}
|
||||
$field_desc = array('type'=>$typedb, 'value'=>$lengthdb, 'null'=>($required ? 'NOT NULL' : 'NULL'), 'default'=>$default);
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
$hookmanager->initHooks(array('extrafieldsdao'));
|
||||
$parameters = array('field_desc'=>&$field_desc, 'table'=>$table, 'attr_name'=>$attrname, 'label'=>$label, 'type'=>$type, 'length'=>$length, 'unique'=>$unique, 'required'=>$required, 'pos'=>$pos, 'param'=>$param, 'alwayseditable'=>$alwayseditable, 'perms'=>$perms, 'list'=>$list, 'help'=>$help, 'default'=>$default, 'computed'=>$computed, 'entity'=>$entity, 'langfile'=>$langfile, 'enabled'=>$enabled, 'totalizable'=>$totalizable, 'printable'=>$printable);
|
||||
$reshook = $hookmanager->executeHooks('updateExtrafields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if ($reshook < 0) {
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($type != 'separate') // No table update when separate type
|
||||
{
|
||||
$result = $this->db->DDLUpdateField(MAIN_DB_PREFIX.$table, $attrname, $field_desc);
|
||||
@ -1330,7 +1344,10 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'checkbox')
|
||||
{
|
||||
$value_arr = explode(',', $value);
|
||||
$value_arr = $value;
|
||||
if (!is_array($value)) {
|
||||
$value_arr = explode(',', $value);
|
||||
}
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
|
||||
}
|
||||
elseif ($type == 'radio')
|
||||
@ -2038,7 +2055,8 @@ class ExtraFields
|
||||
foreach ($extralabels as $key => $value)
|
||||
{
|
||||
if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) continue;
|
||||
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && ! GETPOSTISSET('options_'.$key)) continue;
|
||||
//when unticking boolean field, it's not set in POST
|
||||
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && ! GETPOSTISSET('options_'.$key) && $this->attributes[$object->table_element]['type'][$key] != 'boolean') continue;
|
||||
|
||||
$key_type = $this->attributes[$object->table_element]['type'][$key];
|
||||
if ($key_type == 'separate') continue;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Christophe Battarel <christophe@altairis.fr>
|
||||
@ -1182,7 +1182,7 @@ class Form
|
||||
// mode 1
|
||||
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).($showtype ? '&showtype='.urlencode($showtype) : '');
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
|
||||
elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
|
||||
@ -6052,7 +6052,7 @@ class Form
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
if ($placeholder) $placeholder = ' placeholder="'.$placeholder.'"';
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
}
|
||||
@ -6160,7 +6160,7 @@ class Form
|
||||
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
|
||||
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
|
||||
}
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe')
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe')
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE 1=1";
|
||||
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
|
||||
@ -6172,7 +6172,7 @@ class Form
|
||||
else $sql .= " AND t.fk_soc = ".$user->socid;
|
||||
}
|
||||
if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey);
|
||||
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
|
||||
if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
}
|
||||
if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
@ -7132,7 +7132,7 @@ class Form
|
||||
print '<input type="radio" name="idtolinkto" value='.$objp->rowid.'>';
|
||||
print '</td>';
|
||||
print '<td class="center">'.$objp->ref.'</td>';
|
||||
print '<td>'.$objp->ref_client.'</td>';
|
||||
print '<td>'.(!empty($objp->ref_client)?$objp->ref_client:$objp->ref_supplier).'</td>';
|
||||
print '<td class="right">'.price($objp->total_ht).'</td>';
|
||||
print '<td>'.$objp->name.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -268,7 +268,7 @@ class FormFile
|
||||
$out .= "\n</div><!-- End form link new url -->\n";
|
||||
}
|
||||
|
||||
$parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm);
|
||||
$parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm, 'options'=>$options);
|
||||
$res = $hookmanager->executeHooks('formattachOptions', $parameters, $object);
|
||||
if (empty($res))
|
||||
{
|
||||
@ -1382,7 +1382,7 @@ class FormFile
|
||||
// $section is inside $param
|
||||
$newparam.=preg_replace('/&file=.*$/', '', $param); // We don't need param file=
|
||||
$backtopage = DOL_URL_ROOT.'/ecm/index.php?§ion_dir='.urlencode($relativepath).$newparam;
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||
print '<a class="editfielda editfilelink" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||
}
|
||||
|
||||
if (empty($useinecm) || $useinecm == 2 || $useinecm == 6) // 6=Media file manager
|
||||
@ -1408,7 +1408,7 @@ class FormFile
|
||||
if ($permtoeditline)
|
||||
{
|
||||
$paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : '');
|
||||
print '<a class="editfielda reposition" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||
print '<a class="editfielda reposition editfilelink" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
|
||||
}
|
||||
}
|
||||
if ($permonobject)
|
||||
|
||||
@ -325,7 +325,7 @@ class FormMail extends Form
|
||||
$langs->loadLangs(array('other', 'mails'));
|
||||
|
||||
// Clear temp files. Must be done at beginning, before call of triggers
|
||||
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1'))
|
||||
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1'))
|
||||
{
|
||||
$this->clear_attached_files();
|
||||
}
|
||||
|
||||
@ -98,7 +98,8 @@ class FormMargin
|
||||
|
||||
$pv = $line->total_ht;
|
||||
$pa_ht = ($pv < 0 ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
||||
if ($object->element == 'facture' && $object->type == $object::TYPE_SITUATION) {
|
||||
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|
||||
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && $conf->global->INVOICE_USE_SITUATION_CREDIT_NOTE && $object->situation_counter > 0)) {
|
||||
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
|
||||
} else {
|
||||
$pa = $line->qty * $pa_ht;
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2015 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2013-2015 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
@ -351,12 +352,13 @@ class FormTicket
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($conf->projet->enabled) && !$this->ispublic)
|
||||
{
|
||||
$formproject = new FormProjets($this->db);
|
||||
print '<tr><td><label for="project"><span class="">'.$langs->trans("Project").'</span></label></td><td>';
|
||||
print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||
print '</td></tr>';
|
||||
if($subelement != 'project') {
|
||||
if (!empty($conf->projet->enabled) && !$this->ispublic) {
|
||||
$formproject = new FormProjets($this->db);
|
||||
print '<tr><td><label for="project"><span class="">' . $langs->trans("Project") . '</span></label></td><td>';
|
||||
print $formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
// Attached files
|
||||
|
||||
@ -346,17 +346,19 @@ class Utils
|
||||
{
|
||||
$handlein = popen($fullcommandclear, 'r');
|
||||
$i = 0;
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
// Exclude warning line we don't want
|
||||
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
|
||||
fwrite($handle, $read);
|
||||
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok = 1;
|
||||
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok = 1;
|
||||
if ($handlein) {
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
// Exclude warning line we don't want
|
||||
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
|
||||
fwrite($handle, $read);
|
||||
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok = 1;
|
||||
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok = 1;
|
||||
}
|
||||
pclose($handlein);
|
||||
}
|
||||
pclose($handlein);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -308,16 +308,20 @@ abstract class DoliDB implements Database
|
||||
* Note : This method executes a given SQL query and retrieves the first row of results as an object. It should only be used with SELECT queries
|
||||
* Dont add LIMIT to your query, it will be added by this method
|
||||
* @param string $sql the sql query string
|
||||
* @return bool| object
|
||||
* @return bool|int|object false on failure, 0 on empty, object on success
|
||||
*/
|
||||
public function getRow($sql)
|
||||
{
|
||||
$sql .= ' LIMIT 1;';
|
||||
$sql .= ' LIMIT 1';
|
||||
|
||||
$res = $this->query($sql);
|
||||
if ($res)
|
||||
{
|
||||
return $this->fetch_object($res);
|
||||
if ($res) {
|
||||
$obj = $this->fetch_object($res);
|
||||
if ($obj) {
|
||||
return $obj;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -907,11 +907,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
|
||||
't.email',
|
||||
);
|
||||
//Social media
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
if ($value['active']) {
|
||||
$searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
|
||||
}
|
||||
}
|
||||
// foreach ($socialnetworks as $key => $value) {
|
||||
// if ($value['active']) {
|
||||
// $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
|
||||
// }
|
||||
// }
|
||||
|
||||
if (!$sortorder) $sortorder = "ASC";
|
||||
if (!$sortfield) $sortfield = "t.lastname";
|
||||
|
||||
@ -40,6 +40,30 @@
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Return dolibarr global constant string value
|
||||
* @param string $key key to return value, return '' if not set
|
||||
* @return string
|
||||
*/
|
||||
function getDolGlobalString($key)
|
||||
{
|
||||
global $conf;
|
||||
// return $conf->global->$key ?? '';
|
||||
return (string) (empty($conf->global->$key) ? '' : $conf->global->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return dolibarr global constant int value
|
||||
* @param string $key key to return value, return 0 if not set
|
||||
* @return int
|
||||
*/
|
||||
function getDolGlobalInt($key)
|
||||
{
|
||||
global $conf;
|
||||
// return $conf->global->$key ?? 0;
|
||||
return (int) (empty($conf->global->$key) ? 0 : $conf->global->$key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a DoliDB instance (database handler).
|
||||
*
|
||||
@ -4760,7 +4784,7 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
$nbofdectoround = '';
|
||||
if ($rounding == 'MU') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_UNIT;
|
||||
elseif ($rounding == 'MT') $nbofdectoround = $conf->global->MAIN_MAX_DECIMALS_TOT;
|
||||
elseif ($rounding == 'MS') $nbofdectoround = empty($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
|
||||
elseif ($rounding == 'MS') $nbofdectoround = !isset($conf->global->MAIN_MAX_DECIMALS_STOCK) ? 5 : $conf->global->MAIN_MAX_DECIMALS_STOCK;
|
||||
elseif ($rounding == 'CR') $nbofdectoround = 8;
|
||||
elseif (is_numeric($rounding)) $nbofdectoround = $rounding;
|
||||
//print "RR".$amount.' - '.$nbofdectoround.'<br>';
|
||||
@ -6453,11 +6477,11 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
|
||||
if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2__'] = is_object($object) ? $object->total_localtax1 : '';
|
||||
if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3__'] = is_object($object) ? $object->total_localtax2 : '';
|
||||
|
||||
$substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
|
||||
$substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
|
||||
$substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? ($object->total_vat ? price($object->total_vat, 0, $outputlangs, 0, 0, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : '';
|
||||
if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
|
||||
if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, 0, -1, $conf->currency) : null) : '';
|
||||
$substitutionarray['__AMOUNT_FORMATED__'] = is_object($object) ? ($object->total_ttc ? price($object->total_ttc, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : '';
|
||||
$substitutionarray['__AMOUNT_EXCL_TAX_FORMATED__'] = is_object($object) ? ($object->total_ht ? price($object->total_ht, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : '';
|
||||
$substitutionarray['__AMOUNT_VAT_FORMATED__'] = is_object($object) ? ($object->total_vat ? price($object->total_vat, 0, $outputlangs, 0, -1, -1, $conf->currency) : ($object->total_tva ? price($object->total_tva, 0, $outputlangs, 0, 0, -1, $conf->currency) : null)) : '';
|
||||
if ($onlykey != 2 || $mysoc->useLocalTax(1)) $substitutionarray['__AMOUNT_TAX2_FORMATED__'] = is_object($object) ? ($object->total_localtax1 ? price($object->total_localtax1, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : '';
|
||||
if ($onlykey != 2 || $mysoc->useLocalTax(2)) $substitutionarray['__AMOUNT_TAX3_FORMATED__'] = is_object($object) ? ($object->total_localtax2 ? price($object->total_localtax2, 0, $outputlangs, 0, -1, -1, $conf->currency) : null) : '';
|
||||
|
||||
// TODO Add keys for foreign multicurrency
|
||||
|
||||
@ -8306,7 +8330,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
|
||||
if (!isset($dictvalues[$tablename]))
|
||||
{
|
||||
$dictvalues[$tablename] = array();
|
||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
||||
$sql = 'SELECT * FROM '.$tablename.' WHERE 1 = 1'; // Here select * is allowed as it is generic code and we don't have list of fields
|
||||
if ($checkentity) $sql .= ' AND entity IN (0,'.getEntity($tablename).')';
|
||||
|
||||
$resql = $db->query($sql);
|
||||
|
||||
@ -51,7 +51,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
}
|
||||
|
||||
// Check parameters
|
||||
if (count($addfieldentry) > 0)
|
||||
if (is_array($addfieldentry) && count($addfieldentry) > 0)
|
||||
{
|
||||
if (empty($addfieldentry['name']))
|
||||
{
|
||||
|
||||
@ -623,8 +623,8 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// Add a background image on document
|
||||
if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image
|
||||
// Add a background image on document only if good setup of const
|
||||
if (!empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF) && ($conf->global->MAIN_USE_BACKGROUND_ON_PDF != '-1')) // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image
|
||||
{
|
||||
$pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image
|
||||
$pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_X : 0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y) ? $conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y : 0), 0, $page_height);
|
||||
@ -1937,7 +1937,7 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
|
||||
if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
|
||||
{
|
||||
$prev_progress = 0;
|
||||
if (method_exists($object, 'get_prev_progress'))
|
||||
if (method_exists($object->lines[$i], 'get_prev_progress'))
|
||||
{
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
|
||||
|
||||
-- Third parties
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?mainmenu=companies&leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&action=create', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 502__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&leftmenu=thirdparties', 'List', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 503__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=f&leftmenu=suppliers', 'ListSuppliersShort', 1, 'suppliers', '$user->rights->societe->lire && $user->rights->fournisseur->lire', '', 2, 5, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))', __HANDLER__, 'left', 504__+MAX_llx_menu__, 'companies', '', 503__+MAX_llx_menu__, '/societe/card.php?mainmenu=companies&leftmenu=supplier&action=create&type=f', 'NewSupplier', 2, 'suppliers', '$user->rights->societe->creer', '', 2, 0, __ENTITY__);
|
||||
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 506__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/list.php?mainmenu=companies&type=p&leftmenu=prospects', 'ListProspectsShort', 1, 'companies', '$user->rights->societe->lire', '', 2, 3, __ENTITY__);
|
||||
|
||||
@ -362,11 +362,12 @@ class pdf_espadon extends ModelePdfExpedition
|
||||
{
|
||||
$tab_top = 88 + $height_incoterms;
|
||||
$tab_top_alt = $tab_top;
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
||||
if(!empty($object->tracking_number)) {
|
||||
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
|
||||
}
|
||||
|
||||
$tab_top_alt = $pdf->GetY();
|
||||
if(!empty($object->tracking_number)) $tab_top_alt = $pdf->GetY();
|
||||
//$tab_top_alt += 1;
|
||||
|
||||
// Tracking number
|
||||
|
||||
@ -79,8 +79,8 @@ class mailing_contacts1 extends MailingTargets
|
||||
$statssql[0] .= " count(distinct(c.email)) as nb";
|
||||
$statssql[0] .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$statssql[0] .= " WHERE c.entity IN (".getEntity('socpeople').")";
|
||||
$statssql[0] .= " AND c.email != ''"; // Note that null != '' is false
|
||||
$statssql[0] .= " AND c.no_email = 0";
|
||||
$statssql[0] .= " AND c.email <> ''"; // Note that null != '' is false
|
||||
$statssql[0] .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = c.email) = 0";
|
||||
$statssql[0] .= " AND c.statut = 1";
|
||||
|
||||
return $statssql;
|
||||
@ -103,8 +103,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as c";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = c.fk_soc";
|
||||
$sql .= " WHERE c.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " AND c.email != ''"; // Note that null != '' is false
|
||||
$sql .= " AND c.no_email = 0";
|
||||
$sql .= " AND c.email <> ''"; // Note that null != '' is false
|
||||
$sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = c.email) = 0";
|
||||
// exclude unsubscribed users
|
||||
$sql .= " AND c.statut = 1";
|
||||
@ -132,10 +131,9 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
|
||||
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
|
||||
/*$sql.= " AND sp.email != ''"; // Note that null != '' is false
|
||||
$sql.= " AND sp.no_email = 0";
|
||||
$sql.= " AND sp.statut = 1";*/
|
||||
$sql .= " AND (sp.poste IS NOT NULL AND sp.poste != '')";
|
||||
$sql .= " AND sp.email <> ''"; // Note that null != '' is false
|
||||
$sql .= " AND sp.statut = 1";
|
||||
$sql .= " AND (sp.poste IS NOT NULL AND sp.poste <> '')";
|
||||
$sql .= " GROUP BY sp.poste";
|
||||
$sql .= " ORDER BY sp.poste";
|
||||
$resql = $this->db->query($sql);
|
||||
@ -166,10 +164,9 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."categorie as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."categorie_contact as cs";
|
||||
$sql .= " WHERE sp.statut = 1"; // Note that null != '' is false
|
||||
//$sql.= " AND sp.no_email = 0";
|
||||
//$sql.= " AND sp.email != ''";
|
||||
//$sql.= " AND sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " AND sp.email <> ''"; // Note that null != '' is false
|
||||
$sql .= " AND sp.statut = 1";
|
||||
$sql .= " AND cs.fk_categorie = c.rowid";
|
||||
$sql .= " AND cs.fk_socpeople = sp.rowid";
|
||||
$sql .= " GROUP BY c.label";
|
||||
@ -241,10 +238,9 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."categorie as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."categorie_societe as cs";
|
||||
$sql .= " WHERE sp.statut = 1"; // Note that null != '' is false
|
||||
//$sql.= " AND sp.no_email = 0";
|
||||
//$sql.= " AND sp.email != ''";
|
||||
//$sql.= " AND sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " AND sp.email <> ''"; // Note that null != '' is false
|
||||
$sql .= " AND sp.statut = 1";
|
||||
$sql .= " AND cs.fk_categorie = c.rowid";
|
||||
$sql .= " AND cs.fk_soc = sp.fk_soc";
|
||||
$sql .= " GROUP BY c.label";
|
||||
@ -283,10 +279,9 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."categorie as c,";
|
||||
$sql .= " ".MAIN_DB_PREFIX."categorie_fournisseur as cs";
|
||||
$sql .= " WHERE sp.statut = 1"; // Note that null != '' is false
|
||||
//$sql.= " AND sp.no_email = 0";
|
||||
//$sql.= " AND sp.email != ''";
|
||||
//$sql.= " AND sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " AND sp.email <> ''"; // Note that null != '' is false
|
||||
$sql .= " AND sp.statut = 1";
|
||||
$sql .= " AND cs.fk_categorie = c.rowid";
|
||||
$sql .= " AND cs.fk_soc = sp.fk_soc";
|
||||
$sql .= " GROUP BY c.label";
|
||||
@ -385,7 +380,6 @@ class mailing_contacts1 extends MailingTargets
|
||||
if ($filter_category_supplier <> 'all') $sql .= ", ".MAIN_DB_PREFIX."categorie_fournisseur as c3s";
|
||||
$sql .= " WHERE sp.entity IN (".getEntity('socpeople').")";
|
||||
$sql .= " AND sp.email <> ''";
|
||||
$sql .= " AND sp.no_email = 0";
|
||||
$sql .= " AND (SELECT count(*) FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = sp.email) = 0";
|
||||
// Exclude unsubscribed email adresses
|
||||
$sql .= " AND sp.statut = 1";
|
||||
|
||||
@ -209,24 +209,6 @@ class MailingTargets // This can't be abstract as it is used for some method
|
||||
|
||||
dol_syslog(__METHOD__.": mailing ".$j." targets added");
|
||||
|
||||
/*
|
||||
//Update the status to show thirdparty mail that don't want to be contacted anymore'
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=3";
|
||||
$sql .= " WHERE fk_mailing=".$mailing_id." AND email in (SELECT email FROM ".MAIN_DB_PREFIX."societe where fk_stcomm=-1)";
|
||||
$sql .= " AND source_type='thirdparty'";
|
||||
dol_syslog(__METHOD__.": mailing update status to display thirdparty mail that do not want to be contacted");
|
||||
$result=$this->db->query($sql);
|
||||
|
||||
//Update the status to show contact mail that don't want to be contacted anymore'
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=3";
|
||||
$sql .= " WHERE fk_mailing=".$mailing_id." AND source_type='contact' AND (email in (SELECT sc.email FROM ".MAIN_DB_PREFIX."socpeople AS sc ";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid=sc.fk_soc WHERE s.fk_stcomm=-1 OR no_email=1))";
|
||||
dol_syslog(__METHOD__.": mailing update status to display contact mail that do not want to be contacted",LOG_DEBUG);
|
||||
$result=$this->db->query($sql);
|
||||
*/
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing_cibles";
|
||||
$sql .= " SET statut=3";
|
||||
$sql .= " WHERE fk_mailing=".$mailing_id." AND email IN (SELECT mu.email FROM ".MAIN_DB_PREFIX."mailing_unsubscribe AS mu WHERE mu.entity IN ('".getEntity('mailing')."'))";
|
||||
|
||||
@ -285,9 +285,9 @@ class modAccounting extends DolibarrModules
|
||||
//'b.doc_type'=>'Doctype',
|
||||
'b.doc_ref'=>'Piece',
|
||||
'b.code_journal'=>'Codejournal',
|
||||
//'b.journal_label'=>'JournalLabel',
|
||||
'b.journal_label'=>'JournalLabel',
|
||||
'b.numero_compte'=>'AccountAccounting',
|
||||
//'b.label_compte'=>'LabelAccount',
|
||||
'b.label_compte'=>'LabelAccount',
|
||||
'b.subledger_account'=>'SubledgerAccount',
|
||||
'b.subledger_label'=>'SubledgerAccountLabel',
|
||||
'b.label_operation'=>'LabelOperation',
|
||||
@ -302,9 +302,9 @@ class modAccounting extends DolibarrModules
|
||||
//'b.doc_type'=>'import',
|
||||
'b.doc_ref'=>'My document ABC',
|
||||
'b.code_journal'=>"VTE",
|
||||
//'b.journal_label'=>"Sale journal",
|
||||
'b.journal_label'=>"Sale journal",
|
||||
'b.numero_compte'=>"707",
|
||||
//'b.label_compte'=>'Product account 707',
|
||||
'b.label_compte'=>'Product account 707',
|
||||
'b.subledger_account'=>'',
|
||||
'b.subledger_label'=>'',
|
||||
'b.label_operation'=>"Sale of ABC",
|
||||
|
||||
@ -329,7 +329,7 @@ class modAdherent extends DolibarrModules
|
||||
'a.datec'=>'DateCreation', 'a.datefin'=>'DateEndSubscription'
|
||||
);
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'adherent' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
|
||||
@ -491,7 +491,7 @@ class modProduct extends DolibarrModules
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit';
|
||||
// Add extra fields
|
||||
$import_extrafield_sample = array();
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0, ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
|
||||
@ -293,7 +293,7 @@ class modProjet extends DolibarrModules
|
||||
$this->import_tables_array[$r] = array('t'=>MAIN_DB_PREFIX.'projet_task', 'extra'=>MAIN_DB_PREFIX.'projet_task_extrafields'); // List of tables to insert into (insert done in same order)
|
||||
$this->import_fields_array[$r] = array('t.fk_projet'=>'ProjectRef*', 't.ref'=>'RefTask*', 't.label'=>'LabelTask*', 't.dateo'=>"DateStart", 't.datee'=>"DateEnd", 't.planned_workload'=>"PlannedWorkload", 't.progress'=>"Progress", 't.note_private'=>"NotePrivate", 't.note_public'=>"NotePublic", 't.datec'=>"DateCreation");
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'projet_task' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
|
||||
@ -156,7 +156,8 @@ class modPropale extends DolibarrModules
|
||||
$this->rights[$r][1] = 'Close commercial proposals'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'cloturer';
|
||||
$this->rights[$r][4] = 'propal_advance';
|
||||
$this->rights[$r][5] = 'close';
|
||||
|
||||
$r++;
|
||||
$this->rights[$r][0] = 27; // id de la permission
|
||||
|
||||
@ -265,7 +265,7 @@ class modResource extends DolibarrModules
|
||||
$this->import_tables_array[$r] = array('r'=>MAIN_DB_PREFIX.'resource', 'extra'=>MAIN_DB_PREFIX.'resource_extrafields'); // List of tables to insert into (insert done in same order)
|
||||
$this->import_fields_array[$r] = array('r.ref'=>"ResourceFormLabel_ref*", 'r.fk_code_type_resource'=>'ResourceTypeCode', 'r.description'=>'ResourceFormLabel_description', 'r.note_private'=>"NotePrivate", 'r.note_public'=>"NotePublic", 'r.asset_number'=>'AssetNumber', 'r.datec'=>'DateCreation');
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'resource' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'resource' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
|
||||
@ -459,7 +459,7 @@ class modService extends DolibarrModules
|
||||
if (!empty($conf->global->PRODUCT_USE_UNITS)) $this->import_fields_array[$r]['p.fk_unit'] = 'Unit';
|
||||
// Add extra fields
|
||||
$import_extrafield_sample = array();
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'product' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'product' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
|
||||
@ -453,7 +453,7 @@ class modSociete extends DolibarrModules
|
||||
);
|
||||
if (!empty($conf->global->PRODUIT_MULTIPRICES)) $this->import_fields_array[$r]['s.price_level'] = 'PriceLevel';
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'societe' AND entity IN (0, ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
@ -602,7 +602,7 @@ class modSociete extends DolibarrModules
|
||||
's.note_public' => "NotePublic"
|
||||
);
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'socpeople' AND entity IN (0, ".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on an old database (during a migration for example)
|
||||
{
|
||||
|
||||
@ -291,7 +291,7 @@ class modUser extends DolibarrModules
|
||||
'u.statut'=>'Status'
|
||||
);
|
||||
// Add extra fields
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'user' AND entity IN (0,".$conf->entity.")";
|
||||
$sql = "SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE type != 'separate' AND elementtype = 'user' AND entity IN (0,".$conf->entity.")";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) // This can fail when class is used on old database (during migration for example)
|
||||
{
|
||||
|
||||
@ -1560,7 +1560,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
|
||||
|
||||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
|
||||
@ -243,6 +243,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
if (!empty($conf->global->MAIN_DOC_USE_OBJECT_THIRDPARTY_NAME))
|
||||
{
|
||||
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)).'-'.$newfiletmp;
|
||||
$newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
|
||||
}
|
||||
if (!empty($conf->global->MAIN_DOC_USE_TIMING))
|
||||
{
|
||||
|
||||
@ -303,6 +303,11 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
|
||||
{
|
||||
$this->error = $result;
|
||||
return -6;
|
||||
} else {
|
||||
$is_dispo = $this->verif_dispo($db, $code, $soc, $type);
|
||||
if ($is_dispo <> 0) {
|
||||
$result = -3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -206,7 +206,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
global $user, $langs, $conf, $mysoc, $hookmanager, $nblines;
|
||||
|
||||
// Get source company
|
||||
if (!is_object($object->thirdparty)) $object->fetch_thirdparty();
|
||||
$object->fetch_thirdparty();
|
||||
if (!is_object($object->thirdparty)) $object->thirdparty = $mysoc; // If fetch_thirdparty fails, object has no socid (specimen)
|
||||
$this->emetteur = $object->thirdparty;
|
||||
if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
|
||||
@ -220,10 +220,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
|
||||
$nblines = count($object->lines);
|
||||
|
||||
if ($conf->fournisseur->facture->dir_output)
|
||||
{
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if ($conf->fournisseur->facture->dir_output) {
|
||||
$deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||
$amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||
$amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
|
||||
@ -275,7 +272,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
||||
$pdf->SetAutoPageBreak(1, 0);
|
||||
|
||||
$heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part
|
||||
$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page
|
||||
if($heightforinfotot > 220) $heightforinfotot = 220;
|
||||
$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page
|
||||
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
|
||||
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS > 0) $heightforfooter += 6;
|
||||
|
||||
|
||||
@ -1235,26 +1235,30 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
// Logo
|
||||
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
|
||||
if ($this->emetteur->logo) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
|
||||
{
|
||||
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
|
||||
}
|
||||
else {
|
||||
$logo = $logodir.'/logos/'.$this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
|
||||
@ -1151,26 +1151,28 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetXY($this->marge_gauche, $posy);
|
||||
|
||||
// Logo
|
||||
$logo = $conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
|
||||
if ($this->emetteur->logo)
|
||||
{
|
||||
if (is_readable($logo))
|
||||
{
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
|
||||
if ($this->emetteur->logo) {
|
||||
$logodir = $conf->mycompany->dir_output;
|
||||
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
|
||||
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
|
||||
$logo = $logodir . '/logos/thumbs/' . $this->emetteur->logo_small;
|
||||
} else {
|
||||
$logo = $logodir . '/logos/' . $this->emetteur->logo;
|
||||
}
|
||||
if (is_readable($logo)) {
|
||||
$height = pdf_getHeightForLogo($logo);
|
||||
$pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
|
||||
} else {
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
else
|
||||
{
|
||||
$pdf->SetTextColor(200, 0, 0);
|
||||
$pdf->SetFont('', 'B', $default_font_size - 2);
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
|
||||
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
|
||||
@ -120,7 +120,7 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel
|
||||
}
|
||||
else
|
||||
{
|
||||
$colspan = 13;
|
||||
$colspan = 14;
|
||||
if (!empty($conf->multicompany->enabled)) $colspan++;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -42,7 +42,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
|
||||
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search = 4; // Search on a multiselect field with sql type = text
|
||||
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
|
||||
elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {
|
||||
$sql .= ' AND ('.$extrafieldsobjectprefix.$tmpkey.' = "'.$db->escape($crit).'")';
|
||||
$sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." = '".$db->escape($crit)."')";
|
||||
continue;
|
||||
}
|
||||
$sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user