Compare commits

..

279 Commits
3.8.4 ... 3.8

Author SHA1 Message Date
Laurent Destailleur
1ecc1afa9e Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2020-01-10 19:41:49 +01:00
Laurent Destailleur
ceb1e699b7 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2020-01-10 19:37:16 +01:00
Laurent Destailleur
c028819cab FIX clone of purchase order 2020-01-10 19:35:49 +01:00
Laurent Destailleur
9d582a53ca Fix compatibility with new mysql versions 2018-11-23 11:28:28 +01:00
Laurent Destailleur
ca1e3b4d55 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2018-11-10 15:15:33 +01:00
Laurent Destailleur
94bb1ac511 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2018-11-10 12:49:22 +01:00
Laurent Destailleur
8893d8d59f Fix compatiblity with new version of PHP 2018-11-10 11:56:23 +01:00
Laurent Destailleur
e61bcd03ed Fix travis 2017-09-16 13:03:27 +02:00
Laurent Destailleur
3295498e9e Remove code comment 2017-09-16 12:50:34 +02:00
Laurent Destailleur
71818da6a5 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2017-08-22 11:13:58 +02:00
Laurent Destailleur
c53aef9955 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-08-22 10:51:30 +02:00
Laurent Destailleur
a18995d3dc Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-08-22 10:47:47 +02:00
Laurent Destailleur
3017e2b3a0 Merge pull request #7232 from ATM-Marc/FIX_future_accounting
FIX calculate correct remain to pay for planned bank transactions
2017-08-04 15:23:00 +02:00
Marc de Lima Lucio
adbb41799c FIX: calculate correct remain to pay for planned bank transactions 2017-08-01 11:08:58 +02:00
Laurent Destailleur
12d7b92556 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2017-06-19 19:52:49 +02:00
Laurent Destailleur
6fb0fc7b71 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-06-19 19:42:56 +02:00
Laurent Destailleur
f694939fc7 Fix migration with pgsql 2017-06-19 19:39:37 +02:00
Laurent Destailleur
d0d9de37f4 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2017-06-19 04:05:40 +02:00
Laurent Destailleur
1bfdc7438a Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-06-19 04:03:26 +02:00
Regis Houssin
9352ecca1f Fix: PHP 7 - Fatal error: 'break' not in the 'loop' or 'switch' context 2017-06-19 04:01:34 +02:00
Laurent Destailleur
774c624687 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2017-06-19 02:58:44 +02:00
Laurent Destailleur
5439390461 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2017-06-19 02:57:12 +02:00
Laurent Destailleur
6fc4dacd42 Fix migration opensurvey 2017-06-19 02:55:33 +02:00
Laurent Destailleur
b970596310 Merge pull request #6481 from Hugome/fix-agenda-merge
FIX : Agenda getCalendarEvents hook
2017-03-31 18:26:45 +02:00
hugome
38ccf7ffdd Fix : Agenda getCalendarEvents hook
Return of getCalendarEvents on agenda page :
The array_merge change key of merged array.
2017-03-13 11:35:49 +01:00
Laurent Destailleur
290caba160 Merge pull request #6413 from atm-gauthier/3.8_FIX_delete_bank_class_when_delete_bank_categ
FIX : delete bank class lines when we delete bank_categ
2017-02-12 20:45:57 +01:00
gauthier
c01988ba43 FIX : delete bank class lines when we delete bank_categ 2017-02-09 17:28:37 +01:00
Laurent Destailleur
797b68fc20 Merge pull request #6351 from atm-maxime/fix_banklink_expensereport
Fix : link to user in bank was wrong regarding expensereport payment
2017-02-02 01:18:04 +01:00
Maxime Kohlhaas
90e8f062e9 Fix : link to user in bank was wrong regarding expensereport payment 2017-01-31 10:23:03 +01:00
Laurent Destailleur
f49552f6b7 Merge pull request #6297 from atm-arnaud/FIX_ajax_project_list_where
FIX all dolibarr versions about project list and ajax completion bug
2017-01-18 16:33:23 +01:00
arnaud
39f35bbaab FIX all dolibarr versions about project list and ajax completion bug 2017-01-17 11:17:40 +01:00
Laurent Destailleur
321933f267 Fix deletion of product 2016-12-18 02:10:26 +01:00
Laurent Destailleur
f49d332b73 Merge pull request #6113 from atm-maxime/3.8
Fix : delete product was not possible if batch stock
2016-12-10 13:16:50 +01:00
Laurent Destailleur
46d84f8f11 Merge pull request #6111 from simnandez/3.8
Fix: Delete surplus migration file
2016-12-10 13:16:16 +01:00
Maxime Kohlhaas
97e21cb775 Fix : delete product was not possible if batch stock 2016-12-10 13:05:46 +01:00
Juanjo Menent
829ff2299e Fix: Delete surplus migration file 2016-12-10 12:46:26 +01:00
Laurent Destailleur
f516660c0f Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-11-06 14:10:37 +01:00
Laurent Destailleur
73f0159578 Fix phpunit 2016-11-06 14:08:55 +01:00
Juanjo Menent
7acc14903c Merge pull request #5937 from atm-maxime/fix_supporder_vars_set
Fix : vars were not set after commande function
2016-10-28 11:18:15 +02:00
Juanjo Menent
57a8e053b4 Merge pull request #5936 from atm-maxime/fix_pdfmuscadet_hook_call
Fix bad parameter in hook call
2016-10-28 11:17:21 +02:00
Maxime Kohlhaas
3dbab863a7 Fix : vars were not set after commande function 2016-10-28 10:24:31 +02:00
Maxime Kohlhaas
be493fcf09 Fix bad parameter in hook call 2016-10-28 10:16:58 +02:00
Laurent Destailleur
5e7c72068d Merge pull request #5923 from olsesacl/#5907
FIX: #5907 No translation string for PDF Proposal
2016-10-26 10:56:15 +02:00
Sergio Sanchis Climent
2a4517e1bc FIX: #5907 2016-10-24 19:21:41 +02:00
Laurent Destailleur
e4da87d31c Merge pull request #5903 from atm-gauthier/FIX_thirdparty_margin
FIX : margin tab on customer card must filter on current entity invoices
2016-10-24 03:18:37 +02:00
Laurent Destailleur
fe71c0cb2d Merge pull request #5886 from simnandez/3.8
Fix: Bad localtaxes calc for Spain if VAT is 0
2016-10-24 01:01:04 +02:00
gauthier
a814e02d53 FIX : margin tab on customer card must filter on current entity invoices 2016-10-21 12:40:19 +02:00
Juanjo Menent
6a944bb6a3 Fix: Bad localtaxes calc for Spain if VAT is 0 2016-10-18 10:11:42 +02:00
Juanjo Menent
87e8ac51be Merge pull request #5843 from simnandez/3.8
FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object
2016-10-15 17:18:35 +02:00
Juanjo Menent
ffd486e3d6 Fix #5843 best way fixing 2016-10-07 22:54:08 +02:00
Juanjo Menent
45dfb8ca62 Fix #5843 best way fixing 2016-10-07 22:32:11 +02:00
Juanjo Menent
298e5cee61 Fix #5843 best way fixing 2016-10-07 22:21:50 +02:00
Juanjo Menent
b7b18e3355 FIX: Error when CATEGORIE_RECURSIV_ADD is enabled and new category is daughter of an already linked to object 2016-10-07 10:12:25 +02:00
Laurent Destailleur
b19b624908 Merge pull request #5834 from simnandez/3.8
FIX: only show projects of related third if external user
2016-10-06 23:58:24 +02:00
Juanjo Menent
56245e2c9a FIX: only show projects of related third if external user 2016-10-04 16:51:44 +02:00
Laurent Destailleur
a90111cbf3 Merge pull request #5804 from simnandez/3.8
FIX: Failed to export contact categories with contact extra fields
2016-09-28 18:18:29 +02:00
Juanjo Menent
30050b51f0 FIX: Failed to export contact categories with contact extra fields 2016-09-28 10:15:41 +02:00
Laurent Destailleur
8775a51cec Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-09-26 14:14:26 +02:00
Laurent Destailleur
67a1bf2b59 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-09-26 14:13:26 +02:00
Laurent Destailleur
bef5c2748c Merge pull request #5756 from atm-maxime/fix_pgsql_supplierorder_list
FIX No ORDER BY needed for a COUNT sql, causes PGSQL error
2016-09-17 17:49:19 +02:00
Maxime Kohlhaas
5840ed8258 No ORDER BY needed for a COUNT sql, causes PGSQL error 2016-09-15 12:08:47 +02:00
Laurent Destailleur
3d8722ee69 FIX #2853 2016-09-12 02:19:25 +02:00
Juanjo Menent
ff632718fa Merge pull request #5719 from philippe-opendsi/3.8_patch_1
FIX #5705 Supplier Order's lines array initalisation
2016-09-08 18:06:25 +02:00
Juanjo Menent
b72794216e Merge pull request #5702 from simnandez/3.8
FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15)
2016-09-08 18:05:57 +02:00
Philippe
972a2db3a3 No initialisation of the array before filling it. May cause some trouble when fetch is call several times and lines added or deleted 2016-09-08 11:40:39 +02:00
Juanjo Menent
3078e6fa4b FIX: vat dictionary should allow enter and edit multiple values for localtaxes, separated by: (ex -19:-15) 2016-09-06 13:44:07 +02:00
Laurent Destailleur
5c2af9b7bd Merge pull request #5694 from atm-ph/fix_3.8_address_empty
Fix lost value if use double quote
2016-09-02 18:42:32 +02:00
Laurent Destailleur
d6a4b58a68 Merge pull request #5685 from atm-gauthier/3.8_fix_header_title_commercial_area
FIX : header title in commercial area
2016-09-02 18:36:47 +02:00
phf
fcd5e1fb2c Fix lost value if use double quote 2016-09-02 15:30:42 +02:00
gauthier
18cf2f8f8b FIX : header title in commercial area 2016-08-31 10:19:40 +02:00
Laurent Destailleur
5d7414dcc3 Solve php regression failing travis 2016-08-28 01:58:11 +02:00
Juanjo Menent
874db10dbe Merge pull request #5648 from hregis/3.8_bug
Fix: wrong "lastoutput" and "lastresult" if jobtype is "method" or "function"
2016-08-25 13:43:06 +02:00
Regis Houssin
6b3cbc918d Fix: wrong "lastoutput" and "lastresult" if jobtype is "method" or
"function"
2016-08-22 20:49:14 +02:00
Juanjo Menent
965011c8bc Merge pull request #5579 from atm-florian/3.8
FIX : Weather icon is not calculated correctly
2016-08-03 10:33:29 +02:00
florian HENRY
0d536bff54 Fix dashboard 2016-08-03 09:04:24 +02:00
Laurent Destailleur
7dec327995 FIX #5568 2016-08-01 15:43:40 +02:00
Laurent Destailleur
e998a4b8a5 Merge pull request #5572 from fmarcet/3.8
Fix: Can't set PRODUIT_LIMIT_SIZE to value 0
2016-08-01 13:40:11 +02:00
Ferran Marcet
fb2444c7a3 Fix: Can't set PRODUIT_LIMIT_SIZE to value 0 2016-08-01 10:20:10 +02:00
Laurent Destailleur
69247afd06 FIX #4447 2016-07-29 17:26:24 +02:00
Laurent Destailleur
9a4240c292 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-07-29 17:20:30 +02:00
Laurent Destailleur
45e38efdfa FIX #5473 2016-07-29 17:20:14 +02:00
Juanjo Menent
71b8ab8336 Merge pull request #5542 from hregis/3.8_bug
Fix: missing sourcetype can create false positive
2016-07-25 18:21:44 +02:00
Regis Houssin
d8f77abf31 Fix: missing sourcetype can create fault positive 2016-07-25 14:36:20 +02:00
Laurent Destailleur
c0d8bce2df Prepare 3.8.5 2016-07-21 19:44:25 +02:00
Laurent Destailleur
1624894346 Fix missing load 2016-07-21 19:35:45 +02:00
Laurent Destailleur
80354cd8d6 FIX Can correct stock of lot using eatby or sell by date 2016-07-21 18:43:44 +02:00
Laurent Destailleur
2d037eb34e FIX Direction of movement lost if an error occurs 2016-07-21 18:36:43 +02:00
Laurent Destailleur
441a8c4a74 FIX Can make a movement on "out of sell" products 2016-07-21 18:28:06 +02:00
Juanjo Menent
c37c3d1939 Merge pull request #5496 from olsesacl/3.8_#5450
Fix #5450 Bug: Expenses Form : SQL error on updating line
2016-07-17 15:46:03 +02:00
Sergio Sanchis Climent
e52d6db3fd Fix #5450 2016-07-17 12:18:29 +02:00
Juanjo Menent
60384f6d66 Merge pull request #5492 from simnandez/3.8
FIX #5474 Country_id of "Don" object is still empty
2016-07-17 09:45:56 +02:00
Sergio Sanchis Climent
3b56370060 Fix #5450 2016-07-17 02:48:04 +02:00
Juanjo Menent
1232e25859 FIX #5474 Country_id of "Don" object is still empty 2016-07-16 20:00:55 +02:00
Juanjo Menent
02439bed8b Merge pull request #5458 from hregis/3.8_bug
Fix: wrong multicompany filter
2016-07-07 17:12:59 +02:00
Regis Houssin
4503659cba Fix: wrong multicompany filter 2016-07-06 16:50:10 +02:00
Laurent Destailleur
148f2e4c00 Merge pull request #5449 from fmarcet/3.8
Fix: Don't load extrafields on orderstoinvoice
2016-07-06 11:56:05 +02:00
Laurent Destailleur
b77edf9f32 Merge pull request #5448 from atm-maxime/fix_task_odt_model
FIX task ODT company object not correctly retrieved
2016-07-06 11:55:13 +02:00
fmarcet
50c5efc374 Fix: Don't load extrafields on orderstoinvoice 2016-07-05 16:41:46 +02:00
Maxime Kohlhaas
d658e2cf31 FIX task ODT company object not correctly retrieved 2016-07-05 16:04:18 +02:00
Laurent Destailleur
ad82909d08 Merge pull request #5431 from atm-florian/3.8
FIX #4756
2016-07-02 20:31:36 +02:00
florian HENRY
08fbc21bb1 llx_ecm_directories 2016-07-01 08:36:20 +02:00
florian HENRY
bfcc72b8d8 Merge branch '3.8' of https://github.com/Dolibarr/dolibarr.git into 3.8 2016-07-01 08:33:45 +02:00
Laurent Destailleur
07fd911770 Merge pull request #5401 from atm-alexis/FIX_3.8_bug_5383
# FIX #5383 bad object id on don delete
2016-07-01 03:42:59 +02:00
Laurent Destailleur
74378e2c65 Merge pull request #5407 from atm-alexis/FIX_3.8_bug_5338
FIX #5338 use of not initialized var $aphour, $apmin, etc
2016-07-01 03:27:26 +02:00
Laurent Destailleur
3645bd8f69 Merge pull request #5420 from atm-alexis/FIX_3.8_bug_5170
FIX #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option
2016-07-01 03:06:31 +02:00
Laurent Destailleur
c9300bae35 Merge pull request #5415 from fmarcet/3.8
Fix: Incorrect document link on supplier invoices's list
2016-06-30 22:31:18 +02:00
Laurent Destailleur
5c11192c7c Merge pull request #5425 from atm-arnaud/fix_4749
FIX #4749
2016-06-30 22:20:18 +02:00
Laurent Destailleur
f2bb51ad02 Merge pull request #5406 from atm-gauthier/3.8_fix_linked_receiving
FIX : receiving link never works
2016-06-30 21:38:29 +02:00
Laurent Destailleur
578a58527f Merge pull request #5430 from atm-arnaud/fix_4455
FIX #4455
2016-06-30 21:32:17 +02:00
Laurent Destailleur
b09c6533ee Merge pull request #5433 from atm-maxime/fix_filename_bonprelevement
FIX #4448 $filebonprev is not used, $this->filename now
2016-06-30 21:03:00 +02:00
Maxime Kohlhaas
d004f3a538 FIX #4448 $filebonprev is not used, $this->filename now 2016-06-30 17:03:56 +02:00
florian HENRY
8097298c80 FIX #4756 2016-06-30 16:55:59 +02:00
arnaud
38dcb0de49 FIX #4455 2016-06-30 16:53:24 +02:00
arnaud
0ffe106e2c FIX #4749 2016-06-30 16:03:48 +02:00
Alexis Algoud
22bc44620b FIX #5170 tva sign with INVOICE_POSITIVE_CREDIT_NOTE option 2016-06-30 14:27:58 +02:00
fmarcet
e4a2b5abb3 Fix: Incorrect document link on supplier invoices's list 2016-06-30 11:27:29 +02:00
Alexis Algoud
7e8506e25f FIX #5338 use of not initialized var $aphour, $apmin, etc 2016-06-28 13:25:47 +02:00
gauthier
d9035e5308 FIX : receiving link never works 2016-06-28 11:41:23 +02:00
Alexis Algoud
eb9d26a9e0 FIX #5383 bad object id on don delete 2016-06-27 11:36:13 +02:00
Laurent Destailleur
d78eb4495e Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-06-23 20:55:31 +02:00
Laurent Destailleur
9b50150fe8 FIX #5380 2016-06-23 20:54:04 +02:00
Laurent Destailleur
c9d743ac26 Merge pull request #5330 from atm-alexis/FIX_large_expense_note_and_large_logo
FIX 3.8 large expense note
2016-06-16 20:24:39 +02:00
Laurent Destailleur
630a063283 FIX Can't create thirdparty or validate invoice if profid is mandatory
and profid does not exists for other countries

Conflicts:
	htdocs/compta/facture.php
2016-06-15 18:24:15 +02:00
root
b3d58e9510 FIX large expense note 2016-06-08 14:36:52 +02:00
Laurent Destailleur
db2269b9dd Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/core/class/ldap.class.php
	htdocs/langs/en_US/admin.lang
2016-06-05 00:12:34 +02:00
Laurent Destailleur
d9553212ac Merge pull request #5302 from atm-maxime/fix_sanitizefilename
FIX #5153
2016-06-05 00:08:30 +02:00
Maxime Kohlhaas
7866fb9dae Fix #5153 2016-06-04 19:11:32 +02:00
Laurent Destailleur
a4411c7fe7 Merge pull request #5299 from atm-maxime/fix_expensereport_rights
Fix rights check on expense reports
2016-06-04 18:40:45 +02:00
Maxime Kohlhaas
abe84ef991 Fix rights check on expense reports 2016-06-04 18:32:00 +02:00
Laurent Destailleur
acc8cca84a Merge pull request #5290 from atm-ph/fix_3.7_issue_2777
Fix #2777
2016-06-04 18:07:16 +02:00
Laurent Destailleur
aebc7b1233 Merge pull request #5285 from atm-maxime/fix_menus_dashboard_links
FIX #3243
2016-06-04 17:33:25 +02:00
phf
a62f5bd5b4 Fix #2777 2016-06-04 17:17:22 +02:00
Laurent Destailleur
1552e7f41f Merge pull request #5286 from atm-ph/fix_3.7_call_function_not_exists
Fix call function ldap_connect but not exists
2016-06-04 14:56:42 +02:00
phf
8ccda16ef3 Fix call function ldap_connect but not exists 2016-06-04 14:50:32 +02:00
Maxime Kohlhaas
bd2fe75d08 Fix menus in dashboard links 2016-06-04 14:45:03 +02:00
Laurent Destailleur
c9834117c9 Fix #5156 2016-06-04 02:03:30 +02:00
Laurent Destailleur
ff6daebee6 FIX #5203 2016-06-04 01:19:27 +02:00
Laurent Destailleur
b47db3e9e1 Merge pull request #5266 from atm-maxime/fix_project_time_spent_access
Fix access to project task time spent creation #5249
2016-06-04 00:13:32 +02:00
Laurent Destailleur
b9feae0883 Merge pull request #5270 from atm-maxime/fix_pmp_when_stock_enabled
Fix pmp when stock enabled
2016-06-04 00:12:53 +02:00
Maxime Kohlhaas
8b0b3b1a9d PMP available only if stock module enabled 2016-06-03 23:49:34 +02:00
Laurent Destailleur
d20d88e1af Merge pull request #5265 from atm-ph/fix_3.8_soc.php_with_wrong_id
Fix #4632
2016-06-03 23:43:54 +02:00
Maxime Kohlhaas
c9c7045a6f Fix access to project task time spent creation #5249 2016-06-03 23:34:37 +02:00
phf
778b05c341 Fix #4632 2016-06-03 23:06:53 +02:00
Juanjo Menent
fde6909530 Merge pull request #5258 from atm-maxime/3.8
Fix SQL error on order stats
2016-06-03 16:19:56 +02:00
Maxime Kohlhaas
ab44adc6d5 Fix SQL error on order stats 2016-06-02 12:37:37 +02:00
Laurent Destailleur
c2d8bd99dc Merge pull request #5244 from atm-gauthier/3.8_fix_mergepropal
FIX : same page added several times on mergepropal option
2016-05-29 12:03:35 +02:00
Laurent Destailleur
3f49f0df33 Merge pull request #5245 from atm-gauthier/3.8_fix_sql_error_on_facture_create
FIX : SQL error function on getAvailableDiscounts function, on bill c…
2016-05-29 11:58:28 +02:00
gauthier
71ee941cf8 FIX : SQL error function on getAvailableDiscounts function, on bill create mode if socid is empty 2016-05-25 12:25:39 +02:00
gauthier
1ce91bac06 FIX : same page added several times on mergepropal option 2016-05-25 11:25:19 +02:00
Laurent Destailleur
24d7c6aae7 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-05-23 12:27:15 +02:00
Laurent Destailleur
e2e95641a3 FIX Search supplier ref on contract 2016-05-23 12:27:02 +02:00
Laurent Destailleur
ebf31d87ea Merge pull request #5234 from frederic34/patch-7
Fix next month or next year in opensurvey
2016-05-22 14:23:30 +02:00
Frédéric FRANCE
9e5db0f3c6 Fix next month or next year in opensurvey
http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/55209-bug-calendrier-opensurvey-v3-9
2016-05-21 09:18:16 +02:00
Laurent Destailleur
12a5fbbea7 Merge pull request #5191 from FHenry/3.8
Fix email template edition
2016-05-18 20:35:42 +02:00
Laurent Destailleur
24673d066f Merge pull request #5216 from atm-maxime/fix_dispatch_services_on_supplier_order
FIX services dispatch on supplier order only if STOCK_SUPPORTS_SERVICES
2016-05-18 20:27:31 +02:00
Laurent Destailleur
517b189df2 Merge pull request #5225 from hregis/3.8_bug
Fix: doublon (merge problem?)
2016-05-18 17:39:14 +02:00
Regis Houssin
c7dda59fbc Fix: doublon (merge problem?) 2016-05-18 17:33:51 +02:00
Laurent Destailleur
43cb646779 Merge pull request #5219 from fmarcet/3.8
Fix: Expensereport not compatible with multicompany
2016-05-18 13:52:45 +02:00
Laurent Destailleur
a4b497ef81 Merge pull request #5212 from atm-alexis/3.8_fix_hook_called_but_not_initialized
FIX 3.8 hook on group card called but not initialized
2016-05-18 13:50:21 +02:00
Laurent Destailleur
94c532dd8a Clean splitted lines into llx_product_batch 2016-05-16 23:58:06 +02:00
Laurent Destailleur
929787006e Clean data 2016-05-16 22:40:29 +02:00
Your Name
f7c9f20b16 Fix: Expensereport not compatible with multicompany. 2016-05-16 17:21:32 +02:00
Maxime Kohlhaas
af8608ab7a Fix services dispatch on supplier order only if STOCK_SUPPORTS_SERVICES 2016-05-16 10:49:43 +02:00
Alexis Algoud
b3b064d310 FIX hook on group card called but not initialized 2016-05-14 18:58:14 +02:00
Laurent Destailleur
2b225c76d7 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-05-13 23:13:16 +02:00
Laurent Destailleur
1bba8166f8 FIX #5207 2016-05-13 23:12:53 +02:00
Laurent Destailleur
7c26f328bb Merge pull request #5190 from atm-ph/fix_3.8_update_ref_fourn_on_supplier_invoice
Fix update supplier ref on supplier invoice
2016-05-13 20:29:09 +02:00
Laurent Destailleur
a5e3503598 Merge pull request #5187 from atm-gauthier/3.8_fix_param_fetch_company
FIX : can't fetch by siret or siren because of first "if"
2016-05-13 20:28:46 +02:00
Laurent Destailleur
82ea686bc0 Merge pull request #5182 from atm-maxime/fix_contract_line_creation
Fix contract line creation
2016-05-13 20:26:41 +02:00
Florian HENRY
4cbab1cf47 FIX PROPAL_MERGE_PDF with PRODUCT_USE_OLD_PATH 2016-05-12 16:58:14 +02:00
Florian HENRY
d3b3e60d82 Fix email template edition 2016-05-10 22:37:30 +02:00
phf
a57e0f5fd3 Fix update supplier ref on supplier invoice 2016-05-10 14:27:24 +02:00
Florian HENRY
1c0bdfcf1e Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-05-10 14:15:22 +02:00
gauthier
84e75eed88 FIX : can't fetch by siret or siren because of first "if" 2016-05-10 09:31:25 +02:00
Maxime Kohlhaas
6278610d0a Fix contract line creation should take desc even if not displayed on screen 2016-05-09 15:32:21 +02:00
Maxime Kohlhaas
03732fd1aa Fix contract line creation was adding all proposal lines desc 2016-05-09 15:31:44 +02:00
Laurent Destailleur
06eeb0ced4 Merge pull request #5141 from aspangaro/3.8-p3
FIX: Accountancy - 3.8 - Chart of accounts are limited on only one country
2016-05-05 22:28:08 +02:00
aspangaro
e6843a64ae FIX: Accountancy - 3.8 - Chart of accounts are limited on only one country 2016-04-30 07:13:23 +02:00
Laurent Destailleur
53386e22ea Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/commande/class/commande.class.php
	htdocs/expedition/class/expedition.class.php
	htdocs/index.php
2016-04-29 20:39:17 +02:00
Laurent Destailleur
0735413e7c Merge pull request #5101 from altatof/fix_fournprice_select
FIX: end of select when no fournprice
2016-04-29 20:36:44 +02:00
Laurent Destailleur
b94295e4ca Merge pull request #5102 from atm-alexis/3.8
FIX search on date into supplier invoice list
2016-04-29 18:45:04 +02:00
Laurent Destailleur
b0977e3e2a Merge pull request #5122 from fmarcet/3.8
FIX: Not filtering correctly when come from dashboard
2016-04-29 17:40:03 +02:00
Laurent Destailleur
59a30cd2e7 Merge pull request #5120 from atm-maxime/fix_total_on_cabyprodserv
Fix wrong qty total in ca by prod/serv report
2016-04-29 17:39:40 +02:00
Laurent Destailleur
b0b1056a44 Merge pull request #5121 from fmarcet/3.7
Fix: Not filtering correctly on supplier invoice's list
2016-04-29 17:19:15 +02:00
Laurent Destailleur
8a4871323d Merge pull request #5022 from marcosgdf/bug-5008
FIX #5008 SQL error when editing the reference of a supplier invoice that already exists
2016-04-29 17:01:01 +02:00
Laurent Destailleur
f91a8934bd Merge remote-tracking branch 'origin/3.7' into 3.8 2016-04-29 15:17:11 +02:00
Laurent Destailleur
211d217f8c Merge remote-tracking branch 'origin/3.6' into 3.7 2016-04-29 15:13:27 +02:00
Laurent Destailleur
2a27fe02eb Fix detection if tag already exists 2016-04-29 15:12:58 +02:00
Florian HENRY
b280a700d2 FIX missing column when module was installed before standard integration 2016-04-28 14:05:56 +02:00
fmarcet
d599261d20 FIX: Not filtering correctly when come from dashboard 2016-04-28 10:38:50 +02:00
Ferran Marcet
7380676717 Fix: Not filtering correctly on supplier invoice's list 2016-04-28 10:25:55 +02:00
Maxime Kohlhaas
0a67614e72 Fix wrong qty total in ca by prod/serv report 2016-04-28 09:10:22 +02:00
Florian HENRY
bfbb1c20bc FIX bug on email template 2016-04-27 09:27:59 +02:00
Florian HENRY
94d92d3cbb Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-04-26 10:26:45 +02:00
Christophe Battarel
2a0c508d47 FIX: end of select when no fournprice 2016-04-25 11:26:13 +02:00
Alexis Algoud
1746f8f96c FIX search on date into supplier invoice list dont work because of status -1 2016-04-25 11:25:49 +02:00
Marcos García de La Fuente
d98e50e661 Little change 2016-04-23 13:44:43 +02:00
Laurent Destailleur
25810ddfc8 Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/compta/localtax/quadri_detail.php
	htdocs/core/lib/tax.lib.php
2016-04-22 20:08:33 +02:00
Laurent Destailleur
68e96b98c5 Merge remote-tracking branch 'origin/3.6' into 3.7
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
2016-04-22 20:02:34 +02:00
Laurent Destailleur
7f5670cb26 Merge remote-tracking branch 'origin/3.5' into 3.6
Conflicts:
	ChangeLog
2016-04-22 19:49:27 +02:00
Laurent Destailleur
d2003e9607 Merge pull request #5058 from philippe-opendsi/patch-2
FIX #5048 Product supplier list display only one product
2016-04-22 19:44:16 +02:00
Philippe-OpenDSI
2fc876f607 FIX #5048 Product supplier list display only one produc
Last parameter of select_produits_fournisseurs_list is $limit, not $socid
2016-04-21 08:41:45 +02:00
Laurent Destailleur
0c932e0ee6 Merge pull request #4997 from atm-maxime/fix_vat_on_credit_note
Fix VAT amount on credit note was > 0 when manually entered
2016-04-19 19:21:05 +02:00
Florian HENRY
4401d2ee9c Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-04-19 18:52:33 +02:00
Marcos García de La Fuente
aa64266c2f FIX #5008 SQL error when editing the reference of a supplier invoice that already exists
Close #5008
2016-04-16 18:44:31 +02:00
Juanjo Menent
88ff138cd5 Merge pull request #5016 from simnandez/3.7
FIX #3815 With higher quality
2016-04-15 16:07:22 +02:00
Juanjo Menent
77263bb507 Merge pull request #5015 from simnandez/3.8
FIX #3815 With higher quality
2016-04-15 15:57:26 +02:00
Juanjo Menent
9f4ccfab95 FIX #3815 With higher quality 2016-04-15 15:54:51 +02:00
Juanjo Menent
6ba68ee742 Merge remote-tracking branch 'upstream/3.8' into 3.8 2016-04-15 15:43:51 +02:00
Juanjo Menent
c5ecc46a22 FIX #3815 With higher quality 2016-04-15 15:42:58 +02:00
Juanjo Menent
0d7e3a3a5c Merge pull request #5012 from simnandez/3.8
FIX #3815 Call to undefined function local_by_date(). branch 3.8
2016-04-15 13:07:40 +02:00
Juanjo Menent
e33d9eb5b4 Merge pull request #5010 from simnandez/3.7
FIX #3815 Call to undefined function local_by_date(). branch 3.7
2016-04-15 13:07:29 +02:00
Juanjo Menent
4446e6a36c FIX #3815 Call to undefined function local_by_date(). branch 3.8 2016-04-15 12:47:21 +02:00
Juanjo Menent
2d3b2c08b5 FIX #3815 Call to undefined function local_by_date(). branch 3.7 2016-04-15 10:56:03 +02:00
Laurent Destailleur
8342a61ea9 Merge remote-tracking branch 'origin/3.7' into 3.8
Conflicts:
	htdocs/core/tpl/objectline_edit.tpl.php
	htdocs/fourn/class/fournisseur.product.class.php
	htdocs/fourn/facture/card.php
	htdocs/product/composition/card.php
2016-04-12 15:00:02 +02:00
Maxime Kohlhaas
25dcca301f Fix VAT amount on credit note was > 0 when manually entered 2016-04-12 09:47:35 +02:00
Laurent Destailleur
d0e3d9db76 Merge pull request #4992 from altatof/fix_minimum_buying_price
FIX: correct display of minimum buying price
2016-04-11 19:17:09 +02:00
Laurent Destailleur
4d14f3e6f2 Merge pull request #4983 from marcosgdf/bug-4442
FIX #4442 Missing translation in Banks menu
2016-04-11 18:59:03 +02:00
Laurent Destailleur
46dd3c0cec Merge pull request #4982 from marcosgdf/bug-4737
FIX #4737 Bank transacion type selector translation is cropped
2016-04-11 18:58:26 +02:00
Christophe Battarel
292373cf84 forgot new discount field 2016-04-11 17:43:10 +02:00
Christophe Battarel
983b2c9a21 FIX: real min buying price 2016-04-11 17:40:47 +02:00
Christophe Battarel
791df0c9ea FIX: correct display of minimum buying price 2016-04-11 17:27:34 +02:00
Juanjo Menent
f25bf64257 Merge pull request #4978 from marcosgdf/bug-4851
FIX #4851 Project selector in supplier invoices shows the project label twice
2016-04-10 12:41:08 +02:00
Juanjo Menent
ddb1d06ad4 Merge pull request #4980 from marcosgdf/3.8
FIX #4743 UI glitch in project summary page
2016-04-10 11:56:37 +02:00
Juanjo Menent
e27def479f Merge pull request #4986 from marcosgdf/bug-4747
FIX #4747 Missing UI background when registering a supplier invoice payment
2016-04-10 11:54:27 +02:00
Juanjo Menent
be0b7c86ff Merge pull request #4985 from marcosgdf/bug-4742
FIX #4742 Able to delete a supplier invoice with a registered payment
2016-04-10 11:52:21 +02:00
Juanjo Menent
c3472f7879 Merge pull request #4984 from marcosgdf/bug-4424
FIX #4424 Missing email of user popup in supplier orders area
2016-04-10 11:51:36 +02:00
Juanjo Menent
3dbaa38cb4 Merge pull request #4979 from marcosgdf/bug-4748
FIX #4748 Supplier invoice payment confirmation amount is not translated
2016-04-10 11:51:07 +02:00
Juanjo Menent
4f5d96150a Merge pull request #4977 from marcosgdf/bug-4766
FIX #4766 VAT not shown in supplier invoice popup
2016-04-10 11:42:29 +02:00
Marcos García de La Fuente
15d9273751 FIX #4747 Missing UI background when registering a supplier invoice payment
Close #4747
2016-04-10 00:30:31 +02:00
Marcos García de La Fuente
af473df214 FIX #4742 Able to delete a supplier invoice with a registered payment
Close #4742
2016-04-09 23:29:19 +02:00
Marcos García de La Fuente
865f9defff FIX #4424 Missing email of user popup in supplier orders area
Close #4424
2016-04-09 23:08:47 +02:00
Marcos García de La Fuente
b9de3d5852 FIX #4442 Missing translation in Banks menu
Close #4442
2016-04-09 23:03:00 +02:00
Marcos García de La Fuente
3135cf720d FIX #4737 Bank transacion type selector translation is cropped
Close #4737
2016-04-09 22:59:12 +02:00
Marcos García de La Fuente
7cc1288bb2 FIX #4743 UI glitch in project summary page
Close #4743
2016-04-09 22:54:34 +02:00
Marcos García de La Fuente
1026484da1 FIX #4748 Supplier invoice payment confirmation amount is not translated
Close #4748
2016-04-09 22:48:42 +02:00
Marcos García de La Fuente
b2f922291f FIX #4851 Project selector in supplier invoices shows the project label twice
Close #4851
2016-04-09 22:38:58 +02:00
Marcos García de La Fuente
9169adf4ce FIX #4766 VAT not shown in supplier invoice popup
Close #4766
2016-04-09 22:34:55 +02:00
Laurent Destailleur
b5dfa2e446 Merge pull request #4975 from frederic34/patch-7
FIX re-establish user-agent when using nusoap client
2016-04-09 19:35:31 +02:00
Frédéric FRANCE
f90cffd74a Update nusoap.php
re-establish user-agent
2016-04-09 15:42:53 +02:00
Laurent Destailleur
234f3e331d Merge pull request #4962 from FHenry/3.8
FIX : Template email must take care of position column
2016-04-08 21:32:27 +02:00
Florian HENRY
093e3666ae Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-04-07 20:16:33 +02:00
Laurent Destailleur
4092f5fa2f Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-04-07 19:24:49 +02:00
Laurent Destailleur
f7fb95cab8 FIX Box disabled because bugged 2016-04-07 19:24:29 +02:00
Florian HENRY
f62a45ddfc Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-04-07 14:16:38 +02:00
Florian HENRY
1f723cb8d0 FIX : Template email must take care of positino column 2016-04-07 14:16:10 +02:00
Laurent Destailleur
30f27b6fac Merge pull request #4933 from frederic34/patch-10
FIX correctly retreive ref_customer
2016-04-04 00:36:49 +02:00
Laurent Destailleur
6a4ca98ad9 Merge pull request #4908 from altatof/fix_bad_rounding
FIX: systematic rounding causes prices to be updated without reason
2016-04-04 00:18:18 +02:00
Juanjo Menent
deeb6f604d Merge pull request #4905 from altatof/fix_margin_display
FIX: dont retrieve new buying price on margin display
2016-04-03 16:17:41 +02:00
Laurent Destailleur
599b225489 FIX Creation of thumb image for size "small" was not done.
Conflicts:
	htdocs/core/lib/files.lib.php
2016-04-02 14:21:50 +02:00
Frédéric FRANCE
d4529d19c7 Update facture.php
ref_client in order
ref_customer in shipping
2016-04-01 17:32:58 +02:00
Laurent Destailleur
2a19326a3f FIX Missing database escaping on supplier price insert/update 2016-03-31 21:47:32 +02:00
Christophe Battarel
024f55d461 FIX: systematic rounding causes prices to be updated without reason 2016-03-29 12:02:36 +02:00
Christophe Battarel
b8f3264f60 FIX: dont retrieve new buying price on margin display 2016-03-29 11:37:35 +02:00
Laurent Destailleur
00bf8caa8c FIX #4870 2016-03-25 17:55:58 +01:00
Juanjo Menent
4751c5ac67 Merge pull request #4881 from hregis/3.8_fix_merge
Fix: 3.7-3.8 fix merge
2016-03-23 22:59:18 +01:00
fmarcet
b8bc881e5a FIX: Email templates not compatible with Multicompany
Conflicts:
	htdocs/admin/dict.php
2016-03-23 13:57:17 +01:00
fmarcet
84e5c8b437 FIX: Email templates not compatible with Multicompany
Conflicts:
	htdocs/admin/dict.php
2016-03-23 13:56:06 +01:00
fmarcet
e2b4d39292 FIX: Email templates not compatible with Multicompany
Conflicts:
	htdocs/admin/dict.php
2016-03-23 13:54:39 +01:00
fmarcet
52d88db5c3 FIX: Email templates not compatible with Multicompany
Conflicts:
	htdocs/admin/dict.php
2016-03-23 13:53:18 +01:00
Regis Houssin
20d785ad28 Merge remote-tracking branch 'origin/3.7' into 3.8_fix_merge
Conflicts:
	htdocs/filefunc.inc.php
2016-03-23 13:40:05 +01:00
Laurent Destailleur
4f3f1eda7b FIX Duplicate records into export 2016-03-22 12:55:29 +01:00
Laurent Destailleur
876484dfb5 FIX Duplicate records into export 2016-03-22 12:54:26 +01:00
Laurent Destailleur
99ceb006e4 FIX Bad include and param for project numbering module call 2016-03-21 11:47:32 +01:00
Laurent Destailleur
660f825a34 Fix regression description line not visible 2016-03-19 19:25:28 +01:00
Laurent Destailleur
d09faadc24 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.8 2016-03-19 19:14:03 +01:00
Laurent Destailleur
f0eb8ac794 Fix regression Product ref not visible 2016-03-19 19:13:27 +01:00
Laurent Destailleur
b023aa317f Merge pull request #4840 from atm-alexis/3.8_FIX_finished_param_not_use
FIX finished parameters not used
2016-03-18 00:11:07 +01:00
Alexis Algoud
19e3c1b089 FIX finished parameters not used 2016-03-17 16:35:23 +01:00
Laurent Destailleur
aa7eb4935c FIX VAT rate can be negative. Example spain selling to morroco. 2016-03-17 12:18:47 +01:00
Laurent Destailleur
08c5fd2e36 FIX #4809 - Duplicate functions with different content 2016-03-14 14:38:30 +01:00
Laurent Destailleur
0727ee88e6 More robust initdemo script. 2016-03-12 18:33:32 +01:00
Laurent Destailleur
eb65707da8 Fix code to publishing packages on foundation server 2016-03-12 12:50:05 +01:00
Laurent Destailleur
444fce0bd9 Prepare 3.7.4 2016-03-11 18:34:05 +01:00
Laurent Destailleur
e669dac398 Prepare 3.6.7 2016-03-11 18:28:39 +01:00
Laurent Destailleur
32d0f9a8d7 Prepare 3.6.7 2016-03-11 18:27:04 +01:00
Laurent Destailleur
a45ffeecca Missing changelog 2016-03-11 18:21:57 +01:00
fmarcet
d6cda60ed1 FIX: Check stock of product by warehouse if $entrepot_id defined on shippings 2016-02-01 13:40:02 +01:00
fmarcet
acc9879c7c FIX: It doesn't check if there is enough stock to update the lines of orders/invoices 2016-02-01 13:05:14 +01:00
107 changed files with 697 additions and 426 deletions

View File

@@ -126,10 +126,10 @@ before_script:
echo "Set timezone"
echo 'date.timezone = "Europe/Paris"' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
if [ "$TRAVIS_PHP_VERSION" = '5.3' ] || [ "$TRAVIS_PHP_VERSION" = '5.4' ]; then
echo
echo "Enabling APC for PHP <= 5.4"
#echo
#echo "Enabling APC for PHP <= 5.4"
# Documentation says it should be available for PHP <= 5.6 but it's not for 5.5 and 5.6!
echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
#echo 'extension = apc.so' >> ~/.phpenv/versions/$PHP_VERSION_NAME/etc/php.ini
echo
echo "Enabling Memcached for PHP <= 5.4"
# Documentation says it should be available for all PHP versions but it's not for 5.5 and 5.6, 7.0 and nightly!

View File

@@ -8,6 +8,66 @@ You may also experience troubles with Mysql 5.5.41 with error "Lost connection"
Upgrading to any other version or any other database system is abolutely required BEFORE trying
make a Dolibarr upgrade.
***** 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
@@ -533,6 +593,23 @@ Dolibarr better:
- Function get_exdir require now 6 parameters. This is to prepare a future feature.
***** ChangeLog for 3.7.4 compared to 3.7.3 *****
FIX: #3694
FIX: #4239
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: #4341
FIX: #4414 Supplier invoices use FAC_FORCE_DATE_VALIDATION client invoices property
FIX: #4440 Wrong price is filled by Product::fetch into multiprices arrays
FIX: add missing global def for ttc column
FIX: Contrat card don't consider user permissions to show active/unactive service button
FIX: CVE CVE-2015-8685
FIX: Email templates not compatible with Multicompany
Fix: for avoid division by 0
FIX: ISSUE #4506 : make working the PROPAL_CLONE_ON_CREATE_PAGE hidden constant
FIX: $outputlangs is not defined (dolibarr 3.7, 3.8, 3.9)
FIX: sql injection even when code is on several lines
FIX: The third dashboard don't consider user permissions
***** ChangeLog for 3.7.3 compared to 3.7.2 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #3890 Expected transactions bank account page, shows negative numbers
@@ -860,6 +937,11 @@ Dolibarr better:
- Replaced USER_UPDATE_SESSION trigger with an updateSession hook may break modules using it.
***** ChangeLog for 3.6.7 compared to 3.6.6 *****
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: CVE CVE-2015-8685
***** ChangeLog for 3.6.6 compared to 3.6.5 *****
FIX: #3734 Do not show empty links of deleted source objects in stock movement list
FIX: #4081 Added missing translation
@@ -1112,6 +1194,17 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
- Remove add_photo_web() that is not used anymore by core code.
***** ChangeLog for 3.5.8 compared to 3.5.7 *****
FIX: #4291 Correctly filter external calendar GETPOSTs
FIX: bad calculation for stock value
FIX: bad stock valo
FIX: change order date on clone (as everywhere else)
FIX: CVE CVE-2015-8685
FIX: The hours of date filter aren't correct
FIX: #3442 Remove useless syslog
FIX: #3448 Pass expected date format
FIX: #3471 3.5 Rounding issue when dispatching non-integer
***** ChangeLog for 3.5.7 compared to 3.5.6 *****
Fix: Paypal link were broken due to SSL v3 closed.
Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers

View File

@@ -376,7 +376,7 @@ if ($nboftargetok) {
print 'Run git tag -a -m "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'" "'.$MAJOR.'.'.$MINOR.'.'.$BUILD.'"'."\n";
$ret=`git tag -a -m "$MAJOR.$MINOR.$BUILD" "$MAJOR.$MINOR.$BUILD" 2>&1`;
if ($ret =~ /already exists/)
if ($ret =~ /(already exists|existe déjà)/)
{
print "WARNING: Tag ".$MAJOR.'.'.$MINOR.'.'.$BUILD." already exists. Overwrite (y/N) ? ";
$QUESTIONOVERWRITETAG=<STDIN>;
@@ -1086,6 +1086,14 @@ if ($nboftargetok) {
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
"$DESTI/standard/$FILENAMETGZ.zip"=>'Dolibarr ERP-CRM'
);
%filestoscanstableasso=(
"$DESTI/package_rpm_generic/$FILENAMERPM"=>'package_rpm_generic',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',
"$DESTI/standard/$FILENAMETGZ.zip"=>'standard'
);
use POSIX qw/strftime/;
foreach my $file (sort keys %filestoscansf)
{
@@ -1128,13 +1136,15 @@ if ($nboftargetok) {
if ($target eq 'SF') {
$destFolder="$NEWPUBLISH/$filestoscan{$file}/".$MAJOR.'.'.$MINOR.'.'.$BUILD;
print "Publish file ".$file." to $NEWPUBLISH/".$filestoscan{$file}."\n";
}
elsif ($target eq 'ASSO' && $NEWPUBLISH =~ /stable/) {
$destFolder="$NEWPUBLISH/$filestoscanstableasso{$file}";
}
else
{
$destFolder="$NEWPUBLISH";
print "Publish file ".$file." to $NEWPUBLISH\n";
}
print "Publish file ".$file." to ".$destFolder."\n";
# mkdir
#my $ssh = Net::SSH::Perl->new("frs.sourceforge.net");

View File

@@ -171,6 +171,8 @@ then
fi
#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile"
#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
#echo "drop old table"
echo "drop table llx_accounting_account;" | mysql -P$port -u$admin $passwd $base
echo "mysql -P$port -u$admin -p***** $base < $mydir/$dumpfile"
mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile
export res=$?

View File

@@ -208,10 +208,9 @@ print "<td>" . $langs->trans("Selectchartofaccounts") . "</td>";
print "<td>";
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
$sql = "SELECT rowid, pcg_version, fk_pays, label, active";
$sql = "SELECT rowid, pcg_version, label, active";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system";
$sql .= " WHERE active = 1";
$sql .= " AND fk_pays = " . $mysoc->country_id;
dol_syslog('accountancy/admin/index.php:: $sql=' . $sql);
$resql = $db->query($sql);
@@ -227,7 +226,7 @@ if ($resql) {
print '<option value="' . $row[0] . '"';
print $conf->global->CHARTOFACCOUNTS == $row[0] ? ' selected' : '';
print '>' . $row[1] . ' - ' . $row[3] . '</option>';
print '>' . $row[1] . ' - ' . $row[2] . '</option>';
$i ++;
}

View File

@@ -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 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>
@@ -165,7 +165,7 @@ $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT t.rowid as rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates";
$tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")";
$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
$tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm";
$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
@@ -229,7 +229,7 @@ $tabfield[21]= "code,label";
$tabfield[22]= "code,label";
$tabfield[23]= "country_id,country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[24]= "code,label";
$tabfield[25]= "label,type_template,position,topic,content";
$tabfield[25]= "label,type_template,private,position,topic,content";
$tabfield[26]= "code,label,short_label";
$tabfield[27]= "code,libelle";
$tabfield[28]= "code,label,delay,newByMonth,country_id,country";
@@ -261,7 +261,7 @@ $tabfieldvalue[21]= "code,label";
$tabfieldvalue[22]= "code,label";
$tabfieldvalue[23]= "country,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldvalue[24]= "code,label";
$tabfieldvalue[25]= "label,type_template,position,topic,content";
$tabfieldvalue[25]= "label,type_template,private,position,topic,content";
$tabfieldvalue[26]= "code,label,short_label";
$tabfieldvalue[27]= "code,libelle";
$tabfieldvalue[28]= "code,label,delay,newByMonth,country";
@@ -293,7 +293,7 @@ $tabfieldinsert[21]= "code,label";
$tabfieldinsert[22]= "code,label";
$tabfieldinsert[23]= "fk_pays,taux,accountancy_code_sell,accountancy_code_buy,note";
$tabfieldinsert[24]= "code,label";
$tabfieldinsert[25]= "label,type_template,position,topic,content";
$tabfieldinsert[25]= "label,type_template,private,position,topic,content,entity";
$tabfieldinsert[26]= "code,label,short_label";
$tabfieldinsert[27]= "code,libelle";
$tabfieldinsert[28]= "code,label,delay,newByMonth,fk_country";
@@ -617,7 +617,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') {
@@ -665,7 +665,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') {
@@ -1283,23 +1283,12 @@ 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";

View File

@@ -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>
@@ -592,17 +592,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++;
}
}
}
}

View File

@@ -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
*/

View File

@@ -919,7 +919,14 @@ if (count($listofextcals))
// Complete $eventarray with events coming from external module
$parameters=array(); $object=null;
$reshook=$hookmanager->executeHooks('getCalendarEvents',$parameters,$object,$action);
if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($eventarray, $hookmanager->resArray['eventarray']);
if (! empty($hookmanager->resArray['eventarray'])) {
foreach ($hookmanager->resArray['eventarray'] as $keyDate => $events) {
if (!isset($eventarray[$keyDate])) {
$eventarray[$keyDate]=array();
}
$eventarray[$keyDate]=array_merge($eventarray[$keyDate], $events);
}
}

View File

@@ -66,7 +66,7 @@ $companystatic=new Societe($db);
if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db);
if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db);
llxHeader();
llxHeader("",$langs->trans("CommercialArea"));
print_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png');

View File

@@ -562,15 +562,6 @@ if (empty($reshook))
}
}
// Reopen proposal
else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel'))
{
// prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) {
$object->reopen($user, 1);
}
}
// Close proposal
else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel'))
{
@@ -591,17 +582,6 @@ if (empty($reshook))
}
}
// Classify billed
else if ($action == 'classifybilled' && $user->rights->propal->cloturer)
{
$result=$object->cloture($user, 4, '');
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
// Reopen proposal
else if ($action == 'confirm_reopen' && $user->rights->propal->cloturer && ! GETPOST('cancel'))
{
@@ -617,20 +597,6 @@ if (empty($reshook))
}
}
// Close proposal
else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel'))
{
if (! GETPOST('statut')) {
setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentities("CloseAs")), 'errors');
$action = 'statut';
} else {
// prevent browser refresh from closing proposal several times
if ($object->statut == Propal::STATUS_VALIDATED) {
$object->cloture($user, GETPOST('statut'), GETPOST('note'));
}
}
}
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';

View File

@@ -2528,7 +2528,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.
@@ -2803,6 +2803,8 @@ class Propal extends CommonObject
*/
function getLinesArray()
{
// For other object, here we call fetch_lines. But fetch_lines does not exists on proposal
$sql = 'SELECT pt.rowid, pt.label as custom_label, pt.description, pt.fk_product, pt.fk_remise_except,';
$sql.= ' pt.qty, pt.tva_tx, pt.remise_percent, pt.subprice, pt.info_bits,';
$sql.= ' pt.total_ht, pt.total_tva, pt.total_ttc, pt.fk_product_fournisseur_price as fk_fournprice, pt.buy_price_ht as pa_ht, pt.special_code, pt.localtax1_tx, pt.localtax2_tx,';
@@ -2831,9 +2833,11 @@ class Propal extends CommonObject
$this->lines[$i]->id = $obj->rowid; // for backward compatibility
$this->lines[$i]->rowid = $obj->rowid;
$this->lines[$i]->label = $obj->custom_label;
$this->lines[$i]->desc = $obj->description;
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->ref;
$this->lines[$i]->product_ref = $obj->ref;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc;

View File

@@ -9,6 +9,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@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
@@ -1702,7 +1703,7 @@ class Commande extends CommonOrder
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
$sql.= ' WHERE l.fk_commande = '.$this->id;
if ($only_product) $sql .= ' AND p.fk_product_type = 0';
$sql .= ' ORDER BY l.rang';
$sql .= ' ORDER BY l.rang, l.rowid';
dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -1723,6 +1724,7 @@ class Commande extends CommonOrder
$line->commande_id = $objp->fk_commande;
$line->label = $objp->custom_label;
$line->desc = $objp->description;
$line->description = $objp->description; // Description line
$line->product_type = $objp->product_type;
$line->qty = $objp->qty;
$line->tva_tx = $objp->tva_tx;
@@ -2473,7 +2475,7 @@ class Commande extends CommonOrder
*/
function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1=0.0,$txlocaltax2=0.0, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='', $type=0, $fk_parent_line=0, $skip_update_total=0, $fk_fournprice=null, $pa_ht=0, $label='', $special_code=0, $array_options=0, $fk_unit=null)
{
global $conf, $mysoc;
global $conf, $mysoc, $langs;
dol_syslog(get_class($this)."::updateline id=$rowid, desc=$desc, pu=$pu, qty=$qty, remise_percent=$remise_percent, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, price_base_type=$price_base_type, info_bits=$info_bits, date_start=$date_start, date_end=$date_end, type=$type, fk_parent_line=$fk_parent_line, pa_ht=$pa_ht, special_code=$special_code");
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
@@ -2528,6 +2530,26 @@ class Commande extends CommonOrder
$line = new OrderLine($this->db);
$line->fetch($rowid);
if (!empty($line->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($line->fk_product);
$product_type=$product->type;
if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR);
$this->db->rollback();
unset($_POST['productid']);
unset($_POST['tva_tx']);
unset($_POST['price_ht']);
unset($_POST['qty']);
unset($_POST['buying_price']);
return self::STOCK_NOT_ENOUGH_FOR_ORDER;
}
}
$staticline = clone $line;
$line->oldline = $staticline;
@@ -2888,7 +2910,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");
while ($obj=$this->db->fetch_object($resql))
@@ -3233,12 +3255,14 @@ class Commande extends CommonOrder
}
/**
* Return an array of order lines
*
* @return array Lines of order
* Create an array of order lines
*
* @return int >0 if OK, <0 if KO
*/
function getLinesArray()
{
return $this->fetch_lines();
/*
$lines = array();
$sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.price, l.qty, l.tva_tx, ';
@@ -3308,7 +3332,7 @@ class Commande extends CommonOrder
{
$this->error=$this->db->error();
return -1;
}
}*/
}
/**

View File

@@ -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))."'";

View File

@@ -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>';

View File

@@ -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))
{

View File

@@ -87,6 +87,17 @@ if ($action == 'delete')
{
if (GETPOST('categid'))
{
// Delete bank class
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class";
$sql.= " WHERE fk_categ = '".GETPOST('categid')."'";
$result = $db->query($sql);
if (!$result)
{
dol_print_error($db);
}
// Delete bank categ
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_categ";
$sql.= " WHERE rowid = '".GETPOST('categid')."'";
$sql.= " AND entity = ".$conf->entity;

View File

@@ -210,7 +210,7 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="center">';
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1, 8);
$form->select_types_paiements(empty($type)?'':$type, 'type', '', 2, 0, 1);
print '</td>';
print '<td class="liste_titre"><input type="text" class="flat" name="req_nb" value="'.GETPOST("req_nb").'" size="2"></td>';
print '<td class="liste_titre">';

View File

@@ -282,6 +282,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$refcomp=$societestatic->getNomUrl(1,'',24);
$paiement = $facturestatic->getSommePaiement(); // Payment already done
$paiement+= $facturestatic->getSumDepositsUsed();
$paiement+= $facturestatic->getSumCreditNotesUsed();
}
if ($obj->family == 'social_contribution')
{

View File

@@ -390,19 +390,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 ++;
setEventMessage($langs->trans('ErrorProdIdIsMandatory', $langs->transcountry('ProfId' . $i, $object->thirdparty->country_code)), '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;
@@ -1906,7 +1907,7 @@ if ($action == 'create')
$objectsrc->fetch_thirdparty();
$projectid = (! empty($projectid) ? $projectid : $objectsrc->fk_project);
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : (! empty($objectsrc->ref_customer) ? $objectsrc->ref_customer:''));
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
// only if socid not filled else it's allready done upper
@@ -1935,7 +1936,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))
{
@@ -2388,7 +2389,7 @@ if ($action == 'create')
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1);
//We check if Origin document has already an invoice attached to it
$objectsrc->fetchObjectLinked($originid,'','','facture');
$objectsrc->fetchObjectLinked($originid,$origin,'','facture');
$cntinvoice=count($objectsrc->linkedObjects['facture']);
if ($cntinvoice>=1)
{

View File

@@ -14,6 +14,7 @@
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* 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
@@ -1097,7 +1098,7 @@ class Facture extends CommonInvoice
$this->lines=array();
$sql = 'SELECT l.rowid, l.fk_product, l.fk_parent_line, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.tva_tx, ';
$sql .= ' l.situation_percent, l.fk_prev_id,';
$sql.= ' l.situation_percent, l.fk_prev_id,';
$sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise_percent, l.fk_remise_except, l.subprice,';
$sql.= ' l.rang, l.special_code,';
$sql.= ' l.date_start as date_start, l.date_end as date_end,';
@@ -1107,7 +1108,7 @@ class Facture extends CommonInvoice
$sql.= ' FROM '.MAIN_DB_PREFIX.'facturedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
$sql.= ' WHERE l.fk_facture = '.$this->id;
$sql.= ' ORDER BY l.rang';
$sql.= ' ORDER BY l.rang, l.rowid';
dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG);
$result = $this->db->query($sql);
@@ -1124,7 +1125,9 @@ class Facture extends CommonInvoice
$line->rowid = $objp->rowid; // deprecated
$line->label = $objp->custom_label; // deprecated
$line->desc = $objp->description; // Description line
$line->description = $objp->description; // Description line
$line->product_type = $objp->product_type; // Type of line
$line->ref = $objp->product_ref; // Ref product
$line->product_ref = $objp->product_ref; // Ref product
$line->libelle = $objp->product_label; // TODO deprecated
$line->product_label = $objp->product_label; // Label product
@@ -2205,27 +2208,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;
@@ -2363,6 +2371,19 @@ class Facture extends CommonInvoice
$line = new FactureLigne($this->db);
$line->fetch($rowid);
if (!empty($line->fk_product))
{
$product=new Product($this->db);
$result=$product->fetch($line->fk_product);
$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');
$this->db->rollback();
return -3;
}
}
$staticline = clone $line;
$line->oldline = $staticline;
@@ -2390,7 +2411,7 @@ class Facture extends CommonInvoice
$this->line->date_start = $date_start;
$this->line->date_end = $date_end;
$this->line->total_ht = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ht):$total_ht); // For credit note and if qty is negative, total is negative
$this->line->total_tva = $total_tva;
$this->line->total_tva = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_tva):$total_tva);
$this->line->total_localtax1 = $total_localtax1;
$this->line->total_localtax2 = $total_localtax2;
$this->line->total_ttc = (($this->type==self::TYPE_CREDIT_NOTE||$qty<0)?-abs($total_ttc):$total_ttc);
@@ -3248,7 +3269,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");
while ($obj=$this->db->fetch_object($resql))
@@ -3474,6 +3495,8 @@ class Facture extends CommonInvoice
*/
function getLinesArray()
{
return $this->fetch_lines();
/*
$sql = 'SELECT l.rowid, l.label as custom_label, l.description, l.fk_product, l.product_type, l.qty, l.tva_tx,';
$sql.= ' l.fk_remise_except, l.localtax1_tx, l.localtax2_tx,';
$sql .= ' l.situation_percent, l.fk_prev_id,';
@@ -3506,11 +3529,12 @@ class Facture extends CommonInvoice
$this->lines[$i]->description = $obj->description;
$this->lines[$i]->fk_product = $obj->fk_product;
$this->lines[$i]->ref = $obj->product_ref;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_ref = $obj->product_ref;
$this->lines[$i]->product_label = $obj->product_label;
$this->lines[$i]->product_desc = $obj->product_desc;
$this->lines[$i]->fk_product_type = $obj->fk_product_type;
$this->lines[$i]->product_type = $obj->product_type;
$this->lines[$i]->entity = $obj->entity; // Product entity
$this->lines[$i]->qty = $obj->qty;
$this->lines[$i]->subprice = $obj->subprice;
$this->lines[$i]->fk_remise_except = $obj->fk_remise_except;
@@ -3520,6 +3544,10 @@ class Facture extends CommonInvoice
$this->lines[$i]->total_ht = $obj->total_ht;
$this->lines[$i]->total_tva = $obj->total_tva;
$this->lines[$i]->total_ttc = $obj->total_ttc;
$this->lines[$i]->localtax1_tx = $obj->localtax1_tx;
$this->lines[$i]->localtax2_tx = $obj->localtax2_tx;
$this->lines[$i]->localtax1_type = $obj->localtax1_type;
$this->lines[$i]->localtax2_type = $obj->localtax2_type;
$this->lines[$i]->fk_parent_line = $obj->fk_parent_line;
$this->lines[$i]->situation_percent = $obj->situation_percent;
$this->lines[$i]->fk_prev_id = $obj->fk_prev_id;
@@ -3544,7 +3572,7 @@ class Facture extends CommonInvoice
{
$this->error=$this->db->error();
return -1;
}
}*/
}
/**

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2015 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>
*
* 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
@@ -230,7 +231,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
*/
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
{
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.tva as total_tva, f.total_ttc, f.type";
$sql = "SELECT f.ref, f.rowid, f.total_ht, f.total_tva, f.total_ttc, f.type";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_fournisseur";

View File

@@ -271,7 +271,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");

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2014 Rosana Romero <rromero@2byte.es>
* Copyright (C) 2014-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
@@ -116,16 +116,11 @@ $product_static=new Product($db);
$payment_static=new Paiement($db);
$paymentfourn_static=new PaiementFourn($db);
//print_fiche_titre($langs->trans("VAT"),"");
//$fsearch.='<br>';
$fsearch.=' <input type="hidden" name="year" value="'.$year.'">';
$fsearch.=' <input type="hidden" name="modetax" value="'.$modetax.'">';
//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
//$fsearch.=' <input type="text" name="min" value="'.$min.'">';
$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
{
$nom=$langs->trans($local==1?"LT1ReportByQuartersInDueDebtMode":"LT2ReportByQuartersInDueDebtMode");
@@ -138,14 +133,11 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1) // Calculate on invoice
$nextyear=$year_start; $nextquarter=$q;
if ($nextquarter < 4) $nextquarter++;
else { $nextquarter=1; $nextyear++; }
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
else $description.='<br>'.$langs->trans("DepositsAreIncluded");
$description.=$fsearch;
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
$elementcust=$langs->trans("CustomersInvoices");
$productcust=$langs->trans("ProductOrService");
@@ -170,14 +162,10 @@ if ($conf->global->$calc==2) // Invoice for goods, payment for services
$nextyear=$year_start; $nextquarter=$q;
if ($nextquarter < 4) $nextquarter++;
else { $nextquarter=1; $nextyear++; }
//$periodlink=($prevyear?"<a href='".$_SERVER["PHP_SELF"]."?year=".$prevyear."&q=".$prevquarter."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".$nextyear."&q=".$nextquarter."&modetax=".$modetax."'>".img_next()."</a>":"");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded");
else $description.=' '.$langs->trans("DepositsAreIncluded");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch;
$builddate=time();
//$exportlink=$langs->trans("NotYetAvailable");
$elementcust=$langs->trans("CustomersInvoices");
$productcust=$langs->trans("ProductOrService");
@@ -203,16 +191,13 @@ if($local==1){
// VAT Received and paid
$y = $year_current;
$total = 0;
$i=0;
// Load arrays of datas
$x_coll= local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell', $local);
//$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell');
$x_paye = local_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy', $local);
$x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell');
$x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy');
echo '<table class="noborder" width="100%">';
@@ -230,14 +215,14 @@ if (! is_array($x_coll) || ! is_array($x_paye))
else
{
$x_both = array();
//now, from these two arrays, get another array with one rate per line
foreach(array_keys($x_coll) as $my_coll_rate)
{
//foreach($x_coll[$my_coll_rate][localtax1_list]){
$x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
$x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
$x_both[$my_coll_rate]['coll']['localtax'.$local] = $x_coll[$my_coll_rate]['localtax'.$local];
$x_both[$my_coll_rate]['paye']['totalht'] = 0;
$x_both[$my_coll_rate]['paye']['vat'] = 0;
$x_both[$my_coll_rate]['paye']['localtax'.$local] = 0;
$x_both[$my_coll_rate]['coll']['links'] = '';
$x_both[$my_coll_rate]['coll']['detail'] = array();
foreach($x_coll[$my_coll_rate]['facid'] as $id=>$dummy)
@@ -303,9 +288,6 @@ else
}
//now we have an array (x_both) indexed by rates for coll and paye
//print table headers for this quadri - incomes first
$x_coll_sum = 0;
$x_coll_ht = 0;
$x_paye_sum = 0;
@@ -314,8 +296,6 @@ else
$span=3;
if ($modetax == 0) $span+=2;
//print '<tr><td colspan="'.($span+1).'">'..')</td></tr>';
if($conf->global->$calc ==0 || $conf->global->$calc == 2){
// Customers invoices
print '<tr class="liste_titre">';
@@ -345,8 +325,6 @@ else
if($rate!=0){
print "<tr>";
//print '<td class="tax_rate">'.$langs->trans("Rate").': '.vatrate($rate).'%</td><td colspan="'.$span.'"></td>';
/**/
print '<td class="tax_rate">'.$langs->trans("Rate").': '.vatrate($rate).'%</td><td colspan="'.$span.'"></td>';
print '</tr>'."\n";
}
@@ -400,9 +378,7 @@ else
print price($fields['totalht']);
if (price2num($fields['ftotal_ttc']))
{
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
$ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
//print ' ('.round($ratiolineinvoice*100,2).'%)';
}
print '</td>';
}
@@ -413,7 +389,6 @@ else
{
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) $ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
print '<td class="nowrap" align="right">';
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
if ($fields['payment_amount'] && $fields['ftotal_ttc'])
{
$payment_static->id=$fields['payment_id'];
@@ -424,7 +399,7 @@ else
print $langs->trans("NotUsedForGoods");
}
else {
print $fields['payment_amount'];
print price($fields['payment_amount']);
if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
}
print '</td>';
@@ -491,7 +466,6 @@ else
if($conf->global->$calc ==0 || $conf->global->$calc == 1){
echo '<table class="noborder" width="100%">';
//print table headers for this quadri - expenses now
//imprime les en-tete de tables pour ce quadri - maintenant les d<>penses
print '<tr class="liste_titre">';
print '<td align="left">'.$elementsup.'</td>';
print '<td align="left">'.$productsup.'</td>';
@@ -585,7 +559,7 @@ else
}
else
{
print $fields['payment_amount'];
print price($fields['payment_amount']);
if (isset($fields['payment_amount'])) print ' ('.round($ratiopaymentinvoice*100,2).'%)';
}
print '</td>';
@@ -663,6 +637,5 @@ else
$i++;
}
$db->close();
llxFooter();
$db->close();

View File

@@ -918,7 +918,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.'/receipts/'.$ref.'.xml';
// Create withdraw receipt in database
$sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons (";
@@ -934,10 +937,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
{
@@ -1033,7 +1032,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);
}
/*

View File

@@ -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";

View File

@@ -177,6 +177,8 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
// SQL request
$catotal=0;
$catotal_ht=0;
$qtytotal=0;
if ($modecompta == 'CREANCES-DETTES')
{
@@ -386,6 +388,8 @@ if ($modecompta == 'CREANCES-DETTES')
// Total
print '<tr class="liste_total">';
print '<td>'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($qtytotal).'</td>';
print '<td>&nbsp;</td>';
print '<td align="right">'.price($catotal_ht).'</td>';
print '<td align="right">'.price($catotal).'</td>';
print '<td>&nbsp;</td>';

View File

@@ -319,8 +319,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
$label = $lines[$i]->product_label;
}
if ($conf->global->PRODUIT_DESC_IN_FORM)
$desc .= ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
$desc = ($lines[$i]->desc && $lines[$i]->desc!=$lines[$i]->libelle)?dol_htmlentitiesbr($lines[$i]->desc):'';
}
else {
$desc = dol_htmlentitiesbr($lines[$i]->desc);

View File

@@ -180,7 +180,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="7" name="search_ref_supplier value="'.dol_escape_htmltag($search_ref_supplier).'">';
print '<input type="text" class="flat" size="7" name="search_ref_supplier" value="'.dol_escape_htmltag($search_ref_supplier).'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="24" name="search_name" value="'.dol_escape_htmltag($search_name).'">';

View File

@@ -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);

View File

@@ -36,7 +36,8 @@ class box_task extends ModeleBoxes
//var $depends = array("projet");
var $db;
var $param;
var $enabled = 0; // Disabled because bugged.
var $info_box_head = array();
var $info_box_contents = array();

View File

@@ -2726,7 +2726,7 @@ abstract class CommonObject
{
$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " SET fk_incoterms = ".($id_incoterm > 0 ? $id_incoterm : "null");
$sql.= ", location_incoterms = '".($id_incoterm > 0 ? $this->db->escape($location) : "null")."'";
$sql.= ", location_incoterms = ".($id_incoterm > 0 ? "'".$this->db->escape($location)."'" : "null");
$sql.= " WHERE rowid = " . $this->id;
dol_syslog(get_class($this).'::setIncoterms', LOG_DEBUG);
$resql=$this->db->query($sql);

View File

@@ -2267,10 +2267,10 @@ class Form
$form.= $opt;
$i++;
}
$form.= '</select>';
$this->db->free($result);
}
$form.= '</select>';
$this->db->free($result);
return $form;
}
else

View File

@@ -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
@@ -716,9 +717,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.'&amp;file='.urlencode($relativepath).'"';

View File

@@ -859,13 +859,13 @@ class FormMail extends Form
{
$ret=array();
$sql = "SELECT rowid, label, topic, content, lang";
$sql = "SELECT rowid, label, topic, content, lang, position";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
$sql.= " WHERE type_template='".$this->db->escape($type_template)."'";
$sql.= " AND entity IN (".getEntity("c_email_templates").")";
$sql.= " AND (fk_user is NULL or fk_user = 0 or fk_user = ".$user->id.")";
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
$sql.= $this->db->order("lang,label","ASC");
$sql.= $this->db->order("position,lang,label","ASC");
//print $sql;
$resql = $this->db->query($sql);

View File

@@ -127,13 +127,15 @@ class FormProjets
// Search all projects
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
$sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " WHERE p.entity IN (".getEntity('project',1).")";
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
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 .= ' AND (';
$sql .= ' p.title LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= ')';
}
$sql.= " ORDER BY p.ref ASC";
@@ -180,7 +182,7 @@ class FormProjets
continue;
}
$labeltoshow=dol_trunc($obj->ref,18).' - '.$obj->title;
$labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);

View File

@@ -160,57 +160,41 @@ 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 (is_resource($this->connection))
{
// 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 ($connected) break;
if (empty($host)) continue;
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))
{
// 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)
{
@@ -223,26 +207,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)

View File

@@ -746,17 +746,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))

View File

@@ -1139,7 +1139,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
{
// Create small thumbs for image (Ratio is near 16/9)
// Used on logon for example
$imgThumbSmall = vignette($destpath, $maxwidthsmall, $maxheigthsmall, '_small', 50, "thumbs");
$imgThumbSmall = vignette($destpath, $maxwidthsmall, $maxheightsmall, '_small', 50, "thumbs");
// Create mini thumbs for image (Ratio is near 16/9)
// Used on menu or for setup page for example
$imgThumbMini = vignette($destpath, $maxwidthmini, $maxheightmini, '_mini', 50, "thumbs");

View File

@@ -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>
@@ -431,7 +431,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);
}
@@ -3170,7 +3170,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
{
if ($local == 1)
{
if(! $mysoc->localtax1_assuj) return 0;
if(! $mysoc->localtax1_assuj || $tva=="0") return 0;
if ($thirdparty_seller->id==$mysoc->id)
{
if (! $thirdparty_buyer->localtax1_assuj) return 0;
@@ -3183,7 +3183,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
if ($local == 2)
{
if(! $mysoc->localtax2_assuj) return 0;
if(! $mysoc->localtax2_assuj || $tva=="0") return 0;
if ($thirdparty_seller->id==$mysoc->id )
{
if (! $thirdparty_buyer->localtax2_assuj) return 0;

View File

@@ -1490,7 +1490,8 @@ 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
*/

View File

@@ -1342,7 +1342,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;
if (is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
{
@@ -1355,7 +1358,7 @@ function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs);
if (empty($hidedetails) || $hidedetails > 1) return price($sign * (($object->lines[$i]->subprice) + ($object->lines[$i]->subprice)*($object->lines[$i]->tva_tx)/100), 0, $outputlangs);
}
}
@@ -1629,7 +1632,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;
if ($object->lines[$i]->special_code == 3)
{
@@ -1648,7 +1654,7 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
}
else
{
if (empty($hidedetails) || $hidedetails > 1) return price(($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100, 0, $outputlangs);
if (empty($hidedetails) || $hidedetails > 1) return price($sign * (($object->lines[$i]->total_ht) + ($object->lines[$i]->total_ht)*($object->lines[$i]->tva_tx)/100), 0, $outputlangs);
}
}
return '';

View File

@@ -302,7 +302,9 @@ function show_list_sending_receive($origin,$origin_id,$filter='')
$expedition->id=$objp->sendingid;
$expedition->fetchObjectLinked($expedition->id,$expedition->element);
//var_dump($expedition->linkedObjects);
$receiving=(! empty($expedition->linkedObjects['delivery'][0])?$expedition->linkedObjects['delivery'][0]:'');
reset($expedition->linkedObjects['delivery']);
$first = key($expedition->linkedObjects['delivery']);
$receiving=(! empty($expedition->linkedObjects['delivery'][$first])?$expedition->linkedObjects['delivery'][$first]:'');
if (! empty($receiving))
{

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2006-2007 Yannick Warnier <ywarnier@beeznest.org>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
@@ -178,7 +178,6 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
}
}
/**
* Gets VAT to collect for the given year (and given quarter or month)
* The function gets the VAT in split results, as the VAT declaration asks

View File

@@ -753,8 +753,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'))
@@ -1014,6 +1014,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
$langs->load("withdrawals");
$langs->load("banks");
$langs->load("bills");
$langs->load('categories');
// Bank-Caisse
if (! empty($conf->banque->enabled))

View File

@@ -922,7 +922,7 @@ class pdf_aurore extends ModelePDFAskPriceSupplier
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

View File

@@ -911,7 +911,7 @@ class pdf_einstein extends ModelePDFCommandes
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

View File

@@ -818,7 +818,7 @@ class pdf_proforma extends ModelePDFCommandes
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

View File

@@ -100,7 +100,8 @@ class pdf_merou extends ModelePdfExpedition
$outputlangs->load("propal");
$outputlangs->load("deliveries");
$outputlangs->load("sendings");
$outputlangs->load("productbatch");
if ($conf->expedition->dir_output)
{
$object->fetch_thirdparty();

View File

@@ -102,7 +102,8 @@ class pdf_rouget extends ModelePdfExpedition
$outputlangs->load("propal");
$outputlangs->load("deliveries");
$outputlangs->load("sendings");
$outputlangs->load("productbatch");
if ($conf->expedition->dir_output)
{
// Definition de $dir et $file

View File

@@ -313,11 +313,6 @@ class pdf_standard extends ModeleExpenseReport
$pdf->SetFont('','', $default_font_size - 1);
$pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-1, 3, $this->posxpiece-1, $curY, $piece_comptable, 0, 1);
// Comments
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($this->posxcomment, $curY);
$pdf->writeHTMLCell($this->posxdate-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $object->lines[$i]->comments, 0, 1);
//nexY
$nexY = $pdf->GetY();
$pageposafter=$pdf->getPage();
@@ -325,6 +320,11 @@ class pdf_standard extends ModeleExpenseReport
$pdf->setTopMargin($this->marge_haute);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
// Comments
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($this->posxcomment, $curY);
$pdf->writeHTMLCell($this->posxdate-$this->posxdesc-1, 3, $this->posxdesc-1, $curY, $object->lines[$i]->comments, 0, 1);
// Date
$pdf->SetFont('','', $default_font_size - 1);
$pdf->SetXY($this->posxdate, $curY);
@@ -562,7 +562,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);
@@ -570,19 +570,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;

View File

@@ -539,13 +539,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();
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;
$localtax2ligne=$object->lines[$i]->total_localtax2;
@@ -1107,7 +1110,7 @@ class pdf_crabe extends ModelePDFFactures
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

View File

@@ -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

View File

@@ -224,7 +224,7 @@ class modCommande extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON c.fk_user_author = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON c.fk_user_valid = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON c.fk_user_valid = uv.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'commande_extrafields as extra ON c.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';

View File

@@ -217,7 +217,7 @@ class modPropale extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'propal as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON c.fk_user_author = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON c.fk_user_valid = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON c.fk_user_valid = uv.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'propal_extrafields as extra ON c.rowid = extra.fk_object';
$this->export_sql_end[$r] .=', '.MAIN_DB_PREFIX.'propaldet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)';

View File

@@ -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(

View File

@@ -710,7 +710,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');
@@ -1073,7 +1073,7 @@ class pdf_azur extends ModelePDFPropales
// VAT
foreach($this->tva as $tvakey => $tvaval)
{
if ($tvakey > 0) // On affiche pas taux 0
if ($tvakey != 0) // On affiche pas taux 0
{
$this->atleastoneratenotnull++;

View File

@@ -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);

View File

@@ -369,18 +369,12 @@ if (! empty($usemargins) && $user->rights->margins->creer)
jQuery(document).ready(function() {
<?php
if (! empty($conf->global->DISPLAY_MARGIN_RATES)) { ?>
$('#addline').click(function (e) {
return checkFreeLine(e, "np_marginRate");
});
$("input[name='np_marginRate']:first").blur(function(e) {
return checkFreeLine(e, "np_marginRate");
});
<?php
}
if (! empty($conf->global->DISPLAY_MARK_RATES)) { ?>
$('#addline').click(function (e) {
return checkFreeLine(e, "np_markRate");
});
$("input[name='np_markRate']:first").blur(function(e) {
return checkFreeLine(e, "np_markRate");
});

View File

@@ -299,9 +299,6 @@ if (! empty($conf->margin->enabled))
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
{
?>
$('#savelinebutton').click(function (e) {
return checkEditLine(e, "np_marginRate");
});
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
$("input[name='np_marginRate']:first").blur(function(e) {
return checkEditLine(e, "np_marginRate");
@@ -311,9 +308,6 @@ if (! empty($conf->margin->enabled))
if (! empty($conf->global->DISPLAY_MARK_RATES))
{
?>
$('#savelinebutton').click(function (e) {
return checkEditLine(e, "np_markRate");
});
/* Disabled. We must be able to click on button 'cancel'. Check must be done only on button 'save'.
$("input[name='np_markRate']:first").blur(function(e) {
return checkEditLine(e, "np_markRate");
@@ -326,6 +320,7 @@ if (! empty($conf->margin->enabled))
/* If margin rate field empty, do nothing. */
/* Force content of price_ht to 0 or if a discount is set, recalculate it from margin rate */
/* TODO This function seems no more used */
function checkEditLine(e, npRate)
{
var buying_price = $("input[name='buying_price']:first");

View File

@@ -1033,21 +1033,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)

View File

@@ -713,7 +713,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>";
}
@@ -740,9 +740,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
{

View File

@@ -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
@@ -645,7 +646,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

View File

@@ -832,13 +832,19 @@ class Expedition extends CommonObject
return -1;
}
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT) // FIXME Check is done for stock of product, it must be done for stock of product into warehouse if $entrepot_id defined
if ($conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT)
{
$product=new Product($this->db);
$result=$product->fetch($fk_product);
if ($entrepot_id > 0) {
$product->load_stock();
$product_stock = $product->stock_warehouse[$entrepot_id]->real;
}
else
$product_stock = $product->stock_reel;
$product_type=$product->type;
if ($product_type == 0 && $product->stock_reel < $qty)
if ($product_type == 0 && $product_stock < $qty)
{
$this->error=$langs->trans('ErrorStockIsNotEnough');
$this->db->rollback();

View File

@@ -805,7 +805,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
}
}
if ($action == "addline")
if ($action == "addline" && $user->rights->expensereport->creer)
{
$error = 0;
@@ -896,7 +896,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);
@@ -939,7 +939,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);
@@ -1647,7 +1647,7 @@ else
print '<td style="text-align:right;">'.$langs->trans('AmountTTC').'</td>';
}
// Ajout des boutons de modification/suppression
if ($object->fk_statut < 2 || $object->fk_statut==99)
if (($object->fk_statut < 2 || $object->fk_statut==99) && $user->rights->expensereport->creer)
{
print '<td style="text-align:right;"></td>';
}
@@ -1690,7 +1690,7 @@ else
}
// Ajout des boutons de modification/suppression
if($object->fk_statut<2 OR $object->fk_statut==99)
if(($object->fk_statut<2 OR $object->fk_statut==99) && $user->rights->expensereport->creer)
{
print '<td style="text-align:right;" class="nowrap">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;rowid='.$objp->rowid.'#'.$objp->rowid.'">';
@@ -1770,7 +1770,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_fiche_titre($langs->trans("AddLine"),'','');

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
* Copyright (C) 2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@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
@@ -149,6 +150,7 @@ class ExpenseReport extends CommonObject
$sql.= ",paid";
$sql.= ",note_public";
$sql.= ",note_private";
$sql.= ",entity";
$sql.= ") VALUES(";
$sql.= "'(PROV)'";
$sql.= ", ".$this->total_ht;
@@ -165,6 +167,7 @@ class ExpenseReport extends CommonObject
$sql.= ", 0";
$sql.= ", ".($this->note_public?"'".$this->db->escape($this->note_public)."'":"null");
$sql.= ", ".($this->note_private?"'".$this->db->escape($this->note_private)."'":"null");
$sql.= ", ".$conf->entity;
$sql.= ")";
dol_syslog(get_class($this)."::create sql=".$sql, LOG_DEBUG);
@@ -1738,6 +1741,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();

View File

@@ -527,13 +527,14 @@ class PaymentExpenseReport extends CommonObject
{
if ($mode == 'payment_expensereport')
{
$euser = new User($this->db);
$euser->fetch($key);
$er = new ExpenseReport($this->db);
$er->fetch($key);
$er->fetch_user($er->fk_user_author);
$result=$acc->add_url_line(
$bank_line_id,
$euser->id,
$er->user->id,
DOL_URL_ROOT.'/user/card.php?id=',
$euser->getFullName($langs),
$er->user->getFullName($langs),
'user'
);
if ($result <= 0)

View File

@@ -131,11 +131,11 @@ class Export
//print_r("$perm[0]-$perm[1]-$perm[2]<br>");
if (! empty($perm[2]))
{
$bool=$user->rights->$perm[0]->$perm[1]->$perm[2];
$bool=$user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]};
}
else
{
$bool=$user->rights->$perm[0]->$perm[1];
$bool=$user->rights->{$perm[0]}->{$perm[1]};
}
if ($perm[0]=='user' && $user->admin) $bool=true;
if (! $bool) break;

View File

@@ -30,7 +30,7 @@
* \brief File that include conf.php file and commons lib like functions.lib.php
*/
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.4');
if (! defined('DOL_VERSION')) define('DOL_VERSION','3.8.5');
if (! defined('EURO')) define('EURO',chr(128));
// Define syslog constants

View File

@@ -125,9 +125,11 @@ if ($idprod > 0)
}
}
// Add price for pmp
$price=$producttmp->pmp;
$prices[] = array("id" => 'pmpprice', "price" => $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));
if(!empty($conf->stock->enabled)) {
// Add price for pmp
$price=$producttmp->pmp;
$prices[] = array("id" => 'pmpprice', "price" => $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));
}
}
echo json_encode($prices);

View File

@@ -407,6 +407,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;
@@ -417,7 +428,6 @@ if ($object->id > 0)
if ($resql)
{
$i = 0 ;
$num = $db->num_rows($resql);
if ($num > 0)
{
@@ -433,7 +443,7 @@ if ($object->id > 0)
}
$var = True;
while ($i < $num && $i <= $MAXLIST)
while ($i < $num && $i < $MAXLIST)
{
$obj = $db->fetch_object($resql);
$var=!$var;

View File

@@ -243,7 +243,8 @@ class CommandeFournisseur extends CommonOrder
$this->fetch_optionals($this->id,$extralabels);
if ($this->statut == 0) $this->brouillon = 1;
$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,";
@@ -949,6 +950,8 @@ class CommandeFournisseur extends CommonOrder
{
$result = 1;
$this->log($user, 3, $date, $comment);
$this->date_commande = $date;
$this->methode_commande = $methode;
}
else
{
@@ -1048,6 +1051,7 @@ class CommandeFournisseur extends CommonOrder
$this->lines[$i]->remise_percent,
'HT',
0,
$this->lines[$i]->product_type,
$this->lines[$i]->info_bits
);
if ($result < 0)
@@ -2318,7 +2322,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))

View File

@@ -7,7 +7,7 @@
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -646,7 +646,16 @@ class FactureFournisseur extends CommonInvoice
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
if (!$resql) {
$error++;
if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->errors[] = $langs->trans('ErrorRefAlreadyExists');
} else {
$this->errors[] = "Error ".$this->db->lasterror();
}
}
if (! $error)
{
@@ -1431,7 +1440,7 @@ class FactureFournisseur extends CommonInvoice
$response = new WorkboardResponse();
$response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24;
$response->label=$langs->trans("SupplierBillsToPay");
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0';
$response->url=DOL_URL_ROOT.'/fourn/facture/list.php?filtre=fac.fk_statut:1,paye:0&mainmenu=accountancy&leftmenu=suppliers_bills';
$response->img=img_object($langs->trans("Bills"),"bill");
while ($obj=$this->db->fetch_object($resql))
@@ -1474,7 +1483,7 @@ class FactureFournisseur extends CommonInvoice
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('TVA') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
$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);

View File

@@ -277,7 +277,7 @@ class ProductFournisseur extends Product
$error++;
}
if (! $error && !empty($cong->global->PRODUCT_PRICE_SUPPLIER_NO_LOG))
if (! $error && !empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG))
{
// Add record into log table
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_log(";
@@ -666,7 +666,7 @@ class ProductFournisseur extends Product
{
global $langs;
$langs->load("suppliers");
$out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
$out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").' &nbsp; (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1, 'supplier', $maxlen, $notooltip).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':'');
return $out;
}

View File

@@ -386,6 +386,7 @@ if ($id > 0 || ! empty($ref))
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product=p.rowid";
$sql.= " WHERE l.fk_commande = ".$commande->id;
if(empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND l.product_type = 0";
$sql.= " GROUP BY p.ref, p.label, p.tobatch, l.rowid, l.fk_product, l.subprice, l.remise_percent"; // Calculation of amount dispatched is done per fk_product so we must group by fk_product
$sql.= " ORDER BY p.ref, p.label";

View File

@@ -245,7 +245,7 @@ if (! empty($conf->fournisseur->enabled))
/*
* List of users allowed
*/
$sql = "SELECT u.rowid, u.lastname, u.firstname";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.email";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u,";
$sql.= " ".MAIN_DB_PREFIX."user_rights as ur";
$sql.= ", ".MAIN_DB_PREFIX."rights_def as rd";
@@ -278,6 +278,7 @@ if ($resql)
$userstatic->id=$obj->rowid;
$userstatic->lastname=$obj->lastname;
$userstatic->firstname=$obj->firstname;
$userstatic->email=$obj->email;
print $userstatic->getNomUrl(1);
print '</td>';
print "</tr>\n";

View File

@@ -71,6 +71,11 @@ $date_end = dol_mktime(23, 59, 59, $_REQUEST["date_endmonth"], $_REQUEST["date_e
$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_fourn');
if ($action == 'create') {
if (is_array($selected) == false) {
$mesgs = array (
@@ -160,6 +165,9 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) {
if (empty($object->date_echeance))
$object->date_echeance = $object->calculate_date_lim_reglement();
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
if ($_POST['origin'] && $_POST['originid']) {
$object->linked_objects = $orders_id;
$id = $object->create($user);
@@ -337,6 +345,12 @@ if ($action == 'create' && !$error) {
);
$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 FactureFournisseur($db);
print $object->showOptionals($extrafields,'edit');
}
// Modele PDF
print '<tr><td>' . $langs->trans('Model') . '</td>';
print '<td>';

View File

@@ -238,8 +238,11 @@ if (empty($reshook))
// Set supplier ref
if ($action == 'setref_supplier' && $user->rights->fournisseur->commande->creer)
{
$result=$object->setValueFrom('ref_supplier',GETPOST('ref_supplier','alpha'));
if ($result < 0) dol_print_error($db, $object->error);
$object->ref_supplier = GETPOST('ref_supplier', 'alpha');
if ($object->update($user) < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// conditions de reglement
@@ -2213,7 +2216,11 @@ else
// Delete
if ($action != 'edit' && $user->rights->fournisseur->facture->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
if ($object->getSommePaiement()) {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>';
} else {
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a>';
}
}
print '</div>';
print '<br>';

View File

@@ -81,6 +81,7 @@ $year = GETPOST("year","int");
$day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$filter = GETPOST("filtre");
if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
{
@@ -206,10 +207,19 @@ if ($search_amount_all_tax != '')
$sql .= natural_search('fac.total_ttc', $search_amount_all_tax, 1);
}
if ($search_status != '')
if ($search_status != '' && $search_status>=0)
{
$sql.= " AND fac.fk_statut = ".$search_status;
}
if ($filter && $filter != -1)
{
$aFilter = explode(',', $filter);
foreach ($aFilter as $fil)
{
$filt = explode(':', $fil);
$sql .= ' AND ' . trim($filt[0]) . ' = ' . trim($filt[1]);
}
}
$nbtotalofrecords = 0;
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@@ -332,7 +342,8 @@ if ($resql)
print $facturestatic->getNomUrl(1);
$filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->fournisseur->facture->dir_output.'/'.get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink('facture_fournisseur', $filename, $filedir);
$subdir = get_exdir($obj->facid,2,0,0,$facturestatic,'invoice_supplier').dol_sanitizeFileName($obj->ref);
print $formfile->getDocumentsLink('facture_fournisseur', $subdir, $filedir);
print "</td>\n";
// Ref supplier

View File

@@ -281,9 +281,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
print '<input type="hidden" name="societe" value="'.$obj->name.'">';
dol_fiche_head();
print '<table class="border" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans('Payment').'</td>';
print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">';
$supplierstatic->id=$obj->socid;
$supplierstatic->name=$obj->name;
@@ -311,6 +312,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print '</table>';
dol_fiche_end();
$parameters=array('facid'=>$facid, 'ref'=>$ref, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('paymentsupplierinvoices',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -337,7 +339,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
$i = 0;
print '<br>';
print $langs->trans('Invoices').'<br>';
if(!empty($conf->global->FAC_AUTO_FILLJS)){
//Add js for AutoFill
@@ -432,7 +433,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$preselectedchoice=$addwarning?'no':'yes';
print '<br>';
$text=$langs->trans('ConfirmSupplierPayment',$totalpayment,$langs->trans("Currency".$conf->currency));
$text=$langs->trans('ConfirmSupplierPayment', price($totalpayment),$langs->trans("Currency".$conf->currency));
if (GETPOST('closepaidinvoices'))
{
$text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");

View File

@@ -2217,7 +2217,7 @@ class soap_transport_http extends nusoap_base {
}
$this->use_curl = $use_curl;
preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
if (isset($rev[1])) $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
$this->setHeader('User-Agent', $this->title.'/'.$this->version.(isset($rev[1])?' ('.$rev[1].')':''));
}
/**

View File

@@ -437,9 +437,11 @@ foreach($valid_dashboardlines as $board)
if ($board->nbtodolate > 0) {
$totallate += $board->nbtodolate;
}
}
// Show dashboard
// Show dashboard
foreach($valid_dashboardlines as $board)
{
$var=!$var;
print '<tr '.$bc[$var].'><td width="16">'.$board->img.'</td><td>'.$board->label.'</td>';
print '<td align="right"><a href="'.$board->url.'">'.$board->nbtodo.'</a></td>';

View File

@@ -62,6 +62,21 @@ ALTER TABLE llx_societe MODIFY COLUMN fk_currency varchar(3) NULL;
ALTER TABLE llx_bookmark ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_bookmark MODIFY COLUMN url varchar(255) NOT NULL;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT '2001-01-01 00:00:00';
-- Clean corrupted values for tms
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
-- VMYSQL4.1 update llx_opensurvey_sondage set tms = date_fin where DATE(STR_TO_DATE(tms, '%Y-%m-%d')) IS NULL;
-- Remove default not null on date_fin
-- VMYSQL4.3 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN date_fin DATETIME NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_opensurvey_sondage ALTER COLUMN date_fin DROP NOT NULL;
-- VMYSQL4.1 ALTER TABLE llx_opensurvey_sondage MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN entity integer DEFAULT 1 NOT NULL;
ALTER TABLE llx_opensurvey_sondage ADD COLUMN allow_comments tinyint NOT NULL DEFAULT 1;
-- ALTER TABLE llx_opensurvey_sondage DROP COLUMN survey_link_visible;
@@ -189,9 +204,14 @@ CREATE TABLE llx_payment_salary (
fk_user_modif integer
)ENGINE=innodb;
DELETE FROM llx_product_batch where fk_product_stock NOT IN (SELECT rowid from llx_product_stock);
ALTER TABLE llx_product_batch ADD INDEX idx_fk_product_stock (fk_product_stock);
ALTER TABLE llx_product_batch ADD CONSTRAINT fk_product_batch_fk_product_stock FOREIGN KEY (fk_product_stock) REFERENCES llx_product_stock (rowid);
DELETE FROM llx_expeditiondet_batch where fk_expeditiondet NOT IN (SELECT rowid from llx_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD INDEX idx_fk_expeditiondet (fk_expeditiondet);
ALTER TABLE llx_expeditiondet_batch ADD CONSTRAINT fk_expeditiondet_batch_fk_expeditiondet FOREIGN KEY (fk_expeditiondet) REFERENCES llx_expeditiondet(rowid);

View File

@@ -1,30 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 3.9.0 or higher.
--
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
-- To change type of field: ALTER TABLE llx_table MODIFY COLUMN name varchar(60);
-- To drop a foreign key: ALTER TABLE llx_table DROP FOREIGN KEY fk_name;
-- To restrict request to Mysql version x.y use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y use -- VPGSQLx.y
-- To make pk to be auto increment (mysql): VMYSQL4.3 ALTER TABLE llx_c_shipment_mode CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
-- To make pk to be auto increment (postgres): VPGSQL8.2 NOT POSSIBLE. MUST DELETE/CREATE TABLE
-- To set a field as NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name DROP NOT NULL;
-- To set a field as default NULL: VPGSQL8.2 ALTER TABLE llx_table ALTER COLUMN name SET DEFAULT NULL;
-- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user);
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
-- Fix bad data
update llx_opensurvey_sondage set format = 'D' where format = 'D+';
update llx_opensurvey_sondage set format = 'A' where format = 'A+';
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_EXPENSEREPORTS_TO_PAY','31','chaine','Tolérance de retard avant alerte (en jours) sur les notes de frais impayées',0);
ALTER TABLE llx_accounting_system MODIFY COLUMN pcg_version varchar(32);
ALTER TABLE llx_accountingaccount MODIFY COLUMN fk_pcg_version varchar(32);

View File

@@ -54,7 +54,33 @@ delete from llx_adherent_extrafields where fk_object not in (select rowid from l
delete from llx_product_extrafields where fk_object not in (select rowid from llx_product);
--delete from llx_societe_commerciaux where fk_soc not in (select rowid from llx_societe);
-- Clean stocks
-- Reference for qty is llx_product_stock (detail in llx_product_batch may be not complete)
-- qty in llx_product may be not up to date
update llx_product_batch set batch = '' where batch = 'Non d&eacute;fini';
update llx_product_batch set batch = '' where batch = 'Non défini';
DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM llx_product_batch as pb);
-- Merge splitted lines into one in table llx_product_batch
DROP TABLE tmp_llx_product_batch;
DROP TABLE tmp_llx_product_batch2;
CREATE TABLE tmp_llx_product_batch AS select fk_product_stock, eatby, sellby, batch, SUM(qty) as qty, COUNT(rowid) as nb FROM llx_product_batch GROUP BY fk_product_stock, eatby, sellby, batch HAVING COUNT(rowid) > 1;
CREATE TABLE tmp_llx_product_batch2 AS select pb.rowid, pb.fk_product_stock, pb.eatby, pb.sellby, pb.batch, pb.qty from llx_product_batch as pb, tmp_llx_product_batch as tpb where pb.fk_product_stock = tpb.fk_product_stock and COALESCE(pb.eatby, '') = COALESCE(tpb.eatby,'') and COALESCE(pb.sellby, '') = COALESCE(tpb.sellby, '') and pb.batch = tpb.batch
--select * from tmp_llx_product_batch;
--select * from tmp_llx_product_batch2;
DELETE FROM llx_product_batch WHERE rowid IN (select rowid FROM tmp_llx_product_batch2);
INSERT INTO llx_product_batch(fk_product_stock, eatby, sellby, batch, qty) SELECT fk_product_stock, eatby, sellby, batch, qty FROM tmp_llx_product_batch;
DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product_stock FROM llx_product_batch as pb);
DELETE FROM llx_product_batch WHERE qty = 0;
-- Stock calculation on product
UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid);
-- Fix: delete category child with no category parent.
drop table tmp_categorie;
@@ -109,9 +135,6 @@ insert into llx_c_actioncomm (id, code, type, libelle, module, position) values
insert into llx_c_actioncomm (id, code, type, libelle, module, position) values ( 50, 'AC_OTH', 'system', 'Other' ,NULL, 5);
-- Stock calculation on product
UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps WHERE ps.fk_product = p.rowid);
-- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid;
-- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note);

View File

@@ -31,7 +31,7 @@ create table llx_product
datec datetime,
tms timestamp,
virtual tinyint DEFAULT 0 NOT NULL, -- Not used. Used by external modules. Value 0 for physical product, 1 for virtual product
`virtual` tinyint DEFAULT 0 NOT NULL, -- Not used. Used by external modules. Value 0 for physical product, 1 for virtual product
fk_parent integer DEFAULT 0, -- Not used. Used by external modules. Virtual product id
label varchar(255) NOT NULL,

View File

@@ -63,7 +63,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent FOR EACH RO
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_advtargetemailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_askpricesupplier FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_askpricesupplier_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_askpricesupplierdet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -96,7 +95,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cronjob FOR EACH ROW
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_documents FOR EACH ROW EXECUTE PROCEDURE update_modified_column_date_u();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_date_m();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -128,7 +127,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_donation FOR
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_expensereport FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_printer_ipp FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_printing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_batch FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
@@ -155,8 +153,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_rib FOR EACH
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_stock_mouvement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_time_basket FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_timebasket_counter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@@ -1690,3 +1690,4 @@ MailToSendSupplierRequestForQuotation=To send quotation request to supplier
MailToSendSupplierOrder=To send supplier order
MailToSendSupplierInvoice=To send supplier invoice
MailToThirdparty=To send email from thirdparty page
activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is missing, so module "%1$s" may not work correclty. Please install module "%2$s" or disable module "%1$s" if you want to be safe from any surprise

View File

@@ -149,6 +149,7 @@ Save=Save
SaveAs=Save As
TestConnection=Test connection
ToClone=Clone
ConfirmCloneAction=Are you sure you want to clone this event ?
ConfirmClone=Choose data you want to clone :
NoCloneOptionsSpecified=No data to clone defined.
Of=of
@@ -575,6 +576,7 @@ MailSentBy=Email sent by
TextUsedInTheMessageBody=Email body
SendAcknowledgementByMail=Send Ack. by email
NoEMail=No email
Email=Email
NoMobilePhone=No mobile phone
Owner=Owner
DetectedVersion=Detected version

View File

@@ -109,7 +109,7 @@ function getMarginInfos($pvht, $remise_percent, $tva_tx, $localtax1_tx, $localta
$marge_tx_ret='';
$marque_tx_ret='';
if ($fk_pa > 0) {
if ($fk_pa > 0 && empty($paht)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$product = new ProductFournisseur($db);
if ($product->fetch_product_fournisseur_price($fk_pa))

View File

@@ -152,7 +152,7 @@ if ($socid > 0)
$sql.= ", ".MAIN_DB_PREFIX."facturedet as d";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " AND f.fk_statut > 0";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " AND f.entity = ".$conf->entity;
$sql.= " AND d.fk_facture = f.rowid";
$sql.= " AND f.fk_soc = $socid";
$sql.= " AND d.buy_price_ht IS NOT NULL";

View File

@@ -227,7 +227,7 @@ if (! isset($_SESSION['mois'])) $_SESSION['mois']= date('n');
if (! isset($_SESSION['annee'])) $_SESSION['annee']= date('Y');
//mise a jour des valeurs de session si bouton retour a aujourd'hui
if ((!issetAndNoEmpty('choixjourajout')) && !issetAndNoEmpty('choixjourretrait') || issetAndNoEmpty('retourmois')){
if (!issetAndNoEmpty('choixjourajout') && !issetAndNoEmpty('choixjourretrait') && (issetAndNoEmpty('retourmois') || issetAndNoEmpty('retourmois_x'))) {
$_SESSION["jour"]=date("j");
$_SESSION["mois"]=date("n");
$_SESSION["annee"]=date("Y");

View File

@@ -7,6 +7,7 @@
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.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
@@ -108,7 +109,7 @@ if ($action == 'setModuleOptions')
}
}
if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') > 0)
if ($action == 'other' && GETPOST('value_PRODUIT_LIMIT_SIZE') >= 0)
{
$res = dolibarr_set_const($db, "PRODUIT_LIMIT_SIZE", GETPOST('value_PRODUIT_LIMIT_SIZE'),'chaine',0,'',$conf->entity);
}

View File

@@ -48,6 +48,7 @@ $price_level = GETPOST('price_level', 'int');
$action = GETPOST('action', 'alpha');
$id = GETPOST('id', 'int');
$price_by_qty_rowid = GETPOST('pbq', 'int');
$finished = GETPOST('finished', 'int');
/*
* View
@@ -180,9 +181,9 @@ if (! empty($action) && $action == 'fetch' && ! empty($id))
$form = new Form($db);
if (empty($mode) || $mode == 1) {
$arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, 2, $outjson, $socid);
$arrayresult = $form->select_produits_list("", $htmlname, $type, "", $price_level, $searchkey, $status, $finished, $outjson, $socid);
} elseif ($mode == 2) {
$arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson, $socid);
$arrayresult = $form->select_produits_fournisseurs_list($socid, "", $htmlname, $type, "", $searchkey, $status, $outjson);
}
$db->close();

View File

@@ -876,10 +876,26 @@ class Product extends CommonObject
// End call triggers
}
// Delete all child tables
// Delete from product_batch on product delete
if (! $error)
{
$elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price');
$sql = "DELETE FROM ".MAIN_DB_PREFIX.'product_batch';
$sql.= " WHERE fk_product_stock IN (";
$sql.= "SELECT rowid FROM ".MAIN_DB_PREFIX.'product_stock';
$sql.= " WHERE fk_product = ".$id.")";
dol_syslog(get_class($this).'::delete', LOG_DEBUG);
$result = $this->db->query($sql);
if (! $result)
{
$error++;
$this->errors[] = $this->db->lasterror();
}
}
// Delete all child tables
if (! $error)
{
$elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price'); // product_batch done before
foreach($elements as $table)
{
if (! $error)
@@ -2506,7 +2522,7 @@ class Product extends CommonObject
$sql = "SELECT rowid, fk_product";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " WHERE fk_soc = ".$id_fourn;
$sql.= " AND ref_fourn = '".$ref_fourn."'";
$sql.= " AND ref_fourn = '".$this->db->escape($ref_fourn)."'";
$sql.= " AND fk_product != ".$this->id;
$sql.= " AND entity = ".$conf->entity;
@@ -2528,7 +2544,7 @@ class Product extends CommonObject
$sql = "SELECT rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " WHERE fk_soc = ".$id_fourn;
if ($ref_fourn) $sql.= " AND ref_fourn = '".$ref_fourn."'";
if ($ref_fourn) $sql.= " AND ref_fourn = '".$this->db->escape($ref_fourn)."'";
else $sql.= " AND (ref_fourn = '' OR ref_fourn IS NULL)";
$sql.= " AND quantity = '".$quantity."'";
$sql.= " AND fk_product = ".$this->id;
@@ -2557,7 +2573,7 @@ class Product extends CommonObject
$sql.= ", ".$conf->entity;
$sql.= ", ".$this->id;
$sql.= ", ".$id_fourn;
$sql.= ", '".$ref_fourn."'";
$sql.= ", '".$this->db->escape($ref_fourn)."'";
$sql.= ", ".$quantity;
$sql.= ", ".$user->id;
$sql.= ", 0";

View File

@@ -359,7 +359,7 @@ if ($id > 0 || ! empty($ref))
}
print '</td>';
$totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT');
$totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT');
$total+=$totalline;
print '<td align="right">';
print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency));

View File

@@ -247,7 +247,8 @@ if ($object->id)
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs
{
$filearray = dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1);
$filearray = array_merge($filearray,dol_dir_list($upload_dirold, "files", 0, '', '\.meta$', 'name', SORT_ASC, 1));
}
// For each file build select list with PDF extention

View File

@@ -372,14 +372,13 @@ function activitytrim($product_type)
// breakdown by quarter
$sql = "SELECT DATE_FORMAT(p.datep,'%Y') as annee, DATE_FORMAT(p.datep,'%m') as mois, SUM(fd.total_ht) as Mnttot";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " , ".MAIN_DB_PREFIX."paiement as p,".MAIN_DB_PREFIX."paiement_facture as pf";
$sql.= " WHERE f.fk_soc = s.rowid";
$sql.= " WHERE f.entity = " . $conf->entity;
$sql.= " AND f.rowid = fd.fk_facture";
$sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND pf.fk_paiement= p.rowid";
$sql.= " AND fd.product_type=".$product_type;
$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
$sql.= " AND p.datep >= '".$db->idate(dol_get_first_day($yearofbegindate),1)."'";
$sql.= " GROUP BY annee, mois ";
$sql.= " ORDER BY annee, mois ";

View File

@@ -109,8 +109,12 @@ if ($action == "correct_stock")
if ($product->hasbatch())
{
$batch=GETPOST('batch_number');
$eatby=GETPOST('eatby');
$sellby=GETPOST('sellby');
//$eatby=GETPOST('eatby');
//$sellby=GETPOST('sellby');
$eatby=dol_mktime(12, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
$sellby=dol_mktime(12, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
$result=$product->correct_stock_batch(
$user,
$id,

View File

@@ -61,13 +61,13 @@ $langs->load("productbatch");
{
print '<td width="20%" class="fieldrequired" colspan="2">'.$langs->trans("Product").'</td>';
print '<td width="20%">';
print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''));
print $form->select_produits(GETPOST('product_id'),'product_id',(empty($conf->global->STOCK_SUPPORTS_SERVICES)?'0':''),20,0,-1);
print '</td>';
}
print '<td width="20%">';
print '<select name="mouvement" id="mouvement" class="flat">';
print '<option value="0">'.$langs->trans("Add").'</option>';
print '<option value="1">'.$langs->trans("Delete").'</option>';
print '<option value="1"'.(GETPOST('mouvement')?' selected="selected"':'').'>'.$langs->trans("Delete").'</option>';
print '</select></td>';
print '<td width="20%" class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input class="flat" name="nbpiece" id="nbpiece" size="10" value="'.GETPOST("nbpiece").'"></td>';
print '</tr>';

Some files were not shown because too many files have changed in this diff Show More