forked from Wavyzz/dolibarr
Compare commits
394 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cc2a74221 | ||
|
|
f7e5898b4a | ||
|
|
94eeaf9ed0 | ||
|
|
876722733a | ||
|
|
74e00c4d80 | ||
|
|
dbf96b8f59 | ||
|
|
e0db9a8ca7 | ||
|
|
b3d5f40f37 | ||
|
|
6830fdca98 | ||
|
|
321933f267 | ||
|
|
73e6663230 | ||
|
|
c5db333af8 | ||
|
|
534e2b1282 | ||
|
|
2c4c48ad6f | ||
|
|
1f1c75adfb | ||
|
|
e4dd020887 | ||
|
|
af407a094a | ||
|
|
56b3f2c011 | ||
|
|
530d3503f5 | ||
|
|
4dd740fe2f | ||
|
|
5c4ab99a9a | ||
|
|
7fd75c793a | ||
|
|
b42a2616bc | ||
|
|
56aafa4660 | ||
|
|
6e9d6b4e49 | ||
|
|
5a2b8ff53c | ||
|
|
f49d332b73 | ||
|
|
46d84f8f11 | ||
|
|
97e21cb775 | ||
|
|
829ff2299e | ||
|
|
c2bee0f937 | ||
|
|
ad467989bf | ||
|
|
de5ad57af4 | ||
|
|
191474a5db | ||
|
|
5b6d5df159 | ||
|
|
196428edf5 | ||
|
|
423391f12d | ||
|
|
e539842c28 | ||
|
|
ae36daefbe | ||
|
|
a1cccc021e | ||
|
|
f7e780fa9e | ||
|
|
94544fb9ae | ||
|
|
24c12df356 | ||
|
|
c6f96a81d1 | ||
|
|
0b594eab59 | ||
|
|
f0151c5a4c | ||
|
|
75cc6bcf75 | ||
|
|
f516660c0f | ||
|
|
73f0159578 | ||
|
|
e33654cc45 | ||
|
|
718adef600 | ||
|
|
8b16eeb554 | ||
|
|
b8f8b6dcde | ||
|
|
78eaeab168 | ||
|
|
7c3356baff | ||
|
|
d0bd1d5d36 | ||
|
|
7acc14903c | ||
|
|
57a8e053b4 | ||
|
|
3dbab863a7 | ||
|
|
be493fcf09 | ||
|
|
5e7c72068d | ||
|
|
2a4517e1bc | ||
|
|
e4da87d31c | ||
|
|
acf8874c6a | ||
|
|
a6c2758ca2 | ||
|
|
adb05ec05b | ||
|
|
fe71c0cb2d | ||
|
|
a814e02d53 | ||
|
|
f28c7bbc6d | ||
|
|
6a944bb6a3 | ||
|
|
47ed731242 | ||
|
|
ab34885a89 | ||
|
|
3d1ddbb923 | ||
|
|
87e8ac51be | ||
|
|
dda248cb57 | ||
|
|
567f7e5365 | ||
|
|
ffd486e3d6 | ||
|
|
45dfb8ca62 | ||
|
|
298e5cee61 | ||
|
|
b7b18e3355 | ||
|
|
b19b624908 | ||
|
|
02f4f6d039 | ||
|
|
ee20704a8a | ||
|
|
56245e2c9a | ||
|
|
0b49d6316e | ||
|
|
a90111cbf3 | ||
|
|
30050b51f0 | ||
|
|
5d7f182f59 | ||
|
|
8775a51cec | ||
|
|
67a1bf2b59 | ||
|
|
8829db7d65 | ||
|
|
4cccaae831 | ||
|
|
f9f95dec42 | ||
|
|
2c42697cae | ||
|
|
f1bb69eecf | ||
|
|
937f1fd3ee | ||
|
|
bef5c2748c | ||
|
|
5840ed8258 | ||
|
|
b69f037dd3 | ||
|
|
1d95720644 | ||
|
|
4096981378 | ||
|
|
3d8722ee69 | ||
|
|
da41c3ffa7 | ||
|
|
f5884999a9 | ||
|
|
87fb00c293 | ||
|
|
4777faf49b | ||
|
|
b5db70342b | ||
|
|
e3c2299c67 | ||
|
|
ff632718fa | ||
|
|
b72794216e | ||
|
|
972a2db3a3 | ||
|
|
5de88f6af1 | ||
|
|
3078e6fa4b | ||
|
|
d2ef56f3f1 | ||
|
|
4e5105c220 | ||
|
|
e19743519b | ||
|
|
78b2e9e4bf | ||
|
|
9c8145eb88 | ||
|
|
696b54c6c3 | ||
|
|
70de814c3c | ||
|
|
5c2af9b7bd | ||
|
|
d6a4b58a68 | ||
|
|
570c228ee1 | ||
|
|
5dc7c9c6e5 | ||
|
|
fcd5e1fb2c | ||
|
|
416a0892d7 | ||
|
|
1c626c01ee | ||
|
|
10ced563b3 | ||
|
|
18cf2f8f8b | ||
|
|
b1401d6566 | ||
|
|
a9e5668ea4 | ||
|
|
bc8e203019 | ||
|
|
5d7414dcc3 | ||
|
|
874db10dbe | ||
|
|
c298bb62ba | ||
|
|
6b3cbc918d | ||
|
|
919b73b4c4 | ||
|
|
7e8b8e9462 | ||
|
|
f9d707ff48 | ||
|
|
ddc480b6c9 | ||
|
|
5c51cb0f29 | ||
|
|
00443dae3a | ||
|
|
0cb7440647 | ||
|
|
a1323756a9 | ||
|
|
c385b86793 | ||
|
|
3932a32399 | ||
|
|
bf2955909a | ||
|
|
8718edc5fd | ||
|
|
321814fae3 | ||
|
|
4a1fbffba3 | ||
|
|
90cb71f341 | ||
|
|
15f187c466 | ||
|
|
94487cf411 | ||
|
|
112b945e6b | ||
|
|
16c7d51abc | ||
|
|
1253b73879 | ||
|
|
5f415478ac | ||
|
|
965011c8bc | ||
|
|
597f5dae15 | ||
|
|
aadf52fe59 | ||
|
|
0d536bff54 | ||
|
|
5144f21c6c | ||
|
|
7dec327995 | ||
|
|
621a7d93fa | ||
|
|
58c18f438c | ||
|
|
803fe68061 | ||
|
|
9a0494bd64 | ||
|
|
e998a4b8a5 | ||
|
|
fb2444c7a3 | ||
|
|
69247afd06 | ||
|
|
9a4240c292 | ||
|
|
45e38efdfa | ||
|
|
b3cdb1f163 | ||
|
|
27243069cb | ||
|
|
86c2ced714 | ||
|
|
537a51b367 | ||
|
|
4cadf0e5a3 | ||
|
|
a40ea9387b | ||
|
|
e4f8b9a4b0 | ||
|
|
5bc51a3439 | ||
|
|
7b72965315 | ||
|
|
c13c15188b | ||
|
|
b47e6e4520 | ||
|
|
0e79cae9d4 | ||
|
|
1ef27913d7 | ||
|
|
fc1c38420c | ||
|
|
8f0738f792 | ||
|
|
71b8ab8336 | ||
|
|
d8f77abf31 | ||
|
|
3029fd0fe1 | ||
|
|
9e67249b98 | ||
|
|
e59a4d510b | ||
|
|
3ef3a038cf | ||
|
|
a9d75b2c91 | ||
|
|
600a10fa16 | ||
|
|
250d29542f | ||
|
|
5bbd8eded9 | ||
|
|
c0d8bce2df | ||
|
|
1624894346 | ||
|
|
3a08a14d56 | ||
|
|
80354cd8d6 | ||
|
|
2d037eb34e | ||
|
|
441a8c4a74 | ||
|
|
ae18178d56 | ||
|
|
972d998f7e | ||
|
|
9ebe704506 | ||
|
|
ffa1102949 | ||
|
|
01c140ecac | ||
|
|
455add4130 | ||
|
|
5ea72c8d56 | ||
|
|
c37c3d1939 | ||
|
|
4382724b86 | ||
|
|
9b47d7e05d | ||
|
|
e52d6db3fd | ||
|
|
60384f6d66 | ||
|
|
970d088510 | ||
|
|
3b56370060 | ||
|
|
25d9969590 | ||
|
|
653bfd5d43 | ||
|
|
8a303fd4d8 | ||
|
|
587484fabb | ||
|
|
1232e25859 | ||
|
|
87c31d0761 | ||
|
|
931531232c | ||
|
|
e299bad2b5 | ||
|
|
6f489c1fbd | ||
|
|
feef5b2eff | ||
|
|
cd0849209c | ||
|
|
2ed446d014 | ||
|
|
10e7fa51fc | ||
|
|
dc51eb0b75 | ||
|
|
baeedd3690 | ||
|
|
f972b15f5f | ||
|
|
f1b348da34 | ||
|
|
572b2fdec7 | ||
|
|
d5f221452e | ||
|
|
0367cee671 | ||
|
|
0291b6f5d7 | ||
|
|
d01796a214 | ||
|
|
47d7ac8031 | ||
|
|
a48c79b68b | ||
|
|
0f23cef46c | ||
|
|
02439bed8b | ||
|
|
4503659cba | ||
|
|
a8f06d78b1 | ||
|
|
148f2e4c00 | ||
|
|
b77edf9f32 | ||
|
|
50c5efc374 | ||
|
|
d658e2cf31 | ||
|
|
e9797538b3 | ||
|
|
ad82909d08 | ||
|
|
6a903b17e6 | ||
|
|
29cbab1647 | ||
|
|
838852619e | ||
|
|
0639bafa6b | ||
|
|
cf5de9d0c8 | ||
|
|
09b824d819 | ||
|
|
2520ee921a | ||
|
|
08fbc21bb1 | ||
|
|
7118c8b39b | ||
|
|
bfcc72b8d8 | ||
|
|
f8b1d0d7ca | ||
|
|
07fd911770 | ||
|
|
2c5e1c17fe | ||
|
|
74378e2c65 | ||
|
|
625213580c | ||
|
|
9e82a8b4e6 | ||
|
|
102179028c | ||
|
|
3645bd8f69 | ||
|
|
1d0e14be62 | ||
|
|
6066b711af | ||
|
|
29e26c2342 | ||
|
|
c9300bae35 | ||
|
|
a439661ac7 | ||
|
|
5c11192c7c | ||
|
|
d4226a038e | ||
|
|
3ddd56a326 | ||
|
|
f2bb51ad02 | ||
|
|
05a5a2b6c5 | ||
|
|
578a58527f | ||
|
|
b09c6533ee | ||
|
|
d004f3a538 | ||
|
|
855550e274 | ||
|
|
8097298c80 | ||
|
|
38dcb0de49 | ||
|
|
aa67a29115 | ||
|
|
75bb161930 | ||
|
|
0ffe106e2c | ||
|
|
02169478d0 | ||
|
|
fa73dbe8e9 | ||
|
|
97fe75f198 | ||
|
|
22bc44620b | ||
|
|
c73c1a577a | ||
|
|
e4a2b5abb3 | ||
|
|
76a113257e | ||
|
|
7e8506e25f | ||
|
|
d9035e5308 | ||
|
|
eb9d26a9e0 | ||
|
|
b6700c70d6 | ||
|
|
aa1207d77a | ||
|
|
1368e6d462 | ||
|
|
321ccce438 | ||
|
|
0a5ded20a3 | ||
|
|
f6119cfee8 | ||
|
|
d78eb4495e | ||
|
|
9b50150fe8 | ||
|
|
05cbf37aca | ||
|
|
c53429dcae | ||
|
|
c67fa41298 | ||
|
|
3690d11ca2 | ||
|
|
7f0ed90652 | ||
|
|
f514400d87 | ||
|
|
0d62bd704e | ||
|
|
386b19d4b1 | ||
|
|
d717757594 | ||
|
|
76df7afa85 | ||
|
|
a3d53b269f | ||
|
|
19eacba248 | ||
|
|
c9d743ac26 | ||
|
|
b4384c13e1 | ||
|
|
bc22f39aa4 | ||
|
|
252ca09717 | ||
|
|
84e13c153d | ||
|
|
5a51850d54 | ||
|
|
f94d140d2a | ||
|
|
9781baa743 | ||
|
|
31f6cd7353 | ||
|
|
a13c0e5462 | ||
|
|
af5a75c39b | ||
|
|
630a063283 | ||
|
|
4c922f073b | ||
|
|
748b3bb2ba | ||
|
|
f51386c59f | ||
|
|
3646b5f5ae | ||
|
|
5234e8fc8f | ||
|
|
b3d58e9510 | ||
|
|
fb254d3287 | ||
|
|
788c20516c | ||
|
|
62c93ddd12 | ||
|
|
e10db62b3a | ||
|
|
23b748aca3 | ||
|
|
4870cd7616 | ||
|
|
0ab4827091 | ||
|
|
c07933729a | ||
|
|
0d08231cd8 | ||
|
|
c09dbe05b3 | ||
|
|
a5472b58d1 | ||
|
|
db2269b9dd | ||
|
|
d9553212ac | ||
|
|
7866fb9dae | ||
|
|
454d054fdf | ||
|
|
a4411c7fe7 | ||
|
|
abe84ef991 | ||
|
|
3ef9fe2c40 | ||
|
|
acc8cca84a | ||
|
|
aebc7b1233 | ||
|
|
a62f5bd5b4 | ||
|
|
1552e7f41f | ||
|
|
8ccda16ef3 | ||
|
|
bd2fe75d08 | ||
|
|
c7aa486d93 | ||
|
|
01b881a0a6 | ||
|
|
5a105b75ec | ||
|
|
43d475aa42 | ||
|
|
c9834117c9 | ||
|
|
32b6766a7d | ||
|
|
a1c7632a50 | ||
|
|
ff6daebee6 | ||
|
|
085fa6902b | ||
|
|
609cc1dd70 | ||
|
|
9c3365aefc | ||
|
|
6cef3b8a96 | ||
|
|
8901b99e2d | ||
|
|
b47db3e9e1 | ||
|
|
b9feae0883 | ||
|
|
66c73015b2 | ||
|
|
9e85ae3d47 | ||
|
|
8b0b3b1a9d | ||
|
|
d20d88e1af | ||
|
|
c9c7045a6f | ||
|
|
778b05c341 | ||
|
|
fde6909530 | ||
|
|
ab44adc6d5 | ||
|
|
7773afcbbe | ||
|
|
c2d8bd99dc | ||
|
|
3f49f0df33 | ||
|
|
071a230000 | ||
|
|
71ee941cf8 | ||
|
|
1ce91bac06 | ||
|
|
24d7c6aae7 | ||
|
|
e2e95641a3 | ||
|
|
44746c1899 | ||
|
|
2d645c74dc | ||
|
|
d52a93ce4d |
191
ChangeLog
191
ChangeLog
@@ -12,6 +12,136 @@ Upgrading to any other version or any other database system is abolutely require
|
||||
make a Dolibarr upgrade.
|
||||
|
||||
|
||||
***** ChangeLog for 3.9.4 compared to 3.9.3 *****
|
||||
FIX: #2853
|
||||
FIX: #3128
|
||||
FIX: #4447
|
||||
FIX: #5128 if create method return duplicated code error not use GETPOST in order to get a new code
|
||||
FIX: #5340
|
||||
FIX: #5473
|
||||
FIX: #5474 Country_id of "Don" object is still empty
|
||||
FIX: #5534
|
||||
FIX: #5535 bad dependency.
|
||||
FIX: #5537 AJAX project search does not work properly
|
||||
FIX: #5540 getFormMail is not registered as addReplace hook
|
||||
FIX: #5544 Disabled Contact still appear in lists to send emails
|
||||
FIX: #5549 getNomUrl tooltips show Order info even if user has no rights to read them
|
||||
FIX: #5568
|
||||
FIX: #5594
|
||||
FIX: #5629 PgSQL Interger string stylish error
|
||||
FIX: #5651
|
||||
FIX: #5660
|
||||
FIX: #5853 $conf->global->$calc==0 || $conf->global->$calc==1
|
||||
FIX: #5907
|
||||
FIX: #5966 Bug: getNomUrl tooltips show Proposal info even if user has no rights to read them
|
||||
FIX: #6051
|
||||
FIX: #6088
|
||||
FIX: Can correct stock of lot using eatby or sell by date
|
||||
FIX: Can make a movement on "out of sell" products
|
||||
FIX: cannot update bank account on invoice if module order not activated
|
||||
FIX: Can't create withdrawal document
|
||||
FIX: delete contract extrafields on contract deletion
|
||||
FIX: Direction of movement lost if an error occurs
|
||||
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
|
||||
FIX: export extrafields must not include separe type
|
||||
FIX: External user must not be able to edit its discounts
|
||||
FIX: Failed to export contact categories with contact extra fields
|
||||
FIX: header title in commercial area
|
||||
FIX: HT and TTC price should always be displayed together
|
||||
FIX: incoterms
|
||||
FIX: incoterms do not output into crabe invoice PDF
|
||||
FIX: in PgSQL no quote "word style" is permitted around column name
|
||||
FIX: Introduce hidden option MAIL_PREFIX_FOR_EMAIL_ID to solve pb of tracking email.
|
||||
FIX: margin tab on customer card must filter on current entity invoices
|
||||
FIX: missing column into SQL on thridparty list
|
||||
FIX: only show projects of related third if external user
|
||||
FIX: PgSQL Module Ressource list crash #5637
|
||||
FIX: php Strict
|
||||
FIX: Regression when deleting product
|
||||
FIX: Security to restrict email sending was not efficient
|
||||
FIX: tag for date rfc in odt substitution
|
||||
FIX: Update intervention lline crash with PgSQL
|
||||
FIX: update limit stock on product stock
|
||||
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
|
||||
FIX: wrong test on dict.php
|
||||
|
||||
|
||||
***** ChangeLog for 3.9.3 compared to 3.9.2 *****
|
||||
FIX: #4383 $userid not defined
|
||||
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||
FIX: #4455
|
||||
FIX: #4749
|
||||
FIX: #4756
|
||||
FIX: #4828
|
||||
FIX: #4926
|
||||
FIX: #4964 buyprice in customer from shipping buyprice wasn't load in expedition::fetch_lines
|
||||
FIX: #5004
|
||||
FIX: #5068
|
||||
FIX: #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option
|
||||
FIX: #5338 use of not initialized var $aphour, $apmin, etc
|
||||
FIX: #5343
|
||||
FIX: #5380
|
||||
FIX: #5383 bad object id on don delete
|
||||
FIX: #5414
|
||||
FIX: #5470 User of expense report in bank transactions page is not correct
|
||||
FIX: a case of corrupted ODT by Word that insert <text:s> when it should not.
|
||||
FIX: Can't create thirdparty or validate invoice if profid is mandatory and profid does not exists for other countries
|
||||
FIX: dasboard wrong for late invoice
|
||||
FIX: duplicate jquery.js files
|
||||
FIX: extrafield cloned on project clone
|
||||
FIX: Failed to open file
|
||||
FIX: Filter on opportunity amount and budget
|
||||
FIX: form_confirm to delete payment on supplier invoice
|
||||
FIX: javascript error with german-switzerland language
|
||||
FIX: large expense note
|
||||
FIX: Missing original .js file (license violation if sources are not provided)
|
||||
FIX: Option strict mode compatibility
|
||||
FIX: product stats all bloc module without enbaled test
|
||||
FIX: receiving link never works
|
||||
FIX: task ODT company object not correctly retrieved
|
||||
FIX: Translate group perms as it is done into user perms
|
||||
FIX: We must take the last recent defined price when using price level
|
||||
|
||||
***** ChangeLog for 3.9.2 compared to 3.9.1 *****
|
||||
FIX: #4813 Won translation for the key OppStatusWON instead OppStatusWIN
|
||||
FIX: #5008 SQL error when editing the reference of a supplier invoice that already exists
|
||||
FIX: #5236 Cron module activated but "Modules tools" does not appear in the left menu.
|
||||
FIX: Accountancy - 3.9 - Chart of accounts are limited on only one country
|
||||
FIX: bug on email template
|
||||
FIX: Can't create a stock transfer from product card
|
||||
FIX: can't fetch by siret or siren because of first "if"
|
||||
FIX: Check stock of product by warehouse if $entrepot_id defined on shippings
|
||||
FIX: Compatible with multicompany
|
||||
FIX: Creation of the second ressource type fails.
|
||||
FIX: end of select when no fournprice
|
||||
FIX: Filter on assigned to was preselected on current user on list "All events" (instead of no filtering)
|
||||
FIX: Filter on category tag for suppliers
|
||||
FIX: hook on group card called but not initialized
|
||||
FIX: Infinite loop on menu tree output for edition
|
||||
FIX: Can show tree of entries added by external modules using fk_mainmenu and fk_leftmenu instead of fk_menu.
|
||||
FIX: init var at wrong place report incorrect "shippable" flag on draft order.
|
||||
FIX: It doesn't check if there is enough stock to update the lines of orders/invoices
|
||||
FIX: Menu statistics was not visible if module proposal was not enabled
|
||||
FIX: Merge manually PR #5161 - Bad translation key
|
||||
FIX: missing column when module was installed before standard integration
|
||||
FIX: Missing number total of modules
|
||||
FIX: Not filtering correctly when coming from dashboard
|
||||
FIX: PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH
|
||||
FIX: Remove PHP Warning: Creating default object from empty value.
|
||||
FIX: same page added several times on mergepropal option
|
||||
FIX: search on date into supplier invoice list dont work because of status -1
|
||||
FIX: Search supplier ref on contract
|
||||
FIX: Split of credit note into discount page generates records not correctly recognised as credit note.
|
||||
FIX: SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty
|
||||
FIX: #5087
|
||||
FIX: #5108
|
||||
FIX: #5163
|
||||
FIX: #5195
|
||||
FIX: #5203
|
||||
FIX: #5207
|
||||
FIX: #5209
|
||||
FIX: #5230
|
||||
|
||||
***** ChangeLog for 3.9.1 compared to 3.9.* *****
|
||||
FIX: #3815 Call to undefined function local_by_date()
|
||||
FIX: #4424 Missing email of user popup in supplier orders area
|
||||
@@ -236,6 +366,67 @@ This is list of hooks modified:
|
||||
|
||||
|
||||
|
||||
***** ChangeLog for 3.8.5 compared to 3.8.4 *****
|
||||
FIX: #3815 Call to undefined function local_by_date().
|
||||
FIX: #4424 Missing email of user popup in supplier orders area
|
||||
FIX: #4442 Missing translation in Banks menu
|
||||
FIX: #4448 $filebonprev is not used, $this->filename now
|
||||
FIX: #4455
|
||||
FIX: #4737 Bank transacion type selector translation is cropped
|
||||
FIX: #4742 Able to delete a supplier invoice with a registered payment
|
||||
FIX: #4743 UI glitch in project summary page
|
||||
FIX: #4747 Missing UI background when registering a supplier invoice payment
|
||||
FIX: #4748 Supplier invoice payment confirmation amount is not translated
|
||||
FIX: #4749
|
||||
FIX: #4756
|
||||
FIX: #4766 VAT not shown in supplier invoice popup
|
||||
FIX: #4809 - Duplicate functions with different content
|
||||
FIX: #4851 Project selector in supplier invoices shows the project label twice
|
||||
FIX: #4870
|
||||
FIX: #5008 SQL error when editing the reference of a supplier invoice that already exists
|
||||
FIX: #5048 Product supplier list display only one produc
|
||||
FIX: #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option
|
||||
FIX: #5203
|
||||
FIX: #5207
|
||||
FIX: #5338 use of not initialized var $aphour, $apmin, etc
|
||||
FIX: #5380
|
||||
FIX: #5383 bad object id on don delete
|
||||
FIX: #5474 Country_id of "Don" object is still empty
|
||||
FIX: Accountancy - 3.8 - Chart of accounts are limited on only one country
|
||||
FIX: Bad include and param for project numbering module call
|
||||
FIX: Box disabled because bugged
|
||||
FIX: bug on email template
|
||||
FIX: Can correct stock of lot using eatby or sell by date
|
||||
FIX: Can make a movement on "out of sell" products
|
||||
FIX: Can't create thirdparty or validate invoice if profid is mandatory and profid does not exists for other countries
|
||||
FIX: can't fetch by siret or siren because of first "if"
|
||||
FIX: Check stock of product by warehouse if $entrepot_id defined on shippings
|
||||
FIX: correct display of minimum buying price
|
||||
FIX: Creation of thumb image for size "small" was not done.
|
||||
FIX: Direction of movement lost if an error occurs
|
||||
FIX: dont retrieve new buying price on margin display
|
||||
FIX: Duplicate records into export
|
||||
FIX: Email templates not compatible with Multicompany
|
||||
FIX: end of select when no fournprice
|
||||
FIX: finished parameters not used
|
||||
FIX: hook on group card called but not initialized
|
||||
FIX: It doesn't check if there is enough stock to update the lines of orders/invoices
|
||||
FIX: large expense note
|
||||
FIX: missing column when module was installed before standard integration
|
||||
FIX: Missing database escaping on supplier price insert/update
|
||||
FIX: Not filtering correctly when come from dashboard
|
||||
FIX: PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH
|
||||
FIX: real min buying price
|
||||
FIX: receiving link never works
|
||||
FIX: same page added several times on mergepropal option
|
||||
FIX: search on date into supplier invoice list dont work because of status -1
|
||||
FIX: Search supplier ref on contract
|
||||
FIX: SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty
|
||||
FIX: systematic rounding causes prices to be updated without reason
|
||||
FIX: task ODT company object not correctly retrieved
|
||||
FIX: Template email must take care of positino column
|
||||
FIX: VAT rate can be negative. Example spain selling to morroco.
|
||||
|
||||
***** ChangeLog for 3.8.4 compared to 3.8.3 *****
|
||||
FIX: #3694
|
||||
FIX: #3798 #2519 Cron jobs would never be executed
|
||||
|
||||
@@ -222,7 +222,13 @@ $dolibarr_main_prod='0';
|
||||
# $dolibarr_main_limit_users='0';
|
||||
|
||||
# dolibarr_mailing_limit_sendbyweb
|
||||
# Can set a limit for mailing send by web, can be used for a restricted mode.
|
||||
# Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
|
||||
# Default value: 0 (use database value if exist)
|
||||
# Examples:
|
||||
# $dolibarr_mailing_limit_sendbyweb='0';
|
||||
|
||||
# dolibarr_mailing_limit_sendbycli
|
||||
# Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
|
||||
# Default value: 0 (use database value if exist)
|
||||
# Examples:
|
||||
# $dolibarr_mailing_limit_sendbycli='0';
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
README.md
|
||||
README-FR.md
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
version=3
|
||||
|
||||
#http://sf.net/dolibarr/dolibarr-(.+)\.tgz
|
||||
http://www.dolibarr.org/files/stable/standard/dolibarr-(.+)\.tgz
|
||||
http://www.dolibarr.org/files/stable/package_debian-ubuntu/dolibarr_(.+)\.orig\.tar\.gz
|
||||
|
||||
@@ -173,6 +173,7 @@ $build =~ s/-.*$//g;
|
||||
# now build is 0+nmu1 for example
|
||||
$FILENAMEDEBNATIVE="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
||||
$FILENAMEDEB="${PROJECT}_${MAJOR}.${MINOR}.${newbuild}";
|
||||
$FILENAMEDEBSHORT="${PROJECT}_${MAJOR}.${MINOR}.${build}";
|
||||
|
||||
|
||||
my $copyalreadydone=0;
|
||||
@@ -388,10 +389,15 @@ if ($nboftargetok) {
|
||||
{
|
||||
print 'Run git tag -a -f -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
|
||||
$ret=`git tag -a -f -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD"`;
|
||||
print 'Run git push -f --tags'."\n";
|
||||
$ret=`git push -f --tags`;
|
||||
}
|
||||
}
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
else
|
||||
{
|
||||
print 'Run git push --tags'."\n";
|
||||
$ret=`git push --tags`;
|
||||
}
|
||||
chdir("$olddir");
|
||||
}
|
||||
|
||||
@@ -807,7 +813,7 @@ if ($nboftargetok) {
|
||||
$ret=`$cmd`;
|
||||
|
||||
print "Remove other files\n";
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/README-FR.md`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT.tmp/build/README-FR`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT.tmp/build/aps`;
|
||||
@@ -1104,6 +1110,7 @@ if ($nboftargetok) {
|
||||
%filestoscansf=(
|
||||
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'Dolibarr installer for Fedora-Redhat-Mandriva-Opensuse (DoliRpm)',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none',
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
|
||||
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
|
||||
@@ -1111,6 +1118,7 @@ if ($nboftargetok) {
|
||||
%filestoscanstableasso=(
|
||||
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
|
||||
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
|
||||
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
|
||||
"$DESTI/standard/$FILENAMETGZ.zip"=>'standard'
|
||||
@@ -1156,7 +1164,7 @@ if ($nboftargetok) {
|
||||
|
||||
print "\n";
|
||||
|
||||
if ($target eq 'SF') {
|
||||
if ($target eq 'SF' && $filestoscan{$file} ne 'none') {
|
||||
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
|
||||
}
|
||||
elsif ($target eq 'ASSO' and $NEWPUBLISH =~ /stable/) {
|
||||
|
||||
@@ -31,8 +31,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/generate-facture.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
//$path=preg_replace('/generate-commande.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
//$path=preg_replace('/generate-produit.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
//$path=preg_replace('/generate-propale.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/comm/propal/class/propal.class.php");
|
||||
require_once(DOL_DOCUMENT_ROOT."/commande/class/commande.class.php");
|
||||
|
||||
@@ -32,8 +32,8 @@ if (substr($sapi_type, 0, 3) == 'cgi') {
|
||||
}
|
||||
|
||||
// Recupere root dolibarr
|
||||
$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require ($path."../../htdocs/master.inc.php");
|
||||
//$path=preg_replace('/generate-societe.php/i','',$_SERVER["PHP_SELF"]);
|
||||
require (__DIR__. '/../../htdocs/master.inc.php');
|
||||
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
@@ -43,7 +43,9 @@ $search_pcgtype = GETPOST("search_pcgtype");
|
||||
$search_pcgsubtype = GETPOST("search_pcgsubtype");
|
||||
|
||||
// Security check
|
||||
if (! $user->admin)
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->chartofaccount)
|
||||
accessforbidden();
|
||||
|
||||
$sortfield = GETPOST("sortfield", 'alpha');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
/* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,12 +30,15 @@ $action = GETPOST('action');
|
||||
$langs->load("admin");
|
||||
$langs->load("compta");
|
||||
|
||||
if (! $user->admin)
|
||||
// Security check
|
||||
if ($user->societe_id > 0)
|
||||
accessforbidden();
|
||||
if (! $user->rights->accounting->fiscalyear)
|
||||
accessforbidden();
|
||||
|
||||
$error = 0;
|
||||
|
||||
// List of statut
|
||||
// List of status
|
||||
static $tmpstatut2label = array (
|
||||
'0' => 'OpenFiscalYear',
|
||||
'1' => 'CloseFiscalYear'
|
||||
|
||||
@@ -95,7 +95,7 @@ if ($action == 'validatehistory') {
|
||||
$sql1 .= " SET fd.fk_code_ventilation = 0";
|
||||
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
|
||||
$sql1 .= ' (SELECT accnt.rowid ';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accountingaccount as accnt';
|
||||
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
|
||||
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
|
||||
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ $extrafields = new ExtraFields($db);
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array(
|
||||
'd.rowid'=>'Ref',
|
||||
//'d.ref'=>'Ref',
|
||||
'd.login'=>'Login',
|
||||
'd.lastname'=>'Lastname',
|
||||
'd.firstname'=>'Firstname',
|
||||
'd.societe'=>"Company",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
|
||||
@@ -624,7 +624,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$i=0;
|
||||
foreach ($listfieldinsert as $f => $value)
|
||||
{
|
||||
if ($value == 'price' || preg_match('/^amount/i',$value) || preg_match('/^localtax/i',$value) || $value == 'taux') {
|
||||
if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||
}
|
||||
else if ($value == 'entity') {
|
||||
@@ -672,7 +672,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
||||
$i = 0;
|
||||
foreach ($listfieldmodify as $field)
|
||||
{
|
||||
if ($field == 'price' || preg_match('/^amount/i',$field) || preg_match('/^localtax/i',$field) || $field == 'taux') {
|
||||
if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU');
|
||||
}
|
||||
else if ($field == 'entity') {
|
||||
@@ -1290,23 +1290,10 @@ if ($id)
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax1') {
|
||||
else if ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
if ($obj->localtax1 == 0)
|
||||
$valuetoshow = '';
|
||||
$align="right";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax2') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
if ($obj->localtax2 == 0)
|
||||
$valuetoshow = '';
|
||||
$align="right";
|
||||
}
|
||||
else if (in_array($fieldlist[$field],array('taux','localtax1','localtax2')))
|
||||
{
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
$align="right";
|
||||
}
|
||||
else if (in_array($fieldlist[$field],array('recuperableonly')))
|
||||
{
|
||||
$align="center";
|
||||
|
||||
@@ -167,7 +167,7 @@ if ($action == 'edit') // Edit
|
||||
print '<td width="20"> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Multilangual GUI
|
||||
// Multilingual GUI
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
|
||||
print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
|
||||
@@ -181,7 +181,7 @@ if ($action == 'edit') // Edit
|
||||
show_theme(null,1);
|
||||
print '<br>';
|
||||
|
||||
// Liste des zone de recherche permanantes supportees
|
||||
// List of permanent supported search box
|
||||
if (! empty($searchform))
|
||||
{
|
||||
print '<table summary="search" class="noborder" width="100%">';
|
||||
|
||||
@@ -90,7 +90,8 @@ $configfileparameters=array(
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'separator',
|
||||
'?dolibarr_mailing_limit_sendbyweb',
|
||||
'?dolibarr_strict_mode'
|
||||
'?dolibarr_mailing_limit_sendbycli',
|
||||
'?dolibarr_strict_mode'
|
||||
);
|
||||
$configfilelib=array(
|
||||
// 'separator',
|
||||
|
||||
@@ -284,7 +284,8 @@ $configfileparameters=array(
|
||||
'separator4' => '',
|
||||
'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
|
||||
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
|
||||
'?dolibarr_strict_mode' => 'Strict mode is on/off',
|
||||
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
|
||||
'?dolibarr_strict_mode' => 'Strict mode is on/off',
|
||||
'?dolibarr_pdf_force_fpdf' => 'Force fpdf usage to generate PDF'
|
||||
);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2006-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@@ -602,17 +602,19 @@ class Categorie extends CommonObject
|
||||
{
|
||||
if ($this->db->num_rows($resql) > 0)
|
||||
{
|
||||
$objparent = $this->db->fetch_object($resql);
|
||||
$objparent = $this->db->fetch_object($resql);
|
||||
|
||||
if (!empty($objparent->fk_parent))
|
||||
{
|
||||
$cat = new Categorie($this->db);
|
||||
$cat->id=$objparent->fk_parent;
|
||||
$result=$cat->add_type($obj, $type);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error=$cat->error;
|
||||
$error++;
|
||||
$cat->id = $objparent->fk_parent;
|
||||
if (!$cat->containsObject($type, $obj->id)) {
|
||||
$result = $cat->add_type($obj, $type);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->error = $cat->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,14 @@ $originid=GETPOST('originid','int');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
$fulldayevent=GETPOST('fullday');
|
||||
$datep=dol_mktime($fulldayevent?'00':GETPOST("aphour"), $fulldayevent?'00':GETPOST("apmin"), 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
|
||||
$datef=dol_mktime($fulldayevent?'23':GETPOST("p2hour"), $fulldayevent?'59':GETPOST("p2min"), $fulldayevent?'59':'0', GETPOST("p2month"), GETPOST("p2day"), GETPOST("p2year"));
|
||||
|
||||
$aphour = GETPOST('aphour');
|
||||
$apmin = GETPOST('apmin');
|
||||
$p2hour = GETPOST('p2hour');
|
||||
$p2min = GETPOST('p2min');
|
||||
|
||||
$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
|
||||
$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', GETPOST("p2month"), GETPOST("p2day"), GETPOST("p2year"));
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
@@ -92,7 +98,6 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('actioncard','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@@ -781,7 +786,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||
|
||||
$numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:0),GETPOST("projectid")?GETPOST("projectid"):'','projectid');
|
||||
$numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1),GETPOST("projectid")?GETPOST("projectid"):'','projectid');
|
||||
if ($numproject==0)
|
||||
{
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create">'.$langs->trans("AddProject").'</a>';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -210,7 +210,7 @@ if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (
|
||||
if ($filtert > 0 || $usergroup > 0)
|
||||
{
|
||||
$sql.= " AND (";
|
||||
if ($filtert > 0) $sql.= "(ar.fk_element = ".$filtert." OR a.fk_user_action=".$filtert.")";
|
||||
if ($filtert > 0) $sql.= "(ar.fk_element = ".$filtert." OR (ar.fk_element IS NULL AND a.fk_user_action=".$filtert."))"; // The OR is for backward compatibility
|
||||
if ($usergroup > 0) $sql.= ($filtert>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup;
|
||||
$sql.= ")";
|
||||
}
|
||||
@@ -350,7 +350,7 @@ if ($resql)
|
||||
$actionstatic->type_code=$obj->type_code;
|
||||
$actionstatic->type_label=$obj->type_label;
|
||||
$actionstatic->label=$obj->label;
|
||||
print $actionstatic->getNomUrl(1,28);
|
||||
print $actionstatic->getNomUrl(1,36);
|
||||
print '</td>';
|
||||
|
||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||
|
||||
@@ -69,7 +69,7 @@ if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db);
|
||||
if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db);
|
||||
if (! empty($conf->fournisseur->enabled)) $supplierorderstatic=new CommandeFournisseur($db);
|
||||
|
||||
llxHeader();
|
||||
llxHeader("",$langs->trans("CommercialArea"));
|
||||
|
||||
print load_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png');
|
||||
|
||||
@@ -341,7 +341,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print $companystatic->getNomUrl(1,'customer',16);
|
||||
print $companystatic->getNomUrl(1,'supplier',16);
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap">'.price($obj->total_ttc).'</td></tr>';
|
||||
$i++;
|
||||
@@ -647,7 +647,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print $companystatic->getNomUrl(1, 'company', 44);
|
||||
print $companystatic->getNomUrl(1, 'customer', 44);
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
||||
@@ -746,7 +746,7 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
$companystatic->code_client = $obj->code_client;
|
||||
$companystatic->code_fournisseur = $obj->code_fournisseur;
|
||||
$companystatic->canvas=$obj->canvas;
|
||||
print $companystatic->getNomUrl(1, 'company', 44);
|
||||
print $companystatic->getNomUrl(1, 'customer', 44);
|
||||
print '</td>';
|
||||
print '<td align="right">';
|
||||
print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
|
||||
|
||||
@@ -761,10 +761,12 @@ else
|
||||
$sendingmode=$conf->global->MAIN_MAIL_SENDMODE;
|
||||
if (empty($sendingmode)) $sendingmode='mail'; // If not defined, we use php mail function
|
||||
|
||||
// MAILING_NO_USING_PHPMAIL may be defined or not
|
||||
// MAILING_LIMIT_SENDBYWEB is always defined to something != 0, MAILING_LIMIT_SENDBYCLI may be defined ot not.
|
||||
if (! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
|
||||
{
|
||||
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
|
||||
// You ensure that every user is using its own SMTP server.
|
||||
// You ensure that every user is using its own SMTP server when using the mass emailing module.
|
||||
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails.php">';
|
||||
$linktoadminemailend='</a>';
|
||||
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
|
||||
@@ -772,19 +774,27 @@ else
|
||||
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings');
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else if (empty($conf->global->MAILING_LIMIT_SENDBYWEB))
|
||||
else if ($conf->global->MAILING_LIMIT_SENDBYWEB == '-1')
|
||||
{
|
||||
// Pour des raisons de securite, on ne permet pas cette fonction via l'IHM,
|
||||
// on affiche donc juste un message
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
||||
|
||||
// The feature is forbidden from GUI, we show just message to use from command line.
|
||||
setEventMessages($langs->trans("MailingNeedCommand"), null, 'warnings');
|
||||
setEventMessages('<textarea cols="60" rows="'.ROWS_1.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.'</textarea>', null, 'warnings');
|
||||
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings');
|
||||
if ($conf->file->mailing_limit_sendbyweb != '-1') // MAILING_LIMIT_SENDBYWEB was set to -1 in database, but it is allowed ot increase it.
|
||||
{
|
||||
setEventMessages($langs->trans("MailingNeedCommand2"), null, 'warnings'); // You can send online with constant...
|
||||
}
|
||||
$_GET["action"]='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$text='';
|
||||
if ($conf->file->mailing_limit_sendbyweb == 0)
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_PHPMAIL) && $sendingmode == 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_PHPMAIL, null, 'warnings');
|
||||
if (! empty($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL) && $sendingmode != 'mail') setEventMessages($conf->global->MAILING_LIMIT_WARNING_NOPHPMAIL, null, 'warnings');
|
||||
|
||||
$text='';
|
||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0)
|
||||
{
|
||||
$text.=$langs->trans("MailingNeedCommand");
|
||||
$text.='<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>';
|
||||
|
||||
@@ -429,7 +429,8 @@ class Propal extends CommonObject
|
||||
$product_type=$product->type;
|
||||
|
||||
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_PROPOSAL) && $product_type == 0 && $product->stock_reel < $qty) {
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnProposal', $product->ref);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@@ -2505,7 +2506,7 @@ class Propal extends CommonObject
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay = $delay_warning/60/60/24;
|
||||
$response->label = $label;
|
||||
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut;
|
||||
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals';
|
||||
$response->img = img_object($langs->trans("Propals"),"propal");
|
||||
|
||||
// This assignment in condition is not a bug. It allows walking the results.
|
||||
@@ -2733,20 +2734,33 @@ class Propal extends CommonObject
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='', $get_params='')
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $langs, $conf, $user;
|
||||
|
||||
$result='';
|
||||
$label = '<u>' . $langs->trans("ShowPropal") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label.= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
$label.= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
$label = '';
|
||||
|
||||
if ($user->rights->propal->lire) {
|
||||
$label .= '<u>'.$langs->trans("ShowPropal").'</u>';
|
||||
if (!empty($this->ref)) {
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->ref_client)) {
|
||||
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||
}
|
||||
if (!empty($this->total_ht)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
}
|
||||
if (!empty($this->total_tva)) {
|
||||
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
}
|
||||
if (!empty($this->total_ttc)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
}
|
||||
}
|
||||
|
||||
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
if ($option == '') {
|
||||
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$this->id. $get_params .$linkclose;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -255,6 +256,7 @@ if ($result)
|
||||
}
|
||||
|
||||
$param='&socid='.$socid.'&viewstatut='.$viewstatut;
|
||||
if ($sall) $param.='&sall='.$sall;
|
||||
if ($month) $param.='&month='.$month;
|
||||
if ($year) $param.='&year='.$year;
|
||||
if ($search_ref) $param.='&search_ref=' .$search_ref;
|
||||
|
||||
@@ -130,7 +130,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'setremise')
|
||||
if ($action == 'setremise' && $user->rights->societe->creer)
|
||||
{
|
||||
//if ($user->rights->societe->creer)
|
||||
//if ($user->rights->facture->creer)
|
||||
@@ -257,37 +257,47 @@ if ($socid > 0)
|
||||
print '<tr><td class="titlefield">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
|
||||
print '<td>'.$remise_all.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
|
||||
print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
if (! empty($user->fk_soc)) // No need to show this for external users
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
|
||||
print '<td>'.$remise_user.' '.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="38%">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'">';
|
||||
print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$object);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
print '<br>';
|
||||
|
||||
print "</table>";
|
||||
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td width="38%">'.$langs->trans("AmountHT").'</td>';
|
||||
print '<td><input type="text" size="5" name="amount_ht" value="'.$_POST["amount_ht"].'">';
|
||||
print '<span class="hideonsmartphone"> '.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||
print '<tr><td width="38%">'.$langs->trans("VAT").'</td>';
|
||||
print '<td>';
|
||||
print $form->load_tva('tva_tx',GETPOST('tva_tx'),$mysoc,$object);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("NoteReason").'</td>';
|
||||
print '<td><input type="text" size="60" name="desc" value="'.$_POST["desc"].'"></td></tr>';
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">';
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</div>';
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("AddGlobalDiscount").'">';
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
print ' ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
|
||||
@@ -414,7 +424,7 @@ if ($socid > 0)
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
* Liste ristournes appliquees (=liees a une ligne de facture ou facture)
|
||||
* List discount consumed (=liees a une ligne de facture ou facture)
|
||||
*/
|
||||
|
||||
// Remises liees a lignes de factures
|
||||
|
||||
@@ -445,6 +445,14 @@ if (empty($reshook))
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else if ($action == 'classifyunbilled' && $user->rights->commande->creer)
|
||||
{
|
||||
$ret=$object->classifyUnBilled();
|
||||
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Positionne ref commande client
|
||||
else if ($action == 'set_ref_client' && $user->rights->commande->creer) {
|
||||
@@ -2373,7 +2381,11 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifybilled">' . $langs->trans("ClassifyBilled") . '</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($object->statut > Commande::STATUS_DRAFT && $object->billed) {
|
||||
if ($user->rights->commande->creer && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=classifyunbilled">' . $langs->trans("ClassifyUnBilled") . '</a></div>';
|
||||
}
|
||||
}
|
||||
// Clone
|
||||
if ($user->rights->commande->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&object=order">' . $langs->trans("ToClone") . '</a></div>';
|
||||
|
||||
@@ -1242,7 +1242,8 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
|
||||
{
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
|
||||
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
|
||||
@@ -2420,6 +2421,56 @@ class Commande extends CommonOrder
|
||||
return $this->classifyBilled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Classify the order as not invoiced
|
||||
*
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function classifyUnBilled()
|
||||
{
|
||||
global $conf, $user, $langs;
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 0';
|
||||
$sql.= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;
|
||||
|
||||
dol_syslog(get_class($this)."::classifyUnBilled", LOG_DEBUG);
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('ORDER_CLASSIFY_UNBILLED',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$this->facturee=0; // deprecated
|
||||
$this->billed=0;
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($this->errors as $errmsg)
|
||||
{
|
||||
dol_syslog(get_class($this)."::classifyUnBilled ".$errmsg, LOG_ERR);
|
||||
$this->error.=($this->error?', '.$errmsg:$errmsg);
|
||||
}
|
||||
$this->db->rollback();
|
||||
return -1*$error;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a line in database
|
||||
@@ -2513,7 +2564,8 @@ class Commande extends CommonOrder
|
||||
|
||||
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
|
||||
{
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnOrder', $product->ref);
|
||||
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
|
||||
$this->db->rollback();
|
||||
unset($_POST['productid']);
|
||||
@@ -2875,7 +2927,7 @@ class Commande extends CommonOrder
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->commande->client->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("OrdersToProcess");
|
||||
$response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3';
|
||||
$response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders';
|
||||
$response->img=img_object($langs->trans("Orders"),"order");
|
||||
|
||||
$generic_commande = new Commande($this->db);
|
||||
@@ -3019,7 +3071,7 @@ class Commande extends CommonOrder
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option=0,$max=0,$short=0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $user;
|
||||
|
||||
$result='';
|
||||
|
||||
@@ -3029,17 +3081,29 @@ class Commande extends CommonOrder
|
||||
if ($short) return $url;
|
||||
|
||||
$picto = 'order';
|
||||
$label = '<u>' . $langs->trans("ShowOrder") . '</u>';
|
||||
if (! empty($this->ref))
|
||||
$label .= '<br><b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
|
||||
if (! empty($this->ref_client))
|
||||
$label.= '<br><b>' . $langs->trans('RefCustomer') . ':</b> ' . $this->ref_client;
|
||||
if (! empty($this->total_ht))
|
||||
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_tva))
|
||||
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
if (! empty($this->total_ttc))
|
||||
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
|
||||
$label = '';
|
||||
|
||||
if ($user->rights->commande->lire) {
|
||||
$label = '<u>'.$langs->trans("ShowOrder").'</u>';
|
||||
if (!empty($this->ref)) {
|
||||
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
}
|
||||
if (!empty($this->ref_client)) {
|
||||
$label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
|
||||
}
|
||||
if (!empty($this->total_ht)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
}
|
||||
if (!empty($this->total_tva)) {
|
||||
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
}
|
||||
if (!empty($this->total_ttc)) {
|
||||
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1,
|
||||
$conf->currency);
|
||||
}
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend='</a>';
|
||||
|
||||
@@ -206,7 +206,7 @@ class CommandeStats extends Stats
|
||||
|
||||
$sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg";
|
||||
$sql.= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product";
|
||||
//if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE ".$this->where;
|
||||
$sql.= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid";
|
||||
$sql.= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year,1,false))."' AND '".$this->db->idate(dol_get_last_day($year,12,false))."'";
|
||||
|
||||
@@ -259,6 +259,7 @@ if ($resql)
|
||||
$title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||
|
||||
$param='';
|
||||
if ($sall) $param.='&sall='.$sall;
|
||||
if ($socid > 0) $param.='&socid='.$socid;
|
||||
if ($viewstatut != '') $param.='&viewstatut='.$viewstatut;
|
||||
if ($orderday) $param.='&orderday='.$orderday;
|
||||
@@ -587,10 +588,13 @@ if ($resql)
|
||||
print dol_print_date($db->jdate($objp->date_commande), 'day');
|
||||
print '</td>';
|
||||
|
||||
// Delivery date
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_delivery), 'day');
|
||||
print '</td>';
|
||||
if (empty($conf->global->ORDER_DISABLE_DELIVERY_DATE))
|
||||
{
|
||||
// Delivery date
|
||||
print '<td align="center">';
|
||||
print dol_print_date($db->jdate($objp->date_delivery), 'day');
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Amount HT
|
||||
print '<td align="right" class="nowrap">'.price($objp->total_ht).'</td>';
|
||||
|
||||
@@ -70,6 +70,11 @@ $date_end = dol_mktime(23,59,59,$_REQUEST["date_endmonth"],$_REQUEST["date_endda
|
||||
$date_starty = dol_mktime(0,0,0,$_REQUEST["date_start_delymonth"],$_REQUEST["date_start_delyday"],$_REQUEST["date_start_delyyear"]); // Date for local PHP server
|
||||
$date_endy = dol_mktime(23,59,59,$_REQUEST["date_end_delymonth"],$_REQUEST["date_end_delyday"],$_REQUEST["date_end_delyyear"]);
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label('facture');
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
if (is_array($selected) == false)
|
||||
@@ -174,6 +179,9 @@ if (($action == 'create' || $action == 'add') && !$error)
|
||||
$object->remise_absolue = $_POST['remise_absolue'];
|
||||
$object->remise_percent = $_POST['remise_percent'];
|
||||
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
if ($ret < 0) $error++;
|
||||
|
||||
if ($_POST['origin'] && $_POST['originid'])
|
||||
{
|
||||
$object->origin = $_POST['origin'];
|
||||
@@ -464,6 +472,12 @@ if ($action == 'create' && !$error)
|
||||
$parameters=array('objectsrc' => $objectsrc, 'idsrc' => $listoforders, 'colspan' => ' colspan="3"');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
$object=new Facture($db);
|
||||
print $object->showOptionals($extrafields,'edit');
|
||||
}
|
||||
|
||||
// Modele PDF
|
||||
print '<tr><td>'.$langs->trans('Model').'</td>';
|
||||
print '<td>';
|
||||
|
||||
@@ -36,10 +36,10 @@ $id=GETPOST('account');
|
||||
$ref=GETPOST('ref');
|
||||
|
||||
// Security check
|
||||
$fieldid = (! empty($ref)?$ref:$id);
|
||||
$fieldname = isset($ref)?'ref':'rowid';
|
||||
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
|
||||
$fieldtype = (! empty($ref) ? 'ref' :'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result=restrictedArea($user,'banque',$fieldid,'bank_account','','',$fieldname);
|
||||
$result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype);
|
||||
|
||||
$year_start=GETPOST('year_start');
|
||||
$year_current = strftime("%Y",time());
|
||||
@@ -146,7 +146,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("B
|
||||
// Ref
|
||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td colspan="3">';
|
||||
if ($_GET["account"])
|
||||
if (!empty($id))
|
||||
{
|
||||
if (! preg_match('/,/', $id))
|
||||
{
|
||||
|
||||
@@ -66,7 +66,6 @@ if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
|
||||
if (! empty($conf->margin->enabled))
|
||||
$langs->load('margins');
|
||||
|
||||
$sall = trim(GETPOST('sall'));
|
||||
$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0);
|
||||
|
||||
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||
@@ -392,19 +391,20 @@ if (empty($reshook))
|
||||
|
||||
// Check parameters
|
||||
|
||||
// Check for mandatory prof id
|
||||
for($i = 1; $i < 6; $i ++)
|
||||
// Check for mandatory prof id (but only if country is than than ours)
|
||||
if ($mysoc->country_id > 0 && $object->thirdparty->country_id == $mysoc->country_id)
|
||||
{
|
||||
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
|
||||
$idprof = 'idprof' . $i;
|
||||
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
|
||||
{
|
||||
if (! $error)
|
||||
$langs->load("errors");
|
||||
$error ++;
|
||||
|
||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors');
|
||||
}
|
||||
for ($i = 1; $i <= 6; $i++)
|
||||
{
|
||||
$idprof_mandatory = 'SOCIETE_IDPROF' . ($i) . '_INVOICE_MANDATORY';
|
||||
$idprof = 'idprof' . $i;
|
||||
if (! $object->thirdparty->$idprof && ! empty($conf->global->$idprof_mandatory))
|
||||
{
|
||||
if (! $error) $langs->load("errors");
|
||||
$error++;
|
||||
setEventMessages($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), null, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$qualified_for_stock_change = 0;
|
||||
@@ -1954,7 +1954,7 @@ if ($action == 'create')
|
||||
$dateinvoice = (empty($dateinvoice)?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$dateinvoice); // Do not set 0 here (0 for a date is 1970)
|
||||
}
|
||||
|
||||
$absolute_discount = $soc->getAvailableDiscounts();
|
||||
if(!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
|
||||
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
@@ -3315,7 +3315,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('BankAccount');
|
||||
print '<td>';
|
||||
if (($action != 'editbankaccount') && $user->rights->commande->creer && ! empty($object->brouillon))
|
||||
if (($action != 'editbankaccount') && $user->rights->facture->creer && ! empty($object->brouillon))
|
||||
print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editbankaccount&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'),1).'</a></td>';
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="3">';
|
||||
|
||||
@@ -387,8 +387,8 @@ class Facture extends CommonInvoice
|
||||
{
|
||||
$newinvoiceline=$this->lines[$i];
|
||||
$newinvoiceline->fk_facture=$this->id;
|
||||
$newinvoiceline->origin = $this->element;
|
||||
$newinvoiceline->origin_id = $this->lines[$i]->id;
|
||||
$newinvoiceline->origin = $this->element; // TODO This seems not used. Here we but origin 'facture' but after
|
||||
$newinvoiceline->origin_id = $this->lines[$i]->id; // we put an id of object !
|
||||
if ($result >= 0 && ($newinvoiceline->info_bits & 0x01) == 0) // We keep only lines with first bit = 0
|
||||
{
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
@@ -2138,7 +2138,8 @@ class Facture extends CommonInvoice
|
||||
$product_type=$product->type;
|
||||
|
||||
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnInvoice', $product->ref);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@@ -2177,27 +2178,32 @@ class Facture extends CommonInvoice
|
||||
$this->line->fk_facture=$this->id;
|
||||
$this->line->label=$label; // deprecated
|
||||
$this->line->desc=$desc;
|
||||
$this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative
|
||||
|
||||
$this->line->qty= ($this->type==self::TYPE_CREDIT_NOTE?abs($qty):$qty); // For credit note, quantity is always positive and unit price negative
|
||||
$this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise
|
||||
|
||||
$this->line->tva_tx=$txtva;
|
||||
$this->line->localtax1_tx=$txlocaltax1;
|
||||
$this->line->localtax2_tx=$txlocaltax2;
|
||||
$this->line->localtax1_type = $localtaxes_type[0];
|
||||
$this->line->localtax2_type = $localtaxes_type[2];
|
||||
|
||||
$this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_tva= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_localtax1=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax1):$total_localtax1); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_localtax2=(($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_localtax2):$total_localtax2); // For credit note and if qty is negative, total is negative
|
||||
|
||||
$this->line->fk_product=$fk_product;
|
||||
$this->line->product_type=$product_type;
|
||||
$this->line->remise_percent=$remise_percent;
|
||||
$this->line->subprice= ($this->type==self::TYPE_CREDIT_NOTE?-abs($pu_ht):$pu_ht); // For credit note, unit price always negative, always positive otherwise
|
||||
$this->line->date_start=$date_start;
|
||||
$this->line->date_end=$date_end;
|
||||
$this->line->ventil=$ventil;
|
||||
$this->line->rang=$rangtouse;
|
||||
$this->line->info_bits=$info_bits;
|
||||
$this->line->fk_remise_except=$fk_remise_except;
|
||||
$this->line->total_ht= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative
|
||||
$this->line->total_tva= $total_tva;
|
||||
$this->line->total_localtax1=$total_localtax1;
|
||||
$this->line->total_localtax2=$total_localtax2;
|
||||
$this->line->localtax1_type = $localtaxes_type[0];
|
||||
$this->line->localtax2_type = $localtaxes_type[2];
|
||||
$this->line->total_ttc= (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc);
|
||||
|
||||
$this->line->special_code=$special_code;
|
||||
$this->line->fk_parent_line=$fk_parent_line;
|
||||
$this->line->origin=$origin;
|
||||
@@ -2343,7 +2349,8 @@ class Facture extends CommonInvoice
|
||||
$product_type=$product->type;
|
||||
|
||||
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) {
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnInvoice', $product->ref);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@@ -3205,7 +3212,7 @@ class Facture extends CommonInvoice
|
||||
|
||||
$clause = " WHERE";
|
||||
|
||||
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin";
|
||||
$sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
if (!$user->rights->societe->client->voir && !$user->societe_id)
|
||||
{
|
||||
@@ -3227,7 +3234,7 @@ class Facture extends CommonInvoice
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->facture->client->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("CustomerBillsUnpaid");
|
||||
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1';
|
||||
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills';
|
||||
$response->img=img_object($langs->trans("Bills"),"bill");
|
||||
|
||||
$generic_facture = new Facture($this->db);
|
||||
@@ -3235,6 +3242,7 @@ class Facture extends CommonInvoice
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$generic_facture->date_lim_reglement = $this->db->jdate($obj->datefin);
|
||||
$generic_facture->statut = $obj->fk_statut;
|
||||
|
||||
$response->nbtodo++;
|
||||
|
||||
|
||||
@@ -530,7 +530,7 @@ if ($search_user > 0)
|
||||
}
|
||||
if (! $sall)
|
||||
{
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' GROUP BY f.rowid, f.facnumber, ref_client, f.type, f.note_private, f.note_public, f.increment, f.fk_mode_reglement, f.total, f.tva, f.total_ttc,';
|
||||
$sql.= ' f.datef, f.date_lim_reglement,';
|
||||
$sql.= ' f.paye, f.fk_statut,';
|
||||
$sql.= ' s.nom, s.rowid, s.code_client, s.client';
|
||||
@@ -568,6 +568,7 @@ if ($resql)
|
||||
}
|
||||
|
||||
$param='&socid='.$socid;
|
||||
if ($sall) $param.='&sall='.$sall;
|
||||
if ($day) $param.='&day='.$day;
|
||||
if ($month) $param.='&month='.$month;
|
||||
if ($year) $param.='&year=' .$year;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
@@ -824,7 +824,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
print '</tr>';
|
||||
|
||||
$total_ttc += $obj->total_ttc;
|
||||
$total += $obj->total;
|
||||
$total += $obj->total_ht;
|
||||
$totalam += $obj->am;
|
||||
$var=!$var;
|
||||
$i++;
|
||||
@@ -877,7 +877,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
|
||||
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
|
||||
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
|
||||
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur";
|
||||
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
|
||||
$sql.= " ORDER BY ff.date_lim_reglement ASC";
|
||||
|
||||
$resql=$db->query($sql);
|
||||
|
||||
@@ -106,7 +106,7 @@ $fsearch.=' <input type="text" name="min" id="min" value="'.$min.'" size="6">';
|
||||
|
||||
$calc=$conf->global->MAIN_INFO_LOCALTAX_CALC.$local;
|
||||
// Affiche en-tete du rapport
|
||||
if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice for goods and services
|
||||
if ($calc==0 || $calc==1) // Calculate on invoice for goods and services
|
||||
{
|
||||
$nom=$langs->transcountry($local==1?"LT1ReportByCustomersInInputOutputMode":"LT2ReportByCustomersInInputOutputMode",$mysoc->country_code);
|
||||
$calcmode=$calc==0?$langs->trans("CalcModeLT".$local):$langs->trans("CalcModeLT".$local."Rec");
|
||||
@@ -124,7 +124,7 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice
|
||||
$productsup=$langs->trans("Description");
|
||||
$amountsup=$langs->trans("AmountHT");
|
||||
}
|
||||
if ($conf->global->$calc==2) // Invoice for goods, payment for services
|
||||
if ($calc==2) // Invoice for goods, payment for services
|
||||
{
|
||||
$nom=$langs->transcountry($local==1?"LT1ReportByCustomersInInputOutputMode":"LT2ReportByCustomersInInputOutputMode",$mysoc->country_code);
|
||||
$calcmode=$langs->trans("CalcModeLT2Debt");
|
||||
@@ -149,7 +149,7 @@ $vatcust=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code);
|
||||
$vatsup=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code);
|
||||
|
||||
// IRPF that the customer has retained me
|
||||
if($conf->global->$calc ==0 || $conf->global->$calc == 2)
|
||||
if($calc ==0 || $calc == 2)
|
||||
{
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
@@ -232,7 +232,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2)
|
||||
}
|
||||
|
||||
// IRPF I retained my supplier
|
||||
if($conf->global->$calc ==0 || $conf->global->$calc == 1){
|
||||
if($calc ==0 || $calc == 1){
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print '<td align="left">'.$langs->trans("Num")."</td>";
|
||||
@@ -309,7 +309,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
|
||||
}
|
||||
}
|
||||
|
||||
if($conf->global->$calc ==0){
|
||||
if($calc ==0){
|
||||
// Total to pay
|
||||
print '<br><br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@@ -273,7 +273,8 @@ $sql.= " WHERE f.entity = ".$conf->entity;
|
||||
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
|
||||
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
|
||||
$sql.= " AND localtaxtype=".$localTaxType;
|
||||
$sql.= " GROUP BY dm ASC";
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= " ORDER BY dm ASC";
|
||||
|
||||
pt($db, $sql,$langs->trans("Year")." $y");
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014-2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -916,7 +916,10 @@ class BonPrelevement extends CommonObject
|
||||
$row = $this->db->fetch_row($resql);
|
||||
$ref = "T".$ref.str_pad(dol_substr("00".intval($row[0])+1,0,2),2,"0",STR_PAD_LEFT);
|
||||
|
||||
$this->filename = $conf->prelevement->dir_output.'/receipts/'.$ref.'.xml';
|
||||
$dir=$conf->prelevement->dir_output.'/receipts';
|
||||
if (! is_dir($dir)) dol_mkdir($dir);
|
||||
|
||||
$this->filename = $dir.'/'.$ref.'.xml';
|
||||
|
||||
// Create withdraw receipt in database
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
|
||||
@@ -932,10 +935,6 @@ class BonPrelevement extends CommonObject
|
||||
{
|
||||
$prev_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_bons");
|
||||
$this->id = $prev_id;
|
||||
|
||||
$dir=$conf->prelevement->dir_output.'/receipts';
|
||||
$file=$filebonprev;
|
||||
if (! is_dir($dir)) dol_mkdir($dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1031,7 +1030,7 @@ class BonPrelevement extends CommonObject
|
||||
// Generation of SEPA file
|
||||
$this->generate();
|
||||
}
|
||||
dol_syslog(__METHOD__."::End withdraw receipt, file ".$filebonprev, LOG_DEBUG);
|
||||
dol_syslog(__METHOD__."::End withdraw receipt, file ".$this->filename, LOG_DEBUG);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1559,7 +1558,7 @@ class BonPrelevement extends CommonObject
|
||||
$XML_DEBITOR ='';
|
||||
$XML_DEBITOR .=' <DrctDbtTxInf>'.$CrLf;
|
||||
$XML_DEBITOR .=' <PmtId>'.$CrLf;
|
||||
$XML_DEBITOR .=' <EndToEndId>'.('AS-'.$row_facnumber.'-'.$Rowing).'</EndToEndId>'.$CrLf;
|
||||
$XML_DEBITOR .=' <EndToEndId>'.('AS-'.dol_trunc($row_facnumber,20).'-'.$Rowing).'</EndToEndId>'.$CrLf; // ISO20022 states that EndToEndId has a MaxLength of 35 characters
|
||||
$XML_DEBITOR .=' </PmtId>'.$CrLf;
|
||||
$XML_DEBITOR .=' <InstdAmt Ccy="EUR">'.round($row_somme, 2).'</InstdAmt>'.$CrLf;
|
||||
$XML_DEBITOR .=' <DrctDbtTx>'.$CrLf;
|
||||
@@ -1674,8 +1673,9 @@ class BonPrelevement extends CommonObject
|
||||
* @return string String with SEPA Sender
|
||||
*/
|
||||
function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n')
|
||||
{ // SEPA INITIALISATION
|
||||
global $confs;
|
||||
{
|
||||
// SEPA INITIALISATION
|
||||
global $conf;
|
||||
|
||||
$dateTime_YMD = dol_print_date($ladate, '%Y%m%d');
|
||||
$dateTime_ETAD = dol_print_date($ladate, '%Y-%m-%d');
|
||||
|
||||
@@ -141,7 +141,7 @@ if ($prev_id)
|
||||
print price($row[0]);
|
||||
|
||||
print '</td><td align="right">';
|
||||
print round($row[0]/$bon->amount*100,2)." %";
|
||||
if ($bon->amount) print round($row[0]/$bon->amount*100,2)." %";
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@@ -262,9 +262,15 @@ $dolibarr_main_db_prefix='';
|
||||
// $dolibarr_main_limit_users='0';
|
||||
|
||||
// dolibarr_mailing_limit_sendbyweb
|
||||
// Can set a limit for mailing send by web. Can be used for a restricted mode.
|
||||
// Default value: 0 (use database value if exist)
|
||||
// Examples:
|
||||
// Can set a limit for mailing send by web. This overwrite database value. Can be used to restrict on OS level.
|
||||
// Default value: '0' (no overwrite, use database value if exists)
|
||||
// Examples: '-1' (sending by web is forbidden)
|
||||
// $dolibarr_mailing_limit_sendbyweb='0';
|
||||
|
||||
// dolibarr_mailing_limit_sendbycli
|
||||
// Can set a limit for mailing send by cli. This overwrite database value. Can be used to restrict on OS level.
|
||||
// Default value: '0' (no overwrite, use database value if exists)
|
||||
// Examples: '-1' (sending by cli is forbidden)
|
||||
// $dolibarr_mailing_limit_sendbyweb='0';
|
||||
|
||||
// dolibarr_strict_mode
|
||||
|
||||
@@ -364,6 +364,7 @@ if ($result)
|
||||
$param ='&begin='.urlencode($begin).'&view='.urlencode($view).'&userid='.urlencode($userid).'&contactname='.urlencode($sall);
|
||||
$param.='&type='.urlencode($type).'&view='.urlencode($view).'&search_lastname='.urlencode($search_lastname).'&search_firstname='.urlencode($search_firstname).'&search_societe='.urlencode($search_societe).'&search_email='.urlencode($search_email);
|
||||
if (!empty($search_categ)) $param.='&search_categ='.urlencode($search_categ);
|
||||
if ($sall != '') $param.='&sall='.urlencode($sall);
|
||||
if ($search_lastname != '') $param.='&search_lastname='.urlencode($search_lastname);
|
||||
if ($search_firstname != '') $param.='&search_firstname='.urlencode($search_firstname);
|
||||
if ($search_zip != '') $param.='&search_zip='.urlencode($search_zip);
|
||||
|
||||
@@ -1134,6 +1134,16 @@ class Contrat extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Removed extrafields
|
||||
if (! $error) {
|
||||
$result=$this->deleteExtraFields();
|
||||
if ($result < 0)
|
||||
{
|
||||
$error++;
|
||||
dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
// We remove directory
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -222,6 +223,7 @@ if ($resql)
|
||||
$param.='&search_name='.$search_name;
|
||||
$param.='&search_ref_supplier='.$search_ref_supplier;
|
||||
$param.='&search_sale=' .$search_sale;
|
||||
if ($sall != '') $param.='&sall='.$sall;
|
||||
if ($optioncss != '') $param.='&optioncss='.$optioncss;
|
||||
|
||||
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
|
||||
@@ -245,7 +247,7 @@ if ($resql)
|
||||
print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="6" name="search_ref_customer value="'.dol_escape_htmltag($search_ref_supplier).'">';
|
||||
print '<input type="text" class="flat" size="6" name="search_ref_customer value="'.dol_escape_htmltag($search_ref_customer).'">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" size="6" name="search_ref_supplier value="'.dol_escape_htmltag($search_ref_supplier).'">';
|
||||
|
||||
@@ -313,7 +313,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
$interface=new Interfaces($db);
|
||||
$result=$interface->run_triggers($trigger_name,$object,$user,$langs,$conf);
|
||||
if ($result < 0) {
|
||||
$error++; $this->errors=$interface->errors;
|
||||
$error++; $errors=$interface->errors;
|
||||
}
|
||||
// End call of triggers
|
||||
|
||||
@@ -327,8 +327,8 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
||||
// This avoid sending mail twice if going out and then back to page
|
||||
$mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2));
|
||||
setEventMessages($mesg, null, 'mesgs');
|
||||
if($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
|
||||
else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
|
||||
if ($conf->dolimail->enabled) header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id.'&'.($paramname2?$paramname2:'mid').'='.$parm2val);
|
||||
else header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname?$paramname:'id').'='.$object->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +240,10 @@ if ($section)
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
$useglobalvars=1;
|
||||
$form = new Form($db);
|
||||
$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'));
|
||||
$formquestion=array(
|
||||
'urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'),
|
||||
'section'=>array('type'=>'hidden','value'=>$section,'name'=>'section')
|
||||
);
|
||||
print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2012-2014 Charles-François BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -79,8 +80,10 @@ class box_project extends ModeleBoxes
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
if($user->socid) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid=p.fk_soc";
|
||||
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
if($user->socid) $sql.= " AND s.rowid = ".$user->socid;
|
||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||
$sql.= " ORDER BY p.datec DESC";
|
||||
$sql.= $db->plimit($max, 0);
|
||||
|
||||
|
||||
@@ -143,6 +143,8 @@ class CMailFile
|
||||
$this->msgishtml = $msgishtml;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_MAIL_FORCE_CONTENT_TYPE_TO_HTML)) $this->msgishtml=1; // To force to send everything with content type html.
|
||||
|
||||
// Detect images
|
||||
if ($this->msgishtml)
|
||||
{
|
||||
@@ -366,7 +368,7 @@ class CMailFile
|
||||
*/
|
||||
function sendfile()
|
||||
{
|
||||
global $conf,$db;
|
||||
global $conf,$db,$langs;
|
||||
|
||||
$errorlevel=error_reporting();
|
||||
error_reporting($errorlevel ^ E_WARNING); // Desactive warnings
|
||||
@@ -389,6 +391,30 @@ class CMailFile
|
||||
return $reshook;
|
||||
}
|
||||
|
||||
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
|
||||
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL=10;
|
||||
$tmparray = explode(',', $this->addr_to);
|
||||
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in to:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
$tmparray = explode(',', $this->addr_cc);
|
||||
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in cc:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
$tmparray = explode(',', $this->addr_bcc);
|
||||
if (count($tmparray) > $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL)
|
||||
{
|
||||
$this->error = 'Too much recipients in bcc:';
|
||||
dol_syslog("CMailFile::sendfile: mail end error=" . $this->error, LOG_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Action according to choosed sending method
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
||||
{
|
||||
@@ -417,8 +443,6 @@ class CMailFile
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'), LOG_DEBUG);
|
||||
|
||||
$bounce = ''; // By default
|
||||
if (! empty($conf->global->MAIN_MAIL_ALLOW_SENDMAIL_F))
|
||||
{
|
||||
@@ -431,6 +455,7 @@ class CMailFile
|
||||
{
|
||||
$bounce .= ($bounce?' ':'').'-ba';
|
||||
}
|
||||
dol_syslog("CMailFile::sendfile: mail start HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port').", additionnal_parameters=".$bounce, LOG_DEBUG);
|
||||
|
||||
$this->message=stripslashes($this->message);
|
||||
|
||||
@@ -449,7 +474,8 @@ class CMailFile
|
||||
{
|
||||
$this->error.=" to HOST=".ini_get('SMTP').", PORT=".ini_get('smtp_port'); // This values are value used only for non linuxlike systems
|
||||
}
|
||||
$this->error.=".<br>Check your server logs and your firewalls setup";
|
||||
$this->error.=".<br>";
|
||||
$this->error.=$langs->trans("ErrorPhpMailDelivery");
|
||||
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
|
||||
}
|
||||
else
|
||||
@@ -680,7 +706,7 @@ class CMailFile
|
||||
global $conf;
|
||||
$out = "";
|
||||
|
||||
$host = dol_getprefix();
|
||||
$host = dol_getprefix('email');
|
||||
|
||||
// Sender
|
||||
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
|
||||
@@ -798,8 +824,9 @@ class CMailFile
|
||||
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
|
||||
}
|
||||
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
|
||||
$strContent = rtrim(wordwrap($strContent));
|
||||
// Make RFC2045 Compliant, split lines
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
|
||||
$strContent = rtrim(wordwrap($strContent)); // TODO Using this method creates unexpected line break on text/plain content.
|
||||
|
||||
if ($this->msgishtml)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,8 @@ abstract class CommonDocGenerator
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$logotouse=$conf->user->dir_output.'/'.get_exdir($user->id, 2, 0, 1, $user, 'user').'/'.$user->photo;
|
||||
|
||||
return array(
|
||||
'myuser_lastname'=>$user->lastname,
|
||||
'myuser_firstname'=>$user->firstname,
|
||||
@@ -75,7 +77,7 @@ abstract class CommonDocGenerator
|
||||
'myuser_fax'=>$user->office_fax,
|
||||
'myuser_mobile'=>$user->user_mobile,
|
||||
'myuser_email'=>$user->email,
|
||||
'myuser_logo'=>$user->photo,
|
||||
'myuser_logo'=>$logotouse,
|
||||
'myuser_job'=>$user->job,
|
||||
'myuser_web'=>'' // url not exist in $user object
|
||||
);
|
||||
@@ -430,7 +432,7 @@ abstract class CommonDocGenerator
|
||||
'line_fulldesc'=>doc_getlinedesc($line,$outputlangs),
|
||||
'line_product_ref'=>$line->product_ref,
|
||||
'line_product_label'=>$line->product_label,
|
||||
'line_product_type'=>$line->product_type,
|
||||
'line_product_type'=>$line->product_type,
|
||||
'line_desc'=>$line->desc,
|
||||
'line_vatrate'=>vatrate($line->tva_tx,true,$line->info_bits),
|
||||
'line_up'=>price2num($line->subprice),
|
||||
@@ -444,9 +446,9 @@ abstract class CommonDocGenerator
|
||||
'line_price_ttc_locale'=>price($line->total_ttc, 0, $outputlangs),
|
||||
'line_price_vat_locale'=>price($line->total_tva, 0, $outputlangs),
|
||||
'line_date_start'=>$line->date_start,
|
||||
'line_date_start_rfc'=>dol_print_date($line->date_start,'rfc'),
|
||||
'line_date_start_rfc'=>dol_print_date($line->date_start,'dayrfc'),
|
||||
'line_date_end'=>$line->date_end,
|
||||
'line_date_end_rfc'=>dol_print_date($line->date_end,'rfc')
|
||||
'line_date_end_rfc'=>dol_print_date($line->date_end,'dayrfc')
|
||||
);
|
||||
|
||||
// Retrieve extrafields
|
||||
|
||||
@@ -595,50 +595,56 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$datecreate = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insertion dans la base
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||
$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
|
||||
$sql.= "'".$this->db->idate($datecreate)."'";
|
||||
$sql.= ", 4, '". $id_type_contact . "' ";
|
||||
$sql.= ")";
|
||||
dol_syslog(get_class($this)."::add_contact", LOG_DEBUG);
|
||||
if(! empty($id_type_contact)) {
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
$result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user);
|
||||
if ($result < 0)
|
||||
$datecreate = dol_now();
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Insertion dans la base
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."element_contact";
|
||||
$sql.= " (element_id, fk_socpeople, datecreate, statut, fk_c_type_contact) ";
|
||||
$sql.= " VALUES (".$this->id.", ".$fk_socpeople." , " ;
|
||||
$sql.= "'".$this->db->idate($datecreate)."'";
|
||||
$sql.= ", 4, ". $id_type_contact . " ";
|
||||
$sql.= ")";
|
||||
dol_syslog(get_class($this)."::add_contact", LOG_DEBUG);
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if (! $notrigger)
|
||||
{
|
||||
$result=$this->call_trigger(strtoupper($this->element).'_ADD_CONTACT', $user);
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$this->error=$this->db->errno();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
|
||||
{
|
||||
$this->error=$this->db->errno();
|
||||
$this->db->rollback();
|
||||
return -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=$this->db->error();
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,7 @@ class DolEditor
|
||||
// Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart.
|
||||
// Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ?
|
||||
$modulepart='fckeditor';
|
||||
$this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&file=';
|
||||
$this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file=';
|
||||
$this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ;
|
||||
|
||||
$this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false');
|
||||
|
||||
@@ -729,7 +729,7 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'price')
|
||||
{
|
||||
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="6" value="'.price($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
|
||||
$out='<input type="text" class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" size="6" value="'.price2num($value).'" '.($moreparam?$moreparam:'').'> '.$langs->getCurrencySymbol($conf->currency);
|
||||
}
|
||||
elseif ($type == 'double')
|
||||
{
|
||||
@@ -1232,7 +1232,14 @@ class ExtraFields
|
||||
{
|
||||
$sql.= ' as main';
|
||||
}
|
||||
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
||||
if ($selectkey=='rowid' && empty($value)) {
|
||||
$sql.= " WHERE ".$selectkey."=0";
|
||||
} elseif ($selectkey=='rowid') {
|
||||
$sql.= " WHERE ".$selectkey."=".$this->db->escape($value);
|
||||
}else {
|
||||
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
||||
}
|
||||
|
||||
//$sql.= ' AND entity = '.$conf->entity;
|
||||
|
||||
dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
|
||||
|
||||
@@ -167,7 +167,8 @@ class HookManager
|
||||
'printObjectLine',
|
||||
'printObjectSubLine',
|
||||
'createDictionaryFieldList',
|
||||
'editDictionaryFieldlist'
|
||||
'editDictionaryFieldlist',
|
||||
'getFormMail'
|
||||
)
|
||||
)) $hooktype='addreplace';
|
||||
// Deprecated hook types ('returnvalue')
|
||||
|
||||
@@ -1896,8 +1896,8 @@ class Form
|
||||
$sql.= " WHERE fk_product='".$objp->rowid."'";
|
||||
$sql.= " AND entity IN (".getEntity('productprice', 1).")";
|
||||
$sql.= " AND price_level=".$price_level;
|
||||
$sql.= " ORDER BY date_price, rowid";
|
||||
$sql.= " DESC LIMIT 1";
|
||||
$sql.= " ORDER BY date_price DESC, rowid DESC";
|
||||
$sql.= " LIMIT 1";
|
||||
|
||||
dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.'', LOG_DEBUG);
|
||||
$result2 = $this->db->query($sql);
|
||||
@@ -2278,7 +2278,7 @@ class Form
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('productprice', 1).")";
|
||||
$sql.= " AND p.tobuy = 1";
|
||||
$sql.= " AND s.fournisseur = 1";
|
||||
$sql.= " AND p.rowid = ".$productid;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -720,9 +721,6 @@ class FormFile
|
||||
if ($modulepart == 'export') {
|
||||
$relativepath = $file["name"];
|
||||
}
|
||||
if ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_fournisseur') {
|
||||
$relativepath = get_exdir($modulesubdir, 2,0,0,null,'invoice_supplier'). $modulesubdir. "/" . $file["name"];
|
||||
}
|
||||
|
||||
// Show file name with link to download
|
||||
$out.= '<a data-ajax="false" href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'"';
|
||||
|
||||
@@ -140,8 +140,8 @@ class FormProjets
|
||||
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
|
||||
if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
|
||||
if (!empty($filterkey)) {
|
||||
$sql .= ' AND p.title LIKE "%'.$this->db->escape($filterkey).'%"';
|
||||
$sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"';
|
||||
$sql .= " AND p.title LIKE '%".$this->db->escape($filterkey)."%'";
|
||||
$sql .= " OR p.ref LIKE '%".$this->db->escape($filterkey)."%'";
|
||||
}
|
||||
$sql.= " ORDER BY p.ref ASC";
|
||||
|
||||
|
||||
@@ -162,68 +162,52 @@ class Ldap
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (! function_exists('ldap_connect'))
|
||||
if (! function_exists("ldap_connect"))
|
||||
{
|
||||
$this->error='Your PHP need extension ldap';
|
||||
$this->error='LDAPFunctionsNotAvailableOnPHP';
|
||||
dol_syslog(get_class($this)."::connect_bind ".$this->error, LOG_WARNING);
|
||||
return -1;
|
||||
$return=-1;
|
||||
}
|
||||
|
||||
// Loop on each ldap server
|
||||
foreach ($this->server as $key => $host)
|
||||
if (empty($this->error))
|
||||
{
|
||||
if ($connected) break;
|
||||
if (empty($host)) continue;
|
||||
|
||||
if (preg_match('/^ldap/',$host))
|
||||
// Loop on each ldap server
|
||||
foreach ($this->server as $key => $host)
|
||||
{
|
||||
$this->connection = ldap_connect($host);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->connection = ldap_connect($host,$this->serverPort);
|
||||
}
|
||||
if ($connected) break;
|
||||
if (empty($host)) continue;
|
||||
|
||||
if (is_resource($this->connection))
|
||||
{
|
||||
// Begin TLS if requested by the configuration
|
||||
if (! empty($conf->global->LDAP_SERVER_USE_TLS))
|
||||
{
|
||||
if (! ldap_start_tls($this->connection))
|
||||
{
|
||||
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
|
||||
$connected = 0;
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the ldap_set_option here (after connect and before bind)
|
||||
$this->setVersion();
|
||||
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
|
||||
|
||||
|
||||
if ($this->serverType == "activedirectory")
|
||||
if (preg_match('/^ldap/',$host))
|
||||
{
|
||||
$result=$this->setReferrals();
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
$this->bind=$this->result;
|
||||
$connected=2;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
}
|
||||
$this->connection = ldap_connect($host);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Try in auth mode
|
||||
if ($this->searchUser && $this->searchPassword)
|
||||
$this->connection = ldap_connect($host,$this->serverPort);
|
||||
}
|
||||
|
||||
if (is_resource($this->connection))
|
||||
{
|
||||
// Begin TLS if requested by the configuration
|
||||
if (! empty($conf->global->LDAP_SERVER_USE_TLS))
|
||||
{
|
||||
if (! ldap_start_tls($this->connection))
|
||||
{
|
||||
dol_syslog(get_class($this)."::connect_bind failed to start tls", LOG_WARNING);
|
||||
$connected = 0;
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the ldap_set_option here (after connect and before bind)
|
||||
$this->setVersion();
|
||||
ldap_set_option($this->connection, LDAP_OPT_SIZELIMIT, 0); // no limit here. should return true.
|
||||
|
||||
|
||||
if ($this->serverType == "activedirectory")
|
||||
{
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
|
||||
$result=$this->setReferrals();
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth for activedirectory on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
@@ -236,26 +220,45 @@ class Ldap
|
||||
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
}
|
||||
}
|
||||
// Try in anonymous
|
||||
if (! $this->bind)
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG);
|
||||
$result=$this->bind();
|
||||
if ($result)
|
||||
// Try in auth mode
|
||||
if ($this->searchUser && $this->searchPassword)
|
||||
{
|
||||
$this->bind=$this->result;
|
||||
$connected=1;
|
||||
break;
|
||||
dol_syslog(get_class($this)."::connect_bind try bindauth on ".$host." user=".$this->searchUser." password=".preg_replace('/./','*',$this->searchPassword),LOG_DEBUG);
|
||||
$this->result=$this->bindauth($this->searchUser,$this->searchPassword);
|
||||
if ($this->result)
|
||||
{
|
||||
$this->bind=$this->result;
|
||||
$connected=2;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
}
|
||||
}
|
||||
else
|
||||
// Try in anonymous
|
||||
if (! $this->bind)
|
||||
{
|
||||
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
dol_syslog(get_class($this)."::connect_bind try bind on ".$host,LOG_DEBUG);
|
||||
$result=$this->bind();
|
||||
if ($result)
|
||||
{
|
||||
$this->bind=$this->result;
|
||||
$connected=1;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->error=ldap_errno($this->connection).' '.ldap_error($this->connection);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $connected) $this->close();
|
||||
if (! $connected) $this->close();
|
||||
}
|
||||
}
|
||||
|
||||
if ($connected)
|
||||
|
||||
@@ -1126,6 +1126,8 @@ class SMTPs
|
||||
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
|
||||
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
|
||||
|
||||
$host=dol_getprefix('email').'-'.$host;
|
||||
|
||||
//NOTE: Message-ID should probably contain the username of the user who sent the msg
|
||||
$_header .= 'Subject: ' . $this->getSubject() . "\r\n";
|
||||
$_header .= 'Date: ' . date("r") . "\r\n";
|
||||
@@ -1186,7 +1188,9 @@ class SMTPs
|
||||
// Make RFC821 Compliant, replace bare linefeeds
|
||||
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
|
||||
|
||||
$strContent = rtrim(wordwrap($strContent, 75, "\r\n"));
|
||||
// Make RFC2045 Compliant
|
||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems ko if not used on a base64 content
|
||||
$strContent = rtrim(wordwrap($strContent, 75, "\r\n")); // TODO Using this method creates unexpected line break on text/plain content.
|
||||
|
||||
$this->_msgContent[$strType] = array();
|
||||
|
||||
|
||||
@@ -1093,7 +1093,7 @@ class DoliDBPgsql extends DoliDB
|
||||
*/
|
||||
function DDLDropField($table,$field_name)
|
||||
{
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if (! $this->query($sql))
|
||||
{
|
||||
|
||||
@@ -15,36 +15,38 @@ if ($resql) // This can fail when class is used on old database (during migra
|
||||
{
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
{
|
||||
$fieldname=$keyforaliasextra.'.'.$obj->name;
|
||||
$fieldlabel=ucfirst($obj->label);
|
||||
$typeFilter="Text";
|
||||
switch($obj->type)
|
||||
{
|
||||
case 'int':
|
||||
case 'double':
|
||||
case 'price':
|
||||
$typeFilter="Numeric";
|
||||
break;
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
$typeFilter="Date";
|
||||
break;
|
||||
case 'boolean':
|
||||
$typeFilter="Boolean";
|
||||
break;
|
||||
case 'sellist':
|
||||
$tmp='';
|
||||
$tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
||||
if ($tmpparam['options'] && is_array($tmpparam['options'])) {
|
||||
$tmpkeys=array_keys($tmpparam['options']);
|
||||
$tmp=array_shift($tmpkeys);
|
||||
}
|
||||
if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp;
|
||||
break;
|
||||
if ($obj->type!='separate') {
|
||||
$fieldname=$keyforaliasextra.'.'.$obj->name;
|
||||
$fieldlabel=ucfirst($obj->label);
|
||||
$typeFilter="Text";
|
||||
switch($obj->type)
|
||||
{
|
||||
case 'int':
|
||||
case 'double':
|
||||
case 'price':
|
||||
$typeFilter="Numeric";
|
||||
break;
|
||||
case 'date':
|
||||
case 'datetime':
|
||||
$typeFilter="Date";
|
||||
break;
|
||||
case 'boolean':
|
||||
$typeFilter="Boolean";
|
||||
break;
|
||||
case 'sellist':
|
||||
$tmp='';
|
||||
$tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null
|
||||
if ($tmpparam['options'] && is_array($tmpparam['options'])) {
|
||||
$tmpkeys=array_keys($tmpparam['options']);
|
||||
$tmp=array_shift($tmpkeys);
|
||||
}
|
||||
if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp;
|
||||
break;
|
||||
}
|
||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
||||
$this->export_entities_array[$r][$fieldname]=$keyforelement;
|
||||
}
|
||||
$this->export_fields_array[$r][$fieldname]=$fieldlabel;
|
||||
$this->export_TypeFields_array[$r][$fieldname]=$typeFilter;
|
||||
$this->export_entities_array[$r][$fieldname]=$keyforelement;
|
||||
}
|
||||
}
|
||||
// End add axtra fields
|
||||
|
||||
@@ -44,7 +44,8 @@ $Config['Enabled'] = true ;
|
||||
|
||||
|
||||
// Path to user files relative to the document root.
|
||||
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&file=' ;
|
||||
$extEntity=(empty($entity) ? 1 : $entity); // For multicompany with external access
|
||||
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=fckeditor&entity='.$extEntity.'&file=' ;
|
||||
|
||||
// Fill the following value it you prefer to specify the absolute path for the
|
||||
// user files directory. Useful if you are using a virtual directory, symbolic
|
||||
|
||||
@@ -1012,6 +1012,9 @@ function getParameterByName(name, valueifnotfound)
|
||||
}
|
||||
})();
|
||||
|
||||
// Another solution, easier, to build a javascript rounding function
|
||||
function dolroundjs(number, decimals) { return +(Math.round(number + "e+" + decimals) + "e-" + decimals); }
|
||||
|
||||
|
||||
/**
|
||||
* Function similar to PHP price2num()
|
||||
@@ -1024,7 +1027,7 @@ function price2numjs(amount) {
|
||||
if (amount == '') return '';
|
||||
|
||||
<?php
|
||||
$dec = ',';
|
||||
$dec = ',';
|
||||
$thousand = ' ';
|
||||
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
||||
$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
|
||||
@@ -1032,12 +1035,13 @@ function price2numjs(amount) {
|
||||
if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
||||
$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
|
||||
}
|
||||
print "var dec='" . $dec . "'; var thousand='" . $thousand . "';\n"; // Set var in javascript
|
||||
if ($thousand == 'Space') $thousand=' ';
|
||||
print "var dec='" . dol_escape_js($dec) . "'; var thousand='" . dol_escape_js($thousand) . "';\n"; // Set var in javascript
|
||||
?>
|
||||
|
||||
var main_max_dec_shown = <?php echo str_replace('.', '', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>;
|
||||
var main_rounding_unit = <?php echo $conf->global->MAIN_MAX_DECIMALS_UNIT; ?>;
|
||||
var main_rounding_tot = <?php echo $conf->global->MAIN_MAX_DECIMALS_TOT; ?>;
|
||||
var main_max_dec_shown = <?php echo (int) str_replace('.', '', $conf->global->MAIN_MAX_DECIMALS_SHOWN); ?>;
|
||||
var main_rounding_unit = <?php echo (int) $conf->global->MAIN_MAX_DECIMALS_UNIT; ?>;
|
||||
var main_rounding_tot = <?php echo (int) $conf->global->MAIN_MAX_DECIMALS_TOT; ?>;
|
||||
|
||||
var amount = amount.toString();
|
||||
|
||||
@@ -1050,11 +1054,15 @@ function price2numjs(amount) {
|
||||
if (nbdec > rounding) rounding = nbdec;
|
||||
// If rounding higher than max shown
|
||||
if (rounding > main_max_dec_shown) rounding = main_max_dec_shown;
|
||||
|
||||
if (thousand != ',' && thousand != '.') amount = amount.replace(',', '.');
|
||||
amount = amount.replace(' ', ''); // To avoid spaces
|
||||
amount = amount.replace(thousand, ''); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||
amount = amount.replace(dec, '.');
|
||||
|
||||
return Math.round10(amount, rounding);
|
||||
//console.log("amount before="+amount+" rouding="+rounding)
|
||||
var res = Math.round10(amount, - rounding);
|
||||
// Other solution is
|
||||
// var res = dolroundjs(amount, rounding)
|
||||
console.log("res="+res)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -732,17 +732,24 @@ function activateModule($value,$withdeps=1)
|
||||
if (isset($objMod->depends) && is_array($objMod->depends) && ! empty($objMod->depends))
|
||||
{
|
||||
// Activation des modules dont le module depend
|
||||
$TError=array();
|
||||
$num = count($objMod->depends);
|
||||
for ($i = 0; $i < $num; $i++)
|
||||
{
|
||||
$activate = false;
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
if (file_exists($dir.$objMod->depends[$i].".class.php"))
|
||||
{
|
||||
activateModule($objMod->depends[$i]);
|
||||
$activate = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$activate) $TError[] = $langs->trans('activateModuleDependNotSatisfied', $objMod->name, $objMod->depends[$i]);
|
||||
}
|
||||
|
||||
setEventMessages('', $TError, 'errors');
|
||||
}
|
||||
|
||||
if (isset($objMod->conflictwith) && is_array($objMod->conflictwith) && ! empty($objMod->conflictwith))
|
||||
|
||||
@@ -79,7 +79,9 @@ function societe_prepare_head(Societe $object)
|
||||
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
|
||||
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
|
||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
|
||||
$head[$h][2] = 'contact';
|
||||
$h++;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
|
||||
@@ -286,10 +286,20 @@ function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
|
||||
* This prefix is unique for instance and avoid conflict between multi-instances,
|
||||
* even when having two instances with one root dir or two instances in virtual servers
|
||||
*
|
||||
* @param string $mode '' or 'email'
|
||||
* @return string A calculated prefix
|
||||
*/
|
||||
function dol_getprefix()
|
||||
function dol_getprefix($mode='')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// If MAIL_PREFIX_FOR_EMAIL_ID is set and prefix is for email
|
||||
if ($mode == 'email' && ! empty($conf->global->MAIL_PREFIX_FOR_EMAIL_ID))
|
||||
{
|
||||
if ($conf->global->MAIL_PREFIX_FOR_EMAIL_ID != 'SERVER_NAME') return $conf->global->MAIL_PREFIX_FOR_EMAIL_ID;
|
||||
else if (isset($_SERVER["SERVER_NAME"])) return $_SERVER["SERVER_NAME"];
|
||||
}
|
||||
|
||||
if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"]))
|
||||
{
|
||||
return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
|
||||
@@ -436,7 +446,7 @@ function dol_size($size,$type='')
|
||||
*/
|
||||
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
||||
{
|
||||
$filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"');
|
||||
$filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"','°');
|
||||
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
|
||||
}
|
||||
|
||||
@@ -3320,7 +3330,7 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
|
||||
* @param float $vatrate Vat rate. Can be '8.5' or '8.5 (VATCODEX)' for example
|
||||
* @param int $local Local tax to search and return (1 or 2 return only tax rate 1 or tax rate 2)
|
||||
* @param Societe $thirdparty_buyer Object of buying third party
|
||||
* @param Societe $thirdparty_seller Object of selling third party
|
||||
* @param Societe $thirdparty_seller Object of selling third party ($mysoc if not defined)
|
||||
* @param int $vatnpr If vat rate is NPR or not
|
||||
* @return mixed 0 if not found, localtax rate if found
|
||||
* @see get_default_tva
|
||||
@@ -3336,7 +3346,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
$vatratecleaned = $vatrate;
|
||||
if (preg_match('/^(.*)\s*\((.*)\)$/', $vatrate, $reg)) // If vat is "xx (yy)"
|
||||
{
|
||||
$vatratecleaned = $reg[1];
|
||||
$vatratecleaned = trim($reg[1]);
|
||||
$vatratecode = $reg[2];
|
||||
}
|
||||
|
||||
@@ -3350,7 +3360,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
{
|
||||
if ($local == 1)
|
||||
{
|
||||
if (! $mysoc->localtax1_assuj) return 0;
|
||||
if (! $mysoc->localtax1_assuj || (string) $vatratecleaned == "0") return 0;
|
||||
if ($thirdparty_seller->id == $mysoc->id)
|
||||
{
|
||||
if (! $thirdparty_buyer->localtax1_assuj) return 0;
|
||||
@@ -3363,7 +3373,7 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
|
||||
if ($local == 2)
|
||||
{
|
||||
if (! $mysoc->localtax2_assuj) return 0;
|
||||
if (! $mysoc->localtax2_assuj || (string) $vatratecleaned == "0") return 0;
|
||||
if ($thirdparty_seller->id == $mysoc->id)
|
||||
{
|
||||
if (! $thirdparty_buyer->localtax2_assuj) return 0;
|
||||
@@ -3379,18 +3389,15 @@ function get_localtax($vatrate, $local, $thirdparty_buyer="", $thirdparty_seller
|
||||
if ($local == 1 && ! $thirdparty_seller->localtax1_assuj) return 0;
|
||||
if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0;
|
||||
}
|
||||
//if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0);
|
||||
|
||||
// Do not enabled this. We want localtax that match the vat rate.
|
||||
// If we forced a vat, we must also force local tax
|
||||
/*
|
||||
if (is_object($thirdparty_buyer))
|
||||
// For some country MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY is forced to on.
|
||||
if (in_array($mysoc->country_code, array('ES')))
|
||||
{
|
||||
if ($thirdparty_seller->country_code != $thirdparty_buyer->country_code) return 0;
|
||||
}*/
|
||||
$conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY = 1;
|
||||
}
|
||||
|
||||
// Search local taxes
|
||||
if ($mysoc->country_code == 'ES' || ! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
|
||||
if (! empty($conf->global->MAIN_GET_LOCALTAXES_VALUES_FROM_THIRDPARTY))
|
||||
{
|
||||
if ($local==1)
|
||||
{
|
||||
@@ -5079,7 +5086,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
||||
if (preg_match('/SUBSTITUTION_([^_]+)/i',$values[2],$reg))
|
||||
{
|
||||
$substitutionarray=array();
|
||||
complete_substitutions_array($substitutionarray,$langs,$object);
|
||||
complete_substitutions_array($substitutionarray,$langs,$object,array('needforkey'=>$values[2]));
|
||||
$label=make_substitutions($reg[1], $substitutionarray);
|
||||
}
|
||||
else $label=$langs->trans($values[2]);
|
||||
@@ -5099,7 +5106,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
|
||||
if (preg_match('/SUBSTITUTION_([^_]+)/i',$values[2],$reg))
|
||||
{
|
||||
$substitutionarray=array();
|
||||
complete_substitutions_array($substitutionarray,$langs,$object);
|
||||
complete_substitutions_array($substitutionarray,$langs,$object,array('needforkey'=>$values[2]));
|
||||
$label=make_substitutions($reg[1], $substitutionarray);
|
||||
}
|
||||
else $label=$langs->trans($values[2]);
|
||||
@@ -5195,7 +5202,7 @@ function printCommonFooter($zone='private')
|
||||
print 'window.console && console.log("';
|
||||
if (! empty($conf->global->MEMCACHED_SERVER)) print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
|
||||
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');
|
||||
if ($micro_start_time)
|
||||
if (! empty($micro_start_time)) // Works only if MAIN_SHOW_TUNING_INFO is defined at $_SERVER level. Not in global variable.
|
||||
{
|
||||
$micro_end_time = microtime(true);
|
||||
print ' - Build time: '.ceil(1000*($micro_end_time-$micro_start_time)).' ms';
|
||||
|
||||
@@ -1493,6 +1493,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
|
||||
|
||||
/**
|
||||
* This function evaluates a string that should be a valid IPv4
|
||||
* Note: For ip 169.254.0.0, it returns 0 with some PHP (5.6.24) and 2 with some minor patchs of PHP (5.6.25). See https://github.com/php/php-src/pull/1954.
|
||||
*
|
||||
* @param string $ip IP Address
|
||||
* @return int 0 if not valid or reserved range, 1 if valid and public IP, 2 if valid and private range IP
|
||||
|
||||
@@ -318,15 +318,15 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
|
||||
else
|
||||
{
|
||||
for ($page=$start_page; $page <= $end_page; ++$page) {
|
||||
$this->setPage($page);
|
||||
$pdf->setPage($page);
|
||||
if ($page == $start_page) {
|
||||
// first page
|
||||
$height = $this->h - $start_y - $this->bMargin;
|
||||
$height = $pdf->h - $start_y - $pdf->bMargin;
|
||||
} elseif ($page == $end_page) {
|
||||
// last page
|
||||
$height = $end_y - $this->tMargin;
|
||||
$height = $end_y - $pdf->tMargin;
|
||||
} else {
|
||||
$height = $this->h - $this->tMargin - $this->bMargin;
|
||||
$height = $pdf->h - $pdf->tMargin - $pdf->bMargin;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1430,7 +1430,10 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
*/
|
||||
function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
global $hookmanager;
|
||||
global $hookmanager,$conf;
|
||||
|
||||
$sign=1;
|
||||
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
|
||||
|
||||
$result='';
|
||||
$reshook=0;
|
||||
@@ -1447,7 +1450,7 @@ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
}
|
||||
if (empty($reshook))
|
||||
{
|
||||
if (empty($hidedetails) || $hidedetails > 1) $result.=price(($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs);
|
||||
if (empty($hidedetails) || $hidedetails > 1) $result.=price($sign * (($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100), 0, $outputlangs);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -1751,7 +1754,10 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
|
||||
*/
|
||||
function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
global $hookmanager;
|
||||
global $hookmanager,$conf;
|
||||
|
||||
$sign=1;
|
||||
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
|
||||
|
||||
$reshook=0;
|
||||
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||
@@ -1771,7 +1777,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
return $outputlangs->transnoentities("Option");
|
||||
}
|
||||
if (empty($hidedetails) || $hidedetails > 1) $result.=price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs);
|
||||
if (empty($hidedetails) || $hidedetails > 1) $result.=price($sign * ($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -970,7 +970,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks=
|
||||
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
|
||||
$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
|
||||
$sql2.= " WHERE p.rowid IN (".join(',',$arrayidofprojects).")";
|
||||
$sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount";
|
||||
$sql2.= " GROUP BY p.rowid, p.ref, p.title, p.fk_soc, s.nom, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount";
|
||||
$sql2.= " ORDER BY p.title, p.ref";
|
||||
|
||||
$var=true;
|
||||
|
||||
@@ -305,6 +305,7 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
|
||||
$expedition->id=$objp->sendingid;
|
||||
$expedition->fetchObjectLinked($expedition->id,$expedition->element);
|
||||
//var_dump($expedition->linkedObjects);
|
||||
|
||||
$receiving='';
|
||||
if (count($expedition->linkedObjects['delivery']) > 0) $receiving=reset($expedition->linkedObjects['delivery']); // Take first link
|
||||
|
||||
|
||||
@@ -773,8 +773,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
if (! empty($conf->facture->enabled))
|
||||
{
|
||||
$langs->load("bills");
|
||||
$newmenu->add("/compta/facture/list.php",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
||||
$newmenu->add("/compta/facture.php?action=create",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("BillsCustomers"),0,$user->rights->facture->lire, '', $mainmenu, 'customers_bills');
|
||||
$newmenu->add("/compta/facture.php?action=create&leftmenu=customers_bills",$langs->trans("NewBill"),1,$user->rights->facture->creer);
|
||||
$newmenu->add("/compta/facture/list.php?leftmenu=customers_bills",$langs->trans("List"),1,$user->rights->facture->lire);
|
||||
|
||||
if (empty($leftmenu) || ($leftmenu == 'customers_bills'))
|
||||
|
||||
@@ -87,11 +87,11 @@ abstract class ModeleNumRefBarCode
|
||||
/**
|
||||
* Return next value available
|
||||
*
|
||||
* @param Societe $objsoc Object thirdparty
|
||||
* @param Societe $objproduct Object Product
|
||||
* @param int $type Type
|
||||
* @return string Value
|
||||
*/
|
||||
function getNextValue($objsoc=0,$type=-1)
|
||||
function getNextValue($objproduct,$type='')
|
||||
{
|
||||
global $langs;
|
||||
return $langs->trans("Function_getNextValue_InModuleNotWorking");
|
||||
|
||||
@@ -100,6 +100,7 @@ class pdf_merou extends ModelePdfExpedition
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("deliveries");
|
||||
$outputlangs->load("sendings");
|
||||
$outputlangs->load("productbatch");
|
||||
|
||||
if ($conf->expedition->dir_output)
|
||||
{
|
||||
|
||||
@@ -110,6 +110,7 @@ class pdf_rouget extends ModelePdfExpedition
|
||||
$outputlangs->load("propal");
|
||||
$outputlangs->load("deliveries");
|
||||
$outputlangs->load("sendings");
|
||||
$outputlangs->load("productbatch");
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
|
||||
@@ -299,9 +299,11 @@ class pdf_standard extends ModeleExpenseReport
|
||||
|
||||
$showpricebeforepagebreak=1;
|
||||
|
||||
$pdf->SetFont('','', $default_font_size - 1);
|
||||
|
||||
// Accountancy piece
|
||||
$pdf->SetXY($this->posxpiece, $curY);
|
||||
$pdf->MultiCell($this->posxcomment-$this->posxpiece-0.8, 4, $piece_comptable, 0, 'C');
|
||||
$pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-0.8, 4, $this->posxpiece-1, $curY, $piece_comptable, 0, 1);
|
||||
|
||||
// Comments
|
||||
$pdf->SetXY($this->posxcomment, $curY);
|
||||
@@ -537,7 +539,7 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$pdf->SetFont('','B', $default_font_size + 4);
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx,6,$langs->trans("ExpenseReport"), 0, 'L');
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx,6,$langs->trans("ExpenseReport"), 0, 'R');
|
||||
|
||||
$pdf->SetFont('','', $default_font_size -1);
|
||||
|
||||
@@ -545,19 +547,19 @@ class pdf_standard extends ModeleExpenseReport
|
||||
$posy+=8;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'L');
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("Ref")." : " . $object->ref, '', 'R');
|
||||
|
||||
// Date start period
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?dol_print_date($object->date_debut,"day",false,$outpulangs):''), '', 'L');
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateStart")." : " . ($object->date_debut>0?dol_print_date($object->date_debut,"day",false,$outpulangs):''), '', 'R');
|
||||
|
||||
// Date end period
|
||||
$posy+=5;
|
||||
$pdf->SetXY($posx,$posy);
|
||||
$pdf->SetTextColor(0,0,60);
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'L');
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$posx, 3, $outputlangs->transnoentities("DateEnd")." : " . ($object->date_fin>0?dol_print_date($object->date_fin,"day",false,$outpulangs):''), '', 'R');
|
||||
|
||||
// Status Expense Report
|
||||
$posy+=6;
|
||||
|
||||
@@ -337,6 +337,11 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$height_incoterms = 0;
|
||||
if ($conf->incoterm->enabled)
|
||||
{
|
||||
if (is_object($object->thirdparty))
|
||||
{
|
||||
$object->fk_incoterms=$object->thirdparty->fk_incoterms;
|
||||
$object->location_incoterms=$object->thirdparty->location_incoterms;
|
||||
}
|
||||
$desc_incoterms = $object->getIncotermsForPDF();
|
||||
if ($desc_incoterms)
|
||||
{
|
||||
@@ -539,13 +544,16 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$pdf->SetXY($this->postotalht, $curY);
|
||||
$pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
|
||||
|
||||
|
||||
$sign=1;
|
||||
if (isset($object->type) && $object->type == 2 && ! empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) $sign=-1;
|
||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
if ($prev_progress > 0) // Compute progress from previous situation
|
||||
{
|
||||
$tvaligne = $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
|
||||
$tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
|
||||
} else {
|
||||
$tvaligne = $object->lines[$i]->total_tva;
|
||||
$tvaligne = $sign * $object->lines[$i]->total_tva;
|
||||
}
|
||||
|
||||
$localtax1ligne=$object->lines[$i]->total_localtax1;
|
||||
|
||||
@@ -504,6 +504,10 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
if (empty($newval)) $arrayrecord[($key-1)]['type']=-1; // If we get empty value, we will use "null"
|
||||
}
|
||||
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
|
||||
{
|
||||
$newval = price2num($newval);
|
||||
}
|
||||
|
||||
//print 'Val to use as insert is '.$newval.'<br>';
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -302,6 +302,7 @@ class modCategorie extends DolibarrModules
|
||||
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'societe as s ON s.rowid = p.fk_soc';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'socpeople_extrafields as extra ON extra.fk_object = p.rowid';
|
||||
$this->export_sql_end[$r] .= ' WHERE u.rowid = cp.fk_categorie AND cp.fk_socpeople = p.rowid AND u.entity IN ('.getEntity('category',1).')';
|
||||
$this->export_sql_end[$r] .= ' AND u.type = 4'; // contact categories
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class modProductBatch extends DolibarrModules
|
||||
$this->config_page_url = array();
|
||||
|
||||
// Dependencies
|
||||
$this->depends = array("modProduct","modStock","modExpedition","modSupplier"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order).
|
||||
$this->depends = array("modProduct","modStock","modExpedition","modFournisseur"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order).
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
$this->phpmin = array(5,0); // Minimum version of PHP required by module
|
||||
$this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
|
||||
|
||||
@@ -405,7 +405,8 @@ class modSociete extends DolibarrModules
|
||||
's.code_client'=>array('rule'=>'getcustomercodeifauto'),
|
||||
's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'),
|
||||
's.code_compta'=>array('rule'=>'getcustomeraccountancycodeifauto'),
|
||||
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto')
|
||||
's.code_compta_fournisseur'=>array('rule'=>'getsupplieraccountancycodeifauto'),
|
||||
's.capital'=>array('rule'=>'numeric')
|
||||
);
|
||||
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
|
||||
$this->import_regex_array[$r]=array('s.status'=>'^[0|1]','s.client'=>'^[0|1|2|3]','s.fournisseur'=>'^[0|1]','s.fk_typent'=>'id@'.MAIN_DB_PREFIX.'c_typent','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
|
||||
|
||||
@@ -415,6 +415,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
}
|
||||
$project= new Project($this->db);
|
||||
$project->fetch($object->fk_project);
|
||||
$project->fetch_thirdparty();
|
||||
|
||||
$dir = $conf->projet->dir_output. "/" . $project->ref. "/";
|
||||
$objectref = dol_sanitizeFileName($object->ref);
|
||||
@@ -449,7 +450,7 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
|
||||
dol_mkdir($conf->projet->dir_temp);
|
||||
|
||||
$socobject=$object->thirdparty;
|
||||
$socobject=$project->thirdparty;
|
||||
|
||||
// Make substitution
|
||||
$substitutionarray=array(
|
||||
|
||||
@@ -381,6 +381,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
|
||||
|
||||
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other,$array_thirdparty_contact);
|
||||
complete_substitutions_array($tmparray, $outputlangs, $object);
|
||||
$object->fetch_optionals();
|
||||
// Call the ODTSubstitution hook
|
||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs,'substitutionarray'=>&$tmparray);
|
||||
$reshook=$hookmanager->executeHooks('ODTSubstitution',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
@@ -647,7 +647,10 @@ class pdf_azur extends ModelePDFPropales
|
||||
*/
|
||||
|
||||
// Customer signature area
|
||||
$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
|
||||
if (empty($conf->global->PROPAL_DISABLE_SIGNATURE))
|
||||
{
|
||||
$posy=$this->_signature_area($pdf, $object, $posy, $outputlangs);
|
||||
}
|
||||
|
||||
// Pied de page
|
||||
$this->_pagefoot($pdf,$object,$outputlangs);
|
||||
@@ -710,7 +713,7 @@ class pdf_azur extends ModelePDFPropales
|
||||
if (file_exists($infile) && is_readable($infile)) {
|
||||
$pagecount = $pdf->setSourceFile($infile);
|
||||
for($i = 1; $i <= $pagecount; $i ++) {
|
||||
$tplIdx = $pdf->importPage(1);
|
||||
$tplIdx = $pdf->importPage($i);
|
||||
if ($tplIdx!==false) {
|
||||
$s = $pdf->getTemplatesize($tplIdx);
|
||||
$pdf->AddPage($s['h'] > $s['w'] ? 'P' : 'L');
|
||||
|
||||
@@ -211,7 +211,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$hookmanager->initHooks(array('pdfgeneration'));
|
||||
$parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
|
||||
global $action;
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
|
||||
$reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$nblignes = count($object->lines);
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ $coldisplay=-1; // We remove first td
|
||||
$doleditor=new DolEditor('product_desc',$line->description,'',164,$toolbarname,'',false,true,$enable,$nbrows,'98%');
|
||||
$doleditor->Create();
|
||||
} else {
|
||||
print '<textarea id="desc" class="flat" name="desc" readonly style="width: 200px; height:80px;">' . $line->description . '</textarea>';
|
||||
print '<textarea id="product_desc" class="flat" name="product_desc" readonly style="width: 200px; height:80px;">' . $line->description . '</textarea>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -1023,21 +1023,21 @@ class Cronjob extends CommonObject
|
||||
}
|
||||
if (! empty($conf->global->MAIN_UMASK)) @chmod($outputfile, octdec($conf->global->MAIN_UMASK));
|
||||
}
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG);
|
||||
dol_syslog(get_class($this)."::run_jobs output_arr:".var_export($output_arr,true), LOG_DEBUG);
|
||||
|
||||
|
||||
// Update with result
|
||||
$this->lastoutput='';
|
||||
if (is_array($output_arr) && count($output_arr)>0)
|
||||
{
|
||||
foreach($output_arr as $val)
|
||||
// Update with result
|
||||
$this->lastoutput='';
|
||||
if (is_array($output_arr) && count($output_arr)>0)
|
||||
{
|
||||
$this->lastoutput.=$val."\n";
|
||||
foreach($output_arr as $val)
|
||||
{
|
||||
$this->lastoutput.=$val."\n";
|
||||
}
|
||||
}
|
||||
$this->lastresult=$retval;
|
||||
}
|
||||
$this->lastresult=$retval;
|
||||
|
||||
$this->datelastresult=dol_now();
|
||||
$result = $this->update($user);
|
||||
if ($result < 0)
|
||||
|
||||
@@ -712,7 +712,7 @@ if (! empty($id) && $action != 'edit')
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
|
||||
}
|
||||
|
||||
if (($object->statut == 0 || $object->statut == 1) && $remaintopay == 0 && $object->paye == 0)
|
||||
if (($object->statut == 0 || $object->statut == 1) && $remaintopay == 0 && $object->paid == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?rowid='.$object->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>";
|
||||
}
|
||||
@@ -739,9 +739,9 @@ if (! empty($id) && $action != 'edit')
|
||||
// Delete
|
||||
if ($user->rights->don->supprimer)
|
||||
{
|
||||
if ($don->statut == -1 || $don->statut == 0)
|
||||
if ($object->statut == -1 || $object->statut == 0)
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
|
||||
print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -633,7 +634,7 @@ class Don extends CommonObject
|
||||
$this->town = $obj->town;
|
||||
$this->zip = $obj->zip;
|
||||
$this->town = $obj->town;
|
||||
$this->country_id = $obj->country_id;
|
||||
$this->country_id = $obj->fk_country;
|
||||
$this->country_code = $obj->country_code;
|
||||
$this->country = $obj->country;
|
||||
$this->country_olddata= $obj->country_olddata; // deprecated
|
||||
|
||||
@@ -175,10 +175,9 @@ if ($action == 'confirm_deletefile')
|
||||
dol_print_error($db,$ecmdir->error);
|
||||
exit;
|
||||
}
|
||||
$relativepath=$ecmdir->getRelativePath();
|
||||
}
|
||||
else $relativepath='';
|
||||
$upload_dir = $conf->ecm->dir_output.($relativepath?'/'.$relativepath:'');
|
||||
$upload_dir = $conf->ecm->dir_output;
|
||||
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_POST are already decoded by PHP).
|
||||
|
||||
$ret=dol_delete_file($file);
|
||||
|
||||
@@ -874,7 +874,8 @@ class Expedition extends CommonObject
|
||||
$product_type=$product->type;
|
||||
if ($product_type == 0 && $product_stock < $qty)
|
||||
{
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->error=$langs->trans('ErrorStockIsNotEnoughToAddProductOnShipment', $product->ref);
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
@@ -930,7 +931,8 @@ class Expedition extends CommonObject
|
||||
|
||||
if ($prod_batch->qty < $linebatch->dluo_qty)
|
||||
{
|
||||
$this->errors[] = $langs->trans('ErrorStockIsNotEnough');
|
||||
$langs->load("errors");
|
||||
$this->errors[]=$langs->trans('ErrorStockIsNotEnoughToAddProductOnShipment', $prod_batch->fk_product);
|
||||
dol_syslog(get_class($this)."::addline_batch error=Product ".$prod_batch->batch.": ".$this->errorsToString(), LOG_ERR);
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
@@ -1264,7 +1266,7 @@ class Expedition extends CommonObject
|
||||
|
||||
$sql = "SELECT cd.rowid, cd.fk_product, cd.label as custom_label, cd.description, cd.qty as qty_asked";
|
||||
$sql.= ", cd.total_ht, cd.total_localtax1, cd.total_localtax2, cd.total_ttc, cd.total_tva";
|
||||
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent";
|
||||
$sql.= ", cd.tva_tx, cd.localtax1_tx, cd.localtax2_tx, cd.price, cd.subprice, cd.remise_percent,cd.buy_price_ht as pa_ht";
|
||||
$sql.= ", ed.rowid as line_id, ed.qty as qty_shipped, ed.fk_origin_line, ed.fk_entrepot";
|
||||
$sql.= ", p.ref as product_ref, p.label as product_label, p.fk_product_type";
|
||||
$sql.= ", p.weight, p.weight_units, p.length, p.length_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch";
|
||||
@@ -1334,6 +1336,8 @@ class Expedition extends CommonObject
|
||||
$line->volume = $obj->volume;
|
||||
$line->volume_units = $obj->volume_units;
|
||||
|
||||
$line->pa_ht = $obj->pa_ht;
|
||||
|
||||
// For invoicing
|
||||
$tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc); // We force type to 0
|
||||
$line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -124,6 +125,7 @@ if ($resql)
|
||||
$expedition = new Expedition($db);
|
||||
|
||||
$param="";
|
||||
if ($sall) $param.= "&sall=".$sall;
|
||||
if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp;
|
||||
if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv;
|
||||
if ($search_company) $param.= "&search_company=".$search_company;
|
||||
|
||||
@@ -819,7 +819,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "addline")
|
||||
if ($action == "addline" && $user->rights->expensereport->creer)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
@@ -911,7 +911,7 @@ if ($action == "addline")
|
||||
$action='';
|
||||
}
|
||||
|
||||
if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes")
|
||||
if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes" && $user->rights->expensereport->creer)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
@@ -954,7 +954,7 @@ if ($action == 'confirm_delete_line' && GETPOST("confirm") == "yes")
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "updateligne" )
|
||||
if ($action == "updateligne" && $user->rights->expensereport->creer)
|
||||
{
|
||||
$object = new ExpenseReport($db);
|
||||
$object->fetch($id);
|
||||
@@ -1640,8 +1640,11 @@ else
|
||||
print '<td style="text-align:right;">'.$langs->trans('AmountHT').'</td>';
|
||||
print '<td style="text-align:right;">'.$langs->trans('AmountTTC').'</td>';
|
||||
}
|
||||
print '<td style="text-align:right;"></td>';
|
||||
|
||||
// Ajout des boutons de modification/suppression
|
||||
if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
|
||||
{
|
||||
print '<td style="text-align:right;"></td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
$var=true;
|
||||
@@ -1682,7 +1685,7 @@ else
|
||||
|
||||
// Ajout des boutons de modification/suppression
|
||||
print '<td style="text-align:right;" class="nowrap">';
|
||||
if($object->fk_statut<2 OR $object->fk_statut==99)
|
||||
if (($object->fk_statut < 2 || $object->fk_statut == 99) && $user->rights->expensereport->creer)
|
||||
{
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&rowid='.$objp->rowid.'#'.$objp->rowid.'">';
|
||||
print img_edit();
|
||||
@@ -1768,7 +1771,7 @@ else
|
||||
//print '</div>';
|
||||
|
||||
// Add a line
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline')
|
||||
if (($object->fk_statut==0 || $object->fk_statut==99) && $action != 'editline' && $user->rights->expensereport->creer)
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2"></td>';
|
||||
|
||||
@@ -1768,6 +1768,7 @@ class ExpenseReportLine
|
||||
// Clean parameters
|
||||
$this->comments=trim($this->comments);
|
||||
$this->vatrate = price2num($this->vatrate);
|
||||
$this->value_unit = price2num($this->value_unit);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
$param="";
|
||||
if ($sall) $param.="&sall=".$sall;
|
||||
if ($search_ref) $param.="&search_ref=".$search_ref;
|
||||
if ($search_user) $param.="&search_user=".$search_user;
|
||||
if ($search_amount_ht) $param.="&search_amount_ht=".$search_amount_ht;
|
||||
|
||||
@@ -57,6 +57,9 @@ if ($action == 'add_payment')
|
||||
exit;
|
||||
}
|
||||
|
||||
$expensereport = new ExpenseReport($db);
|
||||
$expensereport->fetch($chid);
|
||||
|
||||
$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
||||
|
||||
if (! $_POST["fk_typepayment"] > 0)
|
||||
@@ -85,8 +88,7 @@ if ($action == 'add_payment')
|
||||
{
|
||||
if (substr($key,0,7) == 'amount_')
|
||||
{
|
||||
$other_chid = substr($key,7);
|
||||
$amounts[$other_chid] = price2num($_POST[$key]);
|
||||
$amounts[$expensereport->fk_user_author] = price2num($_POST[$key]);
|
||||
$total += price2num($_POST[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,7 +1202,7 @@ class FichinterLigne extends CommonObjectLine
|
||||
// Mise a jour ligne en base
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET";
|
||||
$sql.= " description='".$this->db->escape($this->desc)."'";
|
||||
$sql.= ",date=".$this->db->idate($this->datei);
|
||||
$sql.= ",date='".$this->db->idate($this->datei)."'";
|
||||
$sql.= ",duree=".$this->duration;
|
||||
$sql.= ",rang='".$this->rang."'";
|
||||
$sql.= " WHERE rowid = ".$this->rowid;
|
||||
|
||||
@@ -139,6 +139,7 @@ if ($result)
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$urlparam='';
|
||||
if ($sall) $urlparam.="&sall=".$sall;
|
||||
if ($socid) $urlparam.="&socid=".$socid;
|
||||
if ($search_ref) $urlparam.="&search_ref=".urlencode($search_ref);
|
||||
if ($search_company) $urlparam.="&search_company=".urlencode($search_company);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.2');
|
||||
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.9.4');
|
||||
|
||||
if (! defined('EURO')) define('EURO',chr(128));
|
||||
|
||||
@@ -122,6 +122,7 @@ if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
|
||||
if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey='';
|
||||
if (empty($dolibarr_main_limit_users)) $dolibarr_main_limit_users=0;
|
||||
if (empty($dolibarr_mailing_limit_sendbyweb)) $dolibarr_mailing_limit_sendbyweb=0;
|
||||
if (empty($dolibarr_mailing_limit_sendbycli)) $dolibarr_mailing_limit_sendbycli=0;
|
||||
if (empty($dolibarr_strict_mode)) $dolibarr_strict_mode=0; // For debug in php strict mode
|
||||
// TODO Multicompany Remove this. Useless.
|
||||
if (empty($multicompany_transverse_mode)) $multicompany_transverse_mode=0;
|
||||
|
||||
@@ -89,9 +89,11 @@ if ($idprod > 0)
|
||||
}
|
||||
}
|
||||
|
||||
// Add price for pmp
|
||||
$price=$producttmp->pmp;
|
||||
$prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); // For price field, we must use price2num(), for label or title, price()
|
||||
if(!empty($conf->stock->enabled)) {
|
||||
// Add price for pmp
|
||||
$price=$producttmp->pmp;
|
||||
$prices[] = array("id" => 'pmpprice', "price" => price2num($price), "label" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency), "title" => $langs->trans("PMPValueShort").': '.price($price,0,$langs,0,0,-1,$conf->currency)); // For price field, we must use price2num(), for label or title, price()
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($prices);
|
||||
|
||||
@@ -379,6 +379,17 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
// TODO move to DAO class
|
||||
$sql = "SELECT count(p.rowid) as total";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||
$sql.= " AND p.entity =".$conf->entity;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$object_count = $db->fetch_object($resql);
|
||||
$num = $object_count->total;
|
||||
}
|
||||
|
||||
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
|
||||
$sql.= " WHERE p.fk_soc =".$object->id;
|
||||
@@ -389,7 +400,6 @@ if ($object->id > 0)
|
||||
if ($resql)
|
||||
{
|
||||
$i = 0 ;
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
if ($num > 0)
|
||||
{
|
||||
@@ -405,7 +415,7 @@ if ($object->id > 0)
|
||||
}
|
||||
|
||||
$var = True;
|
||||
while ($i < $num && $i <= $MAXLIST)
|
||||
while ($i < $num && $i < $MAXLIST)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
@@ -254,6 +254,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
|
||||
$this->fetchObjectLinked();
|
||||
|
||||
$this->lines=array();
|
||||
|
||||
$sql = "SELECT l.rowid, l.ref as ref_supplier, l.fk_product, l.product_type, l.label, l.description,";
|
||||
$sql.= " l.qty,";
|
||||
$sql.= " l.tva_tx, l.remise_percent, l.subprice,";
|
||||
@@ -313,7 +315,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$line->date_end = $this->db->jdate($objp->date_end);
|
||||
$line->fk_unit = $objp->fk_unit;
|
||||
|
||||
$this->special_line = $objp->special_line;
|
||||
$this->special_code = $objp->special_code;
|
||||
$this->fk_parent_line = $objp->fk_parent_line;
|
||||
|
||||
$this->rang = $objp->rang;
|
||||
@@ -991,6 +993,8 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->date_commande = $this->db->idate($date);
|
||||
$result = 1;
|
||||
$this->log($user, 3, $date, $comment);
|
||||
$this->date_commande = $date;
|
||||
$this->methode_commande = $methode;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2371,7 +2375,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$response = new WorkboardResponse();
|
||||
$response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24;
|
||||
$response->label=$langs->trans("SuppliersOrdersToProcess");
|
||||
$response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3';
|
||||
$response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3&mainmenu=commercial&leftmenu=orders_suppliers';
|
||||
$response->img=img_object($langs->trans("Orders"),"order");
|
||||
|
||||
while ($obj=$this->db->fetch_object($resql))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user