Compare commits
273 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fb521667c | ||
|
|
6205913056 | ||
|
|
febf9ccd04 | ||
|
|
776bfabfc4 | ||
|
|
e909d16880 | ||
|
|
45d64e468f | ||
|
|
e224170dc2 | ||
|
|
78ac543dee | ||
|
|
becd3f7d2f | ||
|
|
d9abbfa461 | ||
|
|
530025a346 | ||
|
|
eaffe4d1eb | ||
|
|
25fe861f9b | ||
|
|
ac46d2c918 | ||
|
|
3267c224ff | ||
|
|
d388c0b0a3 | ||
|
|
5e12dcc6b1 | ||
|
|
1a419a6eb6 | ||
|
|
e709c005a0 | ||
|
|
084ab53b4b | ||
|
|
8a7a0b80e2 | ||
|
|
43ce1543d8 | ||
|
|
8152c60878 | ||
|
|
93aa7e208d | ||
|
|
b47ebcca2b | ||
|
|
86e4ca55df | ||
|
|
cb29133a3d | ||
|
|
81cb88721a | ||
|
|
5a1682509b | ||
|
|
4bb1677079 | ||
|
|
6a8e8907ef | ||
|
|
a45ad29e71 | ||
|
|
568faef7f4 | ||
|
|
ee5fdc3239 | ||
|
|
0fe3159a8a | ||
|
|
6662b00575 | ||
|
|
2d1bc90e57 | ||
|
|
94aa98beed | ||
|
|
9f61bd23ce | ||
|
|
07bb83a96d | ||
|
|
d87a1e39a6 | ||
|
|
3432147385 | ||
|
|
2e7cc67f9c | ||
|
|
056f7f826b | ||
|
|
ed0e090d91 | ||
|
|
45b3d623bb | ||
|
|
4f10009113 | ||
|
|
92c624daf0 | ||
|
|
b4827dbe06 | ||
|
|
4fd12e22cb | ||
|
|
e50d32dc00 | ||
|
|
499eb87173 | ||
|
|
650cd2b54f | ||
|
|
9c94ffeea9 | ||
|
|
67d76787eb | ||
|
|
9871dd8770 | ||
|
|
a35173973c | ||
|
|
c3e8aec07c | ||
|
|
2fa3b23cf1 | ||
|
|
f345b5fdb0 | ||
|
|
d109341ebe | ||
|
|
fc9c343af9 | ||
|
|
7ea0af4067 | ||
|
|
2a07ecf659 | ||
|
|
a6fd864145 | ||
|
|
777c297353 | ||
|
|
85a4bac9e0 | ||
|
|
868bfb518b | ||
|
|
c3aba5f1a3 | ||
|
|
0c8331b6d7 | ||
|
|
f2d04fe55c | ||
|
|
9da1d5025b | ||
|
|
9f4aadae18 | ||
|
|
1c105718b9 | ||
|
|
6de31f2c54 | ||
|
|
8921a103c1 | ||
|
|
7377c30bfe | ||
|
|
73422b2149 | ||
|
|
760783b98b | ||
|
|
958fdd5a40 | ||
|
|
091df082fc | ||
|
|
51be0fad99 | ||
|
|
bb72efefc5 | ||
|
|
b847eb1b7e | ||
|
|
7ed3561344 | ||
|
|
156eb7fa61 | ||
|
|
2ba8506608 | ||
|
|
2aee62ea28 | ||
|
|
839929f764 | ||
|
|
12d243b8d4 | ||
|
|
bb84e4a236 | ||
|
|
68a4ab87a2 | ||
|
|
a604fb9afb | ||
|
|
022c67ee68 | ||
|
|
91a922a454 | ||
|
|
7015e71105 | ||
|
|
611b045676 | ||
|
|
23de8694fa | ||
|
|
b9ac8295d4 | ||
|
|
55508e25ec | ||
|
|
219b0d8925 | ||
|
|
8c024b3786 | ||
|
|
3d20766392 | ||
|
|
753da4791e | ||
|
|
fb808d830e | ||
|
|
6c1c008d09 | ||
|
|
37f6aa3395 | ||
|
|
52da21912b | ||
|
|
21dcc549fa | ||
|
|
ac8837d01f | ||
|
|
7f5ccf4b8e | ||
|
|
3e5cd877b8 | ||
|
|
e90234c2bc | ||
|
|
083db12490 | ||
|
|
a06b1b9f3f | ||
|
|
8bf9afb7ca | ||
|
|
a509404636 | ||
|
|
c8fb81710f | ||
|
|
503973cec9 | ||
|
|
c3fa770871 | ||
|
|
68c28ab3c7 | ||
|
|
0b9d27423d | ||
|
|
6cd3d27885 | ||
|
|
55410a55ef | ||
|
|
b787e53020 | ||
|
|
1a66e0b05e | ||
|
|
d9aa816197 | ||
|
|
75be637b0b | ||
|
|
7412335217 | ||
|
|
ae01bd8f07 | ||
|
|
9762d77958 | ||
|
|
03614536f9 | ||
|
|
0d41216624 | ||
|
|
ad3cbd17c2 | ||
|
|
4928a999a0 | ||
|
|
d448998762 | ||
|
|
d6198a1e33 | ||
|
|
2d42afc686 | ||
|
|
9b607a3105 | ||
|
|
64381ac4d6 | ||
|
|
956b46d920 | ||
|
|
7872a93605 | ||
|
|
4ff65ce586 | ||
|
|
d201515514 | ||
|
|
322786cabe | ||
|
|
15e646cc62 | ||
|
|
6ee17022c0 | ||
|
|
2167e7ed98 | ||
|
|
4f356fa412 | ||
|
|
945dd0ae89 | ||
|
|
29d941cb6e | ||
|
|
d2881eb85b | ||
|
|
d0d884742f | ||
|
|
18055bc425 | ||
|
|
46e019642f | ||
|
|
ea62ea8c70 | ||
|
|
5f08a649eb | ||
|
|
e3edb37620 | ||
|
|
4b3430a1dc | ||
|
|
da35e3d7cd | ||
|
|
6d1a571aed | ||
|
|
5d45638248 | ||
|
|
ab33665f7b | ||
|
|
412e0f193b | ||
|
|
34aa64bae2 | ||
|
|
2eaa910336 | ||
|
|
7f9ea2e223 | ||
|
|
de11801792 | ||
|
|
59a099b176 | ||
|
|
fe15871fe3 | ||
|
|
99cfea1ff4 | ||
|
|
61f8771525 | ||
|
|
435edf999b | ||
|
|
13f5decdf7 | ||
|
|
cd295662d6 | ||
|
|
8c3c7fd857 | ||
|
|
d4364dd44e | ||
|
|
5d7e542d37 | ||
|
|
b52e5d51e3 | ||
|
|
cdb6e7f9a6 | ||
|
|
33754f1951 | ||
|
|
24e5b6ab79 | ||
|
|
aa5f35f14f | ||
|
|
0e5d0a7784 | ||
|
|
b0615d477e | ||
|
|
280219843e | ||
|
|
ba1275332d | ||
|
|
0893926189 | ||
|
|
db334a3b94 | ||
|
|
c53be23122 | ||
|
|
9cfe1262bd | ||
|
|
5417dc0356 | ||
|
|
b5c5cc42fc | ||
|
|
6431e8e16d | ||
|
|
26cd418320 | ||
|
|
c97bd14278 | ||
|
|
d22a1e2571 | ||
|
|
b4f31d61fa | ||
|
|
40f75b16d8 | ||
|
|
8ac0383fa0 | ||
|
|
d5877e9c36 | ||
|
|
575e4d11d0 | ||
|
|
d40534e8fa | ||
|
|
3b555797d1 | ||
|
|
536e99e3c9 | ||
|
|
9bf387d43c | ||
|
|
00d5cff00d | ||
|
|
e52788eb75 | ||
|
|
771104bc68 | ||
|
|
345ac28c89 | ||
|
|
7b512587aa | ||
|
|
ad3d21578c | ||
|
|
2da5071642 | ||
|
|
214bf4375e | ||
|
|
24cb1390e4 | ||
|
|
90850c4d31 | ||
|
|
ab9dee631b | ||
|
|
64c53e2e85 | ||
|
|
b53293d84d | ||
|
|
a91f39ea3e | ||
|
|
d3b17f4f2d | ||
|
|
2ac8bd4e16 | ||
|
|
8d79404914 | ||
|
|
e3480780cf | ||
|
|
5233e7d8ad | ||
|
|
23777fd5ff | ||
|
|
abee6dceaa | ||
|
|
f5dd4f4f9e | ||
|
|
edbf8f0186 | ||
|
|
eb70411ae0 | ||
|
|
ea1baefe9a | ||
|
|
a085b79993 | ||
|
|
5d4f702920 | ||
|
|
bb6853a635 | ||
|
|
ab07da02c4 | ||
|
|
cec5666257 | ||
|
|
27e3a2cb1d | ||
|
|
76b3668368 | ||
|
|
544a1237bc | ||
|
|
f946ec0563 | ||
|
|
7b56cbc334 | ||
|
|
bbb62f27c7 | ||
|
|
e0238705cc | ||
|
|
f45abc1b2a | ||
|
|
584549df11 | ||
|
|
697b25aa82 | ||
|
|
56e070cd7f | ||
|
|
3caa1bd43c | ||
|
|
bac1e7133a | ||
|
|
844f0903da | ||
|
|
92c6168247 | ||
|
|
ace9eb9b3e | ||
|
|
e7d01f98cf | ||
|
|
7aac67f79c | ||
|
|
935e84d985 | ||
|
|
fbb8808f29 | ||
|
|
4420af683d | ||
|
|
224b4c147a | ||
|
|
7966bfc2df | ||
|
|
36963423c3 | ||
|
|
9df4f0601d | ||
|
|
7b73e2d57a | ||
|
|
9eb736b110 | ||
|
|
5137104b92 | ||
|
|
00394493eb | ||
|
|
6db7414f88 | ||
|
|
0d3a2f800b | ||
|
|
a12bd6aec8 | ||
|
|
60e85136df | ||
|
|
5f23ba5467 | ||
|
|
c8cb5886f4 | ||
|
|
95417d4c86 | ||
|
|
48419da769 |
72
ChangeLog
@@ -2,8 +2,78 @@
|
||||
English Dolibarr ChangeLog
|
||||
--------------------------------------------------------------
|
||||
|
||||
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
|
||||
***** ChangeLog for 10.0.3 compared to 10.0.2 *****
|
||||
IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card.
|
||||
The unit were not saved correctly in database making calculation on shipments wrong.
|
||||
Update to this version must be done if you use them and have installed version 10.0.0, 10.0.1 or 10.0.2 and set some products after installing or upgrading to one of this version.
|
||||
Once update is done you must then edit (manually) the product that has bad unit to set the correct unit to have features restored.
|
||||
|
||||
FIX: #11702
|
||||
FIX: #11861 No consistent code to manage measuring units
|
||||
FIX: #11942
|
||||
FIX: #12026
|
||||
FIX: #12040
|
||||
FIX: #12041
|
||||
FIX: #12054
|
||||
FIX: #12083
|
||||
FIX: #12088
|
||||
FIX: CVE-2019-17578 CVE-2019-17577 CVE-2019-17576
|
||||
FIX: Clean the + of categories on the product view only in POS module
|
||||
FIX: access to public interface when origin email has an alias.
|
||||
FIX: Alias name is not into the email recipient label.
|
||||
FIX: allow standalone credit note even if no invoice
|
||||
FIX: an admin can not access his own permissions after enabling advanced
|
||||
FIX: an admin can not access his own permissions after enabling advanced permissions
|
||||
FIX: Attachement of linked files on ticket when sending a message
|
||||
FIX: avoid non numeric warning
|
||||
FIX: Bad currency var used in stripe for connect
|
||||
FIX: Bad list of ticket on public interface for ticket emailcollector
|
||||
FIX: Can't modify vendor invoice if transfered into accountancy
|
||||
FIX: change product type must be allowed if we activate hidden conf
|
||||
FIX: colspan on VAT quadri report
|
||||
FIX: CSS
|
||||
FIX: Debug feature orderstoinvoice for suppliers
|
||||
FIX: do not output return code on screen after a select of bank account
|
||||
FIX: Edit of ticket module parameters erased others
|
||||
FIX: empty cache when we want to load specific warehouses in select
|
||||
FIX: escape email alias
|
||||
FIX: expedition.class.php
|
||||
FIX: Export of leave request show the number of open days
|
||||
FIX: Filtering the HTTP Header "Accept-Language".
|
||||
FIX: Filter on project on ticket list
|
||||
FIX: Filter "Open all" of ticket was ko.
|
||||
FIX: Force downlaod of file with .noexe as octet-stream mime type
|
||||
FIX: form not closed.
|
||||
FIX: hidden conf to prevent from changing product_type
|
||||
FIX: If product account not suggested during bind, it is not preselected
|
||||
FIX: If we share invoice, we need to see discount created from a deposit on each entity
|
||||
FIX: Import of product using units
|
||||
FIX: label of thirdparty is wrong on open project list
|
||||
FIX: Look and feel v10
|
||||
FIX: missing begin()
|
||||
FIX: missing "$this->id" in "fetch" function
|
||||
FIX: navigation on ticket tab of projects
|
||||
FIX: new invoice with generic thirdparty in takepos
|
||||
FIX: Pb in units of shipments
|
||||
FIX: regression with option to hide picto on top menu
|
||||
FIX: selection of project i am contact of.
|
||||
FIX: Send email from expense report card.
|
||||
FIX: shipping card: missing user error messages when classifying closed or billed
|
||||
FIX: SQL injection on qty
|
||||
FIX: stripe payment when there is a quote into address
|
||||
FIX: Substitution of __PROJECT_XXX__ not done
|
||||
FIX: TakePOS no invoice validation control and good payment translate
|
||||
FIX: the access of the bank account of one user
|
||||
FIX: top menu right padding
|
||||
FIX: Update of leave request when CSRF with token is on
|
||||
FIX: Var not enough sanitized
|
||||
FIX: wrong test
|
||||
FIX: XSS
|
||||
FIX: Payment from POS ware not recorded.
|
||||
FIX: Can validate invoice with amount including tax of zero for the case of having a final invoice with
|
||||
VAT that includes a deposit without vat.
|
||||
|
||||
***** ChangeLog for 10.0.2 compared to 10.0.1 *****
|
||||
FIX: #10460 compatibility with MariaDB 10.4
|
||||
FIX: #11401 Adherent unknown language key
|
||||
FIX: #11422 Can't edit his own events with standard rights
|
||||
|
||||
BIN
dev/initdemo/documents_demo/adherent/1/photos/person5.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
dev/initdemo/documents_demo/adherent/3/photos/person9.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
BIN
dev/initdemo/documents_demo/adherent/4/photos/person2.jpeg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 9.6 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 143 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
BIN
dev/initdemo/documents_demo/users/10/thumbs/mariecurie_mini.jpg
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
dev/initdemo/documents_demo/users/10/thumbs/mariecurie_small.jpg
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
dev/initdemo/documents_demo/users/11/person4.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
dev/initdemo/documents_demo/users/11/thumbs/person4_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
dev/initdemo/documents_demo/users/11/thumbs/person4_small.jpeg
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
dev/initdemo/documents_demo/users/12/person6.jpeg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
dev/initdemo/documents_demo/users/12/thumbs/person6_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
dev/initdemo/documents_demo/users/12/thumbs/person6_small.jpeg
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
dev/initdemo/documents_demo/users/13/person7.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
dev/initdemo/documents_demo/users/13/thumbs/person7_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
dev/initdemo/documents_demo/users/13/thumbs/person7_small.jpeg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
dev/initdemo/documents_demo/users/14/person3.jpeg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
dev/initdemo/documents_demo/users/14/thumbs/person3_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
dev/initdemo/documents_demo/users/14/thumbs/person3_small.jpeg
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
dev/initdemo/documents_demo/users/16/person1.jpeg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
dev/initdemo/documents_demo/users/16/thumbs/person1_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
dev/initdemo/documents_demo/users/16/thumbs/person1_small.jpeg
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
dev/initdemo/documents_demo/users/17/person5.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
dev/initdemo/documents_demo/users/17/thumbs/person5_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
dev/initdemo/documents_demo/users/17/thumbs/person5_small.jpeg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
BIN
dev/initdemo/documents_demo/users/19/person2.jpeg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
dev/initdemo/documents_demo/users/19/thumbs/person2_mini.jpeg
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
dev/initdemo/documents_demo/users/19/thumbs/person2_small.jpeg
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
BIN
dev/initdemo/documents_demo/users/2/person9.jpeg
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
BIN
dev/initdemo/documents_demo/users/2/thumbs/person9_mini.jpeg
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
dev/initdemo/documents_demo/users/2/thumbs/person9_small.jpeg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
dev/initdemo/documents_demo/users/3/pierrecurie.jpg
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
dev/initdemo/documents_demo/users/3/thumbs/pierrecurie_mini.jpg
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
dev/initdemo/documents_demo/users/3/thumbs/pierrecurie_small.jpg
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
dev/initdemo/documents_demo/users/4/person8.jpeg
Normal file
|
After Width: | Height: | Size: 991 KiB |
BIN
dev/initdemo/documents_demo/users/4/thumbs/person8_mini.jpeg
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
dev/initdemo/documents_demo/users/4/thumbs/person8_small.jpeg
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
@@ -50,7 +50,7 @@ fi
|
||||
# ----------------------------- if no params on command line
|
||||
if [ "x$passwd" = "x" ]
|
||||
then
|
||||
export dumpfile=`ls $mydir/mysqldump_dolibarr_*.sql | sort | tail -n 1`
|
||||
export dumpfile=`ls -v $mydir/mysqldump_dolibarr_*.sql | tail -n 1`
|
||||
export dumpfile=`basename $dumpfile`
|
||||
|
||||
# ----------------------------- input file
|
||||
|
||||
@@ -38,7 +38,7 @@ passwd=$5;
|
||||
# ----------------------------- if no params on command line
|
||||
if [ "x$passwd" = "x" ]
|
||||
then
|
||||
export dumpfile=`ls $mydir/mysqldump_dolibarr_*.sql | sort | tail -n 1`
|
||||
export dumpfile=`ls -v $mydir/mysqldump_dolibarr_*.sql | tail -n 1`
|
||||
export dumpfile=`basename $dumpfile`
|
||||
|
||||
# ----------------------------- input file
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
@@ -65,6 +66,8 @@ $year_current = $year_start;
|
||||
// Validate History
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@@ -102,7 +105,7 @@ if ($action == 'validatehistory') {
|
||||
$db->begin();
|
||||
|
||||
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
||||
if ($db->type == 'pgsql') {
|
||||
/*if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
@@ -115,16 +118,83 @@ if ($action == 'validatehistory') {
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
}
|
||||
}*/
|
||||
|
||||
// Customer Invoice lines (must be same request than into page list.php for manual binding)
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||
$sql.= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||
$sql.= " co.code as country_code, co.label as country_label,";
|
||||
$sql.= " s.tva_intra";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
|
||||
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND l.product_type <= 2";
|
||||
|
||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
$result = $db->query($sql);
|
||||
if (! $result) {
|
||||
$error++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
} else {
|
||||
$num_lines = $db->num_rows($result);
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
// Search suggested account for product/service
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
$objp->code_sell_p = $objp->code_sell_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
$suggestedaccountingaccountfor = 'eec';
|
||||
} else { // Foreign sale
|
||||
$objp->code_sell_p = $objp->code_sell_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
$suggestedaccountingaccountfor = 'export';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0)
|
||||
{
|
||||
$sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
|
||||
$sqlupdate.= " SET fk_code_ventilation = ".$objp->aarowid_suggest;
|
||||
$sqlupdate.= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid;
|
||||
|
||||
$resqlupdate = $db->query($sqlupdate);
|
||||
if (! $resqlupdate)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
else {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
||||
}
|
||||
|
||||
@@ -370,6 +370,7 @@ if ($result) {
|
||||
// Ref Invoice
|
||||
print '<td class="nowraponall">' . $facture_static->getNomUrl(1) . '</td>';
|
||||
|
||||
// Date invoice
|
||||
print '<td class="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
// Ref Product
|
||||
@@ -389,7 +390,13 @@ if ($result) {
|
||||
|
||||
print '<td class="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')</td>';
|
||||
// Country
|
||||
print '<td>';
|
||||
if ($objp->country_code)
|
||||
{
|
||||
print $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
|
||||
@@ -221,9 +221,9 @@ $sql.= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
|
||||
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND l.product_type <= 2";
|
||||
// Add search filter like
|
||||
@@ -249,7 +249,7 @@ if (strlen(trim($search_account))) {
|
||||
$sql .= natural_search("aa.account_number", $search_account);
|
||||
}
|
||||
if (strlen(trim($search_vat))) {
|
||||
$sql .= natural_search("l.tva_tx", $search_vat, 1);
|
||||
$sql .= natural_search("l.tva_tx", price2num($search_vat), 1);
|
||||
}
|
||||
if ($search_month > 0)
|
||||
{
|
||||
@@ -420,12 +420,11 @@ if ($result) {
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
while ( $i < min($num_lines, $limit) ) {
|
||||
while ($i < min($num_lines, $limit)) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$objp->code_sell_l = '';
|
||||
$objp->code_sell_p = '';
|
||||
$objp->aarowid_suggest = '';
|
||||
|
||||
$product_static->ref = $objp->product_ref;
|
||||
$product_static->id = $objp->product_id;
|
||||
@@ -437,7 +436,7 @@ if ($result) {
|
||||
$facture_static->type = $objp->ftype;
|
||||
|
||||
$code_sell_p_notset = '';
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$objp->aarowid_suggest = ''; // Will be set later
|
||||
|
||||
$isBuyerInEEC = isInEEC($objp);
|
||||
|
||||
@@ -471,8 +470,9 @@ if ($result) {
|
||||
}
|
||||
if ($objp->code_sell_l == -1) $objp->code_sell_l='';
|
||||
|
||||
// Search suggested account for product/service
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if ($objp->country_code == $mysoc->country_code || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
@@ -532,6 +532,7 @@ if ($result) {
|
||||
print vatrate($objp->tva_tx_line.($objp->vat_src_code?' ('.$objp->vat_src_code.')':''));
|
||||
print '</td>';
|
||||
|
||||
// Country
|
||||
print '<td>';
|
||||
$labelcountry=($objp->country_code && ($langs->trans("Country".$objp->country_code)!="Country".$objp->country_code))?$langs->trans("Country".$objp->country_code):$objp->country_label;
|
||||
print $labelcountry;
|
||||
@@ -561,12 +562,19 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
$suggestedid = $objp->aarowid_suggest;
|
||||
if (empty($suggestedid) && empty($objp->code_sell_p) && ! empty($objp->code_sell_l) && ! empty($conf->global->ACCOUNTANCY_AUTOFILL_ACCOUNT_WITH_GENERIC))
|
||||
{
|
||||
//$suggestedid = // id of $objp->code_sell_l
|
||||
}
|
||||
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||
//var_dump($objp->aarowid);var_dump($objp->aarowid_intra);var_dump($objp->aarowid_export);var_dump($objp->aarowid_suggest);
|
||||
$ischecked = $objp->aarowid_suggest;
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($ischecked ? "checked" : "") . '/>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2019 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
|
||||
@@ -50,6 +51,7 @@ $hookmanager->initHooks(array('accountancyindex'));
|
||||
llxHeader('', $langs->trans("AccountancyArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy');
|
||||
//dol_fiche_head();
|
||||
|
||||
$step = 0;
|
||||
|
||||
@@ -175,6 +177,7 @@ else
|
||||
{
|
||||
print $langs->trans("Module10Desc")."<br>\n";
|
||||
}
|
||||
//dol_fiche_end();
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
* 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-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.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
|
||||
@@ -387,7 +387,9 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["paymentvariousid"] = $paymentvariousstatic->id;
|
||||
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
||||
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
||||
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
||||
$account_subledger = (! empty($paymentvariousstatic->subledger_account) ? $paymentvariousstatic->subledger_account : ''); // NotDefined is a reserved word
|
||||
$tabpay[$obj->rowid]["account_various"] = $account_various;
|
||||
$tabtp[$obj->rowid][$account_subledger] += $obj->amount;
|
||||
} elseif ($links[$key]['type'] == 'payment_loan') {
|
||||
$paymentloanstatic->id = $links[$key]['url_id'];
|
||||
$paymentloanstatic->ref = $links[$key]['url_id'];
|
||||
@@ -660,11 +662,11 @@ if (! $error && $action == 'writebookkeeping') {
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} elseif ($tabtype[$key] == 'payment_various') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->subledger_account = $k;
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
$bookkeeping->numero_compte = $tabpay[$obj->rowid]["account_various"];
|
||||
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$accountingaccount->fetch(null, $bookkeeping->numero_compte, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} elseif ($tabtype[$key] == 'banktransfert') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
@@ -1123,6 +1125,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($tabtype[$key] == 'payment_salary') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
|
||||
if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
|
||||
if ($tabtype[$key] == 'payment_various') $account_ledger = $tabpay[$key]["account_various"];
|
||||
$accounttoshow = length_accounta($account_ledger);
|
||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||
{
|
||||
@@ -1156,7 +1159,7 @@ if (empty($action) || $action == 'view') {
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
|
||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary'))) // Type of payment with subledger
|
||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) // Type of payment with subledger
|
||||
{
|
||||
$accounttoshowsubledger = length_accounta($k);
|
||||
if ($accounttoshow != $accounttoshowsubledger)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
@@ -63,6 +64,7 @@ $year_current = $year_start;
|
||||
// Validate History
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
|
||||
|
||||
|
||||
/*
|
||||
@@ -100,7 +102,7 @@ if ($action == 'validatehistory') {
|
||||
$db->begin();
|
||||
|
||||
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
|
||||
if ($db->type == 'pgsql') {
|
||||
/*if ($db->type == 'pgsql') {
|
||||
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
|
||||
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
|
||||
@@ -113,16 +115,85 @@ if ($action == 'validatehistory') {
|
||||
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
|
||||
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
|
||||
$sql1 .= " AND fd.fk_code_ventilation = 0";
|
||||
}
|
||||
}*/
|
||||
|
||||
// Supplier Invoice Lines (must be same request than into page list.php for manual binding)
|
||||
$sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
$sql.= " co.code as country_code, co.label as country_label,";
|
||||
$sql.= " s.tva_intra";
|
||||
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
|
||||
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND l.product_type <= 2";
|
||||
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php');
|
||||
|
||||
$resql1 = $db->query($sql1);
|
||||
if (! $resql1) {
|
||||
$error ++;
|
||||
$db->rollback();
|
||||
$result = $db->query($sql);
|
||||
if (! $result) {
|
||||
$error++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
} else {
|
||||
$num_lines = $db->num_rows($result);
|
||||
|
||||
$isSellerInEEC = isInEEC($mysoc);
|
||||
|
||||
$i = 0;
|
||||
while ($i < min($num_lines, 10000)) { // No more than 10000 at once
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
// Search suggested account for product/service
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (($objp->country_code == $mysoc->country_code) || empty($objp->country_code)) { // If buyer in same country than seller (if not defined, we assume it is same country)
|
||||
$objp->code_buy_p = $objp->code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
} else {
|
||||
if ($isSellerInEEC && $isBuyerInEEC) { // European intravat sale
|
||||
//$objp->code_buy_p = $objp->code_buy_intra;
|
||||
$objp->code_buy_p = $objp->code_buy;
|
||||
//$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = 'eec';
|
||||
} else { // Foreign sale
|
||||
//$objp->code_buy_p = $objp->code_buy_export;
|
||||
$objp->code_buy_p = $objp->code_buy;
|
||||
//$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
$suggestedaccountingaccountfor = 'export';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0)
|
||||
{
|
||||
$sqlupdate = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
|
||||
$sqlupdate.= " SET fk_code_ventilation = ".$objp->aarowid_suggest;
|
||||
$sqlupdate.= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".$objp->rowid;
|
||||
|
||||
$resqlupdate = $db->query($sqlupdate);
|
||||
if (! $resqlupdate)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($error)
|
||||
{
|
||||
$db->rollback();
|
||||
}
|
||||
else {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
|
||||
}
|
||||
|
||||
@@ -380,6 +380,7 @@ if ($result) {
|
||||
print $objp->invoice_label;
|
||||
print '</td>';
|
||||
|
||||
// Date invoice
|
||||
print '<td class="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
// Ref product
|
||||
@@ -400,7 +401,12 @@ if ($result) {
|
||||
|
||||
print '<td class="right">' . vatrate($objp->tva_tx.($objp->vat_src_code?' ('.$objp->vat_src_code.')':'')) . '</td>';
|
||||
|
||||
print '<td>' . $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')</td>';
|
||||
print '<td>';
|
||||
if ($objp->country_code)
|
||||
{
|
||||
print $langs->trans("Country".$objp->country_code) .' ('.$objp->country_code.')';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td>' . $objp->tva_intra . '</td>';
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
|
||||
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql.= " AND l.product_type <= 2";
|
||||
// Add search filter like
|
||||
@@ -321,8 +321,8 @@ if ($result) {
|
||||
$arrayofselected=is_array($toselect)?$toselect:array();
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
if ($search_lineid) $param.='&search_lineid='.urlencode($search_lineid);
|
||||
if ($search_day) $param.='&search_day='.urlencode($search_day);
|
||||
if ($search_month) $param.='&search_month='.urlencode($search_month);
|
||||
@@ -477,7 +477,7 @@ if ($result) {
|
||||
|
||||
print '<td class="center">' . dol_print_date($db->jdate($objp->datef), 'day') . '</td>';
|
||||
|
||||
// Ref product
|
||||
// Ref Product
|
||||
print '<td>';
|
||||
if ($product_static->id > 0)
|
||||
print $product_static->getNomUrl(1);
|
||||
@@ -485,7 +485,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Description
|
||||
print '<td>';
|
||||
print '<td class="tdoverflowonsmartphone">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description));
|
||||
$trunclength = empty($conf->global->ACCOUNTING_LENGTH_DESCRIPTION) ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
@@ -533,12 +533,14 @@ if ($result) {
|
||||
|
||||
// Suggested accounting account
|
||||
print '<td>';
|
||||
print $formaccounting->select_account($objp->aarowid_suggest, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
$suggestedid = $objp->aarowid_suggest;
|
||||
print $formaccounting->select_account($suggestedid, 'codeventil'.$objp->rowid, 1, array(), 0, 0, 'codeventil maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone');
|
||||
print '</td>';
|
||||
|
||||
// Column with checkbox
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
|
||||
$ischecked = $objp->aarowid_suggest;
|
||||
print '<input type="checkbox" class="flat checkforselect checkforselect'.$objp->rowid.'" name="toselect[]" value="' . $objp->rowid . "_" . $i . '"' . ($ischecked ? "checked" : "") . '/>';
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@@ -563,7 +563,7 @@ if ($id == 11)
|
||||
'project' => $langs->trans('Project'),
|
||||
'project_task' => $langs->trans('Task'),
|
||||
'agenda' => $langs->trans('Agenda'),
|
||||
'resource' => $langs->trans('Resource'),
|
||||
'dolresource' => $langs->trans('Resource'),
|
||||
// old deprecated
|
||||
'propal' => $langs->trans('Proposal'),
|
||||
'commande' => $langs->trans('Order'),
|
||||
|
||||
@@ -116,7 +116,7 @@ if (empty($reshook))
|
||||
if (GETPOST('addfilter', 'alpha'))
|
||||
{
|
||||
$emailcollectorfilter = new EmailCollectorFilter($db);
|
||||
$emailcollectorfilter->type = GETPOST('filtertype', 'az09');
|
||||
$emailcollectorfilter->type = GETPOST('filtertype', 'aZ09');
|
||||
$emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha');
|
||||
$emailcollectorfilter->fk_emailcollector = $object->id;
|
||||
$emailcollectorfilter->status = 1;
|
||||
@@ -150,7 +150,7 @@ if ($action == 'deletefilter')
|
||||
if (GETPOST('addoperation', 'alpha'))
|
||||
{
|
||||
$emailcollectoroperation = new EmailCollectorAction($db);
|
||||
$emailcollectoroperation->type = GETPOST('operationtype', 'az09');
|
||||
$emailcollectoroperation->type = GETPOST('operationtype', 'aZ09');
|
||||
$emailcollectoroperation->actionparam = GETPOST('operationparam', 'none');
|
||||
$emailcollectoroperation->fk_emailcollector = $object->id;
|
||||
$emailcollectoroperation->status = 1;
|
||||
|
||||
@@ -808,36 +808,39 @@ print '</table>';
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("PathToDocuments"), '', '');
|
||||
|
||||
print '<table class="noborder" width="100%">'."\n";
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>'."\n";
|
||||
print '<td>'.$langs->trans("Value").'</td>'."\n";
|
||||
print "</tr>\n";
|
||||
print '<tr '.$bc[false].'>'."\n";
|
||||
print '<tr class="oddeven">'."\n";
|
||||
print '<td width="140">'.$langs->trans("PathDirectory").'</td>'."\n";
|
||||
print '<td>'.$conf->facture->dir_output.'</td>'."\n";
|
||||
print '</tr>'."\n";
|
||||
print "</table>\n";
|
||||
|
||||
print "</div>\n";
|
||||
|
||||
/*
|
||||
* Notifications
|
||||
*/
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("Notifications"), '', '');
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td class="center" width="60"></td>';
|
||||
print '<td width="80"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
|
||||
print '</td><td class="right">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print "</div>\n";
|
||||
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
|
||||
@@ -65,27 +65,27 @@ complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||
|
||||
if ($action == 'update' && empty($_POST["cancel"]))
|
||||
{
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
// Send mode parameters
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW", 'none'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
// Content parameters
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE', 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
@@ -101,8 +101,8 @@ $mode='emailfortest';
|
||||
$trackid=(($action == 'testhtml')?"testhtml":"test");
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
|
||||
if ($action == 'presend' && GETPOST('trackid') == 'test') $action='test';
|
||||
if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtml';
|
||||
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'test') $action='test';
|
||||
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') $action='testhtml';
|
||||
|
||||
|
||||
|
||||
@@ -823,7 +823,7 @@ else
|
||||
$formmail->frommail = (isset($_POST['frommail'])?$_POST['frommail']:$conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||
$formmail->fromid=$user->id;
|
||||
$formmail->fromalsorobot=1;
|
||||
$formmail->fromtype=(GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||
$formmail->fromtype=(GETPOSTISSET('fromtype')?GETPOST('fromtype', 'aZ09'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user'));
|
||||
$formmail->withfromreadonly=1;
|
||||
$formmail->withsubstit=1;
|
||||
$formmail->withfrom=1;
|
||||
@@ -849,7 +849,7 @@ else
|
||||
$formmail->param["returnurl"]=$_SERVER["PHP_SELF"];
|
||||
|
||||
// Init list of files
|
||||
if (GETPOST("mode")=='init')
|
||||
if (GETPOST("mode", "aZ09")=='init')
|
||||
{
|
||||
$formmail->clear_attached_files();
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmatio
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'alpha');
|
||||
$search_label=GETPOST('search_label', 'alpha');
|
||||
$search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)'
|
||||
$search_type_template=GETPOST('search_type_template', 'alpha');
|
||||
$search_lang=GETPOST('search_lang', 'alpha');
|
||||
$search_fk_user=GETPOST('search_fk_user', 'intcomma');
|
||||
@@ -263,6 +263,7 @@ if (empty($reshook))
|
||||
{
|
||||
//var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value);
|
||||
$keycode=$listfieldvalue[$i];
|
||||
if ($value == 'label') $_POST[$keycode] = dol_escape_htmltag($_POST[$keycode]);
|
||||
if ($value == 'lang') $keycode='langcode';
|
||||
if ($value == 'entity') $_POST[$keycode] = $conf->entity;
|
||||
if ($i) $sql.=",";
|
||||
@@ -667,8 +668,6 @@ if ($resql)
|
||||
print '<tr class="liste_titre">';
|
||||
foreach ($fieldlist as $field => $value)
|
||||
{
|
||||
// Determine le nom du champ par rapport aux noms possibles
|
||||
// dans les dictionnaires de donnees
|
||||
$showfield=1; // By defaut
|
||||
$align="left";
|
||||
$sortable=1;
|
||||
@@ -695,7 +694,7 @@ if ($resql)
|
||||
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
|
||||
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
|
||||
|
||||
// Affiche nom du champ
|
||||
// Show fields
|
||||
if ($showfield)
|
||||
{
|
||||
if (! empty($tabhelp[$id][$value]))
|
||||
@@ -813,6 +812,10 @@ if ($resql)
|
||||
$showfield=1;
|
||||
$align="left";
|
||||
$valuetoshow=$obj->{$fieldlist[$field]};
|
||||
if ($value == 'label' || $value == 'topic')
|
||||
{
|
||||
$valuetoshow = dol_escape_htmltag($valuetoshow);
|
||||
}
|
||||
if ($value == 'type_template')
|
||||
{
|
||||
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
||||
|
||||
@@ -170,9 +170,23 @@ elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
||||
|
||||
if ($action == 'maj_pattern')
|
||||
{
|
||||
dolibarr_set_const($db, "USER_PASSWORD_PATTERN", GETPOST("pattern"), 'chaine', 0, '', $conf->entity);
|
||||
header("Location: security.php");
|
||||
exit;
|
||||
$pattern = GETPOST("pattern");
|
||||
$explodePattern = explode(';', $pattern);
|
||||
|
||||
$patternInError = false;
|
||||
if ($explodePattern[0] < 1 || $explodePattern[4] < 0) {
|
||||
$patternInError = true;
|
||||
}
|
||||
|
||||
if ($explodePattern[0] < $explodePattern[1] + $explodePattern[2] + $explodePattern[3]) {
|
||||
$patternInError = true;
|
||||
}
|
||||
|
||||
if (!$patternInError) {
|
||||
dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity);
|
||||
header("Location: security.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -278,13 +292,6 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
|
||||
|
||||
|
||||
$tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
|
||||
/*$this->length2 = $tabConf[0];
|
||||
$this->NbMaj = $tabConf[1];
|
||||
$this->NbNum = $tabConf[2];
|
||||
$this->NbSpe = $tabConf[3];
|
||||
$this->NbRepeat = $tabConf[4];
|
||||
$this->WithoutAmbi = $tabConf[5];
|
||||
*/
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
@@ -350,6 +357,13 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso"){
|
||||
print ' }';
|
||||
|
||||
print ' function valuePossible(){';
|
||||
print ' var fields = ["#minlenght", "#NbMajMin", "#NbNumMin", "#NbSpeMin", "#NbIteConsecutive"];';
|
||||
print ' for(var i = 0 ; i < fields.length ; i++){';
|
||||
print ' if($(fields[i]).val() < $(fields[i]).attr("min")){';
|
||||
print ' return false;';
|
||||
print ' }';
|
||||
print ' }';
|
||||
print ' ';
|
||||
print ' var length = parseInt($("#minlenght").val());';
|
||||
print ' var length_mini = parseInt($("#NbMajMin").val()) + parseInt($("#NbNumMin").val()) + parseInt($("#NbSpeMin").val());';
|
||||
print ' return length >= length_mini;';
|
||||
|
||||
@@ -160,7 +160,6 @@ print '<ul>';
|
||||
|
||||
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
|
||||
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
|
||||
print '<li><a href="https://plus.google.com/+DolibarrOrg" target="_blank" rel="external">Google Plus page</a></li>';
|
||||
|
||||
print '</ul>';
|
||||
|
||||
|
||||
@@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'ticket';
|
||||
|
||||
$error = 0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstticket = GETPOST('maskconstticket', 'alpha');
|
||||
$maskticket = GETPOST('maskticket', 'alpha');
|
||||
@@ -91,7 +97,7 @@ if ($action == 'updateMask') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
|
||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'restricthtml');
|
||||
if (!empty($mail_intro)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
@@ -101,7 +107,7 @@ if ($action == 'updateMask') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
|
||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'restricthtml');
|
||||
if (!empty($mail_signature)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
@@ -110,16 +116,6 @@ if ($action == 'updateMask') {
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
|
||||
if (!empty($text_help)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setvarother') {
|
||||
|
||||
@@ -42,6 +42,12 @@ $label = GETPOST('label', 'alpha');
|
||||
$scandir = GETPOST('scandir', 'alpha');
|
||||
$type = 'ticket';
|
||||
|
||||
$error = 0;
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
||||
{
|
||||
if (GETPOST('value')) dolibarr_set_const($db, 'TICKET_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
||||
@@ -51,95 +57,54 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE')
|
||||
if ($action == 'setvar') {
|
||||
include_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
|
||||
|
||||
$notification_email = GETPOST('TICKET_NOTIFICATION_EMAIL_FROM', 'alpha');
|
||||
if (!empty($notification_email)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', $notification_email, 'chaine', 0, '', $conf->entity);
|
||||
$topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'nohtml');
|
||||
if (!empty($topic_interface)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_FROM', '', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
// altairis : differentiate notification email FROM and TO
|
||||
$notification_email_to = GETPOST('TICKET_NOTIFICATION_EMAIL_TO', 'alpha');
|
||||
if (!empty($notification_email_to)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', $notification_email_to, 'chaine', 0, '', $conf->entity);
|
||||
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'restricthtml');
|
||||
if (!empty($text_home)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_EMAIL_TO', '', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'alpha');
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'restricthtml');
|
||||
if (!empty($text_help)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_new_ticket = GETPOST('TICKET_MESSAGE_MAIL_NEW', 'restricthtml');
|
||||
if (!empty($mail_new_ticket)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $mail_new_ticket, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_NEW', $langs->trans('TicketMessageMailNewText'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_intro = GETPOST('TICKET_MESSAGE_MAIL_INTRO', 'alpha');
|
||||
if (!empty($mail_intro)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $mail_intro, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_INTRO', $langs->trans('TicketMessageMailIntroText'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$mail_signature = GETPOST('TICKET_MESSAGE_MAIL_SIGNATURE', 'alpha');
|
||||
if (!empty($mail_signature)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $mail_signature, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_MESSAGE_MAIL_SIGNATURE', $langs->trans('TicketMessageMailSignatureText'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
|
||||
$url_interface = GETPOST('TICKET_URL_PUBLIC_INTERFACE', 'alpha');
|
||||
if (!empty($url_interface)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', $url_interface, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
|
||||
$res = dolibarr_set_const($db, 'TICKET_URL_PUBLIC_INTERFACE', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$topic_interface = GETPOST('TICKET_PUBLIC_INTERFACE_TOPIC', 'alpha');
|
||||
if (!empty($topic_interface)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', $topic_interface, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_INTERFACE_TOPIC', '', 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$text_home = GETPOST('TICKET_PUBLIC_TEXT_HOME', 'alpha');
|
||||
if (!empty($text_home)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $text_home, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HOME', $langs->trans('TicketPublicInterfaceTextHome'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$text_help = GETPOST('TICKET_PUBLIC_TEXT_HELP_MESSAGE', 'alpha');
|
||||
if (!empty($text_help)) {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $text_help, 'chaine', 0, '', $conf->entity);
|
||||
} else {
|
||||
$res = dolibarr_set_const($db, 'TICKET_PUBLIC_TEXT_HELP_MESSAGE', $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,14 +127,11 @@ if ($action == 'setvarother') {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
$param_show_module_logo = GETPOST('TICKET_SHOW_MODULE_LOGO', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_MODULE_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
$param_show_module_logo = GETPOST('TICKET_SHOW_COMPANY_LOGO', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_SHOW_COMPANY_LOGO', $param_show_module_logo, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
||||
{
|
||||
@@ -179,12 +141,6 @@ if ($action == 'setvarother') {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$param_limit_view = GETPOST('TICKET_LIMIT_VIEW_ASSIGNED_ONLY', 'alpha');
|
||||
$res = dolibarr_set_const($db, 'TICKET_LIMIT_VIEW_ASSIGNED_ONLY', $param_limit_view, 'chaine', 0, '', $conf->entity);
|
||||
if (!$res > 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -238,8 +194,7 @@ print '<br><br>';
|
||||
|
||||
if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
{
|
||||
|
||||
if (!$conf->use_javascript_ajax) {
|
||||
if (empty($conf->use_javascript_ajax)) {
|
||||
print '<form method="post" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data" >';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="setvarother">';
|
||||
@@ -349,16 +304,6 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Url public interface
|
||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||
print '<tr><td>' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . '</label>';
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="' . $conf->global->TICKET_URL_PUBLIC_INTERFACE . '" size="40" ></td>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
// Interface topic
|
||||
$url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC;
|
||||
print '<tr><td>' . $langs->trans("TicketPublicInterfaceTopicLabelAdmin") . '</label>';
|
||||
@@ -420,6 +365,16 @@ if (! empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE))
|
||||
print $form->textwithpicto('', $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
// Url public interface
|
||||
$url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
|
||||
print '<tr><td>' . $langs->trans("TicketUrlPublicInterfaceLabelAdmin") . '</label>';
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="TICKET_URL_PUBLIC_INTERFACE" value="' . $conf->global->TICKET_URL_PUBLIC_INTERFACE . '" size="40" ></td>';
|
||||
print '</td>';
|
||||
print '<td align="center">';
|
||||
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center"><input type="submit" class="button" value="' . $langs->trans("Save") . '"></div>';
|
||||
|
||||
@@ -1048,6 +1048,7 @@ class BlockedLog
|
||||
if (empty($conf->global->BLOCKEDLOG_ENTITY_FINGERPRINT)) { // creation of a unique fingerprint
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
|
||||
$fingerprint = dol_hash(print_r($mysoc, true).getRandomPassword(1), '5');
|
||||
|
||||
@@ -302,7 +302,7 @@ class Boms extends DolibarrApi
|
||||
private function _validate($data)
|
||||
{
|
||||
$myobject = array();
|
||||
foreach ($this->myobject->fields as $field => $propfield) {
|
||||
foreach ($this->bom->fields as $field => $propfield) {
|
||||
if (in_array($field, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat')) || $propfield['notnull'] != 1) continue; // Not a mandatory field
|
||||
if (!isset($data[$field]))
|
||||
throw new RestException(400, "$field field missing");
|
||||
|
||||
@@ -100,14 +100,15 @@ if ($nolinesbefore) {
|
||||
$filtertype='';
|
||||
if (! empty($object->element) && $object->element == 'contrat' && empty($conf->global->CONTRACT_SUPPORT_PRODUCTS)) $filtertype='1';
|
||||
|
||||
$statustoshow = -1;
|
||||
if (! empty($conf->global->ENTREPOT_EXTRA_STATUS))
|
||||
{
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
|
||||
echo '</span>';
|
||||
|
||||
@@ -96,11 +96,11 @@ else
|
||||
|
||||
<tr>
|
||||
<td class="label1"><?php echo $langs->trans("Login"); ?></td>
|
||||
<td><input name="txtUsername" class="texte_login" type="text" value="<?php echo $usertxt; ?>" /></td>
|
||||
<td><input name="txtUsername" class="texte_login maxwidth150onsmartphoneimp" type="text" value="<?php echo $usertxt; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label1"><?php echo $langs->trans("Password"); ?></td>
|
||||
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
|
||||
<td><input name="pwdPassword" class="texte_login maxwidth150onsmartphoneimp" type="password" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
@@ -157,7 +157,7 @@ print '<td class="label1">'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||
print '<td>';
|
||||
$defaultknown=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && $conf->global->CASHDESK_ID_BANKACCOUNT_CASH > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
|
||||
print $form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2));
|
||||
$form->select_comptes(((GETPOST('bankid_cash') > 0)?GETPOST('bankid_cash'):$conf->global->CASHDESK_ID_BANKACCOUNT_CASH), 'CASHDESK_ID_BANKACCOUNT_CASH', 0, "courant=2", ($defaultknown?0:2));
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -166,7 +166,7 @@ print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCheque").'</td>
|
||||
print '<td>';
|
||||
$defaultknown=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE) && $conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
|
||||
print $form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2));
|
||||
$form->select_comptes(((GETPOST('bankid_cheque') > 0)?GETPOST('bankid_cheque'):$conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE), 'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0, "courant=1", ($defaultknown?0:2));
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -175,7 +175,7 @@ print '<td class="label1">'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||
print '<td>';
|
||||
$defaultknown=0;
|
||||
if (! empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB) && $conf->global->CASHDESK_ID_BANKACCOUNT_CB > 0) $defaultknown=1; // If a particular stock is defined, we disable choice
|
||||
print $form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2));
|
||||
$form->select_comptes(((GETPOST('bankid_cb') > 0)?GETPOST('bankid_cb'):$conf->global->CASHDESK_ID_BANKACCOUNT_CB), 'CASHDESK_ID_BANKACCOUNT_CB', 0, "courant=1", ($defaultknown?0:2));
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -191,7 +191,7 @@ print "</tr>\n";
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<div align="center"><span class="bouton_login"><input class="button" name="sbmtConnexion" type="submit" value=<?php echo $langs->trans("Connection"); ?> /></span></div>
|
||||
<div align="center"><span class="bouton_login"><input class="button" name="sbmtConnexion" type="submit" value="<?php echo dol_escape_htmltag($langs->trans("Connection")); ?>" /></span></div>
|
||||
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
@@ -842,11 +842,14 @@ class Categorie extends CommonObject
|
||||
if ($type=="contact") {
|
||||
$subcol_name="fk_socpeople";
|
||||
}
|
||||
|
||||
$idoftype = array_search($type, self::$MAP_ID_TO_CODE);
|
||||
|
||||
$sql = "SELECT s.rowid";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as s";
|
||||
$sql.= " , ".MAIN_DB_PREFIX."categorie_".$sub_type." as sub ";
|
||||
$sql.= ' WHERE s.entity IN ('.getEntity('category').')';
|
||||
$sql.= ' AND s.type='.array_search($type, self::$MAP_ID_TO_CODE);
|
||||
$sql.= ' AND s.type='.$idoftype;
|
||||
$sql.= ' AND s.rowid = sub.fk_categorie';
|
||||
$sql.= ' AND sub.'.$subcol_name.' = '.$id;
|
||||
|
||||
@@ -865,7 +868,15 @@ class Categorie extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$sql.= $this->db->plimit($limit + 1, $offset);
|
||||
if ($limit) {
|
||||
if ($page < 0)
|
||||
{
|
||||
$page = 0;
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$sql.= $this->db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
|
||||
@@ -36,7 +36,7 @@ $langs->load("categories");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$label= GETPOST('label', 'alpha');
|
||||
$type = GETPOST('type', 'az09');
|
||||
$type = GETPOST('type', 'aZ09');
|
||||
$action=GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$removeelem = GETPOST('removeelem', 'int');
|
||||
|
||||
@@ -676,7 +676,7 @@ class ActionComm extends CommonObject
|
||||
|
||||
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
|
||||
$this->contactid = $obj->fk_contact; // To have fetch_contact method working
|
||||
$this->fk_project = $obj->fk_project; // To have fetch_project method working
|
||||
$this->fk_project = $obj->fk_project; // To have fetch_projet method working
|
||||
|
||||
$this->societe->id = $obj->fk_soc; // deprecated
|
||||
//$this->contact->id = $obj->fk_contact; // deprecated
|
||||
|
||||
@@ -87,7 +87,7 @@ $week=GETPOST("week", "int")?GETPOST("week", "int"):date("W");
|
||||
$day=GETPOST("day", "int")?GETPOST("day", "int"):date("d");
|
||||
$pid=GETPOST("search_projectid", "int", 3)?GETPOST("search_projectid", "int", 3):GETPOST("projectid", "int", 3);
|
||||
$status=GETPOST("search_status", 'aZ09')?GETPOST("search_status", 'aZ09'):GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
|
||||
$type=GETPOST("search_type", 'az09')?GETPOST("search_type", 'az09'):GETPOST("type", 'az09');
|
||||
$type=GETPOST("search_type", 'aZ09')?GETPOST("search_type", 'aZ09'):GETPOST("type", 'aZ09');
|
||||
$maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
|
||||
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
|
||||
if (GETPOST('search_actioncode', 'array'))
|
||||
|
||||
@@ -338,7 +338,7 @@ if ($object->fetch($id) >= 0)
|
||||
|
||||
print '<div class="tagtd">';
|
||||
if (empty($obj->picto)) $obj->picto='generic';
|
||||
print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj), $obj->picto);
|
||||
print img_object($langs->trans("EmailingTargetSelector").': '.get_class($obj), $obj->picto, 'class="valignmiddle pictomodule"');
|
||||
print ' ';
|
||||
print $obj->getDesc();
|
||||
print '</div>';
|
||||
|
||||
@@ -551,7 +551,7 @@ class Mailing extends CommonObject
|
||||
$result = '';
|
||||
$companylink = '';
|
||||
|
||||
$label = '<u>' . $langs->trans("ShowEmailing") . '</u>';
|
||||
$label = '<u>' . $langs->trans("ShowEMailing") . '</u>';
|
||||
$label.= '<br>';
|
||||
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
|
||||
@@ -570,7 +570,7 @@ class Mailing extends CommonObject
|
||||
{
|
||||
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
|
||||
{
|
||||
$label=$langs->trans("ShowEmailing");
|
||||
$label=$langs->trans("ShowEMailing");
|
||||
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||
}
|
||||
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
|
||||
|
||||
@@ -91,15 +91,13 @@ if ($_socid > 0)
|
||||
|
||||
dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company');
|
||||
|
||||
print '<table width="100%" border="0">';
|
||||
print '<tr><td class="tdtop">';
|
||||
print '<table class="border" width="100%">';
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td colspan="2" width="25%">';
|
||||
print $langs->trans("PriceLevel").'</td><td colspan="2">'.$objsoc->price_level."</td></tr>";
|
||||
print '<tr><td class="titlefieldcreate">';
|
||||
print $langs->trans("PriceLevel").'</td><td>'.$objsoc->price_level."</td></tr>";
|
||||
|
||||
print '<tr><td colspan="2">';
|
||||
print $langs->trans("NewValue").'</td><td colspan="2">';
|
||||
print '<tr><td>';
|
||||
print $langs->trans("NewValue").'</td><td>';
|
||||
print '<select name="price_level" class="flat">';
|
||||
for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++)
|
||||
{
|
||||
@@ -116,12 +114,6 @@ if ($_socid > 0)
|
||||
|
||||
print "</table>";
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||
@@ -157,8 +149,8 @@ if ($_socid > 0)
|
||||
while ($i < $num )
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$tag = !$tag;
|
||||
print '<tr '.$bc[$tag].'>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc), "dayhour").'</td>';
|
||||
print '<td>'.$obj->price_level.' </td>';
|
||||
$userstatic->id=$obj->uid;
|
||||
|
||||