2
0
forked from Wavyzz/dolibarr

Compare commits

..

887 Commits
7.0.2 ... 7.0

Author SHA1 Message Date
Laurent Destailleur
af6e95aa79 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-03-10 15:49:51 +01:00
Laurent Destailleur
5d942c9d1a Fix infinit logs 2022-03-10 15:46:00 +01:00
Laurent Destailleur
10e32c056e FIX avoid infinite loop on dump with popen 2022-01-07 15:35:33 +01:00
Laurent Destailleur
eb7dd74026 Revert error 2020-06-04 16:05:40 +02:00
Laurent Destailleur
88f6c71e88 Add tuto for live streaming 2020-06-04 16:05:04 +02:00
Laurent Destailleur
b081cf5cba Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/product/class/product.class.php
2020-03-30 19:48:41 +02:00
Laurent Destailleur
3ea9c297ea Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2020-03-30 19:46:23 +02:00
Laurent Destailleur
474260e526 Merge pull request #13447 from c3do/patch-1
Fix can set desiredstock to (int) 0 from API Rest
2020-03-30 19:46:02 +02:00
Cédric
eead9a93d3 Fix can set desiredstock to (int) 0 from API Rest
When you set desiredstock to 0 as an integer from the API, it registers to null in the database. Using is_numeric() fixes this.
2020-03-30 13:03:13 +02:00
Laurent Destailleur
4bdf10c995 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2020-03-11 16:44:03 +01:00
Laurent Destailleur
7f759c6ff5 Merge pull request #13322 from atm-lena/6.0_FIX_FournCommandClone_ExtrafieldsLines
FIX - Clone Fourn Command, add line's extrafields
2020-03-11 16:36:27 +01:00
atm-lena
20aa51f26b FIX - Clone Fourn Command, add line's extrafields Part 2 2020-03-11 15:26:49 +01:00
atm-lena
35f32391a0 FIX - Clone Fourn Command, add line's extrafields 2020-03-10 14:46:15 +01:00
Laurent Destailleur
ec6e933f66 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2020-01-10 19:47:00 +01:00
Laurent Destailleur
e0c8ccb9fb Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2020-01-10 19:45:35 +01:00
Laurent Destailleur
ef00cb0736 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
2020-01-10 19:44:52 +01:00
Laurent Destailleur
d7f7f5bf3d Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2020-01-10 19:42:34 +01:00
Laurent Destailleur
7c0a6946a7 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.9 2020-01-10 19:42:15 +01:00
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
5dbf060f00 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/functions.lib.php
2019-12-09 13:24:01 +01:00
Laurent Destailleur
53149bb7cd Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2019-12-08 04:22:50 +01:00
Laurent Destailleur
394104291a Fix function not found when creating a payment of an expense report 2019-12-08 04:22:09 +01:00
Laurent Destailleur
b847eb1b7e Merge pull request #12056 from atm-florianm/FIX_7.0_email_addresses_in_email_sending_error_message
FIX 7.0: addresses not displayed in e-mail sending error messages
2019-10-07 20:25:01 +02:00
Florian Mortgat
2aee62ea28 FIX: $from and $sendto variables are unescaped in the sending error message
This causes addresses like Tom <tom@examp.le> not to be shown in the message.
2019-10-07 17:32:52 +02:00
Laurent Destailleur
7aac67f79c Merge pull request #11884 from frederic34/patch-10
fix colspan in show_project
2019-09-14 16:33:02 +02:00
Laurent Destailleur
935e84d985 Merge pull request #11885 from frederic34/patch-12
Create .stickler.yml
2019-09-14 16:32:25 +02:00
Laurent Destailleur
fbb8808f29 Merge pull request #11887 from frederic34/patch-14
Update index.php
2019-09-14 16:32:11 +02:00
Frédéric FRANCE
00394493eb Update index.php 2019-09-12 22:02:39 +02:00
Frédéric FRANCE
6db7414f88 Create .stickler.yml 2019-09-12 21:45:04 +02:00
Frédéric FRANCE
0d3a2f800b fix colspan in show_project 2019-09-12 21:39:57 +02:00
Laurent Destailleur
bdd57ecce7 Merge pull request #11727 from hregis/7.0_price
FIX avoid sql error if fk_project is empty during update
2019-08-26 16:38:57 +02:00
Regis Houssin
2d59f6bb3d FIX avoid sql error if fk_project is empty during update 2019-08-23 07:59:36 +02:00
Laurent Destailleur
e8932335aa Merge pull request #11544 from atm-josselin/FIX_upload_file_with_multiple_spaces
FIX : correct error in files with multiple spaces
2019-07-25 17:48:26 +02:00
atm-josselin
0a1f4b7931 FIX : correct error in files with multiple spaces 2019-07-23 09:45:17 +02:00
Laurent Destailleur
4c4a0b796e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-07-22 18:50:59 +02:00
Laurent Destailleur
891eaf50e1 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-07-22 18:50:49 +02:00
Laurent Destailleur
45ea80a336 Merge pull request #11530 from atm-florianm/FIX_if_MAIN_USE_COMPANY_NAME_OF_CONTACT_set_socobject_is_a_contact
FIX: extrafield loading bug due to assumption that an object is a thi…
2019-07-22 18:43:51 +02:00
Laurent Destailleur
a872b7d42f Merge pull request #11532 from atm-gauthier/6.0_fix_phone_search
FIX : search by phone pro
2019-07-22 18:30:07 +02:00
gauthier
cd7d3f1a36 FIX : search by phone pro 2019-07-19 15:41:44 +02:00
Florian Mortgat
b100cdb9db FIX: extrafield loading bug due to assumption that an object is a third party while it may be a contact if MAIN_USE_COMPANY_NAME_OF_CONTACT is set. 2019-07-19 11:58:21 +02:00
Laurent Destailleur
2035cbaee1 Merge pull request #11440 from atm-maxime/7.0
Fix wrong column for filters on invoice template list
2019-07-04 10:46:49 +02:00
Maxime Kohlhaas
6b43c325c7 Fix wrong column for filters on invoice template list 2019-07-02 10:53:47 +02:00
Laurent Destailleur
58a7640dc3 Merge pull request #11417 from atm-maxime/7.0
Fix invoice list filter on withdrawal card
2019-06-28 12:41:13 +02:00
Maxime Kohlhaas
fc1d4704a5 Fix invoice list filter on withdrawal card 2019-06-27 17:33:47 +02:00
Laurent Destailleur
e1ee079254 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-06-25 23:20:07 +02:00
Laurent Destailleur
c5572e0176 Add info on signature generator 2019-06-25 23:19:00 +02:00
Laurent Destailleur
162498d2f8 Add info on signature generator 2019-06-25 23:18:20 +02:00
Laurent Destailleur
de3ec5682c Merge pull request #11403 from fmarcet/7.0
FIX: Not showing Contract and Project columns on ficheinter list
2019-06-25 13:07:03 +02:00
Ferran Marcet
7f127989b2 FIX: Not showing Contract and Project columns on ficheinter list 2019-06-25 09:55:34 +02:00
Laurent Destailleur
04606ec6a3 Merge pull request #11384 from ATM-Consulting/7.0_fix_mass_send_mail
FIX mass send mail
2019-06-24 15:34:06 +02:00
John Botella
ec7ebe9f39 redo backported fix and update adherent substitution methode 2019-06-21 15:32:38 +02:00
John Botella
200b66d11f Remove a backported fix because failling at init test 2019-06-21 14:52:12 +02:00
Laurent Destailleur
9093be2f0a FIX Add missing end date of subscription in export 2019-06-21 11:23:49 +02:00
John Botella
b21006614c Fix substitutions null 2019-06-20 12:00:44 +02:00
John Botella
6a68c8cd99 Fix display option email per participient 2019-06-20 11:09:37 +02:00
John Botella
9305403bea Fix duplicate pdf in mass sendmail 2019-06-20 10:32:32 +02:00
John Botella
252bd6d9ba FIX condition 2019-06-20 09:48:08 +02:00
John Botella
7c29fb614c Fix replacement and vars names 2019-06-20 09:21:35 +02:00
Laurent Destailleur
5bac3d4d2b Merge pull request #11332 from atm-gauthier/7.0_fix_syntax_error
FIX : syntax error
2019-06-14 13:35:40 +02:00
Laurent Destailleur
319bc7ec8a Fix syntax error 2019-06-13 12:12:20 +02:00
gauthier
28218a00b3 FIX : syntax error 2019-06-13 11:01:12 +02:00
Laurent Destailleur
1318e26cda Merge pull request #11298 from hregis/7.0_price
FIX missing compatibility with multicompany transverse mode
2019-06-13 10:01:05 +02:00
Laurent Destailleur
4cbfb67d63 Update html.formother.class.php 2019-06-13 09:59:10 +02:00
Laurent Destailleur
420f3bbdab FIX #11316 2019-06-12 10:05:53 +02:00
Regis Houssin
5726b40a10 FIX try to use WHERE EXISTS instead DISTINCT 2019-06-03 17:26:03 +02:00
Regis Houssin
7fd1051efc FIX missing compatibility with multicompany transverse mode
Conflicts:
	htdocs/core/class/html.formother.class.php
2019-06-03 17:22:15 +02:00
Laurent Destailleur
b40041146b Merge pull request #11276 from atm-maxime/fix_db_table_prefix
Fix : remove hardcoded llx_ prefix
2019-06-02 12:13:33 +02:00
Maxime Kohlhaas
15fd24a511 Fix : remove hardcoded llx_ prefix 2019-05-31 12:14:51 +02:00
Laurent Destailleur
e11bd8c70d Merge pull request #11257 from atm-ph/fix_7.0_create_bills_multicurrency
Fix create bills on mass action does not retrieve the original currency
2019-05-29 13:51:57 +02:00
atm-ph
c79b9b9704 Fix create bills on mass action does not retrieve the original currency code 2019-05-27 11:18:29 +02:00
Laurent Destailleur
234ad4c76a Merge pull request #11214 from atm-maxime/7.0
Fix #8344
2019-05-19 01:53:13 +02:00
Maxime Kohlhaas
1d980342ec Fix #8344 2019-05-19 00:05:23 +02:00
Laurent Destailleur
ba88d89ff5 Merge pull request #11195 from ATM-Marc/FIX_7.0_presend_file_overwrite
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
2019-05-18 00:52:29 +02:00
ATM-Marc
b85ed3e0b7 FIX: mail presend: can overwrite a file previously uploaded 2019-05-18 00:11:15 +02:00
Juanjo Menent
3a99ef7319 Fix: missing GETPOST params 2019-05-11 17:04:05 +02:00
Juanjo Menent
3ae2d71ea6 Fix: missing GETPOST params 2019-05-11 17:00:55 +02:00
Juanjo Menent
91ae365588 Fix: missing GETPOST params 2019-05-11 16:58:00 +02:00
Juanjo Menent
6206519456 Fix: missing GETPOST params 2019-05-11 16:54:56 +02:00
Juanjo Menent
2e6cb2afaa Fix: missing GETPOST params 2019-05-11 16:53:16 +02:00
Juanjo Menent
dc9f8a349f Fix: missing GETPOST params 2019-05-11 16:50:31 +02:00
Juanjo Menent
80ef97e215 FIX: #11025 2019-05-11 16:41:01 +02:00
Juanjo Menent
759427f6ac FIX: #11025 2019-05-11 16:36:35 +02:00
Juanjo Menent
81bf7d07e3 Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-05-11 16:32:02 +02:00
Juanjo Menent
72dd3705ed Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-05-10 09:13:33 +02:00
Laurent Destailleur
50b1a54dca FIX Update/delete currency on same languages 2019-05-01 14:06:30 +02:00
Laurent Destailleur
0532598ecf Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-27 13:28:05 +02:00
Laurent Destailleur
410a3801da Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-27 13:27:52 +02:00
Laurent Destailleur
5259547b96 Merge pull request #11069 from atm-gauthier/6.0_fix_select_prev_situ
Fix prev situation invoice selection (backport fix 8.0)
2019-04-25 18:59:48 +02:00
gauthier
31897f54ac Fix prev situation invoice selection (backport fix 8.0) 2019-04-25 12:37:05 +02:00
Laurent Destailleur
b62323939e Merge pull request #11064 from atm-greg/FIX_create_supplier_invoice_button
FIX test to display create invoice button on supplier_order card
2019-04-24 21:07:15 +02:00
atm-greg
70017da95a testing if customer invoice module is activated doesn't make sense on supplier commande card... 2019-04-24 14:59:54 +02:00
Laurent Destailleur
11d737f23a Merge pull request #11029 from ATM-Marc/FIX_7.0_sort_events
FIX: actioncomm: sort events by date after external calendars and hook (into 7.0)
2019-04-19 13:06:09 +02:00
Laurent Destailleur
91af1f8702 Merge pull request #11011 from ATM-Nicolas/fix_search_contact_list
FIX : Wrong variable name
2019-04-16 23:43:58 +02:00
Laurent Destailleur
c0defe3965 Update index.php 2019-04-16 23:27:45 +02:00
Marc de Lima Lucio
1669d497b4 FIX: actioncomm: sort events by date after external calendars and hook 2019-04-16 17:36:27 +02:00
ATM-Nicolas
d4a7c0abc6 FIX : Wrong variable name 2019-04-15 10:05:46 +02:00
Juanjo Menent
1b5cabad71 Fix: #10956 2019-04-12 18:50:48 +02:00
Laurent Destailleur
125796b0f5 Merge pull request #10967 from atm-ph/fix_7.0_timesheet_init_hook
Fix no init hook on timesheet
2019-04-08 13:49:21 +02:00
Laurent Destailleur
c1f0826005 Update perweek.php 2019-04-08 13:49:16 +02:00
Laurent Destailleur
153e563c9f Update perday.php 2019-04-08 13:49:05 +02:00
atm-ph
ea87b2ddb6 Fix no init hook on timesheet 2019-04-05 11:26:11 +02:00
Laurent Destailleur
26fbd6e2ec Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-02 19:34:16 +02:00
Laurent Destailleur
cb1489e2fa Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-02 19:34:10 +02:00
Laurent Destailleur
2f51221660 Merge pull request #10933 from atm-greg/Add_final_hooks_on_replenish
Add all missing hooks on replenish
2019-03-31 18:50:34 +02:00
Laurent Destailleur
f671b8bce7 Merge pull request #10945 from aspangaro/7_p1
FIX: Don't show accountingjournal:getNomUrl without data
2019-03-31 18:49:50 +02:00
Laurent Destailleur
143cbba09b Update card.php 2019-03-31 18:49:38 +02:00
Laurent Destailleur
5dfc1c0897 Merge pull request #10921 from atm-greg/Fix_hook_in_margins_heads
FIX missing hook completeTabsHead in margins module
2019-03-31 18:21:48 +02:00
Alexandre SPANGARO
5588fe5b81 FIX: Don't show journal:getNomUrl without data
ErrorBadValueForParamNotAString
2019-03-30 09:42:13 +01:00
atm-greg
957fae1081 missing params 2019-03-28 11:07:27 +01:00
atm-greg
11343e986c add all missing hooks on replenish 2019-03-28 10:47:32 +01:00
atm-greg
83d7750274 FIX missing hook completeTabsHead in margins module 2019-03-27 09:33:51 +01:00
Laurent Destailleur
f7f20df323 Merge pull request #10891 from atm-greg/Add_hook_on_replenish
Add hook on replenish
2019-03-21 18:23:06 +01:00
Laurent Destailleur
89087c6847 Merge pull request #10800 from atm-quentin/FIX_wrong_vat_deposit_invoice
Wrong vat if deposit from propal with multiple vat
2019-03-18 11:14:11 +01:00
Laurent Destailleur
ae35c982af Merge pull request #9652 from atm-gauthier/7.0_fix_round_debitcredit
FIX : need to round with 2 decimals to avoid movements not correctly balanced
2019-03-16 14:27:03 +01:00
Laurent Destailleur
4bb45ad1c1 Merge pull request #10824 from atm-gauthier/7.0_fix_nocreateline_deposit_if_amount_zero
FIX : when we create deposit with multi tva, we mustn't add line if a…
2019-03-15 19:16:56 +01:00
Laurent Destailleur
b33c366b02 Update card.php 2019-03-15 19:16:49 +01:00
Laurent Destailleur
482a37a2c9 Merge pull request #10850 from atm-ph/fix_7.0_var_name
Fix var name
2019-03-15 19:12:55 +01:00
atm-ph
2da60fb885 Fix var name 2019-03-15 15:15:03 +01:00
Laurent Destailleur
6c2cad3d48 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/security.lib.php
2019-03-15 11:00:00 +01:00
Laurent Destailleur
8711e51bce Merge pull request #10841 from atm-gauthier/6.0_notest_tab_documents_on_expensereport
FIX : no need to test anything to display documents tabs on expense report
2019-03-15 10:56:53 +01:00
gauthier
8375b47e74 FIX : in fact expensereport must be in $check array 2019-03-15 10:21:50 +01:00
Laurent Destailleur
5ec8adb7f5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-03-14 18:48:35 +01:00
gauthier
3fb6978bc8 FIX : no need to test anything to display documents tabs on expense report 2019-03-14 17:36:49 +01:00
Laurent Destailleur
eab1e13343 Merge pull request #10839 from atm-gauthier/6.0_fix_useless_join
FIX : useless join
2019-03-14 17:12:38 +01:00
gauthier
885797b748 FIX : useless join 2019-03-14 17:00:51 +01:00
gauthier
a524bbc5c6 FIX : when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line) 2019-03-13 15:59:41 +01:00
atm-quentin
ab781c32c7 Wrong vat if deposit from propal with multiple vat 2019-03-11 11:28:25 +01:00
Laurent Destailleur
520387c03d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/holiday/card.php
2019-03-09 00:01:29 +01:00
Laurent Destailleur
233bd4374a Fix phpcs 2019-03-08 19:52:26 +01:00
Laurent Destailleur
2ae3d75df4 Merge pull request #10752 from atm-gauthier/7.0_fix_fourninvoice_specialcode
FIX : we need to keep originline special_code
2019-03-07 12:29:00 +01:00
Laurent Destailleur
e3fb228a4d Update fournisseur.facture.class.php 2019-03-07 12:28:19 +01:00
gauthier
0ff2905180 FIX : we need to keep originline special_code 2019-03-06 12:10:24 +01:00
Laurent Destailleur
22bb62d900 Merge pull request #10737 from atm-gauthier/6.0_fix_wrong_redirect_link
FIX : wrong redirect link on holiday refuse
2019-03-05 18:43:57 +01:00
Laurent Destailleur
3db8218cba Merge pull request #10745 from frederic34/patch-6
add session newtoken
2019-03-05 18:41:50 +01:00
Frédéric FRANCE
1bbf6737ec add session newtoken 2019-03-05 15:27:31 +01:00
gauthier
dada8c8ff5 FIX : wrong redirect link on holiday refuse 2019-03-04 17:23:29 +01:00
Laurent Destailleur
76dd9e42d2 Merge pull request #10726 from frederic34/patch-3
Update DolibarrModules.class.php
2019-03-04 16:05:06 +01:00
Frédéric FRANCE
3037e4a157 Update DolibarrModules.class.php 2019-03-02 20:49:53 +01:00
Laurent Destailleur
a2eefab696 Merge pull request #10714 from ATM-Marc/FIX_7.0_export_actioncomm
FIX: actioncomm export: ORDER BY clause / event type filter
2019-03-02 18:44:34 +01:00
Marc de Lima Lucio
b96ac794e9 FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work 2019-02-28 16:15:32 +01:00
Laurent Destailleur
c1fa48889e Merge pull request #10677 from frederic34/patch-6
fix #10385
2019-02-24 20:46:04 +01:00
Frédéric FRANCE
2ad91213b2 Update combinations.php 2019-02-24 12:09:57 +01:00
Laurent Destailleur
f2a73eecf2 Merge pull request #10645 from atm-gauthier/7.0_fix_feature_not_finished
FIX : function sendEmailsReminder isn't completely developed, then MA…
2019-02-23 15:01:44 +01:00
gauthier
58d82eb477 FIX : function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it 2019-02-21 11:08:55 +01:00
Laurent Destailleur
04b0216277 Merge pull request #10548 from aspangaro/7.0_accountancy_multicomp_movement
FIX: Accountancy - Add transaction with multicompany use only the first entity
2019-02-12 13:19:00 +01:00
Alexandre SPANGARO
2dc4edb68c FIX: Accountancy - Add transaction with multicompany use all the time 1st entity 2019-02-11 11:36:12 +01:00
gauthier
2142ccee8a FIX : better method 2019-02-08 15:17:40 +01:00
Laurent Destailleur
4997b5968f Merge pull request #10506 from ATM-Marc/FIX_7.0_parent_line
FIX: line edit template: keep fk_parent_line
2019-02-08 09:52:21 +01:00
Laurent Destailleur
76b021d061 Merge pull request #10505 from ATM-Marc/FIX_7.0_expedition_status
FIX: expedition: reset status on rollback
2019-02-08 09:46:14 +01:00
Marc de Lima Lucio
428efa9227 FIX: line edit template: keep fk_parent_line 2019-02-05 12:02:49 +01:00
Marc de Lima Lucio
64739098ae FIX: expedition: reset status on rollback + replace hardcoded status with const 2019-02-05 11:58:49 +01:00
Laurent Destailleur
dbf7ae4c25 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-02-01 15:56:58 +01:00
Laurent Destailleur
452dfafd32 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-02-01 15:56:47 +01:00
Laurent Destailleur
bff2f33022 Merge pull request #10404 from atm-john/6.0_fix_supplier_order_line_fetch
Fix fetch test
2019-02-01 15:56:26 +01:00
Laurent Destailleur
f00271fee6 Merge pull request #10467 from atm-gauthier/7.0_fix_nextnumref
FIX : need an order by in case we found other invoice with same number but not same date
2019-02-01 15:38:16 +01:00
Laurent Destailleur
a08a0b4c1d Merge pull request #10469 from atm-gauthier/7.0_fix_wrong_test_enabled
FIX : wrong test enabled
2019-02-01 15:34:55 +01:00
gauthier
caa937660d FIX : wrong test enabled 2019-01-31 12:43:39 +01:00
gauthier
09ba059c21 FIX : need an order by in case we found other invoice with same number but not same date 2019-01-31 11:03:06 +01:00
Laurent Destailleur
484b4371c1 FIX XSS
Conflicts:
	htdocs/viewimage.php
2019-01-31 10:19:23 +01:00
Laurent Destailleur
231395dab8 Merge pull request #10398 from atm-john/fix_trigger
Fix missing trigger
2019-01-30 18:53:10 +01:00
Laurent Destailleur
104364ed02 Merge pull request #10459 from atm-gauthier/7.0_FIX_cmd_fourn_enabled
FIX : $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
2019-01-30 15:51:09 +01:00
Laurent Destailleur
8d9b92698d Merge pull request #10443 from EuskalMoneta/7.0
FIX Fix PHP warning "count(): Parameter must be an array..."
2019-01-30 15:48:31 +01:00
gauthier
9490929216 FIX : $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled 2019-01-30 10:49:32 +01:00
Xebax
b24f5fda68 FIX Fix PHP warning "count(): Parameter must be an array..." 2019-01-29 08:47:46 +01:00
Laurent Destailleur
9d1a02b0d7 Fix language 2019-01-28 16:25:37 +01:00
John BOTELLA
6f12cdf236 Fix travis 2019-01-28 11:58:16 +01:00
John BOTELLA
5dbc9ddae0 fix travis 2019-01-28 11:56:20 +01:00
John BOTELLA
9a666b265f Use an other test 2019-01-28 11:53:19 +01:00
Laurent Destailleur
3e78807cbc Merge pull request #10424 from EuskalMoneta/7.0
FIX 'statut' is ignored when updating a user with the REST API.
2019-01-27 17:56:14 +01:00
Xebax
94d3f038eb FIX 'statut' is ignored when updating a user with the REST API. 2019-01-27 13:20:33 +01:00
John BOTELLA
15e1d3b456 Fix fetch test 2019-01-24 09:40:58 +01:00
John BOTELLA
624d17c96a Fix missing no trigger arg 2019-01-23 17:32:49 +01:00
John BOTELLA
1c51716997 Fix missing trigger 2019-01-23 17:02:20 +01:00
Laurent Destailleur
b868397902 Fix colspan 2019-01-21 02:27:13 +01:00
Laurent Destailleur
1ac55b0800 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/html.formfile.class.php
	htdocs/core/lib/security2.lib.php
2019-01-19 13:19:58 +01:00
wdammak
aaa61254ac Update stats.class.php
Fix div/0 warnings
2019-01-19 11:36:09 +01:00
Laurent Destailleur
c1c3eb61f8 Merge pull request #10356 from atm-gauthier/6.0_fix_dol_loginfunction
FIX : if(!function_exists(dol_loginfunction))
2019-01-17 19:14:46 +01:00
Laurent Destailleur
cb59c97ef7 Merge pull request #10350 from a-schild/7.0
Fix for issue #10333 branch 7.0
2019-01-17 18:59:52 +01:00
gauthier
d997309bcb FIX : if(!method_exists(dol_loginfunction)) 2019-01-17 14:49:30 +01:00
Laurent Destailleur
476527e71e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-01-16 16:34:46 +01:00
Laurent Destailleur
6becdc8af4 Fix missing substitution of ID 2019-01-16 16:34:36 +01:00
a-schild
7e3bfd332e Fix for issue #10333
paymentterm.class.php invalid SQL in fetch
2019-01-16 13:07:00 +01:00
Laurent Destailleur
05dc40b6b9 Merge pull request #10331 from frederic34/patch-2
correct list of links
2019-01-15 17:52:05 +01:00
Frédéric FRANCE
cf55b54cf5 correct list of links 2019-01-14 10:02:48 +01:00
Laurent Destailleur
6ca163c68b Merge pull request #10311 from ATM-Marc/FIX_7.0_hook_action_list
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
2019-01-08 14:06:24 +01:00
Laurent Destailleur
9a6c3ac3df FIX Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER 2019-01-08 14:05:07 +01:00
Marc de Lima Lucio
68802c659e FIX: action list: add printFieldListSelect and printFieldListWhere hooks 2019-01-08 11:41:58 +01:00
Laurent Destailleur
8e3df45cbf Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/holiday/define_holiday.php
2019-01-08 01:46:03 +01:00
Laurent Destailleur
3d578cab28 Merge pull request #10308 from EuskalMoneta/7.0
FIX Civility not saved when creating a member.
2019-01-07 14:10:00 +01:00
Xebax
fbb1b344d1 Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-01-06 13:44:13 +01:00
Xebax
2c496d2ac0 FIX Civility not saved when creating a member. 2019-01-06 13:42:41 +01:00
Juanjo Menent
e8424ebec3 Merge pull request #10304 from simnandez/7.0
Change to 7.0.6
2019-01-05 14:47:24 +01:00
Juanjo Menent
74442911a7 Change to 7.0.6 2019-01-05 14:45:23 +01:00
Juanjo Menent
709d173669 Merge pull request #10303 from simnandez/7.0
Fix #8152 and prepare 7.0.5
2019-01-05 14:00:02 +01:00
Juanjo Menent
96967100ba Prepare 7.0.5 2019-01-05 13:35:32 +01:00
Juanjo Menent
7908550937 Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-01-05 13:05:50 +01:00
Juanjo Menent
61fbfaf356 Merge pull request #10298 from fmarcet/7.0
FIX: Can't generate invoice pdf
2019-01-05 13:02:58 +01:00
Ferran Marcet
f3dd875fc7 FIX: Can't generate invoice pdf 2019-01-04 12:00:39 +01:00
Ferran Marcet
4694af0488 FIX: Can't generate invoice pdf 2019-01-04 11:45:02 +01:00
Ferran Marcet
3e358c90b3 Merge branch '7.0up' into 7.0 2019-01-04 11:32:19 +01:00
Ferran Marcet
15cc45b8ae FIX: Can't generate invoice pdf 2019-01-04 10:52:10 +01:00
Laurent Destailleur
66b2a82be6 Merge pull request #10292 from atm-gauthier/6.0_fix_holidays
FIX : holidays get natural_search if search params are set only
2019-01-02 20:04:39 +01:00
ldestailleur
8645a7f524 FIX Interface regression for bind people. Fix option
MAIN_OPTIMIZEFORTEXTBROWSER
2019-01-02 18:58:45 +01:00
gauthier
fc3da0f5be FIX : holidays get natural_search if search params are set only 2019-01-02 10:02:30 +01:00
Juanjo Menent
cf64053fa5 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-29 15:07:09 +01:00
Laurent Destailleur
b76c45e8d0 Merge pull request #10264 from hregis/7.0_price
FIX avoid Class 'AdherentType' not found
2018-12-22 18:16:40 +01:00
Regis Houssin
09ce84ca93 FIX avoid Class 'AdherentType' not found 2018-12-21 16:38:02 +01:00
Laurent Destailleur
ed13f7b729 Merge pull request #10252 from ATM-Nicolas/fix_call_to_update_price
FIX : Function updatePrice with wrong parameters
2018-12-19 13:02:00 +01:00
Laurent Destailleur
2978522006 Merge pull request #10251 from ATM-Marc/FIX_7.0_contact_change
FIX: contact/address tab issue when changing company
2018-12-19 12:59:32 +01:00
Laurent Destailleur
fb8c3f01a4 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/modules/project/doc/pdf_baleine.modules.php
	htdocs/core/modules/project/doc/pdf_beluga.modules.php
2018-12-18 21:35:30 +01:00
Laurent Destailleur
4b6ae9d424 FIX Error reported when creation of thirdparty from member fails
Conflicts:
	htdocs/adherents/subscription.php
	htdocs/core/class/commonobject.class.php
2018-12-18 21:32:41 +01:00
Laurent Destailleur
b8429c607e FIX Can't create a thirdparty from member if customer code is mandatory. 2018-12-18 21:29:53 +01:00
Laurent Destailleur
6851232314 Fix removing constant no more required 2018-12-18 21:29:36 +01:00
ATM-Nicolas
96144e18f1 FIX : Function updatePrice with wrong parameters 2018-12-18 15:27:32 +01:00
Marc de Lima Lucio
7e2eca661b FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account 2018-12-18 09:40:58 +01:00
Laurent Destailleur
051853fc00 Merge pull request #10246 from atm-ph/fix_7.0_user_attached_files
Fix attached files from user mail form don't work
2018-12-17 21:11:43 +01:00
atm-ph
1aadcc50f1 Fix attached files from user mail form don't work 2018-12-17 15:48:27 +01:00
Laurent Destailleur
6275355cd5 Merge pull request #10234 from aspangaro/7.0_alert_bank
Fix: Accountancy - remove alert on bank account configuration when bank account is closed
2018-12-16 17:41:23 +01:00
Juanjo Menent
a61677dcc6 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-16 11:31:06 +01:00
Alexandre SPANGARO
6eb9013430 Fix: Accountancy - remove alert on bank account configuration when bank account is closed 2018-12-16 06:36:55 +01:00
Laurent Destailleur
45115a9590 Merge pull request #10191 from fappels/7.0_fix_issue#10186
Fix issue #10186 no display of stock per batch series.
2018-12-14 19:34:11 +01:00
Laurent Destailleur
42d4cf9992 Fix sql 2018-12-10 10:17:54 +01:00
Juanjo Menent
531cfe791d Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-07 11:34:42 +01:00
fappels
e2727f6d91 Fix issue #10186 no display of stock per batch series. 2018-12-06 21:43:10 +01:00
Laurent Destailleur
779d33cf02 Merge pull request #10085 from fmarcet/7.0
FIX Lines are not inserted correctly if VAT have code
2018-12-04 13:55:57 +01:00
Laurent Destailleur
b67ed87103 Merge pull request #10166 from atm-maxime/fix_pdf_footer
Fix pdf footer height for all documents
2018-12-04 13:35:11 +01:00
Laurent Destailleur
6d57c1b5f9 Merge pull request #10165 from atm-maxime/fix_user_noperm
Fix #6610
2018-12-04 13:34:11 +01:00
Laurent Destailleur
347384734d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/install/mysql/tables/llx_paiementfourn.sql
2018-12-04 13:15:32 +01:00
Ferran Marcet
602986ced8 Merge remote-tracking branch 'origin/7.0' into 7.0
# Conflicts:
#	htdocs/comm/propal/class/propal.class.php
#	htdocs/commande/class/commande.class.php
#	htdocs/expensereport/class/expensereport.class.php
#	htdocs/fourn/class/fournisseur.commande.class.php
2018-12-03 12:33:18 +01:00
Ferran Marcet
7247b14bd9 FIX Lines are not inserted correctly if VAT have code 2018-12-03 12:28:17 +01:00
Ferran Marcet
135a94dfed Merge branch '7.0up' into 7.0 2018-12-03 11:59:46 +01:00
Ferran Marcet
8312d57d16 FIX Lines are not inserted correctly if VAT have code 2018-12-03 11:58:39 +01:00
Maxime Kohlhaas
8fea6338e1 Fix #6565
Fix pdf footer height for all documents
2018-12-02 18:51:49 +01:00
Maxime Kohlhaas
42c97cf7d5 Fix #6610 2018-12-02 17:59:11 +01:00
Laurent Destailleur
07425e4e19 Merge pull request #10156 from grandoc/7.0_bug
FIX #3234
2018-12-02 17:06:06 +01:00
Juanjo Menent
4b785b22f6 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-02 15:53:14 +01:00
Philippe GRAND
8ec2bac36a FIX #3234 2018-12-02 10:02:05 +01:00
Laurent Destailleur
0668f90e14 Merge pull request #10146 from atm-maxime/fix_ecm_expensereport
Fix expense report in ecm auto dir
2018-12-01 23:02:09 +01:00
Maxime Kohlhaas
5e2f3a53c9 Fix expense report in ecm auto dir 2018-12-01 19:39:00 +01:00
Laurent Destailleur
a49a083629 Merge pull request #10142 from atm-maxime/fix_import_fk_dept
Fix add missing fk_department and fk_pays in contact/bank imports
2018-12-01 17:14:27 +01:00
Laurent Destailleur
e30bee50a2 Merge pull request #10139 from atm-john/fix_#8741
FIX #8741
2018-12-01 17:12:55 +01:00
Maxime Kohlhaas
13806124b2 Fix add missing fk_department and fk_pays in contact/bank imports 2018-12-01 17:11:04 +01:00
ATM John BOTELLA
474228cbd6 FIX #8741 2018-12-01 17:01:11 +01:00
Laurent Destailleur
b41e0a40e7 Merge pull request #10138 from inoveaconseil/patch-4
FIX #6580
2018-12-01 16:56:31 +01:00
Juanjo Menent
642a86ba25 Fix #8152 2018-12-01 16:55:45 +01:00
Inovea Conseil
18281d9d43 FIX #6580
FIX #6580
2018-12-01 16:48:50 +01:00
Maxime Kohlhaas
748dd12e4d Merge pull request #9056 from ATM-Nicolas/fix_default_preselected_mail_model
FIX : Select first mail model by default
2018-12-01 16:39:22 +01:00
Laurent Destailleur
3ea69cb1f1 Merge pull request #10130 from inoveaconseil/patch-3
Fix #9572
2018-12-01 16:22:38 +01:00
Inovea Conseil
0ba5fda3da Update price.php 2018-12-01 16:11:49 +01:00
Inovea Conseil
8964ec7ea1 Fix #9572
Fix #9572
2018-12-01 15:58:37 +01:00
Laurent Destailleur
03a67cee99 Merge pull request #10113 from frederic34/patch-9
llx_paiementfourn.sql #8723
2018-12-01 14:54:57 +01:00
Laurent Destailleur
305ab85f5d Merge pull request #10114 from frederic34/patch-17
Update 6.0.0-7.0.0.sql #8723
2018-12-01 14:54:31 +01:00
Juanjo Menent
6104d16b08 Merge pull request #10117 from atm-maxime/fix_pdf_contract
Fix pdf strato for contract with multipage
2018-12-01 11:14:38 +01:00
Maxime Kohlhaas
2b5bf0e2dd Fix pdf strato for contract with multipage 2018-12-01 01:07:15 +01:00
Frédéric FRANCE
335327827d Update 6.0.0-7.0.0.sql 2018-12-01 00:34:17 +01:00
Frédéric FRANCE
0270da7d8c Update 5.0.0-6.0.0.sql 2018-12-01 00:28:58 +01:00
Frédéric FRANCE
6ab12b5911 Update llx_paiementfourn.sql 2018-12-01 00:26:51 +01:00
Juanjo Menent
d1df592c7e Merge pull request #10110 from atm-maxime/fix_supp_pay_specimen
Fix #9074
2018-11-30 23:57:49 +01:00
Juanjo Menent
859d6c4401 Merge pull request #10109 from atm-maxime/fix_dupl_code
Fix #9070
2018-11-30 23:57:32 +01:00
Juanjo Menent
6d8f3aedc3 Merge pull request #10107 from atm-maxime/fix_import_extrafields
Fix extrafields in import tool
2018-11-30 23:56:57 +01:00
Maxime Kohlhaas
e8a02a971d Fix #9074 2018-11-30 23:05:12 +01:00
Maxime Kohlhaas
7585461486 Fix #9070 2018-11-30 22:16:17 +01:00
Maxime Kohlhaas
5dcb3d2a1f Fix extrafields in import tool 2018-11-30 19:23:05 +01:00
Laurent Destailleur
d8ab614efb Merge pull request #10088 from ATM-Marc/FIX_7.0_select_type_actions
FIX: form actions: select_type_actions could be too small + bad $db init
2018-11-29 11:16:57 +01:00
Marc de Lima Lucio
c13cc5d697 FIX: form actions: select_type_actions could be too small + bad init 2018-11-28 15:46:27 +01:00
Ferran Marcet
9d6c95e8a9 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-11-27 11:39:07 +01:00
Ferran Marcet
d8537a3c76 FIX Lines are not inserted correctly if VAT have code 2018-11-27 11:36:31 +01:00
Laurent Destailleur
fe4d8e36be Merge pull request #10072 from fappels/7.0_fix_expensereport_paid
Fix expensereport class fetch method
2018-11-24 11:06:47 +01:00
Laurent Destailleur
d59b1bb0c6 Merge 2018-11-23 11:44:07 +01:00
Laurent Destailleur
9d582a53ca Fix compatibility with new mysql versions 2018-11-23 11:28:28 +01:00
fappels
322ce410d7 Add missing paid field in fetch sql 2018-11-23 09:42:43 +01:00
Laurent Destailleur
8535844737 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-19 18:27:00 +01:00
Laurent Destailleur
bd8856b988 Merge pull request #10033 from frederic34/patch-9
Update CMailFile.class.php
2018-11-19 18:20:20 +01:00
Laurent Destailleur
7a3f088fcb Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-19 18:19:11 +01:00
Laurent Destailleur
77bc1c4313 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
2018-11-19 18:18:43 +01:00
Laurent Destailleur
fcb9b693cf Merge pull request #10042 from atm-gauthier/6.0_fix_massaction_sendinvoicebymail
FIX : We want to be able to send PDF of paid invoices
2018-11-19 18:14:12 +01:00
Laurent Destailleur
1e50e0576b Merge pull request #10039 from atm-florian/7.0
fix list agenda extrafield visibility
2018-11-19 18:09:21 +01:00
gauthier
ecdfa5219b FIX : We want to be able to send PDF of paid invoices 2018-11-19 17:31:45 +01:00
florian HENRY
dc2f1e9812 fix list agenda extrafield visibility 2018-11-19 11:25:48 +01:00
Frédéric FRANCE
30b1db34cd Update CMailFile.class.php 2018-11-17 11:33:01 +01:00
Laurent Destailleur
f2bbb54b8f Merge pull request #10011 from atm-gauthier/7.0_fix_search_categ_product_on_supplierorderlist
FIX : filter on product category doesn't work
2018-11-15 16:44:40 +01:00
Laurent Destailleur
1b377c0c48 Merge pull request #10004 from atm-gauthier/7.0_fix_payment_modes
FIX : fourn payment modes musn't be available on customer docs
2018-11-15 16:28:26 +01:00
gauthier
85dd0ec2dd FIX : filter on product category doesn't work 2018-11-13 15:24:53 +01:00
gauthier
f404cae546 FIX : Same on customer card 2018-11-12 16:04:42 +01:00
gauthier
66ea8bbe87 FIX : fourn payment modes musn't be available on customer docs 2018-11-12 15:58:41 +01:00
Laurent Destailleur
7f79bb1ffb Merge pull request #10002 from tarrsalah/fix-sql-performance-on-create-supplier-invoice
FIX slow SQL query on creating a new supplier invoice
2018-11-12 12:54:05 +01:00
tarrsalah
5eb897e049 FIX sql query performance on list_qualified_avoir_supplier_invoices. 2018-11-12 12:11:40 +01:00
Laurent Destailleur
c492b3328b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-10 15:50:00 +01:00
Laurent Destailleur
edc59b9290 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-11-10 15:49:20 +01:00
Laurent Destailleur
24c499aa44 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-11-10 15:48:53 +01:00
Laurent Destailleur
8eac45a762 Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2018-11-10 15:48:07 +01:00
Laurent Destailleur
3d85407619 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.9 2018-11-10 15:46:31 +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
d827601857 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-09 01:25:35 +01:00
Laurent Destailleur
aad0b700d4 Fix travis 2018-11-09 01:22:56 +01:00
Laurent Destailleur
f889c9994b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-11-09 01:21:13 +01:00
Laurent Destailleur
0d6709c9f7 Update phpcs config 2018-11-09 01:20:57 +01:00
Laurent Destailleur
400b48bd9b Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-08 20:14:59 +01:00
Laurent Destailleur
9012f6ecc5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-08 20:14:40 +01:00
Laurent Destailleur
f919e6ddb0 Merge pull request #9971 from atm-gauthier/FIX_langs_projet
FIX : OppStatusShort doesn't exists
2018-11-08 20:00:49 +01:00
Laurent Destailleur
e84e7f02c8 Merge pull request #9963 from atm-john/fix_marge_sign
FIX marge sign
2018-11-08 19:37:52 +01:00
Laurent Destailleur
78778e4c58 Merge pull request #9948 from frederic34/patch-9
FIX mode is only customer in stats fichinter
2018-11-08 19:16:00 +01:00
Laurent Destailleur
e92a63ba73 FIX If we change customer/supplier rule we can't edit old thirdparty. 2018-11-08 17:15:35 +01:00
Frédéric FRANCE
8bb1545ed0 Update index.php 2018-11-08 12:16:05 +01:00
Frédéric FRANCE
670eed1e68 Update index.php 2018-11-08 12:13:07 +01:00
gauthier
70826c3191 FIX : same on lines 2018-11-07 16:32:23 +01:00
gauthier
05a679a10c FIX : OppStatusShort doesn't exists 2018-11-07 16:26:25 +01:00
John BOTELLA
9d780a1722 Fix sign 2018-11-07 10:11:29 +01:00
Laurent Destailleur
56a70ab4e5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-05 10:23:15 +01:00
Laurent Destailleur
693cf72fca Merge pull request #9920 from ATM-Marc/FIX_6.0_task_activity_access
FIX: task time screen: bad task assignments
2018-11-05 10:21:28 +01:00
Laurent Destailleur
e1e0001fda Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-05 09:56:00 +01:00
Laurent Destailleur
8b373fb7a3 Merge pull request #9935 from atm-maxime/fix_socdelete_unlink_parent
Fix parent link was not removed on societe deletion #9106
2018-11-05 09:35:41 +01:00
Laurent Destailleur
98a3af620b FIX #9934 2018-11-05 09:26:23 +01:00
Laurent Destailleur
02eaaaa53e Merge pull request #9934 from atm-maxime/fix_mandatory_tracking
Fix tracking field in dictionnary should not be mandatory #8919
2018-11-05 09:22:24 +01:00
Frédéric FRANCE
d6b909a280 Update index.php 2018-11-03 18:26:11 +01:00
Frédéric FRANCE
8ab53012b7 mode is only customer in stats fichinter 2018-11-03 18:20:36 +01:00
Maxime Kohlhaas
29c0448a2e Fix parent link was not removed on societe deletion #9106 2018-11-01 15:41:58 +01:00
Maxime Kohlhaas
d1133916e0 Fix tracking field in dictionnary should not be mandatory 2018-11-01 15:33:14 +01:00
Laurent Destailleur
4b402aa6d1 Fix regression on name of array 2018-10-31 15:41:00 +01:00
Laurent Destailleur
07719eaf1e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-31 15:31:44 +01:00
Laurent Destailleur
ca726e6c94 FIX Error generating ODT when option to use contact on doc on 2018-10-31 15:31:22 +01:00
Laurent Destailleur
064417dcf1 Merge pull request #9889 from atm-maxime/fix_invoice_from_contract2
Fix invoice creation from contract was invoicing closed services #9087
2018-10-30 21:13:38 +01:00
Marc de Lima Lucio
2fbc305683 FIX: task time screen: last fix was overkill 2018-10-30 16:00:56 +01:00
Laurent Destailleur
68804cf8a5 Merge pull request #9890 from atm-maxime/fix_import_societe_alias
FIX missing name alias field in societe import/export #9091
2018-10-30 15:00:34 +01:00
Laurent Destailleur
b0ef8680ff Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-30 14:28:25 +01:00
Laurent Destailleur
38396e490a Merge pull request #9891 from frederic34/patch-17
Update brouillon when validate order
2018-10-30 14:17:29 +01:00
Marc de Lima Lucio
8911d72be8 FIX: task time screen: prevent users with access to all project from assigning to tasks they're not allowed to do 2018-10-30 12:28:04 +01:00
Frédéric FRANCE
a30091fd74 Update commande.class.php 2018-10-27 09:51:19 +02:00
Maxime Kohlhaas
abb343d37e Fix missing name alias field in societe import/export #9091 2018-10-27 09:42:08 +02:00
Maxime Kohlhaas
1b054f1b36 Fix invoice creation from contract was invoicing closed services #9087 2018-10-27 09:21:49 +02:00
Laurent Destailleur
7c81124e66 Merge pull request #9869 from ATM-Marc/FIX_6.0_typhon_order_ref
FIX: pdf typhon: order reference duplicate
2018-10-26 15:18:19 +02:00
Marc de Lima Lucio
16c35035c1 FIX: pdf typhon: order reference duplicate 2018-10-25 12:07:40 +02:00
Laurent Destailleur
7a14a1716d Merge pull request #9860 from atm-gauthier/7.0_fix_nb_occurrences_contrat
FIX : wrong occurence number of contract on contact card, we must only count externals
2018-10-24 12:24:57 +02:00
gauthier
036f70860e FIX : wrong occurence number of contract on contact card, we must only count externals 2018-10-24 10:17:21 +02:00
Laurent Destailleur
919c4fc5bc Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/theme/md/style.css.php
2018-10-24 02:40:57 +02:00
Laurent Destailleur
4060dd5377 Merge pull request #9826 from frederic34/patch-9
Update ajax.lib.php
2018-10-24 02:29:20 +02:00
Laurent Destailleur
52364f0fd9 Merge pull request #9834 from frederic34/patch-19
missing semicolon in MD style css
2018-10-24 02:29:02 +02:00
Laurent Destailleur
2ba6f96765 Update style.css.php 2018-10-24 02:27:59 +02:00
Laurent Destailleur
ddd267f4c3 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-24 02:21:53 +02:00
Laurent Destailleur
acaaf53085 Merge pull request #9843 from ATM-Nicolas/fix_variable
FIX : Variable name
2018-10-24 02:07:11 +02:00
ATM-Nicolas
cf28e4e442 FIX : Variable name 2018-10-22 15:19:33 +02:00
Frédéric FRANCE
83e2951107 Update style.css.php 2018-10-21 09:59:14 +02:00
Frédéric FRANCE
28c86a613d Update style.css.php 2018-10-21 09:39:07 +02:00
Frédéric FRANCE
c4029f5e5f Update style.css.php 2018-10-21 09:23:33 +02:00
Frédéric FRANCE
f322c73dd7 Update ajax.lib.php 2018-10-19 22:52:18 +02:00
Laurent Destailleur
57ad200ae5 Fix regression in creating discount 2018-10-19 14:43:10 +02:00
Laurent Destailleur
47abbd3eb2 Fix bad merge 2018-10-19 14:23:36 +02:00
Laurent Destailleur
36ae81c749 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-19 14:17:20 +02:00
Laurent Destailleur
de4ead2558 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/accountancy/class/accountancycategory.class.php
	htdocs/core/actions_massactions.inc.php
	htdocs/product/reassort.php
2018-10-19 14:16:53 +02:00
Laurent Destailleur
6fde6e4250 Merge pull request #9787 from fmarcet/6.0
FIX: When delete a product, llx_product_association rows are not deleted
2018-10-19 14:06:50 +02:00
Laurent Destailleur
5e650bcc1f Merge pull request #9791 from atm-gauthier/7.0_fix_discount_with_multicurrency
FIX : use discount with multicurrency
2018-10-19 13:27:08 +02:00
gauthier
aea7299970 FIX : use discount with multicurrency 2018-10-17 15:49:08 +02:00
Ferran Marcet
ffde353441 FIX When delete a product, llx_product_association rows are not deleted 2018-10-17 10:06:06 +02:00
Ferran Marcet
bdae4e1c4d FIX When delete a product, llx_product_association rows are not deleted 2018-10-17 10:04:42 +02:00
Ferran Marcet
b462e7b217 FIX When delete a product, llx_product_association rows are not deleted 2018-10-17 10:01:02 +02:00
Laurent Destailleur
33031450a3 Merge pull request #9747 from atm-maxime/fix_status_tobatch
Fix missing status_batch var on product lists #9606
2018-10-16 20:02:56 +02:00
Laurent Destailleur
d56c237d4e Merge pull request #9756 from atm-maxime/fix_refused_proposal_in_total
Fix refused proposals were counted in totals in project overview
2018-10-16 19:46:19 +02:00
Laurent Destailleur
7cd8b36cea Merge pull request #9755 from atm-greg/fix_massaction_delete_tasks
FIX modify parenting before task deletion
2018-10-16 19:45:43 +02:00
Laurent Destailleur
330824748b Merge pull request #9750 from frederic34/patch-16
code comment
2018-10-16 19:37:32 +02:00
Laurent Destailleur
575038d3a3 Merge pull request #9769 from atm-ph/fix_7.0_list_duplicate_extrafield_value
Fix list from 'Contacts/Addresses' on company may show duplicate valu…
2018-10-16 19:36:37 +02:00
atm-ph
72dd182b1f Fix list from 'Contacts/Addresses' on company may show duplicate value for extrafields 2018-10-16 18:22:43 +02:00
Maxime Kohlhaas
dfe239bf8d Fix refused proposals were counted in totals in project overview 2018-10-15 16:58:53 +02:00
atm-greg
06477b40a0 modify parenting before task deletion 2018-10-15 12:34:14 +02:00
Frédéric FRANCE
4d6d3afbea code comment 2018-10-15 08:39:46 +02:00
Maxime Kohlhaas
af813f8214 Fix missing status_batch var on product lists #9606 2018-10-14 19:55:25 +02:00
Laurent Destailleur
aedc6fadf4 Merge pull request #9740 from frederic34/patch-14
reduce complexity of payments.lib.php
2018-10-14 16:27:31 +02:00
Laurent Destailleur
fabc11191d Merge pull request #9739 from frederic34/patch-11
fix size of $head when replacing by hook
2018-10-14 16:27:14 +02:00
Laurent Destailleur
f9a66a34d0 Merge pull request #9738 from frederic34/patch-9
fix doc in import.lib.php
2018-10-14 16:24:47 +02:00
Laurent Destailleur
995f54ca52 Merge pull request #9735 from atm-ph/fix_6.0_sort_product_stock_list
Fix 6.0 sort product stock list
2018-10-14 16:23:30 +02:00
Frédéric FRANCE
787658ac98 reduce complexity of payments.lib.php 2018-10-14 10:56:03 +02:00
Frédéric FRANCE
70a98743e8 Update functions.lib.php 2018-10-14 10:48:06 +02:00
Frédéric FRANCE
1f1a614b47 Update import.lib.php 2018-10-14 10:21:06 +02:00
Laurent Destailleur
c15505bc13 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-13 14:27:50 +02:00
Laurent Destailleur
76e6968a21 Merge pull request #9730 from atm-ph/fix_7.0_extrafield_date_not_show
Fix extrafield contact typed as date isn't show in the list from 'con…
2018-10-13 12:03:07 +02:00
atm-ph
7b17b453bf Fix sort and switch page 2018-10-12 23:29:35 +02:00
atm-ph
23e4cd57f3 Fix warnings PHP7 2018-10-12 23:27:38 +02:00
atm-ph
e2748953c3 Fix print extrafield date in list 2018-10-12 22:31:47 +02:00
Laurent Destailleur
87f744896d Merge pull request #9733 from ATM-Marc/FIX_6.0_propal_customcode
FIX: propal pdf: missing parenthesis for customs code
2018-10-12 21:14:40 +02:00
Laurent Destailleur
b78932b9f7 Prepare 7.0.5 2018-10-12 21:11:40 +02:00
Laurent Destailleur
bd60fe6ffd Prepare 7.0.4 2018-10-12 19:13:11 +02:00
Laurent Destailleur
bb606df5e0 Prepare 7.0.4 2018-10-12 19:12:20 +02:00
Laurent Destailleur
067b29c9f8 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-12 19:09:45 +02:00
Laurent Destailleur
9f27dd41e5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
	htdocs/societe/class/societe.class.php
2018-10-12 19:08:06 +02:00
Laurent Destailleur
d4b02c0552 Release 6.0.8 2018-10-12 19:03:03 +02:00
Marc de Lima Lucio
afd9b4ea1a FIX: propal pdf: missing parenthesis for customs code 2018-10-12 18:19:17 +02:00
Laurent Destailleur
fd46ae13d6 Merge pull request #9731 from atm-ph/fix_7.0_empty_column_physical_stock
Fix display 0 (as virtual stock) instead of empty string
2018-10-12 18:17:04 +02:00
Laurent Destailleur
2fdc1a9883 Merge pull request #9718 from frederic34/patch-9
define $code for all execution paths
2018-10-12 17:42:07 +02:00
Laurent Destailleur
817920f282 Prepare 6.0.8 2018-10-12 17:36:49 +02:00
atm-ph
79420593f4 Fix display 0 (as virtual stock) instead of empty string 2018-10-11 17:14:22 +02:00
atm-ph
4b32c8e100 Fix extrafield contact typed as date isn't show in the list from 'contact/address' tab of company 2018-10-11 14:24:55 +02:00
Frédéric FRANCE
c3f07dd2e0 define $code for all execution paths 2018-10-09 19:28:52 +02:00
Laurent Destailleur
84605bc59b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-09 16:59:47 +02:00
Laurent Destailleur
430f833222 Merge pull request #9626 from OPEN-DSI/fix_product_margin
FIX Product margin tab and credit note
2018-10-09 16:57:08 +02:00
Laurent Destailleur
bd8cf3d81e Merge pull request #9704 from atm-gauthier/7.0_fix_userlist
FIX : when we're just admin and not super admin, if we create new use…
2018-10-09 16:17:49 +02:00
Laurent Destailleur
67e7736eb2 Merge pull request #9698 from Dolibarr/atm-maxime-patch-1
Fix request on project overview
2018-10-09 12:40:51 +02:00
gauthier
021f9552dd FIX : when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup 2018-10-08 15:41:31 +02:00
Maxime Kohlhaas
320ca3db67 Fix request on project overview
Fixes #9220
2018-10-06 22:53:28 +02:00
Laurent Destailleur
e165dce908 Merge pull request #9689 from ATM-Marc/FIX_6.0_facture_stats_situation
FIX: invoice stats: situation invoices were not counted
2018-10-06 12:46:25 +02:00
Laurent Destailleur
a97dafc1f2 Merge pull request #9688 from atm-florian/7.0_fix9161
7.0 fix9161
2018-10-06 12:40:42 +02:00
Marc de Lima Lucio
82651cd920 FIX: invoice stats: situation invoices were not counted 2018-10-05 12:12:04 +02:00
florian HENRY
cba4676032 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_fix9161 2018-10-05 10:36:03 +02:00
florian HENRY
68c99d01a7 OMG!!!! var_dump.... 2018-10-05 10:35:32 +02:00
Laurent Destailleur
b20dc5678c Merge pull request #9684 from atm-ph/fix_7.0_wrong_modulepart_name
FIX wrong value for module part and return access denied
2018-10-04 19:06:53 +02:00
Laurent Destailleur
8592b03b49 Merge pull request #9682 from atm-ph/fix_7.0_missing_hook
Fix missing hook on sellsjournal
2018-10-04 19:06:02 +02:00
Laurent Destailleur
17e4af50ec Merge pull request #9680 from ATM-Nicolas/fix_wrong_variable_name
FIX : Wrong variable name
2018-10-04 18:47:08 +02:00
Laurent Destailleur
ac86eac508 Merge pull request #9675 from atm-ph/fix_7.0_dom_error
Fix minor error in dom
2018-10-04 18:32:52 +02:00
Laurent Destailleur
3060647212 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/pdf.lib.php
2018-10-04 17:50:19 +02:00
Laurent Destailleur
8690d65479 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/pdf.lib.php
2018-10-04 17:47:22 +02:00
Laurent Destailleur
577192554d Merge pull request #9670 from oas-services/7.0
Fix issue #9434 : no array_options available when calling api on order line and invoice line
2018-10-04 17:39:37 +02:00
Laurent Destailleur
9e397206d3 Merge pull request #9668 from atm-greg/Fix_pdf_generation
fix error 500 on pdf_generation
2018-10-04 17:27:29 +02:00
Laurent Destailleur
1dd276b046 Merge pull request #9666 from atm-gauthier/7.0_wrongfunction
FIX : wrong function name
2018-10-04 17:26:59 +02:00
atm-ph
bfaf25ca2a Fix wrong value for module part and return access denied 2018-10-04 16:55:16 +02:00
atm-ph
58d1ac427e Fix missing hook on sellsjournal 2018-10-04 10:57:22 +02:00
ATM-Nicolas
c048f51562 FIX : Wrong variable name 2018-10-04 09:54:40 +02:00
florian HENRY
e95921eb93 better test 2018-10-04 09:47:04 +02:00
florian HENRY
7f4f27ebfe indent 2018-10-04 09:45:12 +02:00
florian HENRY
292dab192b FIX : #9161 2018-10-04 09:42:11 +02:00
atm-ph
2acd69033c Fix minor error in dom 2018-10-03 22:48:29 +02:00
aplose
8ee7a48583 Fix issue #9434 : no array_options available when calling api :
I replace the deprecated code by the fetch_optionnals() recommanded call.
2018-10-03 15:15:46 +02:00
atm-greg
583ea05567 fix missing letter... 2018-10-03 12:13:53 +02:00
gauthier
587766b39b FIX : wrong function name 2018-10-03 10:38:47 +02:00
gauthier
d6a9da57e1 FIX : need to round with 2 decimals to avoid movements not correctly balanced 2018-10-01 14:11:19 +02:00
Philippe
06fe172669 FIX Product marge tabs on product card
Credit note are not negative so the grand total are false
2018-09-27 20:06:00 +02:00
Philippe
8deb2eaa0c Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-09-27 19:00:09 +02:00
Laurent Destailleur
6e7fd15e1e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-27 12:48:08 +02:00
Laurent Destailleur
291d477f65 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/commonobject.class.php
2018-09-27 12:47:48 +02:00
Laurent Destailleur
4c8664b297 Merge pull request #9619 from ATM-Marc/FIX_6.0_extrafield_columns
FIX: showOptionals: column mismatches
2018-09-27 09:39:51 +02:00
Laurent Destailleur
2d88b69cf6 Merge pull request #9616 from frederic34/patch-14
add try catch for swiftmailer
2018-09-27 09:34:21 +02:00
Laurent Destailleur
bc5b794b1a Merge pull request #9613 from frederic34/patch-11
FIX Option MAIN_DISABLE_NOTES_TAB #9611
2018-09-27 09:30:56 +02:00
Laurent Destailleur
77341470e1 Merge pull request #9608 from frederic34/patch-10
comparaison of two boolean in rssparser.class.php
2018-09-27 09:23:24 +02:00
Laurent Destailleur
46363a7705 Merge pull request #9607 from atm-gauthier/7.0_fix_replenish_entity
FIX : need to filter on current entity on replenish
2018-09-27 09:22:44 +02:00
Laurent Destailleur
ff3f1e933a Update replenish.php 2018-09-27 09:22:38 +02:00
Marc de Lima Lucio
af93fc7484 FIX: showOptionals: column mismatches 2018-09-26 17:19:06 +02:00
Frédéric FRANCE
1bac3a0ccf swiftmailer is doing encodetorfc2822 2018-09-26 10:37:20 +02:00
Frédéric FRANCE
92a3faeaf7 add try catch for swiftmailer 2018-09-26 10:13:14 +02:00
Frédéric FRANCE
a9f7bdead6 fix Option MAIN_DISABLE_NOTES_TAB #9611 2018-09-25 15:22:08 +02:00
Frédéric FRANCE
d15c52db3b Update rssparser.class.php 2018-09-25 08:16:05 +02:00
gauthier
fc7c0ce521 FIX : need to filter on current entity on replenish 2018-09-24 16:23:44 +02:00
Laurent Destailleur
40bed96a01 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-24 10:15:20 +02:00
Laurent Destailleur
dbb75e35a1 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/facture/list.php
	htdocs/langs/en_US/admin.lang
	htdocs/langs/fr_FR/agenda.lang
2018-09-24 10:14:38 +02:00
Laurent Destailleur
2dbb82fc76 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-09-24 10:03:21 +02:00
Laurent Destailleur
12690666e2 Missing trans 2018-09-24 10:03:08 +02:00
Laurent Destailleur
9ddc1770e8 Merge pull request #9501 from atm-gauthier/7.0_fix_tva_if_buyer_hors_cee_and_particulier
FIX : According to french law, if seller is in France and buyer isn't…
2018-09-23 15:41:33 +02:00
Laurent Destailleur
1569770855 Rename hidden conf into MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC 2018-09-23 15:41:22 +02:00
gauthier
7b46bedce6 NEW : hidden configuration 2018-09-21 14:35:36 +02:00
Laurent Destailleur
a0bc26a923 Merge pull request #9476 from atm-maxime/fix_invoicelist_creditnote
Fix invoicelist creditnote
2018-09-21 09:56:43 +02:00
Laurent Destailleur
779d7e9689 Merge pull request #9568 from atm-gauthier/6.0_fix_langs_fr
FIX : langs fr
2018-09-19 15:04:18 +02:00
Laurent Destailleur
9b190d2cbc Merge pull request #9201 from atm-quentin/FIX_select_element
FIX exclude element of the select
2018-09-19 14:55:31 +02:00
gauthier
d62118dca8 FIX : langs fr 2018-09-19 14:53:56 +02:00
Laurent Destailleur
02617bd799 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-19 14:53:07 +02:00
Laurent Destailleur
2b67da3f34 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
2018-09-19 14:52:43 +02:00
Laurent Destailleur
d6bd0ed73e Merge pull request #9566 from frederic34/patch-9
call to deprecated add_object_linked was present two times
2018-09-19 14:37:05 +02:00
Laurent Destailleur
a6996169d6 Merge pull request #9565 from frederic34/multicpdf
correct typo in multicurrency doc pdf #9562
2018-09-19 14:30:15 +02:00
Frédéric FRANCE
1d43c6bc3a call to deprecated add_object_linked was present two times 2018-09-19 10:57:59 +02:00
Frédéric FRANCE
cdbb79a26c correct typo in multicurrency doc pdf 2018-09-19 09:26:56 +02:00
Laurent Destailleur
9c4f582f5c Merge 2018-09-16 12:52:11 +02:00
Laurent Destailleur
5655856ca5 Merge pull request #9504 from atm-gauthier/6.0_fix_refsupplier
FIX : wrong var name
2018-09-13 17:55:04 +02:00
gauthier
7838b75ec9 FIX : wrong var name 2018-09-13 16:11:42 +02:00
gauthier
b68523b9c1 FIX : According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product 2018-09-13 14:37:12 +02:00
ias-ceo
fece67b629 use correct resultset 2018-09-12 19:00:19 +02:00
Laurent Destailleur
58ba1c3496 Merge pull request #9451 from hregis/7.0_price
FIX better compatibility with multicompany
2018-09-12 18:27:50 +02:00
Laurent Destailleur
e3a00c5dcd Merge pull request #9450 from frederic34/patch-15
Update accountancycategory.class.php
2018-09-12 18:25:54 +02:00
Laurent Destailleur
a57e82a300 Merge pull request #9479 from atm-quentin/FIX_character_bill_list
FIX character making error on bill list
2018-09-12 18:22:07 +02:00
Laurent Destailleur
a3968b86df Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-12 18:05:47 +02:00
Laurent Destailleur
3662ebe3a3 Fix syntax error 2018-09-12 18:05:20 +02:00
Laurent Destailleur
eb242d58f2 Merge pull request #9469 from atm-ph/fix_7.0_classname_colht
Fix classname liencolht to linecolht
2018-09-12 17:30:36 +02:00
Laurent Destailleur
fd93a22dca Fix missing field 2018-09-12 16:45:12 +02:00
atm-quentin
c42f39cc34 FIX character making error on list 2018-09-12 14:44:08 +02:00
Maxime Kohlhaas
c94689e9a9 FIX remain to pay for credit note was wrong on invoice list 2018-09-12 11:53:57 +02:00
Laurent Destailleur
aad6a0871f FIX Lose filter on payment type or category after a sort on invoice list
Conflicts:
	htdocs/compta/facture/list.php
2018-09-12 10:59:53 +02:00
atm-ph
40c79cb7cd Fix classname liencolht to linecolht 2018-09-11 17:56:11 +02:00
Regis Houssin
43ac51b44c FIX remove debug 2018-09-10 10:11:07 +02:00
Regis Houssin
8699866062 FIX better compatibility with multicompany 2018-09-10 10:08:04 +02:00
Frédéric FRANCE
d8f77f040f Update accountancycategory.class.php 2018-09-09 23:12:16 +02:00
Frédéric FRANCE
9d8a4e463b Update accountancycategory.class.php 2018-09-09 23:09:52 +02:00
Laurent Destailleur
dfea391c88 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/pdf.lib.php
2018-09-05 20:39:38 +02:00
Laurent Destailleur
f7d5172a74 Merge pull request #9410 from frederic34/patch-10
Create index.html
2018-09-05 14:15:22 +02:00
Laurent Destailleur
ead2a764c7 Merge pull request #9409 from frederic34/patch-9
Create index.html
2018-09-05 14:15:12 +02:00
Frédéric FRANCE
2015268b7e Create index.html 2018-09-04 22:06:24 +02:00
Frédéric FRANCE
e4afd4af00 Create index.html 2018-09-04 22:05:06 +02:00
Laurent Destailleur
847189805a Merge pull request #9404 from ATM-Marc/FIX_6.0_pdf_address
FIX: PDF address: handle when contact thirdparty different from document thirdparty
2018-09-04 09:57:07 +02:00
Laurent Destailleur
252335318f Update pdf.lib.php 2018-09-04 09:57:01 +02:00
Marc de Lima Lucio
e285b42a18 FIX: PDF address: handle when contact thirdparty different from document thirdparty 2018-09-03 17:57:30 +02:00
Laurent Destailleur
f216da78d5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	.travis.yml
2018-09-02 15:27:03 +02:00
Laurent Destailleur
e0b272941f Fix mariadb 2018-09-02 15:25:27 +02:00
Laurent Destailleur
ebba0b9e67 phpunit 6.1 compatibility 2018-09-02 15:24:29 +02:00
Laurent Destailleur
0b34acae7c Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-02 15:22:56 +02:00
Laurent Destailleur
42cb2b07db Only min and max version 2018-09-02 15:22:49 +02:00
Laurent Destailleur
a7dfc88b59 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	test/phpunit/CoreTest.php
2018-09-02 15:21:21 +02:00
Laurent Destailleur
bd3647a9d7 Prepare phpunit 6.1 compatibility 2018-09-02 14:23:52 +02:00
Laurent Destailleur
b9c95a5a5c Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-09-02 14:19:43 +02:00
Laurent Destailleur
5bab9d59b2 Fix var_dump 2018-09-02 14:19:23 +02:00
Laurent Destailleur
df721a5fbc Only min and max php version 2018-09-02 14:18:04 +02:00
Laurent Destailleur
37fb70d983 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-09-02 14:15:32 +02:00
Laurent Destailleur
02bedc49d3 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts:
	test/phpunit/PricesTest.php
	test/phpunit/RestAPIUserTest.php
	test/phpunit/WebservicesInvoicesTest.php
2018-09-02 14:15:17 +02:00
Laurent Destailleur
e41b55af13 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0 2018-09-02 14:10:28 +02:00
Laurent Destailleur
a69c3caf2c Prepare compatibility with phpunit 6.1 2018-09-02 14:10:06 +02:00
Laurent Destailleur
53caac13a9 Test phpunit 2018-09-02 13:57:51 +02:00
Laurent Destailleur
fe7a0c894f Merge pull request #9368 from atm-ph/fix_7.0_search_company_by_code
Fix search company by code
2018-09-01 14:42:32 +02:00
Laurent Destailleur
945e925399 Update html.form.class.php 2018-09-01 14:41:44 +02:00
Laurent Destailleur
677d7dd0fb Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-01 14:09:20 +02:00
Laurent Destailleur
123a66dc2a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/product/class/product.class.php
2018-09-01 14:09:00 +02:00
Laurent Destailleur
b6f4b1dff7 Merge pull request #9363 from frederic34/patch-21
Update modSociete.class.php
2018-09-01 13:31:23 +02:00
Laurent Destailleur
bb444c80d0 Merge pull request #9360 from frederic34/patch-18
Update ldap.php
2018-09-01 13:28:16 +02:00
Laurent Destailleur
1eeb567e67 Merge pull request #9359 from frederic34/patch-17
Update card.php
2018-09-01 13:27:49 +02:00
Josep Lluís
bfaf7ae473 Fix: undefined rights_class on modules
When a module has the permission variable rights_class undefined, on unactivate the module are deleted all rows in cronjobs and menu tables with module=''.
2018-09-01 12:44:16 +02:00
Laurent Destailleur
179feebd80 Merge pull request #9347 from atm-greg/fix_getLabelOfUnit
remove useless db begin
2018-09-01 12:34:43 +02:00
Laurent Destailleur
160a35f63f Merge pull request #9335 from frederic34/patch-11
Update blockedlog.lang
2018-09-01 12:19:36 +02:00
Laurent Destailleur
81c4e6a764 FIX Force stripe api version to avoid trouble if we update stripe api
Conflicts:
	htdocs/stripe/config.php
2018-09-01 12:03:44 +02:00
atm-ph
102b698c76 Fix search company by code 2018-08-31 11:38:45 +02:00
Laurent Destailleur
07d5bd143a Fix entity 2018-08-31 11:26:53 +02:00
Frédéric FRANCE
2eade6ea68 Update modSociete.class.php 2018-08-30 23:22:06 +02:00
Frédéric FRANCE
f61450ffa8 Update ldap.php 2018-08-30 23:04:32 +02:00
Frédéric FRANCE
9c44f80746 Update card.php 2018-08-30 23:03:03 +02:00
atm-greg
f8fef61075 remove useless db begin 2018-08-30 09:19:44 +02:00
Frédéric FRANCE
285e231ea1 Update blockedlog.lang 2018-08-29 23:08:13 +02:00
Laurent Destailleur
46fe19bed5 Code comment 2018-08-29 18:56:57 +02:00
Laurent Destailleur
0c11007e34 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	README.md
	htdocs/comm/propal/card.php
2018-08-29 18:53:39 +02:00
Laurent Destailleur
e317b0847a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	README.md
2018-08-29 18:50:00 +02:00
Laurent Destailleur
7af083f1ec Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-08-29 18:49:08 +02:00
Laurent Destailleur
34ceec7067 FIX #9328 2018-08-29 18:40:12 +02:00
Laurent Destailleur
428354303c FIX #9328 2018-08-29 18:29:42 +02:00
Laurent Destailleur
275b9a9960 Merge pull request #9325 from frederic34/patch-12
Fix allow barcode with special char
2018-08-29 18:01:15 +02:00
Laurent Destailleur
46a24ff28f Merge pull request #9321 from atm-gauthier/6.0_fix_default_bank_on_create_propal
FIX : $fk_account is always empty, must be $soc->fk_account
2018-08-29 17:56:36 +02:00
Laurent Destailleur
4d8424f9eb Merge pull request #9314 from frederic34/patch-10
Build Badge for 7.0
2018-08-29 17:50:10 +02:00
Laurent Destailleur
cb24fa0f08 Merge pull request #9310 from frederic34/patch-9
Build Badge for 6.0
2018-08-29 17:50:04 +02:00
Frédéric FRANCE
24be0b7305 Update viewimage.php
code may have rich content (qrcode, datamatrix,...)
2018-08-29 13:08:52 +02:00
gauthier
61a57e619f FIX : $fk_account is always empty, must be $soc->fk_account 2018-08-28 16:54:04 +02:00
Frédéric FRANCE
055b7392d0 Build Badge for 7.0 2018-08-28 10:07:09 +02:00
Frédéric FRANCE
53e476483c Build Badge for 6.0 2018-08-28 09:38:24 +02:00
Laurent Destailleur
32ef9695a7 Merge pull request #9282 from frederic34/patch-19
Update card.php
2018-08-28 02:28:35 +02:00
Laurent Destailleur
7462a1ae1d Update card.php 2018-08-28 02:27:56 +02:00
Laurent Destailleur
4369be7b39 Merge pull request #9284 from frederic34/patch-20
Update commondocgenerator.class.php
2018-08-28 02:11:50 +02:00
Laurent Destailleur
d90eed3098 Merge pull request #9291 from frederic34/patch-23
typo
2018-08-28 01:55:44 +02:00
Laurent Destailleur
b96082a577 Merge pull request #9274 from frederic34/patch-17
Build badge for 5.0
2018-08-28 01:38:06 +02:00
Laurent Destailleur
1f807b9216 Merge pull request #9305 from atm-gauthier/7.0_fix_altertable_charges
FIX : table llx_chargessociales doesn't exists
2018-08-28 01:37:31 +02:00
Norbert Penel
f9c1dd8edd There is a begin transaction without rollback
In this Select, there is no need of this Begin Transaction on my understanding.
Don't know why this line code is here for.
2018-08-28 01:32:55 +02:00
Laurent Destailleur
0d91aff32c Merge pull request #9304 from atm-ph/fix_attributes_missing_for_api
Fix datec and tms missing in fetch method for API
2018-08-28 01:30:56 +02:00
gauthier
79aa390fe8 FIX : table llx_chargessociales doesn't exists 2018-08-27 15:07:19 +02:00
atm-ph
d9beb3f882 Fix tms missing in fetch propal 2018-08-27 10:19:07 +02:00
atm-quentin
ec9eeb5201 FIX check !empty exclude select element 2018-08-27 10:17:18 +02:00
atm-ph
eb4e42bc40 Fix datec and tms missing in fetch method for API 2018-08-26 18:08:10 +02:00
Frédéric FRANCE
85ae8f3901 Update card.php 2018-08-24 09:29:17 +02:00
Laurent Destailleur
62b2981e42 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-08-23 19:47:31 +02:00
Laurent Destailleur
61ced8220b Fix sample doc 2018-08-23 17:49:14 +02:00
Frédéric FRANCE
343e6ce8b3 typo 2018-08-23 14:34:27 +02:00
Frédéric FRANCE
96f16b7497 Update commondocgenerator.class.php 2018-08-22 17:29:05 +02:00
Frédéric FRANCE
0334409d18 Update card.php 2018-08-22 13:43:30 +02:00
Laurent Destailleur
c7a241a5db FIX Get templates in a forced language
Conflicts:
	htdocs/core/class/html.formmail.class.php
2018-08-22 13:22:49 +02:00
Frédéric FRANCE
b1a3238c94 Build badge for 5.0 2018-08-21 14:22:29 +02:00
Laurent Destailleur
4fdd521d61 Merge pull request #8671 from ATM-Nicolas/fix_comments_on_tasks
FIX : Fetch task will now fetch comments
2018-08-21 13:36:20 +02:00
Laurent Destailleur
0ee7befa19 Update replenish.php 2018-08-21 13:27:49 +02:00
Laurent Destailleur
009424cd67 Merge pull request #9226 from atm-greg/Fix_project_delete_tasks
Fix project delete tasks
2018-08-21 13:11:00 +02:00
Laurent Destailleur
91bfa4be6c Update project.class.php 2018-08-21 13:10:20 +02:00
Laurent Destailleur
3523c2b3d2 Update project.class.php 2018-08-21 13:09:06 +02:00
Laurent Destailleur
58b668e74f Merge pull request #9256 from c3do/patch-2
Fix : Erreur de syntaxe ( + au lieu de . )
2018-08-21 12:48:58 +02:00
Laurent Destailleur
e03d7eba8c Merge pull request #9254 from frederic34/patch-17
Build Badge by branch
2018-08-21 12:48:23 +02:00
Cédric
fe6779c223 Erreur de syntaxe ( + au lieu de . ) 2018-08-16 17:20:38 +02:00
Frédéric FRANCE
2aa0956f15 Update README.md 2018-08-16 16:08:04 +02:00
Frédéric FRANCE
bb09bcece4 Update README.md 2018-08-16 16:03:56 +02:00
Laurent Destailleur
0c654bd452 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-08-16 14:47:56 +02:00
Laurent Destailleur
e88b68f131 Merge pull request #9246 from atm-florian/6.0
fix : ODT project substitution
2018-08-16 00:33:04 +02:00
florian HENRY
20309665e6 fix : ODT project substitution 2018-08-14 10:45:08 +02:00
atm-greg
ba6f7d4b0a fix infinite loop 2018-08-14 09:32:43 +02:00
Laurent Destailleur
7cd24c389d Fix firstname/lastname 2018-08-13 01:21:23 +02:00
Laurent Destailleur
21555a7435 Fix firstname/lastname 2018-08-13 01:10:51 +02:00
Laurent Destailleur
2d571acc03 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/commande/list.php
2018-08-12 19:25:44 +02:00
Laurent Destailleur
30b4d88428 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/facture/list.php
	htdocs/product/reassort.php
	htdocs/societe/list.php
2018-08-12 19:23:45 +02:00
Laurent Destailleur
61a5be6e2a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-08-12 19:19:21 +02:00
Laurent Destailleur
234b0d3120 Merge pull request #9230 from ATM-Nicolas/fix_withdraw_pagination
FIX : Pagination on withdraw request list
2018-08-12 19:18:57 +02:00
Laurent Destailleur
b81b6b651f Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-08-12 19:17:26 +02:00
Laurent Destailleur
be7a764de7 Merge pull request #9202 from atm-florian/7.0
fix bad use of test_sql_and_script_inject return int not value tested
2018-08-12 18:24:54 +02:00
Laurent Destailleur
7f797668c9 Merge pull request #9186 from atm-florian/6.0
fix : odt project and task extrafields management
2018-08-12 18:15:02 +02:00
Laurent Destailleur
56d8935976 Merge pull request #9181 from ATM-Nicolas/fix_dolGetFirstLastname
FIX : Wrong position of firstname lastname
2018-08-12 18:11:36 +02:00
Laurent Destailleur
6954ab00f9 Update functions.lib.php 2018-08-12 18:11:27 +02:00
Laurent Destailleur
9124d5c6a5 Merge pull request #9231 from atm-gauthier/7.0_fix_notice
FIX : global $mysoc missing (to avoid php notice on lines 279, 280 & 281
2018-08-12 17:36:39 +02:00
gauthier
391230babc FIX : global $mysoc missing (to avoid php notice on lines 279, 280 & 281) 2018-08-10 15:39:49 +02:00
ATM-Nicolas
d8d54d246c FIX : Pagination on withdraw request list 2018-08-10 15:05:21 +02:00
florian HENRY
06189f8153 Merge branch '6.0' into 6.0_fhe 2018-08-09 18:31:59 +02:00
florian HENRY
9024ed9e61 Merge branch '7.0' into 7.0_fhe 2018-08-09 17:47:21 +02:00
atm-greg
3d84adbd76 fix recurcivity 2018-08-09 12:21:48 +02:00
atm-greg
4e16f64af0 Fix project::delete to delete children tasks before parent tasks 2018-08-09 12:13:06 +02:00
Laurent Destailleur
de1386c83c Merge branch '7.0' of github.com:Dolibarr/dolibarr into 7.0 2018-08-08 16:49:09 +02:00
Juanjo Menent
e2499392a9 Merge pull request #9215 from fmarcet/7.0
Fix: Bad position when document have incoterms/notes
2018-08-08 11:10:47 +02:00
Juanjo Menent
b840152bcd Merge pull request #9217 from ATM-Nicolas/fix_undefined_index_notnull
FIX : PHP warning, undefined index notnull
2018-08-08 11:10:17 +02:00
Juanjo Menent
9f09c97eb9 Merge pull request #9198 from OPEN-DSI/fix_cmd_list
FIX : Search on Ref project on order list
2018-08-08 10:56:57 +02:00
Ferran Marcet
5ce31f65a4 Fix: Bad position when document have incoterms/notes 2018-08-07 11:40:11 +02:00
ATM-Nicolas
5b15e688af FIX : PHP warning, undefined index notnull 2018-08-07 09:38:18 +02:00
florian HENRY
74d05da149 fix : display if error 2018-08-06 11:28:34 +02:00
florian HENRY
0d85eb52c5 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0 2018-08-03 17:10:26 +02:00
florian HENRY
615ed11534 fix bad use of test_sql_and_script_inject return int not value tested 2018-08-03 17:09:58 +02:00
atm-quentin
09dfcc6016 FIX exclude element of the select 2018-08-03 14:54:21 +02:00
Philippe
61e1f0508d FIX : Search on Ref project on order list 2018-08-03 11:08:09 +02:00
ATM-Nicolas
70adfb135d FIX : Missing behavior 2018-08-03 09:51:29 +02:00
Laurent Destailleur
6010d9de4b Merge pull request #9158 from atm-gauthier/7.0_missing_hook
FIX : missing hook to edit sql
2018-08-02 18:36:25 +02:00
Laurent Destailleur
17ed19503c Code comment 2018-08-02 17:51:04 +02:00
Laurent Destailleur
e85ec19018 Merge pull request #9093 from atm-gauthier/FIX_filters
FIX : page must always be 0 when we search
2018-08-02 17:48:35 +02:00
Laurent Destailleur
b5a0e14ffe Merge pull request #9185 from atm-john/fix_situation_total_calcul
Important: fix situation line's total
2018-08-02 17:45:44 +02:00
Laurent Destailleur
d84bacad00 Merge pull request #9196 from ATM-Nicolas/fix_wrong_variable_and_trigger_name
FIX : Wrong variable and trigger name
2018-08-02 17:43:16 +02:00
ATM-Nicolas
f3090e4819 FIX : Wrong variable and trigger name 2018-08-02 16:05:54 +02:00
Juanjo Menent
5b3c6de06c Merge pull request #9184 from atm-gauthier/7.0_fix_extrafieldkey
FIX : extrafieldkey
2018-08-02 11:24:19 +02:00
Juanjo Menent
1fbbaf2895 Merge pull request #9180 from atm-florian/7.0
FIX: keep context filter on contact list on change column displayed
2018-08-02 11:20:25 +02:00
Juanjo Menent
ce49230d71 Merge pull request #9177 from ATM-Nicolas/fix_preselect_project
FIX : Keep same project when creating shipping from order
2018-08-02 11:18:39 +02:00
Juanjo Menent
98dada47de Merge pull request #9174 from tarrsalah/fix-soc-filter-on-supplier-invoices
FIX filter supplier invoice list by societe name.
2018-08-02 11:12:01 +02:00
Juanjo Menent
2cf51fbdf1 Merge pull request #9173 from frederic34/patch-22
fix #8820
2018-08-02 11:08:47 +02:00
Juanjo Menent
2206eb98d1 Merge pull request #9191 from Dolibarr/revert-9147-7.0_price
Revert "FIX multicompany compatibility !"
2018-08-02 10:46:20 +02:00
Juanjo Menent
99f29a9764 Revert "FIX multicompany compatibility !" 2018-08-02 10:45:15 +02:00
Juanjo Menent
e6f416e745 Merge pull request #9147 from hregis/7.0_price
FIX multicompany compatibility !
2018-08-02 10:45:01 +02:00
florian HENRY
ceb85cfa45 fix : odt project and task extrafields management 2018-07-31 17:29:08 +02:00
gauthier
cadf931e8d FIX : extrafieldkey 2018-07-31 15:02:51 +02:00
John BOTELLA
4ddca02bb9 fix situation line's total 2018-07-31 14:58:33 +02:00
ATM-Nicolas
b9a44fc76b FIX : Wrong position of firstname lastname 2018-07-31 12:15:18 +02:00
florian HENRY
5d19361782 fix: keep context filter on contact list on change column displayed 2018-07-31 11:39:54 +02:00
ATM-Nicolas
1536bbc65e FIX : Keep same project when creating shipping from order 2018-07-30 15:16:53 +02:00
tarrsalah
8278a9fa52 FIX filter supplier invoice list by societe name. 2018-07-29 13:18:05 +01:00
Frédéric FRANCE
7dada7ae8e fix #8820 2018-07-29 09:15:42 +02:00
Laurent Destailleur
894f484de8 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-27 12:34:02 +02:00
Laurent Destailleur
83ae27d122 FIX Deletion of files in migration 2018-07-27 12:33:36 +02:00
gauthier
c95d6271a9 FIX : missing hook to edit sql 2018-07-25 11:15:13 +02:00
Laurent Destailleur
cfb0f2df05 Merge pull request #9149 from OPEN-DSI/fix_propal_list
FIX search on ref project on propal list
2018-07-24 21:42:02 +02:00
Philippe
d7f58d0087 FIX search on ref project on propal list 2018-07-24 20:28:49 +02:00
Laurent Destailleur
927727edf3 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-24 19:22:12 +02:00
Laurent Destailleur
20f178fdfe Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/comm/action/index.php
	htdocs/core/lib/functions.lib.php
2018-07-24 19:22:00 +02:00
Regis Houssin
b7dfc99882 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_price 2018-07-24 18:58:23 +02:00
Laurent Destailleur
f50aa03187 Merge pull request #9112 from atm-gauthier/FIX_multientity_replenish
FIX: stock replenish with multientity
2018-07-24 18:10:00 +02:00
Laurent Destailleur
e9eb8da61b Update replenish.php 2018-07-24 18:09:50 +02:00
Laurent Destailleur
c7f54439ff Merge pull request #9145 from frederic34/patch-12
use defaut currency for supplier order
2018-07-24 17:32:11 +02:00
Regis Houssin
835cb04631 FIX remove rowid for multicompany compatibility 2018-07-24 17:07:08 +02:00
Frédéric FRANCE
bde30b85ad use defaut currency for supplier order 2018-07-24 17:06:12 +02:00
Laurent Destailleur
3bdf7d411d Merge pull request #9125 from atm-john/fix_php7_warning_mysql
Fix: Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NU…
2018-07-24 16:56:10 +02:00
Laurent Destailleur
8866b8eb1d Merge pull request #9133 from frederic34/patch-12
__NEXT_MONTH __PREVIOUS_MONTH give day instead month
2018-07-24 16:54:04 +02:00
Laurent Destailleur
e4705669ba Merge pull request #9136 from frederic34/patch-17
remove % in supplier order pdf
2018-07-24 16:51:58 +02:00
Regis Houssin
d4920521b5 FIX multicompany compatibility ! 2018-07-24 15:44:21 +02:00
Frédéric FRANCE
4341e367d2 remove % in supplier order pdf 2018-07-23 10:30:28 +02:00
Frédéric FRANCE
d582f72bd9 __NEXT_MONTH __PREVIOUS_MONTH give day instead month 2018-07-22 17:27:02 +02:00
Laurent Destailleur
a1180f79bd Fix missing customer code and ref customer 2018-07-21 12:56:18 +02:00
John BOTELLA
1e986bc39a Fix: Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) 2018-07-20 11:51:01 +02:00
Laurent Destailleur
7fcec5f6c3 Fix duplicate tab "contact" on thirdparty 2018-07-17 13:54:13 +02:00
Laurent Destailleur
45a45b0dec NEW Can enable a module, even external module, from command line
Conflicts:
	htdocs/install/upgrade2.php
2018-07-16 15:35:00 +02:00
gauthier
33aa373362 FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing 2018-07-16 15:27:37 +02:00
Laurent Destailleur
e92052353d Merge pull request #9026 from inoveaconseil/FixExtrafieldResource
Fix extrafields resource
2018-07-15 20:13:24 +02:00
Laurent Destailleur
b690306b70 Merge pull request #9027 from hregis/7.0_price
Fix: avoid a non numeric value !!
2018-07-15 20:11:50 +02:00
Laurent Destailleur
cb0553c3bf Merge pull request #9094 from atm-ph/fix_7.0_getrights
Fix user rights overrided by user group rights
2018-07-15 19:58:00 +02:00
atm-ph
0c252d9778 Fix user rights overrided by user group rights 2018-07-11 18:09:29 +02:00
gauthier
80ff7fa86f FIX : case when we valid form with keyboard 2018-07-11 15:18:30 +02:00
gauthier
103c7e6d06 FIX : page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied) 2018-07-11 09:51:36 +02:00
Regis Houssin
f52187e829 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_price 2018-07-11 08:22:13 +02:00
Laurent Destailleur
aeb5f5e4f3 Fix phpcs 2018-07-10 13:56:03 +02:00
Laurent Destailleur
bda142d82d Update commande.class.php 2018-07-10 11:10:55 +02:00
Laurent Destailleur
c0d6aee040 Update propal.class.php 2018-07-10 11:10:01 +02:00
Laurent Destailleur
ed3023f7d9 Update propal.class.php 2018-07-10 11:09:08 +02:00
Laurent Destailleur
dc7fcc009b Update propal.class.php 2018-07-10 10:56:45 +02:00
Laurent Destailleur
8e0a663b7c Code comment 2018-07-10 10:53:59 +02:00
Laurent Destailleur
97b1589fb5 Merge pull request #9082 from ATM-Marc/FIX_5.0_propal_projectFromOrigin
FIX: propal: correctly preset project when creating with origin/originid
2018-07-10 10:42:10 +02:00
Marc de Lima Lucio
2ba7c07574 FIX: propal: correctly preset project when creating with origin/originid 2018-07-09 17:34:31 +02:00
Laurent Destailleur
2f668ccc79 Merge pull request #9076 from atm-john/fix_count_parameter_6.0
Fix count(): Parameter must be an array or an object that implements …
2018-07-09 17:34:10 +02:00
Laurent Destailleur
8184eff66c Fix for #9079 2018-07-09 15:25:14 +02:00
Laurent Destailleur
c33aaa076d FIX #8984 button create expense report 2018-07-09 14:35:22 +02:00
Laurent Destailleur
e427496ddf FIX Injection 2018-07-09 14:13:01 +02:00
John BOTELLA
1daba56bbc Fix count(): Parameter must be an array or an object that implements Countable 2018-07-09 10:05:53 +02:00
Laurent Destailleur
2a676b414a Merge pull request #9024 from atm-maxime/fix_link_create_event
Fix link to create event had no socid if from thirdparty card
2018-07-06 14:26:38 +02:00
Laurent Destailleur
2113965b57 Update html.formactions.class.php 2018-07-06 14:26:21 +02:00
Laurent Destailleur
2cdd9adc6e Merge pull request #9023 from atm-maxime/fix_stocklist
Fix filters not saved when ordering
2018-07-06 14:23:10 +02:00
Laurent Destailleur
3b8ecb18ab Merge pull request #9044 from hregis/7.0_loan
Fix: missing "paid" field
2018-07-06 13:03:37 +02:00
Laurent Destailleur
0587e73272 FIX Pagination on related item pages 2018-07-05 15:53:28 +02:00
ATM-Nicolas
59220c05e4 FIX : Select first mail model by default 2018-07-05 11:18:28 +02:00
Inovea Conseil
d53f03b596 Update after comment 2018-07-05 09:14:36 +02:00
Regis Houssin
875cee84c7 Fix: missing "paid" field 2018-07-03 13:47:53 +02:00
Laurent Destailleur
0138b0e0b7 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/html.form.class.php
2018-07-03 10:01:30 +02:00
Laurent Destailleur
f9fa19e7ae Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-02 12:26:45 +02:00
Laurent Destailleur
9c5d34fc5f Fix translation 2018-07-02 12:26:32 +02:00
Laurent Destailleur
af21222c30 Fix translation 2018-07-02 11:47:04 +02:00
Laurent Destailleur
e8b97b0be4 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-02 11:33:49 +02:00
Laurent Destailleur
11021353da Fix text in payment area of crabe pdf 2018-07-02 11:33:33 +02:00
Regis Houssin
4925624ed9 Fix: avoid NULL value when "subprice" is 0 2018-06-30 10:38:30 +02:00
Regis Houssin
964f11491f Revert "Fix: avoid a non numeric value !!"
This reverts commit 2824afa75c.
2018-06-30 10:26:50 +02:00
Laurent Destailleur
bc632c9ab7 Merge pull request #9019 from atm-gauthier/6.0_fix_getentity
FIX : getEntity project and not projet
2018-06-30 01:15:23 +02:00
Laurent Destailleur
03306fa56e Merge pull request #9022 from atm-maxime/7.0
Fix : division by 0 on homepage if nothing to do
2018-06-29 19:58:48 +02:00
Laurent Destailleur
a6c6bbe16d Merge pull request #9029 from hregis/6.0_multicompany
Fix: broken feature with edit in place
2018-06-29 19:40:17 +02:00
Laurent Destailleur
3f2b3c0840 FIX #9032 2018-06-29 19:38:12 +02:00
Laurent Destailleur
1c7cd19c1d Merge pull request #9033 from hregis/6.0_bug3
Fix: #9032 Vulnerability
2018-06-29 19:26:12 +02:00
Laurent Destailleur
c4143763be Update step1.php 2018-06-29 19:23:17 +02:00
Laurent Destailleur
932ff0be18 Trans 2018-06-29 19:16:29 +02:00
Laurent Destailleur
ca8144c5ea Fix error message 2018-06-29 19:08:35 +02:00
Laurent Destailleur
2175a012e1 Fix lang 2018-06-29 18:23:59 +02:00
Regis Houssin
41709f07d0 Fix: #9032 Vulnerability 2018-06-29 18:18:10 +02:00
Regis Houssin
2d13b5b59d Fix: broken feature with edit in place 2018-06-29 15:57:34 +02:00
Regis Houssin
2824afa75c Fix: avoid a non numeric value !! 2018-06-29 11:25:30 +02:00
Inovea Conseil
c4513a755d Fix extrafields resource 2018-06-28 16:39:37 +02:00
Maxime Kohlhaas
5756955d55 Fix link to create event had no socid if from thirdparty card 2018-06-28 14:27:59 +02:00
Maxime Kohlhaas
3babdb9798 Fix filters not saved when ordering 2018-06-28 13:45:30 +02:00
Maxime Kohlhaas
7ebf54fbea Fix : division by 0 on homepage if nothing to do 2018-06-28 12:54:19 +02:00
Laurent Destailleur
da138db528 FIX combo into popup become crazy with IE10
Conflicts:
	htdocs/asset/card.php
	htdocs/modulebuilder/template/myobject_card.php
2018-06-28 12:16:12 +02:00
Laurent Destailleur
ed2ec78332 FIX combo of stock in popup are crazy in IE 2018-06-28 12:11:00 +02:00
gauthier
d8ca9f2947 FIX : we must see number of all shared projects 2018-06-27 17:26:04 +02:00
gauthier
86a58def3b FIX : getEntity project and not projet 2018-06-27 17:13:50 +02:00
Laurent Destailleur
aa37786596 Fix migration errors reported by Softaculous 2018-06-26 11:51:49 +02:00
Laurent Destailleur
7f8570f720 Fix lang loading 2018-06-26 00:48:43 +02:00
Laurent Destailleur
52eddbf809 Sync transifex 2018-06-26 00:29:50 +02:00
Laurent Destailleur
9f77ea0ece Code comment 2018-06-25 17:05:15 +02:00
Laurent Destailleur
9b46ae50f0 Fix left join on expensereport lines 2018-06-25 16:25:37 +02:00
Laurent Destailleur
36402c22ee FIX SQL Injections reported by mu shcor (ADLab of Venustech) 2018-06-25 14:06:09 +02:00
Laurent Destailleur
d9fc1e0b5d Fix param to avoid to create holiday or expense report in wrong entity. 2018-06-25 10:09:01 +02:00
Laurent Destailleur
97976fbb43 Fix type of parameter must be string 2018-06-25 09:19:45 +02:00
Laurent Destailleur
bc71685258 Fix migration error 2018-06-25 08:30:37 +02:00
Laurent Destailleur
16f940b637 Prepare 7.0.4 2018-06-23 14:55:33 +02:00
Laurent Destailleur
edec89ef1e Prepare 7.0.3 2018-06-23 12:44:30 +02:00
Laurent Destailleur
ca04ffe420 Load lang 2018-06-22 17:07:49 +02:00
Laurent Destailleur
d458b383ad Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-22 15:29:44 +02:00
Laurent Destailleur
533c19cc2c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/accountancy/customer/list.php
	htdocs/core/lib/functions.lib.php
2018-06-22 15:29:26 +02:00
Laurent Destailleur
8414ceaddb Merge pull request #9000 from ATM-Marc/FIX_7.0_propal_contact_SHIPPING
FIX: proposal: missing contact type translation key
2018-06-22 15:16:56 +02:00
Laurent Destailleur
bd7277431f Merge pull request #8986 from atm-greg/fix_desired_stock
FIX bad result on fetch ProductStockEntrepot
2018-06-22 15:01:19 +02:00
Laurent Destailleur
dab264c641 Merge pull request #8994 from hregis/6.0_multicompany
Fix: to avoid deleting line breaks
2018-06-22 15:00:26 +02:00
Laurent Destailleur
cfc8e8b0ef Merge pull request #8972 from fmarcet/7.0
FIX Avoid converting into reduction twice and draft invoice
2018-06-22 14:35:26 +02:00
Laurent Destailleur
5bee324578 Update paiement.class.php 2018-06-22 14:34:59 +02:00
Laurent Destailleur
2d89d9634b Fix search on extrafields 2018-06-20 23:16:06 +02:00
Laurent Destailleur
714057d435 Fix stats on project. Must use assignement on project as filter. 2018-06-20 21:31:37 +02:00
Laurent Destailleur
9f2437fa04 Fix missing field 2018-06-20 17:59:01 +02:00
Marc de Lima Lucio
2fab4d7f76 FIX: proposal: missing contact type translation key 2018-06-20 14:56:24 +02:00
Regis Houssin
8fc2f7441c Fix: to avoid deleting line breaks 2018-06-20 09:06:16 +02:00
bgenere
403116898f Fix cherry-pick 2018-06-19 18:25:52 +02:00
atm-greg
df056980b5 fix bad result on fetch ProductStockEntrepot 2018-06-19 10:46:07 +02:00
Laurent Destailleur
31067b6250 FIX picto for type in product link in accountany list is wrong 2018-06-18 14:43:32 +02:00
Laurent Destailleur
ce5514bd68 Fix sql begin at wrong place 2018-06-18 14:37:16 +02:00
Laurent Destailleur
5d6d43d539 Merge pull request #8964 from atm-gauthier/6.0_accounting_entity
FIX : need to filter on aa.entity for same accounting accounts available in several entities
2018-06-18 14:30:55 +02:00
Laurent Destailleur
16fee19b6f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-18 13:20:11 +02:00
Laurent Destailleur
102f9aa84f FIX Problems in accountancy module when using multicompany module. 2018-06-18 13:19:46 +02:00
gauthier
fed61930d5 FIX : clause must not be there 2018-06-18 11:37:15 +02:00
atm-greg
2cdae2ec98 remove globalcard context 2018-06-18 11:30:38 +02:00
Laurent Destailleur
8c6f311aa6 Merge pull request #8974 from atm-ph/fix_7.0_addMoreActionsButtons_on_usercard
Fix missing hook on usercard (addMoreActionsButtons)
2018-06-18 11:18:12 +02:00
Laurent Destailleur
9cfc4a8d28 Merge pull request #8971 from atm-ph/fix_7.0_hook_getnomurltooltip
Fix can't add an attribute simply
2018-06-18 11:13:29 +02:00
Laurent Destailleur
95ee3325fc Part of fix of #8972 2018-06-18 11:11:07 +02:00
Laurent Destailleur
3c55e50bac Merge pull request #8966 from hregis/7.0_bug6
Fix: MEMBER_MODIFY trigger not called if i change only extrafields
2018-06-18 10:53:35 +02:00
Laurent Destailleur
95dfa1f7aa Merge pull request #8973 from altatof/FIX_HTML_DETECTION
Fix <br/> detection
2018-06-18 10:42:02 +02:00
Laurent Destailleur
63fb82931c Update functions.lib.php 2018-06-18 10:41:11 +02:00
atm-greg
72449ddef4 add hooks on stock replenish 2018-06-15 16:55:23 +02:00
atm-ph
3c80ce501b Fix missing hook on usercard (addMoreActionsButtons) 2018-06-15 16:05:50 +02:00
altatof
5d6cd381b9 Fix <br/> detection 2018-06-15 15:59:14 +02:00
Ferran Marcet
a21e138c70 Fix: Avoid converting into reduction twice and draft invoice 2018-06-15 11:19:04 +02:00
atm-ph
cb3704b67e Fix can't add an attribute simply 2018-06-15 11:02:46 +02:00
Regis Houssin
f9a86ba43f Fix: MEMBER_MODIFY trigger not called if i change only extrafields 2018-06-14 14:01:05 +02:00
Laurent Destailleur
e18a5d148c Merge pull request #8962 from ATM-Marc/FIX_7.0_supplierorder_reffourn
FIX: supplier order: product supplier ref not saved on addline
2018-06-14 12:00:36 +02:00
gauthier
e9d65ea751 FIX : need to filter on aa.entity for same accounting accounts available in several entities 2018-06-14 11:56:22 +02:00
Marc de Lima Lucio
1dec4c4320 FIX: supplier order: product supplier ref not saved on addline 2018-06-14 10:37:40 +02:00
Laurent Destailleur
4c2af6fc70 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/comm/propal/class/propal.class.php
	htdocs/core/class/html.form.class.php
2018-06-13 23:04:08 +02:00
Laurent Destailleur
09c92b7cc8 Merge pull request #8936 from atm-gauthier/6.0_fix_dont_remove_all_fourn_rights
FIX : If we enable 3 steps for supplier order approbation, we must no…
2018-06-13 21:36:01 +02:00
Laurent Destailleur
c586f2ecf7 Merge pull request #8957 from altatof/FIX_TOTAL_HT_DEVISE
FIX : pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
2018-06-13 21:20:42 +02:00
Laurent Destailleur
b5cd722eb1 Merge pull request #8917 from atm-gauthier/6.0_fix_apply_reduc
FIX : sometimes amounts are identical but php find them different.
2018-06-13 20:34:59 +02:00
Laurent Destailleur
76ee88f0b1 Merge pull request #8951 from fappels/7.0_fix_ErrorProductAlreadyExists
Fix Wrong error for duplicate ref if barcode enabled but not set.
2018-06-13 20:19:55 +02:00
Laurent Destailleur
eabb3e9cd3 Merge pull request #8930 from hregis/7.0_non-numeric
FIX wrong var name $search_month_lim
2018-06-13 20:09:13 +02:00
Laurent Destailleur
5fcfad5966 Merge pull request #8918 from atm-gauthier/6.0_fix_entity_select_prod_fourn_prices
FIX : entity test must be on product_fourn_price table and not product table
2018-06-13 20:08:25 +02:00
Laurent Destailleur
3f7f77ce95 Merge pull request #8923 from atm-florian/7.0
fix error display
2018-06-13 20:02:45 +02:00
Laurent Destailleur
fdc90da408 Update card.php 2018-06-13 20:02:38 +02:00
Laurent Destailleur
4c1bb9d28f Merge pull request #8948 from glu000/7.0
Fix #8946
2018-06-13 20:01:29 +02:00
Laurent Destailleur
f07408c6c3 Merge pull request #8929 from ATM-Marc/FIX_7.0_extrafields_intervention
FIX: intervention: extrafield error when calling insertExtrafields
2018-06-13 20:00:48 +02:00
altatof
d42f00bca9 FIX : pu_ht_devise was not converted to numeric so decimals were lost
when clculating total_ht_devise
2018-06-13 16:35:52 +02:00
fappels
a86c90fed1 Fix Wrong error for duplicate ref if barcode enabled but not set. 2018-06-12 16:38:42 +02:00
Günter Lukas
fcbf50467e Update user.class.php 2018-06-12 09:52:55 +02:00
Laurent Destailleur
31eeaf9914 Trans 2018-06-09 13:46:42 +02:00
gauthier
baf9d4a806 FIX : If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def. 2018-06-08 17:11:59 +02:00
Regis Houssin
7ce2ebf1a9 Fix: wrong var name 2018-06-07 16:25:47 +02:00
Marc de Lima Lucio
d69fae72c7 FIX: intervention: extrafield regression in commit b5f37301a5 2018-06-07 15:17:22 +02:00
florian HENRY
75305e095d Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0 2018-06-05 20:39:53 +02:00
florian HENRY
8031ef49f2 fix error return 2018-06-05 20:38:55 +02:00
Laurent Destailleur
8400614c3d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-05 18:22:47 +02:00
Laurent Destailleur
426eb178f2 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-06-05 18:22:28 +02:00
Laurent Destailleur
8785d69548 Do not load database handler 2018-06-05 18:21:56 +02:00
Laurent Destailleur
30b04c0d3d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/files.lib.php
2018-06-05 18:16:32 +02:00
Laurent Destailleur
4c21ad4e4e FIX: dol_delete_file must work in a context without db handler loaded
Conflicts:
	htdocs/core/lib/files.lib.php
2018-06-05 18:12:14 +02:00
Laurent Destailleur
9c32e49bd3 FIX: dol_delete_file must work in a context without db handler loaded 2018-06-05 18:05:33 +02:00
gauthier
45ecb0258b FIX : entity test must be on product_fourn_price table and not product table 2018-06-05 12:41:38 +02:00
gauthier
77e7932671 FIX : sometimes amounts are identical but php find them different. 2018-06-05 11:33:58 +02:00
Laurent Destailleur
3368e35502 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-04 14:09:34 +02:00
Laurent Destailleur
de2ffa1122 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/comm/action/listactions.php
2018-06-04 14:09:17 +02:00
Laurent Destailleur
840330deea Merge pull request #8905 from atm-greg/Add_supplier_proposals_in_suppliers_linkedObjects
Add supplier proposal in linkedObjects type select of the suppliers
2018-06-04 13:46:36 +02:00
Laurent Destailleur
7eaa2011ba Merge pull request #8900 from atm-florian/6.0_fixagenda
fix: when agenda is filterd with "todo" event, do not display "not applicable" event
2018-06-04 13:39:23 +02:00
atm-greg
0785029fe0 Add supplier proposal in linkedObjects type select of the suppliers 2018-05-31 10:46:50 +02:00
florian HENRY
b996237142 fix: when agenda is filterd with "todo" event, do not display "not
applicable" event
2018-05-30 13:37:17 +02:00
Laurent Destailleur
0412264418 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
2018-05-30 12:05:54 +02:00
Laurent Destailleur
60321aabd8 Fix regression 2018-05-30 11:59:23 +02:00
Laurent Destailleur
3733169120 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/recap-compta.php
	htdocs/fourn/class/fournisseur.commande.class.php
2018-05-30 11:09:53 +02:00
Laurent Destailleur
2df2071bae Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-30 11:05:12 +02:00
Laurent Destailleur
02da9b6992 FIX #8893 to get formatted price as substitution vars 2018-05-30 11:04:44 +02:00
Laurent Destailleur
28646a6b50 Merge pull request #8892 from ATM-Nicolas/fix_bad_email_substitution_key
FIX : Bad substitution key used for default send proposal email
2018-05-30 10:57:31 +02:00
Laurent Destailleur
7590df85e6 Merge pull request #8887 from atm-florian/6.0
add hook on balence pages
2018-05-30 10:47:59 +02:00
Laurent Destailleur
aa59c380ad Merge pull request #8886 from ATM-Nicolas/fix_supplier_order
FIX : Keep supplier proposal price for supplier order
2018-05-30 10:45:37 +02:00
Laurent Destailleur
e57ceab5de Update fournisseur.commande.class.php 2018-05-30 10:45:06 +02:00
ATM-Nicolas
48a315f6cd FIX : Bad substitution key used for default send proposal email 2018-05-30 10:14:34 +02:00
florian HENRY
b65b545e0f add hook on balence pages 2018-05-29 16:29:14 +02:00
Laurent Destailleur
b846f0f84c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-29 12:42:33 +02:00
Laurent Destailleur
2e2cc55350 Backport fix of file checker generation 2018-05-29 12:15:28 +02:00
Laurent Destailleur
95e3c5a4b1 Backport fix of file list check generation 2018-05-29 12:13:58 +02:00
ATM-Nicolas
6b0b975ffd FIX : Keep supplier proposal price for supplier order 2018-05-29 11:21:30 +02:00
Laurent Destailleur
86ec2b8c20 Merge pull request #8883 from ATM-Marc/FIX_7.0_commande_list
FIX: missing parenthesis
2018-05-29 10:58:52 +02:00
Laurent Destailleur
fe2795d7f9 Merge pull request #8867 from ptibogxiv/patch-28
Fix error in list.php
2018-05-29 10:45:13 +02:00
Laurent Destailleur
7b824e3c48 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-29 10:13:48 +02:00
Laurent Destailleur
7eea70ebc8 FIX #8858 #8860 Backport better compatibility fix 2018-05-29 10:13:34 +02:00
Laurent Destailleur
21dab0d8ee Merge pull request #8866 from frederic34/patch-12
Fix Travis for 7.0
2018-05-29 10:04:38 +02:00
Marc de Lima Lucio
ea9e833ab8 FIX: missing parenthesis 2018-05-28 15:03:24 +02:00
ptibogxiv
d032b6ecfb Fix error in list.php 2018-05-26 09:51:56 +02:00
Frédéric FRANCE
091fb81368 Update list.php 2018-05-26 09:49:13 +02:00
Laurent Destailleur
bf81b755f9 Fix state code for payment from indonesia 2018-05-25 16:21:13 +02:00
Laurent Destailleur
37dcfe4a46 FIX button to pay still visible when amount null used 2018-05-25 16:00:23 +02:00
Laurent Destailleur
943d1dce2e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-25 13:15:38 +02:00
Laurent Destailleur
8a64ee2297 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/commande/list.php
	htdocs/compta/facture/card.php
	htdocs/compta/facture/list.php
	htdocs/expedition/class/expedition.class.php
	htdocs/expedition/list.php
	htdocs/societe/card.php
2018-05-25 13:14:58 +02:00
Laurent Destailleur
1a1f0fbc62 Merge pull request #8839 from ATM-Nicolas/fix_shipping_fetch
FIX : Fetch shipping will now fetch project id
2018-05-25 11:46:06 +02:00
Laurent Destailleur
131ddd6984 Merge pull request #8827 from ATM-Marc/FIX_shipment_fk_project
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
2018-05-25 11:12:39 +02:00
Laurent Destailleur
b25c7e44d3 Merge pull request #8816 from atm-gauthier/6.0_fix_test_before_delete_invoice
FIX : test is_erasable() must be done before call function delete()
2018-05-25 11:05:20 +02:00
Laurent Destailleur
0a581e48d4 Update card.php 2018-05-25 11:04:04 +02:00
Laurent Destailleur
04586fab66 Merge pull request #8824 from ggg44473/7.0
Fix sql error accounting account
2018-05-25 10:41:16 +02:00
Laurent Destailleur
545133960e Merge pull request #8849 from atm-quentin/FIX_missing_filters_during_ordering
FIX missing filters during reordering
2018-05-25 10:15:20 +02:00
Laurent Destailleur
3816b18c27 Merge pull request #8856 from glu000/7.0
FIX: It's not possible to remove a contact which is assigned to an event #8852
2018-05-25 10:14:19 +02:00
Günter Lukas
1b237a75b9 Update card.php 2018-05-24 13:31:23 +02:00
atm-quentin
eb224e43a5 FIX missing filters during ordering 2018-05-24 10:41:24 +02:00
Laurent Destailleur
4967c678b8 Fix translation 2018-05-23 18:05:19 +02:00
Laurent Destailleur
3a06918b16 FIX Missing extrafields in export of stock or products 2018-05-23 18:00:27 +02:00
Laurent Destailleur
d1d8494666 FIX Missing extrafields in export 2018-05-23 17:48:18 +02:00
ATM-Nicolas
734ecbc9b5 FIX : Fetch shipping will now fetch project id 2018-05-23 09:47:29 +02:00
Laurent Destailleur
2a579b707a FIX javascript showempty error
FIX Contact tab not visible when using canvas
2018-05-22 19:43:28 +02:00
Laurent Destailleur
be21405d21 Fix missing error message 2018-05-22 19:24:56 +02:00
ATM-Nicolas
a455f60c42 FIX : Add calls to fetchComments function 2018-05-22 16:07:32 +02:00
ATM-Nicolas
d875553648 FIX : Remove fetchComments from project and task fetch function 2018-05-22 16:03:03 +02:00
ATM-Nicolas
f46d514586 Merge branch '7.0' of github.com:Dolibarr/dolibarr into fix_comments_on_tasks 2018-05-22 15:12:24 +02:00
Laurent Destailleur
7fce02e72e Fix phpunit test name 2018-05-21 23:43:26 +02:00
Laurent Destailleur
8951c4a7a5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-21 23:36:47 +02:00
Laurent Destailleur
afa57fd66d Fix syntax error 2018-05-21 23:33:20 +02:00
Laurent Destailleur
69141c9493 Fix PSR True->true and GETPOST file name for local checksum check 2018-05-21 22:24:27 +02:00
Laurent Destailleur
e5561ecdfb Remove useless files 2018-05-21 22:14:15 +02:00
Marc de Lima Lucio
c9222adf6d FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods 2018-05-21 16:22:06 +02:00
Philippe
4d72573484 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-05-21 14:44:22 +02:00
Sean Wang
8e397b772f Fix sql error 2018-05-21 14:19:41 +08:00
gauthier
4c3f9d6d5e FIX : test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url 2018-05-18 15:20:16 +02:00
BENKE Charlene
24d353c9a7 inversion of dateo and datee 2018-05-18 12:24:44 +02:00
Laurent Destailleur
7de812d2ed Merge pull request #8793 from atm-john/Fix_situation_discount_used
Fix creating next situation invoice if a discount was allready apply
2018-05-18 12:18:58 +02:00
Laurent Destailleur
b5f37b2876 Merge pull request #8811 from fappels/7.0_fix_product_vat_update_errorhandling
Fix product vat update error handling
2018-05-18 12:00:03 +02:00
Laurent Destailleur
508f6c1a89 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-18 11:53:09 +02:00
Laurent Destailleur
6d0306f75a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/html.formfile.class.php
2018-05-18 11:52:48 +02:00
Laurent Destailleur
5f8346f854 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-05-18 11:48:30 +02:00
Laurent Destailleur
492b1e7169 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-05-18 11:48:08 +02:00
Laurent Destailleur
75f5cdbc0f Merge pull request #8810 from simnandez/7.0
Fix: extrafiels is not passing orders to invoice
2018-05-18 11:47:44 +02:00
Laurent Destailleur
f2cfb928e8 Merge pull request #8809 from simnandez/5.0
Fix: extrafiels is not passing orders to invoice
2018-05-18 11:47:27 +02:00
Laurent Destailleur
24281028b7 Merge pull request #8807 from inoveaconseil/patch-2
Fix missing params for commonGenerateDocument
2018-05-18 11:43:11 +02:00
Laurent Destailleur
fa7f81c828 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-18 11:38:26 +02:00
Laurent Destailleur
a450f99e8a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/filefunc.inc.php
2018-05-18 11:38:11 +02:00
Laurent Destailleur
162d271884 Merge pull request #8803 from atm-alexis/7.0_fix_task_contact_card_withoutproject
FIX 7.0 task contact card without withproject parameters
2018-05-18 11:29:11 +02:00
Laurent Destailleur
71f8971a8e Merge pull request #8794 from ATM-Nicolas/fix_select_user
FIX : Select user on add time spent form
2018-05-18 11:27:05 +02:00
Laurent Destailleur
078ea2ce9b Merge pull request #8790 from aspangaro/7.0-f1
Fix : Double WHERE on admin/journal_list.php
2018-05-18 11:20:05 +02:00
Laurent Destailleur
2e9f5d1c94 Merge pull request #8798 from atm-florian/6.0
fix SQL and add hook
2018-05-18 11:18:10 +02:00
Laurent Destailleur
79bbeb05ae Add missing phpunit tests 2018-05-18 11:17:33 +02:00
Laurent Destailleur
e2369dea29 FIX #8722 2018-05-18 11:17:21 +02:00
John
3dd11e1eaf Fix discount id 2018-05-18 11:02:04 +02:00
Laurent Destailleur
80bce6b62d Add phpunit for accountingaccount 2018-05-18 09:25:59 +02:00
Juanjo Menent
dd259043cd Fix: Cashdesk does not apply multi-price or price per customer 2018-05-18 09:20:18 +02:00
Laurent Destailleur
26e10caa7d FIX #8813 2018-05-18 09:15:18 +02:00
fappels
90d2ccc79c Fix product vat update error handling
Product vat update does not show update error if update result negative.
2018-05-17 21:29:15 +02:00
Juanjo Menent
0aa8c6f498 Fix: extrafiels is not passing orders to invoice 2018-05-17 19:05:25 +02:00
Juanjo Menent
dc7a1610e7 Fix: extrafiels is not passing orders to invoice 2018-05-17 18:56:01 +02:00
Inovea Conseil
5804d1d4a3 Fix missing params for commonGenerateDocument
ADD param moreparams for compatibility with commonGenerateDocument
2018-05-17 10:16:44 +02:00
alexis Algoud
5c727c077b fix task contact card without withproject parameters 2018-05-16 16:34:19 +02:00
florian HENRY
630e38072b fix SQL and add hook 2018-05-15 17:02:54 +02:00
Alexandre SPANGARO
88bc2dd416 Correct insert 2018-05-14 20:59:38 +02:00
Laurent Destailleur
a46362a71f Prepare 7.0.3 2018-05-14 15:17:10 +02:00
Laurent Destailleur
c8e758411d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-14 15:16:33 +02:00
Laurent Destailleur
9552a914d8 FIX link for projets not linked to a thirdparties 2018-05-14 15:16:19 +02:00
ATM-Nicolas
ca09fddfb3 FIX : Select user on add time spent form 2018-05-14 15:16:07 +02:00
John
b42c87256c Fix_situation_discount_used 2018-05-14 14:55:33 +02:00
Alexandre SPANGARO
2f1ac6fad8 Fix : Double WHERE on admin/journal_list.php 2018-05-13 20:35:07 +02:00
Laurent Destailleur
e1585a4d68 Merge pull request #8763 from fmarcet/7.0
Fix: Bug on invoice status list on left menu
2018-05-10 11:54:34 +02:00
Laurent Destailleur
842c6168a2 FIX #8762 2018-05-10 11:50:35 +02:00
Ferran Marcet
d1fd39936c Fix: Bug on invoice status list on left menu 2018-05-08 09:04:04 +02:00
Laurent Destailleur
20c50e809d Start 6.0.8 2018-05-06 10:43:40 +02:00
ATM-Nicolas
3d179fb7d3 FIX : Fetch function will fetch comments 2018-04-24 09:17:03 +02:00
Philippe
cbf12b779d Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-02-21 12:50:23 +01:00
Philippe
7406d3c7ee Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-11 15:32:52 +01:00
Philippe
bcbbcc1c66 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-11 09:13:46 +01:00
Philippe
e66847d5c3 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-05 14:47:04 +01:00
Philippe
dd8ef47a25 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-12-18 15:37:46 +01:00
Philippe
2f2b0630e2 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-11-23 21:52:11 +01:00
Philippe
26e3593c98 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-10-25 14:15:59 +02: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
Philippe
c88f5c560c Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-09-06 15:30:45 +02:00
Philippe
04466651d6 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-07-27 14:28:28 +02:00
363 changed files with 3926 additions and 2766 deletions

1
.gitignore vendored
View File

@@ -12,6 +12,7 @@ dolibarr_install.log
upgrade.log
doxygen_warnings.log
/.project
/.vscode
.DS_Store
.idea
*.iml

10
.stickler.yml Normal file
View File

@@ -0,0 +1,10 @@
---
linters:
phpcs:
standard: 'dev/setup/codesniffer/ruleset.xml'
extensions: 'php'
tab_width: 4
fixer: true
fixers:
enable: true

View File

@@ -38,7 +38,6 @@ php:
- '7.0'
- '7.1'
- '7.2'
#- hhvm only with dist: trusty
- nightly
env:
@@ -60,10 +59,19 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: nightly
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.4'
env: DB=mariadb
- php: '5.5'
env: DB=mariadb
- php: '5.6'
env: DB=mariadb
- php: '7.0'
env: DB=mariadb
- php: '7.1'
env: DB=mariadb
- php: '5.4'
env: DB=postgresql
- php: '5.5'
@@ -74,8 +82,6 @@ matrix:
env: DB=postgresql
- php: '7.1'
env: DB=postgresql
- php: hhvm
env: DB=postgresql
- php: nightly
env: DB=postgresql

158
ChangeLog
View File

@@ -3,6 +3,138 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 7.0.5 compared to 7.0.4 *****
FIX: #3234
FIX: #6580
FIX: #8741
FIX: #9934
FIX: avoid Class 'AdherentType' not found
FIX: Can't create a thirdparty from member if customer code is mandatory.
FIX: Can't generate invoice pdf
FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account
FIX: Error generating ODT when option to use contact on doc on
FIX: Error reported when creation of thirdparty from member fails
FIX: filter on product category doesn't work
FIX: form actions: select_type_actions could be too small + bad init
FIX: fourn payment modes musn't be available on customer docs
FIX: Function updatePrice with wrong parameters
FIX: If we change customer/supplier rule we can't edit old thirdparty.
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: Lines are not inserted correctly if VAT have code
FIX: OppStatusShort doesn't exists
FIX: pdf typhon: order reference duplicate
FIX: propal pdf: missing parenthesis for customs code
FIX: Same on customer card
FIX: same on lines
FIX: Select first mail model by default
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
FIX: task time screen: last fix was overkill
FIX: task time screen: prevent users with access to all project from assigning to tasks they're not allowed to do
FIX: use discount with multicurrency
FIX: Variable name
FIX: We want to be able to send PDF of paid invoices
FIX: When delete a product, llx_product_association rows are not deleted
FIX: wrong occurence number of contract on contact card, we must only count externals
***** ChangeLog for 7.0.4 compared to 7.0.3 *****
FIX: #8984 button create expense report
FIX: #9032
FIX: #9161
FIX: #9328
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
FIX: Add calls to fetchComments function
FIX: better compatibility with multicompany
FIX: case when we valid form with keyboard
FIX: character making error on bill list
FIX: check !empty exclude select element
FIX: combo into popup become crazy with IE10
FIX: combo of stock in popup are crazy in IE
FIX: Deletion of files in migration
FIX: exclude element of the select
FIX: extrafieldkey
FIX: Fetch function will fetch comments
FIX: Fetch task will now fetch comments
FIX: filter supplier invoice list by societe name.
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: Force stripe api version to avoid trouble if we update stripe api
FIX: getEntity project and not projet
FIX: Get templates in a forced language
FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281)
FIX: Injection
FIX: invoice stats: situation invoices were not counted
FIX: keep context filter on contact list on change column displayed
FIX: Keep same project when creating shipping from order
FIX: langs fr
FIX: Lose filter on payment type or category after a sort on invoice list
FIX: Missing behavior
FIX: missing hook to edit sql
FIX: multicompany compatibility !
FIX: need to filter on current entity on replenish
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
FIX: Pagination on related item pages
FIX: Pagination on withdraw request list
FIX: PDF address: handle when contact thirdparty different from document thirdparty
FIX: PHP warning, undefined index notnull
FIX: Product marge tabs on product card
FIX: Product margin tab and credit note
FIX: propal: correctly preset project when creating with origin/originid
FIX: remain to pay for credit note was wrong on invoice list
FIX: remove debug
FIX: Remove fetchComments from project and task fetch function
FIX: remove rowid for multicompany compatibility
FIX: Search on Ref project on order list
FIX: search on ref project on propal list
FIX: showOptionals: column mismatches
FIX: SQL Injections reported by mu shcor (ADLab of Venustech)
FIX: stock replenish with multientity
FIX: table llx_chargessociales doesn't exists
FIX: we must see number of all shared projects
FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
FIX: wrong function name
FIX: Wrong position of firstname lastname
FIX: wrong value for module part and return access denied
FIX: Wrong variable and trigger name
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
FIX: 7.0 task contact card without withproject parameters
FIX: #8722
FIX: #8762
FIX: #8813
FIX: #8858 #8860 Backport better compatibility fix
FIX: #8893 to get formatted price as substitution vars
FIX: Avoid converting into reduction twice and draft invoice
FIX: bad result on fetch ProductStockEntrepot
FIX: Bad substitution key used for default send proposal email
FIX: button to pay still visible when amount null used
FIX: clause must not be there
FIX: Contact tab not visible when using canvas
FIX: dol_delete_file must work in a context without db handler loaded
FIX: entity test must be on product_fourn_price table and not product table
FIX: Fetch shipping will now fetch project id
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
FIX: intervention: extrafield error when calling insertExtrafields
FIX: It's not possible to remove a contact which is assigned to an event #8852
FIX: javascript showempty error
FIX: Keep supplier proposal price for supplier order
FIX: link for projets not linked to a thirdparties
FIX: Missing extrafields in export of stock or products
FIX: missing filters during ordering
FIX: missing filters during reordering
FIX: missing parenthesis
FIX: need to filter on aa.entity for same accounting accounts available in several entities
FIX: picto for type in product link in accountany list is wrong
FIX: Problems in accountancy module when using multicompany module.
FIX: proposal: missing contact type translation key
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
FIX: Select user on add time spent form
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
FIX: sometimes amounts are identical but php find them different.
FIX: supplier order: product supplier ref not saved on addline
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: wrong var name $search_month_lim
***** ChangeLog for 7.0.2 compared to 7.0.1 *****
FIX: #8023
FIX: #8259 can't update contact birthday with REST API
@@ -447,6 +579,32 @@ Following changes may create regressions for some external modules, but were nec
multicompany module to a version that support Dolibarr v7, everything should work as expected.
***** ChangeLog for 6.0.8 compared to 6.0.7 *****
FIX: #8762
FIX: #9032
FIX: case when we valid form with keyboard
FIX: clause must not be there
FIX: dol_delete_file must work in a context without db handler loaded
FIX: entity test must be on product_fourn_price table and not product table
FIX: Fetch shipping will now fetch project id
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: getEntity project and not projet
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
FIX: Keep supplier proposal price for supplier order
FIX: langs fr
FIX: missing filters during reordering
FIX: need to filter on aa.entity for same accounting accounts available in several entities
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
FIX: PDF address: handle when contact thirdparty different from document thirdparty
FIX: propal: correctly preset project when creating with origin/originid
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
FIX: remain to pay for credit note was wrong on invoice list
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
FIX: showOptionals: column mismatches
FIX: sometimes amounts are identical but php find them different.
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: we must see number of all shared projects
FIX: wrong var name
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
FIX: #8023

View File

@@ -1,6 +1,6 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).

View File

@@ -22,6 +22,8 @@
* \brief This script create a xml checksum file
*/
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';
@@ -97,6 +99,7 @@ else
}
print "Release : ".$release."\n";
print "Working on files into : ".DOL_DOCUMENT_ROOT."\n";
print "Include custom in signature : ".$includecustom."\n";
print "Include constants in signature : ";
foreach ($includeconstants as $countrycode => $tmp)

View File

@@ -25,19 +25,19 @@
<rule ref="Generic.CodeAnalysis.EmptyStatement" />
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCATCH">
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedCatch">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedFOREACH">
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedForeach">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIF">
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedIf">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSE">
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElse">
<severity>0</severity>
</rule>
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedELSEIF">
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedElseif">
<severity>0</severity>
</rule>

View File

@@ -276,7 +276,7 @@ if ($resql)
if (! empty($arrayfields['aa.pcg_type']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgtype" value="' . $search_pcgtype . '"></td>';
if (! empty($arrayfields['aa.pcg_subtype']['checked'])) print '<td class="liste_titre"><input type="text" class="flat" size="6" name="search_pcgsubtype" value="' . $search_pcgsubtype . '"></td>';
if (! empty($arrayfields['aa.active']['checked'])) print '<td class="liste_titre">&nbsp;</td>';
print '<td align="right" colspan="2" class="liste_titre">';
print '<td align="right" class="liste_titre">';
$searchpicto=$form->showFilterAndCheckAddButtons($massactionbutton?1:0, 'checkforselect', 1);
print $searchpicto;
print '</td>';

View File

@@ -30,9 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
$langs->load("admin");
$langs->load("compta");
$langs->load("accountancy");
$langs->loadLangs(array("admin","compta","accountancy"));
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$confirm=GETPOST('confirm','alpha');
@@ -86,7 +84,7 @@ $tablib[35]= "DictionaryAccountancyJournal";
// Requests to extract data
$tabsql=array();
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity;
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a";
// Criteria to sort dictionaries
$tabsqlsort=array();
@@ -102,7 +100,7 @@ $tabfieldvalue[35]= "code,label,nature";
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array();
$tabfieldinsert[35]= "code,label,nature,entity";
$tabfieldinsert[35]= "code,label,nature";
// Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on

View File

@@ -651,8 +651,8 @@ if ($action == 'create')
print "</tr>\n";
}
$total_debit = price2num($total_debit);
$total_credit = price2num($total_credit);
$total_debit = price2num($total_debit, 'MT');
$total_credit = price2num($total_credit, 'MT');
if ($total_debit != $total_credit)
{

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Jamal Elbaz <jamelbaz@gmail.pro>
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -378,7 +379,7 @@ class AccountancyCategory
* Return list of personalized groups that are active
*
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
* @return array Array of groups
* @return array|int Array of groups or -1 if error
*/
public function getCats($categorytype=-1)
{
@@ -491,9 +492,9 @@ class AccountancyCategory
* Get all accounting account of a group.
* You must choose between first parameter (personalized group) or the second (free criteria filter)
*
* @param int $cat_id Id if personalized accounting group/category
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
* @return array Array of accounting accounts
* @param int $cat_id Id if personalized accounting group/category
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
* @return array|int Array of accounting accounts or -1 if error
*/
public function getCptsCat($cat_id, $predefinedgroupwhere='')
{

View File

@@ -84,7 +84,8 @@ class AccountingAccount extends CommonObject
* @param int $limittocurrentchart 1=Do not load record if it is into another accounting system
* @return int <0 if KO, 0 if not found, Id of record if OK and found
*/
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) {
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0)
{
global $conf;
if ($rowid || $account_number) {
@@ -96,10 +97,10 @@ class AccountingAccount extends CommonObject
if ($rowid) {
$sql .= " a.rowid = '" . $rowid . "'";
} elseif ($account_number) {
$sql .= " a.account_number = '" . $account_number . "'";
$sql .= " a.account_number = '" . $this->db->escape($account_number) . "'";
}
if (! empty($limittocurrentchart)) {
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')';
}
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
@@ -201,9 +202,9 @@ class AccountingAccount extends CommonObject
$sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'");
$sql .= ", " . (empty($this->pcg_subtype) ? 'NULL' : "'" . $this->db->escape($this->pcg_subtype) . "'");
$sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'");
$sql .= ", " . (empty($this->account_parent) ? 'NULL' : "'" . $this->db->escape($this->account_parent) . "'");
$sql .= ", " . (empty($this->account_parent) ? '0' : "'" . $this->db->escape($this->account_parent) . "'");
$sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'");
$sql .= ", " . (empty($this->account_category) ? 'NULL' : "'" . $this->db->escape($this->account_category) . "'");
$sql .= ", " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
$sql .= ", " . $user->id;
$sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active));
$sql .= ")";
@@ -274,7 +275,7 @@ class AccountingAccount extends CommonObject
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
$sql .= " , account_parent = '" . $this->db->escape($this->account_parent) . "'";
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "null");
$sql .= " , fk_accounting_category = '" . $this->db->escape($this->account_category) . "'";
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
$sql .= " , fk_user_modif = " . $user->id;
$sql .= " , active = " . $this->active;
$sql .= " WHERE rowid = " . $this->id;

View File

@@ -195,7 +195,7 @@ class BookKeeping extends CommonObject
// First check if line not yet already in bookkeeping.
// Note that we must include doc_type - fk_doc - numero_compte - label to be sure to have unicity of line (we may have several lines
// with same doc_type, fk_odc, numero_compte for 1 invoice line when using localtaxes with same account)
// with same doc_type, fk_doc, numero_compte for 1 invoice line when using localtaxes with same account)
// WARNING: This is not reliable, label may have been modified. This is just a small protection.
// The page to make journalization make the test on couple doc_type - fk_doc only.
$sql = "SELECT count(*) as nb";
@@ -1618,11 +1618,11 @@ class BookKeeping extends CommonObject
$error++;
}
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'(doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num)';
$sql .= 'SELECT doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' doc_ref, fk_doc, fk_docdet, entity, thirdparty_code, subledger_account, subledger_label,';
$sql .= ' numero_compte, label_compte, label_operation, debit, credit,';
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, '.$next_piecenum.'';
$sql .= ' FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;

View File

@@ -70,38 +70,53 @@ $year_current = $year_start;
$action = GETPOST('action','aZ09');
/*
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
@@ -131,26 +146,6 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilCustomer") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';

View File

@@ -116,10 +116,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
$db->begin();
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
@@ -174,13 +174,13 @@ print '<script type="text/javascript">
* Customer Invoice lines
*/
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.datef, f.ref_client,";
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql .= " fd.situation_percent, co.label as country, s.tva_intra";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
@@ -338,8 +338,8 @@ if ($result) {
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->product_type;
$product_static->label = $objp->product_label;
$product_static->type = $objp->line_type;
print '<tr class="oddeven">';

View File

@@ -219,9 +219,9 @@ $sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND l.product_type <= 2";
// Add search filter like

View File

@@ -72,33 +72,48 @@ $action = GETPOST('action','aZ09');
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'expensereport WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "expensereport_det.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd, " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
$sql1 .= " AND erd.fk_code_ventilation = 0";
}
@@ -128,26 +143,6 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("ExpenseReportsVentilation") . "&nbsp;" . $textprevyear . "&nbsp;" . $langs->trans("Year") . "&nbsp;" . $year_start . "&nbsp;" . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilExpenseReport") . '<br>';
print $langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';

View File

@@ -109,10 +109,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
$db->begin();
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';

View File

@@ -200,7 +200,7 @@ $sql.= " aa.rowid as aarowid";
$sql.= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
// Add search filter like
if (strlen(trim($search_expensereport))) {

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -60,6 +61,7 @@ $langs->load("loans");
llxHeader('', $langs->trans("AccountancyArea"));
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy');
dol_fiche_head();
$step = 0;
@@ -175,6 +177,7 @@ else
{
print $langs->trans("Module10Desc")."<br>\n";
}
dol_fiche_end();
llxFooter();
$db->close();

View File

@@ -840,7 +840,7 @@ if (empty($action) || $action == 'view') {
// Test that setup is complete
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0';
$resql = $db->query($sql);
if ($resql)
{

View File

@@ -59,11 +59,15 @@ $now = dol_now();
if ($user->societe_id > 0)
accessforbidden();
$hookmanager->initHooks(array('sellsjournal'));
$parameters=array();
/*
* Actions
*/
$reshook=$hookmanager->executeHooks('doActions',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks
// Get informations of journal
$accountingjournalstatic = new AccountingJournal($db);
$accountingjournalstatic->fetch($id_journal);

View File

@@ -73,33 +73,48 @@ $action = GETPOST('action','aZ09');
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture_fourn WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
@@ -129,26 +144,6 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("SuppliersVentilation") . " " . $textprevyear . "&nbsp;" . $langs->trans("Year") . "&nbsp;" . $year_start . "&nbsp;" . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilSupplier") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';

View File

@@ -117,10 +117,10 @@ if (is_array($changeaccount) && count($changeaccount) > 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
$db->begin();
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
@@ -174,17 +174,16 @@ print '<script type="text/javascript">
* Supplier Invoice lines
*/
$sql = "SELECT f.rowid as facid, f.ref as facnumber, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql.= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql.= " aa.label, aa.account_number, ";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql.= " AND aa.rowid = l.fk_code_ventilation";
if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1);
}
@@ -339,8 +338,8 @@ if ($result) {
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->type;
$product_static->label = $objp->product_label;
$product_static->type = $objp->line_type;
print '<tr class="oddeven">';

View File

@@ -220,7 +220,7 @@ $sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND l.product_type <= 2";
// Add search filter like

View File

@@ -212,7 +212,7 @@ if (empty($reshook))
}
else
{
setEventMessages($object->errors, $object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}
@@ -446,7 +446,7 @@ if (empty($reshook))
}
$typeid=GETPOST("typeid",'int');
$civility_id=GETPOST("civility_id",'int');
$civility_id=GETPOST("civility_id",'alpha');
$lastname=GETPOST("lastname",'alpha');
$firstname=GETPOST("firstname",'alpha');
$societe=GETPOST("societe",'alpha');

View File

@@ -213,23 +213,25 @@ class Adherent extends CommonObject
// Substitutions
$substitutionarray=array(
'__CIVILITY__'=>$this->getCivilityLabel(),
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'__ID__'=>$this->id,
'__MEMBER_ID__'=>$this->id,
'__CIVILITY__'=>$this->getCivilityLabel(),
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):($this->firstname?$this->firstname:''),
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):($this->lastname?$this->lastname:''),
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
'__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
'__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
'__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
'__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):($this->societe?$this->societe:''),
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):($this->address?$this->address:''),
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):($this->zip?$this->zip:''),
'__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):($this->town?$this->town:''),
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):($this->country?$this->country:''),
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):($this->email?$this->email:''),
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):($birthday?$birthday:''),
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):($this->photo?$this->photo:''),
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):($this->login?$this->login:''),
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):($this->pass?$this->pass:''),
'__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):($this->phone?$this->phone:''),
'__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):($this->phone_perso?$this->phone_perso:''),
'__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):($this->phone_mobile?$this->phone_mobile:'')
);
complete_substitutions_array($substitutionarray, $langs, $this);
@@ -582,13 +584,14 @@ class Adherent extends CommonObject
$lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id;
$lthirdparty->country_id=$this->country_id;
//$lthirdparty->phone_mobile=$this->phone_mobile;
$result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates
$result=$lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates
if ($result < 0)
{
$this->error=$lthirdparty->error;
$this->errors=$lthirdparty->errors;
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
$error++;
}
@@ -599,14 +602,14 @@ class Adherent extends CommonObject
$error++;
}
}
}
if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('MEMBER_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}
if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('MEMBER_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}
if (! $error)

View File

@@ -75,7 +75,7 @@ if ($action == 'dolibarr2ldap')
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
}
else {
setEventMessages($ldap->errors, $ldap->error, 'errors');
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
}

View File

@@ -120,7 +120,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{
// Creation user
$company = new Societe($db);
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'));
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'), GETPOST('customercode', 'alpha'));
if ($result < 0)
{
@@ -558,7 +558,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if (! $error)
{
// Send confirmation Email
if ($object->email && $_POST["sendmail"])
if ($object->email && $_POST["sendmail"]) // $object is 'Adherent'
{
$subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT);
$texttosend=$object->makeSubstitution($adht->getMailOnSubscription());
@@ -1011,6 +1011,15 @@ if ($rowid > 0)
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
);
// If customer code was forced to "required", we ask it at creation to avoid error later
if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED))
{
$tmpcompany = new Societe($db);
$tmpcompany->name=$companyname;
$customercode = $tmpcompany->get_codeclient($tmpcompany,0);
$formquestion[]=array('label' => $langs->trans("CustomerCode"), 'type' => 'text', 'name' => 'customercode', 'value' => $customercode, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"');
}
// @TODO Add other extrafields mandatory for thirdparty creation
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
}

View File

@@ -194,7 +194,7 @@ print '</tr>'."\n";
// AGENDA REMINDER EMAIL
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
if ($conf->global->MAIN_FEATURES_LEVEL == 2)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_EMAIL', $langs->transnoentities("Module2300Name")).'</td>'."\n";
@@ -211,7 +211,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0)
}
// AGENDA REMINDER BROWSER
if ($conf->global->MAIN_FEATURES_LEVEL > 0)
if ($conf->global->MAIN_FEATURES_LEVEL == 2)
{
print '<tr class="oddeven">'."\n";
print '<td>'.$langs->trans('AGENDA_REMINDER_BROWSER').'</td>'."\n";

View File

@@ -70,18 +70,8 @@ else if ($action == 'update')
$res = dolibarr_set_const($db, "PRODUIT_DEFAULT_BARCODE_TYPE", $coder_id,'chaine',0,'',$conf->entity);
$coder_id = GETPOST('GENBARCODE_BARCODETYPE_THIRDPARTY','alpha');
$res = dolibarr_set_const($db, "GENBARCODE_BARCODETYPE_THIRDPARTY", $coder_id,'chaine',0,'',$conf->entity);
}
else if ($action == 'updateengine')
{
// TODO Update engines.
}
if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
{
if (! $res > 0) $error++;
if (! $error)
if ($res > 0)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
@@ -90,6 +80,42 @@ if ($action && $action != 'setcoder' && $action != 'setModuleOptions')
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
else if ($action == 'updateengine')
{
$sql = "SELECT rowid, coder";
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
$sql.= " WHERE entity = ".$conf->entity;
$sql.= " ORDER BY code";
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
if (GETPOST('coder'.$obj->rowid, 'alpha'))
{
$coder = GETPOST('coder'.$obj->rowid,'alpha');
$code_id = $obj->rowid;
$sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type";
$sqlp.= " SET coder = '" . $coder."'";
$sqlp.= " WHERE rowid = ". $code_id;
$sqlp.= " AND entity = ".$conf->entity;
$upsql=$db->query($sqlp);
if (! $upsql) dol_print_error($db);
}
$i++;
}
}
}
/*
* View
@@ -162,9 +188,12 @@ $var=true;
print '<br>';
print load_fiche_titre($langs->trans("BarcodeEncodeModule"),'','');
//print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
//print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
//print "<input type=\"hidden\" name=\"action\" value=\"updateengine\">";
if (empty($conf->use_javascript_ajax))
{
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" id="form_engine">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateengine">';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@@ -260,10 +289,9 @@ print "</table>\n";
if (empty($conf->use_javascript_ajax))
{
// TODO Implement code behind action updateengine
//print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"></div>';
print '<div class="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"></div>';
print '</form>';
}
//print '</form>';
print "<br>";

View File

@@ -36,11 +36,11 @@ $rowid=GETPOST('rowid','int');
$entity=GETPOST('entity','int');
$action=GETPOST('action','alpha');
$update=GETPOST('update','alpha');
$delete=GETPOST('delete'); // Do not use alpha here
$delete=GETPOST('delete','none'); // Do not use alpha here
$debug=GETPOST('debug','int');
$consts=GETPOST('const','array');
$constname=GETPOST('constname','alpha');
$constvalue=GETPOST('constvalue');
$constvalue=GETPOST('constvalue','none'); // We shoul dbe able to send everything here
$constnote=GETPOST('constnote','alpha');
@@ -247,7 +247,7 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($result);
print "\n";

View File

@@ -38,7 +38,7 @@ if (!$user->admin) accessforbidden();
$id=GETPOST('rowid','int');
$action=GETPOST('action','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');

View File

@@ -629,7 +629,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
)
)

View File

@@ -315,8 +315,8 @@ if ($action == 'edit') // Edit
// Firstname/Name
print '<tr><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';

View File

@@ -89,7 +89,7 @@ if ($action == 'update')
if ($result > 0)
{
$menu->titre=GETPOST('titre', 'alpha');
$menu->leftmenu=GETPOST('leftmenu', 'alpha');
$menu->leftmenu=GETPOST('leftmenu', 'aZ09');
$menu->url=GETPOST('url','alpha');
$menu->langs=GETPOST('langs','alpha');
$menu->position=GETPOST('position','int');

View File

@@ -108,9 +108,7 @@ elseif ($action == 'update_currency')
{
$error = 0;
$submit = GETPOST('submit', 'alpha');
if ($submit == $langs->trans('Modify'))
if (GETPOST('updatecurrency', 'alpha'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
$rate = price2num(GETPOST('rate', 'alpha'));
@@ -129,7 +127,7 @@ elseif ($action == 'update_currency')
}
}
}
elseif ($submit == $langs->trans('Delete'))
elseif (GETPOST('deletecurrency', 'alpha'))
{
$fk_multicurrency = GETPOST('fk_multicurrency', 'int');
$currency = new MultiCurrency($db);
@@ -357,8 +355,8 @@ foreach ($TCurrency as &$currency)
print '<input type="hidden" name="fk_multicurrency" value="'.$currency->id.'">';
print '1 '.$conf->currency.' = ';
print '<input type="text" name="rate" value="'.($currency->rate->rate ? $currency->rate->rate : '').'" size="13" />&nbsp;'.$currency->code.'&nbsp;';
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Modify").'">&nbsp;';
print '<input type="submit" name="submit" class="button" value="'.$langs->trans("Delete").'">';
print '<input type="submit" name="updatecurrency" class="button" value="'.$langs->trans("Modify").'">&nbsp;';
print '<input type="submit" name="deletecurrency" class="button" value="'.$langs->trans("Delete").'">';
print '</form>';
print '</td></tr>';

View File

@@ -179,24 +179,30 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
// TODO We add/delete permission here until permission can have a condition on a global var
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
$newmodule=new modFournisseur($db);
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
// Insert
$newmodule->insert_permissions(1);
}
else
{
// Remove all rights with Permission1190
$newmodule->delete_permissions();
// Add all right without Permission1190
$newmodule->insert_permissions(1);
}
}

View File

@@ -157,7 +157,7 @@ $i=0;
foreach($_SESSION as $key => $val)
{
if ($i > 0) print ', ';
print $key.' => '.$val;
print $key.' => '.dol_escape_htmltag($val);
$i++;
}
print '</td></tr>'."\n";

View File

@@ -72,7 +72,7 @@ print '<br>';
$file_list = array('missing' => array(), 'updated' => array());
// Local file to compare to
$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
$xmlshortfile = GETPOST('xmlshortfile','alpha')?GETPOST('xmlshortfile','alpha'):'/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)?'':$conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml';
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
// Remote file to compare to
$xmlremote = GETPOST('xmlremote');
@@ -83,8 +83,8 @@ if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signa
// Test if remote test is ok
$enableremotecheck = True;
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
$enableremotecheck = true;
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=false;
$enableremotecheck = true;
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';

View File

@@ -39,7 +39,7 @@ $transkey=GETPOST('transkey','alpha');
$transvalue=GETPOST('transvalue','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'overwrite';
$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'overwrite';
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');

View File

@@ -65,6 +65,8 @@ class DolibarrApi
$this->r->setBaseUrls($urlwithouturlroot, $urlwithouturlrootautodetect);
$this->r->setAPIVersion(1);
//$this->r->setSupportedFormats('json');
//$this->r->setSupportedFormats('jsonFormat');
}
/**
@@ -249,7 +251,7 @@ class DolibarrApi
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
$tmp=$sqlfilters;
$ok=0;
$i=0; $nb=count($tmp);
$i=0; $nb=strlen($tmp);
$counter=0;
while ($i < $nb)
{

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -150,7 +151,8 @@ switch($action)
$obj_facturation->id($ret['rowid']);
$obj_facturation->ref($ret['ref']);
$obj_facturation->stock($ret['reel']);
$obj_facturation->prix($ret['price']);
//$obj_facturation->prix($ret['price']);
$obj_facturation->prix($pu_ht);
$vatrate = $tva_tx;

View File

@@ -417,6 +417,7 @@ if ($action == 'update')
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$socpeopleassigned = GETPOST("socpeopleassigned",'array');
$object->socpeopleassigned = array();
foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid);
$object->contactid = GETPOST("contactid",'int');
$object->fk_project = GETPOST("projectid",'int');
@@ -1244,8 +1245,13 @@ if ($id > 0)
if (! empty($object->fk_element) && ! empty($object->elementtype))
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
print '<td>'.dolGetElementUrl($object->fk_element,$object->elementtype,1).'</td></tr>';
print '<tr>';
print '<td>'.$langs->trans("LinkedObject").'</td>';
print '<td>'.dolGetElementUrl($object->fk_element,$object->elementtype,1);
print '<input type="hidden" name="fk_element" value="'.$object->fk_element.'">';
print '<input type="hidden" name="elementtype" value="'.$object->elementtype.'">';
print '</td>';
print '</tr>';
}
// Description
@@ -1605,7 +1611,7 @@ if ($id > 0)
$var=true;
print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
print $formfile->showdocuments('actions',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@@ -894,7 +894,7 @@ class ActionComm extends CommonObject
$val=array('id'=>$val);
}
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory'])?'0':$val['mandatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
$resql = $this->db->query($sql);
if (! $resql)

View File

@@ -541,8 +541,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{
@@ -1001,6 +1001,11 @@ if (! empty($hookmanager->resArray['eventarray'])) {
}
}
// Sort events
foreach($eventarray as $keyDate => &$dateeventarray)
{
usort($dateeventarray, 'sort_events_by_date');
}
$maxnbofchar=0;
@@ -1260,7 +1265,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
$nextindextouse=count($colorindexused); // At first run this is 0, so first user has 0, next 1, ...
$nextindextouse=is_array($colorindexused)?count($colorindexused):0; // At first run this is 0, so fist user has 0, next 1, ...
//var_dump($colorindexused);
foreach ($eventarray as $daykey => $notused)
@@ -1630,3 +1635,22 @@ function dol_color_minus($color, $minus, $minusunit = 16)
}
return $newcolor;
}
/**
* Sort events by date
*
* @param object $a Event A
* @param object $b Event B
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
*/
function sort_events_by_date($a, $b)
{
if($a->datep != $b->datep)
{
return $a->datep - $b->datep;
}
// If both events have the same start time, longest first
return $b->datef - $a->datef;
}

View File

@@ -136,7 +136,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
{
foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]);
}
}
@@ -235,8 +235,15 @@ $sql.= " a.fk_contact, a.note, a.percent as percent,";
$sql.= " a.fk_element, a.elementtype,";
$sql.= " c.code as type_code, c.libelle as type_label,";
$sql.= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
@@ -291,8 +298,8 @@ if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
if ($search_title) $sql.=natural_search("a.label", $search_title);
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
@@ -307,9 +314,15 @@ if ($filtert > 0 || $usergroup > 0)
if ($dateselect > 0) $sql.= " AND ((a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."') OR (a.datep2 IS NULL AND a.datep > '".$db->idate($dateselect-3600)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'))";
if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= $db->order($sortfield,$sortorder);
$nbtotalofrecords = '';

View File

@@ -427,8 +427,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{

View File

@@ -453,8 +453,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{

View File

@@ -326,7 +326,7 @@ if ($id > 0)
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id', 'CRDT');
}
else
{

View File

@@ -80,6 +80,7 @@ $originid = GETPOST('originid', 'int');
$confirm = GETPOST('confirm', 'alpha');
$lineid = GETPOST('lineid', 'int');
$contactid = GETPOST('contactid','int');
$projectid = GETPOST('projectid','int');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@@ -903,6 +904,7 @@ if (empty($reshook))
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt = '(';
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
@@ -1360,7 +1362,7 @@ if ($action == 'create')
}
$objectsrc->fetch_thirdparty();
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
@@ -1488,7 +1490,7 @@ if ($action == 'create')
// Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1);
print '</td></tr>';
}
@@ -1526,9 +1528,6 @@ if ($action == 'create')
// Project
if (! empty($conf->projet->enabled))
{
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
$langs->load("projects");
print '<tr>';
print '<td>' . $langs->trans("Project") . '</td><td>';
@@ -2046,7 +2045,7 @@ if ($action == 'create')
print '</tr></table>';
print '</td><td>';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}

View File

@@ -12,6 +12,8 @@
* 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) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 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
@@ -414,37 +416,40 @@ class Propal extends CommonObject
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
$pa_ht=price2num($pa_ht);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
if ($this->statut == self::STATUS_DRAFT)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
$pa_ht=price2num($pa_ht);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
$this->db->begin();
$product_type=$type;
@@ -647,6 +652,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva = price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
@@ -1016,6 +1022,7 @@ class Propal extends CommonObject
// Add linked object (deprecated, use ->linkedObjectsIds instead)
if (! $error && $this->origin && $this->origin_id)
{
dol_syslog('Deprecated use of linked object, use ->linkedObjectsIds instead', LOG_WARNING);
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
@@ -1088,13 +1095,6 @@ class Propal extends CommonObject
}
}
// Add linked object
if (! $error && $this->origin && $this->origin_id)
{
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
// Set delivery address
if (! $error && $this->fk_delivery_address)
{
@@ -1341,6 +1341,7 @@ class Propal extends CommonObject
$sql.= ", p.fk_shipping_method";
$sql.= ", p.fk_incoterms, p.location_incoterms";
$sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc";
$sql.= ", p.tms as date_modification";
$sql.= ", i.libelle as libelle_incoterms";
$sql.= ", c.label as statut_label";
$sql.= ", ca.code as availability_code, ca.label as availability";
@@ -1394,6 +1395,7 @@ class Propal extends CommonObject
$this->datev = $this->db->jdate($obj->datev); // TODO deprecated
$this->date_creation = $this->db->jdate($obj->datec); //Creation date
$this->date_validation = $this->db->jdate($obj->datev); //Validation date
$this->date_modification = $this->db->jdate($obj->date_modification); // tms
$this->date = $this->db->jdate($obj->dp); // Proposal date
$this->datep = $this->db->jdate($obj->dp); // deprecated
$this->fin_validite = $this->db->jdate($obj->dfv);
@@ -3937,7 +3939,7 @@ class PropaleLigne extends CommonObjectLine
$sql.= " ".price2num($this->localtax2_tx).",";
$sql.= " '".$this->db->escape($this->localtax1_type)."',";
$sql.= " '".$this->db->escape($this->localtax2_type)."',";
$sql.= " ".($this->subprice?price2num($this->subprice):"null").",";
$sql.= " ".(price2num($this->subprice)!==''?price2num($this->subprice):"null").",";
$sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".(isset($this->info_bits)?"'".$this->db->escape($this->info_bits)."'":"null").",";
$sql.= " ".price2num($this->total_ht).",";

View File

@@ -74,6 +74,8 @@ $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$viewstatut=GETPOST('viewstatut','alpha');
$optioncss = GETPOST('optioncss','alpha');
@@ -87,7 +89,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -283,7 +285,7 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet);
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_login) $sql .= natural_search("u.login", $search_login);
@@ -379,6 +381,7 @@ if ($resql)
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($socid > 0) $param.='&socid='.urlencode($socid);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_product_category != '') $param.='&search_product_category='.$search_product_category;
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';

View File

@@ -1850,13 +1850,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value'
// => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse','int')?GETPOST('idwarehouse','int'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
@@ -1882,13 +1883,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value'
// => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
@@ -1923,13 +1925,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value'
// => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1);
@@ -2193,7 +2196,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</tr></table>';
print '</td><td>';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}

View File

@@ -9,7 +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-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2018 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
@@ -85,6 +85,9 @@ class Commande extends CommonOrder
public $facturee;
public $billed; // billed or not
/**
* @var int Draft Status of the order
*/
public $brouillon;
public $cond_reglement_code;
@@ -233,7 +236,7 @@ class Commande extends CommonOrder
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
if ($mybool === false)
{
dol_print_error('',"Failed to include file ".$file);
return '';
@@ -407,6 +410,7 @@ class Commande extends CommonOrder
{
$this->ref = $num;
$this->statut = self::STATUS_VALIDATED;
$this->brouillon = 0;
}
if (! $error)
@@ -1266,43 +1270,46 @@ class Commande extends CommonOrder
dol_syslog(get_class($this)."::addline commandeid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
if ($this->statut == self::STATUS_DRAFT)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0;
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
$label=trim($label);
$desc=trim($desc);
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
$label=trim($label);
$desc=trim($desc);
// Check parameters
if ($type < 0) return -1;
// Check parameters
if ($type < 0) return -1;
if ($this->statut == self::STATUS_DRAFT)
{
$this->db->begin();
$product_type=$type;
@@ -1676,10 +1683,11 @@ class Commande extends CommonOrder
// Retrieve all extrafields for invoice
// fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// $extrafields=new ExtraFields($this->db);
// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
// $this->fetch_optionals($this->id,$extralabels);
$this->fetch_optionals();
$this->db->free($result);
@@ -1881,6 +1889,9 @@ class Commande extends CommonOrder
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
$line->fetch_optionals();
$this->lines[$i] = $line;
$i++;
@@ -2870,6 +2881,7 @@ class Commande extends CommonOrder
$qty=price2num($qty);
$pu = price2num($pu);
$pa_ht=price2num($pa_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
@@ -4063,7 +4075,7 @@ class OrderLine extends CommonOrderLine
$sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").',';
$sql.= " '".$this->db->escape($this->product_type)."',";
$sql.= " '".price2num($this->remise_percent)."',";
$sql.= " ".($this->subprice!=''?"'".price2num($this->subprice)."'":"null").",";
$sql.= " ".(price2num($this->subprice)!==''?price2num($this->subprice):"null").",";
$sql.= " ".($this->price!=''?"'".price2num($this->price)."'":"null").",";
$sql.= " '".price2num($this->remise)."',";
$sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").',';
@@ -4072,11 +4084,11 @@ class OrderLine extends CommonOrderLine
$sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").',';
$sql.= ' '.price2num($this->pa_ht).',';
$sql.= " '".$this->db->escape($this->info_bits)."',";
$sql.= " '".price2num($this->total_ht)."',";
$sql.= " '".price2num($this->total_tva)."',";
$sql.= " '".price2num($this->total_localtax1)."',";
$sql.= " '".price2num($this->total_localtax2)."',";
$sql.= " '".price2num($this->total_ttc)."',";
$sql.= " ".price2num($this->total_ht).",";
$sql.= " ".price2num($this->total_tva).",";
$sql.= " ".price2num($this->total_localtax1).",";
$sql.= " ".price2num($this->total_localtax2).",";
$sql.= " ".price2num($this->total_ttc).",";
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);

View File

@@ -75,6 +75,9 @@ $search_total_ht=GETPOST('search_total_ht','alpha');
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$viewstatut=GETPOST('viewstatut');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$search_project_ref=GETPOST('search_project_ref','alpha');
// Security check
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
@@ -88,7 +91,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -384,6 +387,7 @@ if ($resql)
$arrayofselected=is_array($toselect)?$toselect:array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($sall) $param.='&sall='.urlencode($sall);
@@ -401,12 +405,19 @@ if ($resql)
if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
if ($search_total_ht != '') $param.='&search_total_ht='.urlencode($search_total_ht);
if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat);
if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc);
if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref);
if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat);
if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc);
if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref);
if ($search_town != '') $param .= '&search_town='.urlencode($search_town);
if ($search_zip != '') $param .= '&search_zip='.urlencode($search_zip);
if ($search_state != '') $param .= '&search_state='.urlencode($search_state);
if ($search_country != '') $param .= '&search_country='.urlencode($search_country);
if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category);
if ($show_files) $param.='&show_files=' .urlencode($show_files);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($billed != '') $param.='&billed='.urlencode($billed);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@@ -285,6 +285,13 @@ if (($action == 'create' || $action == 'add') && !$error)
{
$fk_parent_line = 0;
}
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_options = $lines[$i]->array_options;
}
$result = $object->addline(
$desc,
$lines[$i]->subprice,
@@ -309,7 +316,8 @@ if (($action == 'create' || $action == 'add') && !$error)
$fk_parent_line,
$lines[$i]->fk_fournprice,
$lines[$i]->pa_ht,
$lines[$i]->label
$lines[$i]->label,
$array_options
);
if ($result > 0)
{

View File

@@ -637,11 +637,12 @@ else
print '<tr><td>'.$langs->trans("AccountancyJournal").'</td>';
print '<td>';
$accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($object->fk_accountancy_journal);
print $accountingjournal->getNomUrl(0,1,1,'',1);
if ($object->fk_accountancy_journal > 0) {
$accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($object->fk_accountancy_journal);
print $accountingjournal->getNomUrl(0, 1, 1, '', 1);
}
print '</td></tr>';
}

View File

@@ -1152,7 +1152,7 @@ class Account extends CommonObject
$solde = $obj->amount;
}
$this->db->free($resql);
return $solde;
return price2num($solde, 'MU');
}
}

View File

@@ -12,7 +12,7 @@
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -189,13 +189,16 @@ if (empty($reshook))
$qualified_for_stock_change = $object->hasProductsOrServices(1);
}
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1');
exit();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
if ($object->is_erasable())
{
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1');
exit();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
}
}
@@ -405,7 +408,7 @@ if (empty($reshook))
//var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit;
if ($discount->amount_ttc > $object->getRemainToPay(0))
if (price2num($discount->amount_ttc) > price2num($object->getRemainToPay(0)))
{
// TODO Split the discount in 2 automatically
$error++;
@@ -690,6 +693,9 @@ if (empty($reshook))
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;
$amount_ttc[$line->tva_tx] += $line->total_ttc;
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
$i ++;
}
}
@@ -720,7 +726,6 @@ if (empty($reshook))
$sql.= ' WHERE pf.fk_facture = '.$object->id;
$sql.= ' AND pf.fk_paiement = p.rowid';
$sql.= ' AND p.entity IN (' . getEntity('facture').')';
$sql.= ' ORDER BY p.datep, p.tms';
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
@@ -746,6 +751,9 @@ if (empty($reshook))
$discount->amount_ht = abs($amount_ht[$tva_tx]);
$discount->amount_tva = abs($amount_tva[$tva_tx]);
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
$discount->tva_tx = abs($tva_tx);
$result = $discount->create($user);
@@ -1188,15 +1196,15 @@ if (empty($reshook))
$qualified=1;
if (empty($lines[$i]->qty)) $qualified=0; // We discard qty=0, it is an option
if (! empty($lines[$i]->special_code)) $qualified=0; // We discard special_code (frais port, ecotaxe, option, ...)
if ($qualified) $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
if ($qualified){
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
$tva_tx = $lines[$i]->tva_tx;
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
}
}
if ($totalamount != 0) {
if ($numlines > 0) $numlines = $numlines-1;
$tva_tx = $lines[$numlines]->tva_tx;
if (! empty($lines[$numlines]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$numlines]->vat_src_code.')';
$amountdeposit[$tva_tx] = ($totalamount * $valuedeposit) / 100;
} else {
if($totalamount == 0) {
$amountdeposit[0] = 0;
}
} else {
@@ -1207,9 +1215,10 @@ if (empty($reshook))
$amount_ttc_diff = $amountdeposit[0];
}
foreach ($amountdeposit as $tva => $amount)
{
if (empty($amount)) continue;
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
$descline = $langs->trans('Deposit');
$descline.= ' - '.$langs->trans($arraylist[$typeamount]);
@@ -1218,6 +1227,7 @@ if (empty($reshook))
} elseif ($typeamount=='variable') {
$descline.= ' ('. $valuedeposit.'%)';
}
$descline.= ' - '.$srcobject->ref;
$result = $object->addline(
$descline,
@@ -1274,6 +1284,8 @@ if (empty($reshook))
{
// Don't add lines with qty 0 when coming from a shipment including all order lines
if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue;
// Don't add closed lines when coming from a contract
if($srcobject->element == 'contrat' && $lines[$i]->statut == 5) continue;
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
@@ -1444,11 +1456,26 @@ if (empty($reshook))
$object->origin = $origin;
$object->origin_id = $originid;
foreach ($object->lines as &$line)
foreach ($object->lines as $i => &$line)
{
$line->origin = $object->origin;
$line->origin_id = $line->id;
$line->fetch_optionals($line->id);
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
if ($line->fk_remise_except)
{
$discount=new DiscountAbsolute($line->db);
$result=$discount->fetch($line->fk_remise_except);
if ($result > 0)
{
// Check if discount not already affected to another invoice
if ($discount->fk_facture_line > 0)
{
$line->fk_remise_except = 0;
}
}
}
}
}
@@ -3047,13 +3074,14 @@ else if ($id > 0 || ! empty($ref))
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease");
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' =>
// 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
// => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"))));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"), 0, $forcecombo))
);
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1);
} else {
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1);
@@ -4358,7 +4386,7 @@ else if ($id > 0 || ! empty($ref))
if ($objectidnext) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else {
//if ($resteapayer == 0) {
//if ($resteapayer == 0) { // Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done)
// print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
//} else {
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&amp;action=create&amp;accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
@@ -4391,7 +4419,7 @@ else if ($id > 0 || ! empty($ref))
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&amp;action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
}
// For deposit invoice
if ($object->type == Facture::TYPE_DEPOSIT && $user->rights->facture->creer && empty($discount->id))
if ($object->type == Facture::TYPE_DEPOSIT && $user->rights->facture->creer && $object->statut > 0 && empty($discount->id))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&amp;action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
}

View File

@@ -15,6 +15,7 @@
* 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>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.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
@@ -1352,10 +1353,12 @@ class Facture extends CommonInvoice
// Retrieve all extrafield for invoice
// fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// $extrafields=new ExtraFields($this->db);
// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
// $this->fetch_optionals($this->id,$extralabels);
$this->fetch_optionals();
/*
* Lines
@@ -1476,7 +1479,7 @@ class Facture extends CommonInvoice
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
// TODO Fetch optional like done in fetch line of facture_rec ?
$line->fetch_optionals();
$this->lines[$i] = $line;
@@ -1697,9 +1700,9 @@ class Facture extends CommonInvoice
$facligne->total_ttc = -$remise->amount_ttc;
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
$facligne->multicurrency_total_ht = -$remise->multicurrency_amount_ht;
$facligne->multicurrency_total_tva = -$remise->multicurrency_amount_tva;
$facligne->multicurrency_total_ttc = -$remise->multicurrency_amount_ttc;
$lineid=$facligne->insert();
if ($lineid > 0)
@@ -2577,54 +2580,47 @@ class Facture extends CommonInvoice
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline id=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type, fk_unit=$fk_unit", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($ventil)) $ventil=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($fk_prev_id)) $fk_prev_id = 'null';
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
if (! empty($this->brouillon))
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($ventil)) $ventil=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($fk_prev_id)) $fk_prev_id = 'null';
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
$this->db->begin();
$product_type=$type;
@@ -2647,6 +2643,16 @@ class Facture extends CommonInvoice
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, $situation_percent, $this->multicurrency_tx, $pu_ht_devise);
$total_ht = $tabprice[0];
@@ -2828,6 +2834,7 @@ class Facture extends CommonInvoice
$remise_percent = price2num($remise_percent);
$qty = price2num($qty);
$pu = price2num($pu);
$pu_ht_devise = price2num($pu_ht_devise);
$pa_ht = price2num($pa_ht);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
@@ -3979,9 +3986,10 @@ class Facture extends CommonInvoice
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
* @return int <0 if KO, >0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf,$langs;
@@ -4000,7 +4008,7 @@ class Facture extends CommonInvoice
$modelpath = "core/modules/facture/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
/**
@@ -4809,7 +4817,7 @@ class FactureLigne extends CommonInvoiceLine
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
return $res['situation_percent'];
return floatval($res['situation_percent']);
} else {
$this->error = $this->db->error();
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);

View File

@@ -84,8 +84,8 @@ class FactureStats extends Stats
$this->where.=" AND f.fk_soc = ".$this->socid;
}
if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid;
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2)";
else $this->where.= " AND f.type IN (0,1,2,3)";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where.= " AND f.type IN (0,1,2,5)";
else $this->where.= " AND f.type IN (0,1,2,3,5)";
}

View File

@@ -167,7 +167,7 @@ class PaymentTerm // extends CommonObject
global $langs;
$sql = "SELECT";
$sql.= " t.rowid,";
$sql.= " t.entity";
$sql.= " t.entity,";
$sql.= " t.code,";
$sql.= " t.sortorder,";

View File

@@ -43,10 +43,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
$langs->load('bills');
$langs->load('compta');
$langs->load('admin');
$langs->load('other');
$langs->loadLangs(array('bills','compta','admin','other','products'));
$action = GETPOST('action','alpha');
$massaction = GETPOST('massaction','alpha');

View File

@@ -264,7 +264,7 @@ if ($search_month_date_when > 0)
if ($search_year_date_when > 0 && empty($search_day_date_when))
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,$search_month_date_when,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,$search_month_date_when,false))."'";
else if ($search_year_date_when > 0 && ! empty($search_day_date_when))
$sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'";
else
$sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'";
}

View File

@@ -89,12 +89,14 @@ $search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_user = GETPOST('search_user','int');
$search_sale = GETPOST('search_sale','int');
$search_day = GETPOST('search_day','int');
$search_day = GETPOST('search_day','int');
$search_month = GETPOST('search_month','int');
$search_year = GETPOST('search_year','int');
$search_day_lim = GETPOST('search_day_lim','int');
$search_day_lim = GETPOST('search_day_lim','int');
$search_month_lim = GETPOST('search_month_lim','int');
$search_year_lim = GETPOST('search_year_lim','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$option = GETPOST('option');
if ($option == 'late') {
@@ -106,7 +108,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
if (! $sortorder) $sortorder='DESC';
@@ -449,7 +451,7 @@ if ($search_month > 0)
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $serch_year))."'";
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$month."'";
}
@@ -457,7 +459,7 @@ else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
if ($month_lim > 0)
if ($search_month_lim > 0)
{
if ($search_year_lim > 0 && empty($search_day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($search_year_lim,$search_month_lim,false))."' AND '".$db->idate(dol_get_last_day($search_year_lim,$search_month_lim,false))."'";
@@ -549,16 +551,18 @@ if ($resql)
if ($search_refcustomer) $param.='&search_refcustomer=' .urlencode($search_refcustomer);
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
if ($search_town) $param.='&search_town='.urlencode($search_town);
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($show_files) $param.='&show_files=' .urlencode($show_files);
if ($option) $param.="&option=".urlencode($option);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
@@ -872,7 +876,8 @@ if ($resql)
print "</tr>\n";
$projectstatic=new Project($db);
$discount = new DiscountAbsolute($db);
if ($num > 0)
{
$i=0;
@@ -886,6 +891,9 @@ if ($resql)
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
$facturestatic->statut=$obj->fk_statut;
$facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->paye=$obj->paye;
$facturestatic->fk_soc=$obj->fk_soc;
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
$facturestatic->note_public=$obj->note_public;
$facturestatic->note_private=$obj->note_private;
@@ -905,7 +913,12 @@ if ($resql)
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
$remaintopay = $facturestatic->total_ttc - $totalpay;
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) {
$remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = $facturestatic->total_ttc - $remaintopay;
}
print '<tr class="oddeven">';
if (! empty($arrayfields['f.facnumber']['checked']))

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 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
@@ -288,39 +289,40 @@ class Paiement extends CommonObject
{
$amount_ht = $amount_tva = $amount_ttc = array();
// Loop on each vat rate
$i = 0;
foreach ($invoice->lines as $line)
{
if ($line->total_ht!=0)
{ // no need to create discount if amount is null
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;
$amount_ttc[$line->tva_tx] += $line->total_ttc;
$i ++;
}
}
// Insert one discount by VAT rate category
$discount = new DiscountAbsolute($this->db);
$discount->fetch('',$invoice->id);
if (empty($discount->id)) { // If the invoice was not yet converted into a discount (this may have been done manually before we come here)
// Insert one discount by VAT rate category
$discount = new DiscountAbsolute($this->db);
$discount->description = '(DEPOSIT)';
$discount->fk_soc = $invoice->socid;
$discount->fk_facture_source = $invoice->id;
foreach ($amount_ht as $tva_tx => $xxx)
{
$discount->amount_ht = abs($amount_ht[$tva_tx]);
$discount->amount_tva = abs($amount_tva[$tva_tx]);
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
$discount->tva_tx = abs($tva_tx);
$discount->description = '(DEPOSIT)';
$discount->fk_soc = $invoice->socid;
$discount->fk_facture_source = $invoice->id;
$result = $discount->create($user);
if ($result < 0)
{
$error++;
break;
}
}
// Loop on each vat rate
$i = 0;
foreach ($invoice->lines as $line) {
if ($line->total_ht != 0) { // no need to create discount if amount is null
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;
$amount_ttc[$line->tva_tx] += $line->total_ttc;
$i++;
}
}
foreach ($amount_ht as $tva_tx => $xxx) {
$discount->amount_ht = abs($amount_ht[$tva_tx]);
$discount->amount_tva = abs($amount_tva[$tva_tx]);
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
$discount->tva_tx = abs($tva_tx);
$result = $discount->create($user);
if ($result < 0) {
$error++;
break;
}
}
}
if ($error)
{

View File

@@ -47,7 +47,10 @@ $result = restrictedArea($user, 'prelevement', '', '', 'bons');
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha')?GETPOST('mode','alpha'):'real';
$format = GETPOST('format','aZ09');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
/*
* Actions
@@ -196,13 +199,33 @@ $sql.= " AND pfd.traite = 0";
$sql.= " AND pfd.fk_facture = f.rowid";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->plimit($limit+1,$offset);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print load_fiche_titre($langs->trans("InvoiceWaitingWithdraw").($num > 0?' ('.$num.')':''),'','');
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if($socid) $param .= '&socid='.urlencode($socid);
if($option) $param .= "&option=".urlencode($option);
if(! empty($page) && $num <= $nbtotalofrecords) $page = 0;
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"),$page,$_SERVER['PHP_SELF'],$param,'','','',$num,$nbtotalofrecords,'title_accountancy.png',0,'','', $limit);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@@ -219,7 +242,7 @@ if ($resql)
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($db);
while ($i < $num && $i < 20)
while ($i < $num && $i < $limit)
{
$obj = $db->fetch_object($resql);
@@ -260,6 +283,7 @@ if ($resql)
}
else print '<tr '.$bc[0].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print "</table>";
print "</form>";
print "<br>\n";
}
else

View File

@@ -160,7 +160,7 @@ $sql.= " AND pl.fk_prelevement_bons = p.rowid";
$sql.= " AND f.fk_soc = s.rowid";
$sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND f.entity = ".$conf->entity;
if ($prev_id) $sql.= " AND p.rowid=".$prev_id;
if ($object->id) $sql.= " AND p.rowid=".$object->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql.= $db->order($sortfield,$sortorder);

View File

@@ -61,6 +61,9 @@ $arrayfields=array(
//...
);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplierbalencelist','globalcard'));
/*
* Actions
*/
@@ -100,7 +103,7 @@ if ($id > 0)
// Invoice list
print load_fiche_titre($langs->trans("CustomerPreview"));
print '<table class="noborder" width="100%">';
print '<table class="noborder tagtable liste" width="100%">';
print '<tr class="liste_titre">';
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'],$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
print '<td>'.$langs->trans("Element").'</td>';
@@ -253,13 +256,18 @@ if ($id > 0)
if (!empty($data['fk_facture'])) print dol_print_date($data['date'],'day');
elseif (!empty($data['fk_paiement'])) print dol_print_date($data['date'],'dayhour');
print "</td>\n";
print '<td>'.$data['link']."</td>\n";
print '<td aling="left">'.$data['status'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance
print '<td align="right">'.price($data['balance'])."</td>\n";

View File

@@ -278,10 +278,12 @@ class ChargeSociales extends CommonObject
* Met a jour une charge sociale
*
* @param User $user Utilisateur qui modifie
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 si erreur, >0 si ok
*/
function update($user)
function update($user,$notrigger=0)
{
$error=0;
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
@@ -289,23 +291,46 @@ class ChargeSociales extends CommonObject
$sql.= ", date_ech='".$this->db->idate($this->date_ech)."'";
$sql.= ", periode='".$this->db->idate($this->periode)."'";
$sql.= ", amount='".price2num($this->amount,'MT')."'";
$sql.= ", fk_projet='".$this->db->escape($this->fk_project)."'";
$sql.= ", fk_projet=".($this->fk_project>0?$this->db->escape($this->fk_project):"NULL");
$sql.= ", fk_user_modif=".$user->id;
$sql.= " WHERE rowid=".$this->id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
if (! $resql) {
$error++; $this->errors[]="Error ".$this->db->lasterror();
}
if (! $error)
{
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('SOCIALCHARGES_MODIFY',$user);
if ($result < 0) $error++;
// End call triggers
}
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -1;
}
}
/**

View File

@@ -681,6 +681,7 @@ class Contact extends CommonObject
$sql.= " c.photo,";
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
$sql.= " c.import_key,";
$sql.= " c.datec as date_creation, c.tms as date_modification,";
$sql.= " co.label as country, co.code as country_code,";
$sql.= " d.nom as state, d.code_departement as state_code,";
$sql.= " u.rowid as user_id, u.login as user_login,";
@@ -712,6 +713,9 @@ class Contact extends CommonObject
$this->zip = $obj->zip;
$this->town = $obj->town;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_modification = $this->db->jdate($obj->date_modification);
$this->fk_departement = $obj->fk_departement; // deprecated
$this->state_id = $obj->fk_departement;
$this->departement_code = $obj->state_code; // deprecated
@@ -856,6 +860,7 @@ class Contact extends CommonObject
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.=" WHERE ec.fk_c_type_contact = tc.rowid";
$sql.=" AND fk_socpeople = ". $this->id;
$sql.=" AND tc.source = 'external'";
$sql.=" GROUP BY tc.element";
dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG);

View File

@@ -296,12 +296,14 @@ if ($search_firstname) $sql.= natural_search('p.firstname', $search
if ($search_societe) $sql.= natural_search('s.nom', $search_societe);
if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste);
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
if (strlen($search_zip)) $sql.= natural_search("p.zip",$search_zip);
if (strlen($search_town)) $sql.= natural_search("p.town",$search_town);
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key);
if ($type == "o") // filtre sur type
@@ -418,6 +420,7 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies.png', 0, '', '', $limit);

View File

@@ -8,7 +8,7 @@
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2018 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
@@ -1358,11 +1358,23 @@ class Contrat extends CommonObject
{
$this->db->begin();
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
// Clean parameters
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva=price2num($txtva);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
$remise_percent=price2num($remise_percent);
@@ -1392,16 +1404,6 @@ class Contrat extends CommonObject
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
@@ -46,14 +46,14 @@ $show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$search_name=GETPOST('search_name');
$search_email=GETPOST('search_email');
$search_name=GETPOST('search_name', 'alpha');
$search_email=GETPOST('search_email', 'alpha');
$search_town=GETPOST('search_town','alpha');
$search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state"));
$search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_contract=GETPOST('search_contract');
$search_contract=GETPOST('search_contract','alpha');
$search_ref_customer=GETPOST('search_ref_customer','alpha');
$search_ref_supplier=GETPOST('search_ref_supplier','alpha');
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2019 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
@@ -46,9 +47,9 @@ if (! $sortorder) $sortorder="ASC";
$mode = GETPOST("mode");
$filter=GETPOST("filter");
$search_name=GETPOST("search_name");
$search_contract=GETPOST("search_contract");
$search_service=GETPOST("search_service");
$search_name=GETPOST("search_name", 'alpha');
$search_contract=GETPOST("search_contract", 'alpha');
$search_service=GETPOST("search_service", 'alpha');
$search_status=GETPOST("search_status","alpha");
$statut=GETPOST('statut')?GETPOST('statut'):1;
$search_product_category=GETPOST('search_product_category','int');

View File

@@ -1,5 +1,7 @@
<?php
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 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
@@ -67,6 +69,8 @@ if (! $error && $massaction == 'confirm_presend')
$listofobjectid=array();
$listofobjectthirdparties=array();
$listofobjectref=array();
$attachedfilesThirdpartyObj=array();
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
if (! $error)
{
@@ -91,7 +95,7 @@ if (! $error && $massaction == 'confirm_presend')
}
// Check mandatory parameters
if (empty($user->email))
if (GETPOST('fromtype','alpha') === 'user' && empty($user->email))
{
$error++;
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
@@ -191,7 +195,6 @@ if (! $error && $massaction == 'confirm_presend')
$sendtocc=implode(',',$tmparray);
//var_dump($listofobjectref);exit;
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
$listofqualifiedobj=array();
$listofqualifiedref=array();
$thirdpartywithoutemail=array();
@@ -206,14 +209,14 @@ if (! $error && $massaction == 'confirm_presend')
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
continue; // Payment done or started or canceled
}
if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT)
if ($objectclass == 'Commande' && $objectobj->statut == Commande::STATUS_DRAFT)
{
$langs->load("errors");
$nbignored++;
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
continue;
}
if ($objectclass == 'Facture' && $objectobj->statut != Facture::STATUS_VALIDATED)
if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT)
{
$langs->load("errors");
$nbignored++;
@@ -261,12 +264,12 @@ if (! $error && $massaction == 'confirm_presend')
if (dol_is_file($file))
{
// Create form object
$attachedfiles=array(
'paths'=>array_merge($attachedfiles['paths'],array($file)),
'names'=>array_merge($attachedfiles['names'],array($filename)),
'mimes'=>array_merge($attachedfiles['mimes'],array($mime))
);
// Create form object
$attachedfilesThirdpartyObj[$thirdpartyid][$objectid]=array(
'paths'=>array($file),
'names'=>array($filename),
'mimes'=>array($mime)
);
}
else
{
@@ -331,12 +334,16 @@ if (! $error && $massaction == 'confirm_presend')
if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO));
if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO));
// $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
$looparray=array();
if (! $oneemailperrecipient)
{
$looparray = $listofqualifiedobj;
foreach ($looparray as $key => $objecttmp)
{
$looparray[$key]->thirdparty = $thirdparty;
}
}
else
{
@@ -345,8 +352,9 @@ if (! $error && $massaction == 'confirm_presend')
$looparray[0]=$objectforloop;
}
//var_dump($looparray);exit;
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record
dol_syslog("We have set an array of ".count($looparray)." emails to send. oneemailperrecipient=".$oneemailperrecipient);
//var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref);
foreach ($looparray as $objectid => $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
{
// Make substitution in email content
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
@@ -356,20 +364,54 @@ if (! $error && $massaction == 'confirm_presend')
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
$parameters=array('mode'=>'formemail');
if ( ! empty( $listofobjectthirdparties ) ) {
$parameters['listofobjectthirdparties'] = $listofobjectthirdparties;
}
if ( ! empty( $listofobjectref ) ) {
$parameters['listofobjectref'] = $listofobjectref;
}
complete_substitutions_array($substitutionarray, $langs, $objecttmp, $parameters);
$subject=make_substitutions($subject, $substitutionarray);
$message=make_substitutions($message, $substitutionarray);
$subjectreplaced=make_substitutions($subject, $substitutionarray);
$messagereplaced=make_substitutions($message, $substitutionarray);
$attachedfiles=array('paths'=>array(), 'names'=>array(), 'mimes'=>array());
if($oneemailperrecipient)
{
// if "one email per recipient" isn't check we must collate $attachedfiles by thirdparty
if(is_array($attachedfilesThirdpartyObj[$thirdparty->id]) && count($attachedfilesThirdpartyObj[$thirdparty->id]))
{
foreach ($attachedfilesThirdpartyObj[$thirdparty->id] as $keyObjId => $objAttachedFiles){
// Create form object
$attachedfiles=array(
'paths'=>array_merge($attachedfiles['paths'], $objAttachedFiles['paths']),
'names'=>array_merge($attachedfiles['names'], $objAttachedFiles['names']),
'mimes'=>array_merge($attachedfiles['mimes'], $objAttachedFiles['mimes'])
);
}
}
}
elseif(!empty($attachedfilesThirdpartyObj[$thirdparty->id][$objectid])){
// Create form object
// if "one email per recipient" isn't check we must separate $attachedfiles by object
$attachedfiles=$attachedfilesThirdpartyObj[$thirdparty->id][$objectid];
}
$filepath = $attachedfiles['paths'];
$filename = $attachedfiles['names'];
$mimetype = $attachedfiles['mimes'];
//var_dump($filepath);
// Send mail (substitutionarray must be done just before this)
require_once(DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php');
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1);
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, $filepath, $mimetype, $filename, $sendtocc, $sendtobcc, $deliveryreceipt, -1);
if ($mailfile->error)
{
$resaction.='<div class="error">'.$mailfile->error.'</div>';
@@ -384,8 +426,12 @@ if (! $error && $massaction == 'confirm_presend')
$error=0;
// Insert logs into agenda
foreach($listofqualifiedobj as $objid => $objectobj)
foreach($listofqualifiedobj as $objid2 => $objectobj2)
{
if ((! $oneemailperrecipient) && $objid2 != $objectid) continue; // We discard this pass to avoid duplicate with other pass in looparray at higher level
dol_syslog("Try to insert email event into agenda for objid=".$objid2." => objectobj=".get_class($objectobj2));
/*if ($objectclass == 'Propale') $actiontypecode='AC_PROP';
if ($objectclass == 'Commande') $actiontypecode='AC_COM';
if ($objectclass == 'Facture') $actiontypecode='AC_FAC';
@@ -397,47 +443,47 @@ if (! $error && $massaction == 'confirm_presend')
if ($message)
{
if ($sendtocc) $actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
}
$actionmsg2='';
// Initialisation donnees
$objectobj->sendtoid = 0;
$objectobj->actionmsg = $actionmsg; // Long text
$objectobj->actionmsg2 = $actionmsg2; // Short text
$objectobj->fk_element = $objid;
$objectobj->elementtype = $objectobj->element;
$objectobj2->sendtoid = 0;
$objectobj2->actionmsg = $actionmsg; // Long text
$objectobj2->actionmsg2 = $actionmsg2; // Short text
$objectobj2->fk_element = $objid2;
$objectobj2->elementtype = $objectobj2->element;
$triggername = strtoupper(get_class($objectobj)) .'_SENTBYMAIL';
if ($triggername == 'SOCIETE_SENTBYMAIL') $triggername = 'COMPANY_SENTBYEMAIL';
if ($triggername == 'CONTRAT_SENTBYMAIL') $triggername = 'CONTRACT_SENTBYEMAIL';
if ($triggername == 'COMMANDE_SENTBYMAIL') $triggername = 'ORDER_SENTBYEMAIL';
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYEMAIL';
if ($triggername == 'FACTURE_SENTBYMAIL') $triggername = 'BILL_SENTBYMAIL';
if ($triggername == 'EXPEDITION_SENTBYMAIL') $triggername = 'SHIPPING_SENTBYEMAIL';
if ($triggername == 'COMMANDEFOURNISSEUR_SENTBYMAIL') $triggername = 'ORDER_SUPPLIER_SENTBYMAIL';
if ($triggername == 'FACTUREFOURNISSEUR_SENTBYMAIL') $triggername = 'BILL_SUPPLIER_SENTBYEMAIL';
if ($triggername == 'SUPPLIERPROPOSAL_SENTBYMAIL') $triggername = 'PROPOSAL_SUPPLIER_SENTBYEMAIL';
if (! empty($trigger_name))
if (! empty($triggername))
{
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
include_once DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php";
$interface=new Interfaces($db);
$result=$interface->run_triggers($trigger_name, $objectobj, $user, $langs, $conf);
$result=$interface->run_triggers($triggername, $objectobj2, $user, $langs, $conf);
if ($result < 0) { $error++; $errors=$interface->errors; }
// Fin appel triggers
if ($error)
{
setEventMessages($db->lasterror(), $errors, 'errors');
dol_syslog("Error in trigger ".$trigger_name.' '.$db->lasterror(), LOG_ERR);
dol_syslog("Error in trigger ".$triggername.' '.$db->lasterror(), LOG_ERR);
}
}
$nbsent++;
}
$nbsent++; // Nb of email sent (may be lower than number of record selected if we group thirdparties)
}
else
{
@@ -502,13 +548,15 @@ if ($massaction == 'confirm_createbills')
$objecttmp = new Facture($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
else {
// Load extrafields of order
$cmd->fetch_optionals();
$objecttmp->socid = $cmd->socid;
$objecttmp->type = Facture::TYPE_STANDARD;
$objecttmp->cond_reglement_id = $cmd->cond_reglement_id;
$objecttmp->mode_reglement_id = $cmd->mode_reglement_id;
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture))
{
@@ -519,6 +567,8 @@ if ($massaction == 'confirm_createbills')
$objecttmp->origin = 'commande';
$objecttmp->origin_id = $id_order;
$objecttmp->array_options = $cmd->array_options; // Copy extrafields
$res = $objecttmp->create($user);
if($res > 0) $nb_bills_created++;
@@ -558,6 +608,12 @@ if ($massaction == 'confirm_createbills')
for ($i=0;$i<$num;$i++)
{
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
// If we build one invoice for several order, we must put the invoice of order on the line
if (! empty($createbills_onebythird))
{
$desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
}
if ($lines[$i]->subprice < 0)
{
// Negative line, we create a discount line
@@ -601,6 +657,13 @@ if ($massaction == 'confirm_createbills')
{
$fk_parent_line = 0;
}
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_options = $lines[$i]->array_options;
}
$result = $objecttmp->addline(
$desc,
$lines[$i]->subprice,
@@ -625,7 +688,8 @@ if ($massaction == 'confirm_createbills')
$fk_parent_line,
$lines[$i]->fk_fournprice,
$lines[$i]->pa_ht,
$lines[$i]->label
$lines[$i]->label,
$array_options
);
if ($result > 0)
{
@@ -660,6 +724,7 @@ if ($massaction == 'confirm_createbills')
if (! $error && $validate_invoices)
{
$massaction = $action = 'builddoc';
foreach($TAllFact as &$objecttmp)
{
$result = $objecttmp->validate($user);
@@ -671,12 +736,18 @@ if ($massaction == 'confirm_createbills')
}
$id = $objecttmp->id; // For builddoc action
$object = $objecttmp;
// Builddoc
$donotredirect = 1;
$upload_dir = $conf->facture->dir_output;
$permissioncreate=$user->rights->facture->creer;
// Call action to build doc
$savobject = $object;
$object = $objecttmp;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
$object = $savobject;
}
$massaction = $action = 'confirm_createbills';
@@ -685,7 +756,7 @@ if ($massaction == 'confirm_createbills')
if (! $error)
{
$db->commit();
setEventMessage($langs->trans('BillCreated', $nb_bills_created));
setEventMessages($langs->trans('BillCreated', $nb_bills_created), null, 'mesgs');
// Make a redirect to avoid to bill twice if we make a refresh or back
$param='';
@@ -996,6 +1067,18 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
continue;
}*/
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
$res = $db->query($sql);
if (!$res)
{
setEventMessage('ErrorRecordParentingNotModified', 'errors');
$error++;
}
}
if (in_array($objecttmp->element, array('societe','member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);
else $result = $objecttmp->delete($user);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* Copyright (C) 2013 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
* the Free Software Foundation; either version 3 of the License, or
@@ -42,7 +43,7 @@ if (GETPOST('addfile','alpha'))
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid);
dol_add_file_process($upload_dir_tmp, 1, 0, 'addedfile', '', null, $trackid);
$action='presend';
}
@@ -192,7 +193,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
// Recipient was provided from combo list
if ($val == 'thirdparty') // Id of third party
{
$tmparray[] = $thirdparty->name.' <'.$thirdparty->email.'>';
$tmparray[] = str_replace(","," ",$thirdparty->name).' <'.$thirdparty->email.'>';
}
elseif ($val) // Id du contact
{
@@ -459,7 +460,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$mesg='<div class="error">';
if ($mailfile->error)
{
$mesg.=$langs->trans('ErrorFailedToSendMail',$from,$sendto);
$mesg.=$langs->transnoentities('ErrorFailedToSendMail',dol_escape_htmltag($from),dol_escape_htmltag($sendto));
$mesg.='<br>'.$mailfile->error;
}
else

View File

@@ -172,7 +172,7 @@ if ($type == 'directory')
$sorting = (strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC);
// Right area. If module is defined here, we are in automatic ecm.
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport');
$automodules = array('company', 'invoice', 'invoice_supplier', 'propal', 'supplier_proposal', 'order', 'order_supplier', 'contract', 'product', 'tax', 'project', 'fichinter', 'user', 'expensereport', 'holiday');
// TODO change for multicompany sharing
// Auto area for suppliers invoices
@@ -203,6 +203,8 @@ if ($type == 'directory')
else if ($module == 'user') $upload_dir = $conf->user->dir_output;
// Auto area for expense report
else if ($module == 'expensereport') $upload_dir = $conf->expensereport->dir_output;
// Auto area for holiday
else if ($module == 'holiday') $upload_dir = $conf->holiday->dir_output;
// Automatic list
if (in_array($module, $automodules))

View File

@@ -409,18 +409,44 @@ class CMailFile
// TODO if (! empty($moreinheader)) ...
// Give the message a subject
$this->message->setSubject($this->encodetorfc2822($subject));
try {
$this->message->setSubject($subject);
} catch (Exception $e) {
$this->error = $e->getMessage();
}
// Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (! empty($from)) $this->message->setFrom($this->getArrayAddress($from));
if (! empty($from)) {
try {
$result = $this->message->setFrom($this->getArrayAddress($from));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}
// Set the To addresses with an associative array
if (! empty($to)) $this->message->setTo($this->getArrayAddress($to));
if (! empty($to)) {
try {
$result = $this->message->setTo($this->getArrayAddress($to));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}
if (! empty($from)) $this->message->SetReplyTo($this->getArrayAddress($from));
if (! empty($from)) {
try {
$result = $this->message->SetReplyTo($this->getArrayAddress($from));
} catch (Exception $e) {
$this->error = $e->getMessage();
}
}
$this->message->setCharSet($conf->file->character_set_client);
try {
$result = $this->message->setCharSet($conf->file->character_set_client);
} catch (Exception $e) {
$this->error = $e->getMessage();
}
if (! empty($this->html))
{
@@ -469,7 +495,7 @@ class CMailFile
if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
if (isset($deliveryreceipt) && $deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
}
else
{
@@ -613,6 +639,7 @@ class CMailFile
if (! $res)
{
$langs->load("errors");
$this->error="Failed to send mail with php mail";
$linuxlike=1;
if (preg_match('/^win/i',PHP_OS)) $linuxlike=0;

View File

@@ -578,15 +578,15 @@ abstract class CommonDocGenerator
}
// Retrieve extrafields
/*if(is_array($object->array_options) && count($object->array_options))
if(is_array($object->array_options) && count($object->array_options))
{
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('shipment',true);
$extralabels = $extrafields->fetch_name_optionals_label('expedition',true);
$object->fetch_optionals($object->id,$extralabels);
$array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs);
}*/
}
return $array_shipment;
}
@@ -603,7 +603,7 @@ abstract class CommonDocGenerator
global $conf;
dol_include_once('/core/lib/product.lib.php');
return array(
$resarray = array(
'line_fulldesc'=>doc_getlinedesc($line,$outputlangs),
'line_product_ref'=>$line->product_ref,
'line_product_label'=>$line->product_label,
@@ -622,6 +622,18 @@ abstract class CommonDocGenerator
'line_surface'=>empty($line->surface) ? '' : $line->surface*$line->qty_shipped.' '.measuring_units_string($line->surface_units, 'surface'),
'line_volume'=>empty($line->volume) ? '' : $line->volume*$line->qty_shipped.' '.measuring_units_string($line->volume_units, 'volume'),
);
// Retrieve extrafields
$extrafieldkey = $line->element;
$array_key = "line";
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true);
$line->fetch_optionals($line->rowid, $extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
return $resarray;
}

View File

@@ -173,7 +173,7 @@ abstract class CommonInvoice extends CommonObject
}
/**
* Return amount (with tax) of all credit notes and deposits invoices used by invoice
* Return amount (with tax) of all credit notes invoices + excess received used by invoice
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise

View File

@@ -1064,7 +1064,7 @@ abstract class CommonObject
$sql.= " ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE ec.element_id = ".$id;
$sql.= " AND ec.fk_socpeople = c.rowid";
if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")";
if ($source == 'internal') $sql.= " AND c.entity IN (".getEntity('user').")";
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe').")";
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
$sql.= " AND tc.element = '".$element."'";
@@ -4459,6 +4459,7 @@ abstract class CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$this->array_options = array();
$numrows=$this->db->num_rows($resql);
if ($numrows)
{
@@ -4578,6 +4579,7 @@ abstract class CommonObject
if ($this->array_options[$key] === '') $mandatorypb=true;
if ($mandatorypb)
{
dol_syslog($this->error);
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
return -1;
}
@@ -5810,7 +5812,12 @@ abstract class CommonObject
// Convert date into timestamp format (value in memory must be a timestamp)
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
{
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]);
$datenotinstring = $this->array_options['options_' . $key];
if (! is_numeric($this->array_options['options_' . $key])) // For backward compatibility
{
$datenotinstring = $this->db->jdate($datenotinstring);
}
$value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$datenotinstring;
}
// Convert float submited string into real php numeric (value in memory must be a php numeric)
if (in_array($extrafields->attribute_type[$key],array('price','double')))
@@ -6286,7 +6293,7 @@ abstract class CommonObject
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
if (isset($this->fields[$key]['notnull']) && $this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
{
$error++;
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);

View File

@@ -103,7 +103,7 @@ class DiscountAbsolute
$this->amount_tva = $obj->amount_tva;
$this->amount_ttc = $obj->amount_ttc;
$this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
@@ -147,8 +147,17 @@ class DiscountAbsolute
$this->amount_ht=price2num($this->amount_ht);
$this->amount_tva=price2num($this->amount_tva);
$this->amount_ttc=price2num($this->amount_ttc);
$this->tva_tx=price2num($this->tva_tx);
$this->multicurrency_amount_ht=price2num($this->multicurrency_amount_ht);
$this->multicurrency_amount_tva=price2num($this->multicurrency_amount_tva);
$this->multicurrency_amount_ttc=price2num($this->multicurrency_amount_ttc);
if (empty($this->multicurrency_amount_ht)) $this->multicurrency_amount_ht=0;
if (empty($this->multicurrency_amount_tva)) $this->multicurrency_amount_tva=0;
if (empty($this->multicurrency_amount_ttc)) $this->multicurrency_amount_ttc=0;
// Check parameters
if (empty($this->description))
{
@@ -161,10 +170,12 @@ class DiscountAbsolute
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
$sql.= " (entity, datec, fk_soc, fk_user, description,";
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
$sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
$sql.= " fk_facture_source";
$sql.= ")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".$user->id.", '".$this->db->escape($this->description)."',";
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
$sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null");
$sql.= ")";

View File

@@ -241,10 +241,10 @@ class ExtraFields
if ($type == 'varchar' && empty($lengthdb)) $lengthdb='255';
}
$field_desc = array(
'type'=>$typedb,
'value'=>$lengthdb,
'null'=>($required?'NOT NULL':'NULL'),
'default' => $default_value
'type'=>$typedb,
'value'=>$lengthdb,
'null'=>($required?'NOT NULL':'NULL'),
'default' => $default_value
);
$result=$this->db->DDLAddField(MAIN_DB_PREFIX.$table, $attrname, $field_desc);
@@ -360,8 +360,8 @@ class ExtraFields
$sql.= " ".$list.",";
$sql.= " ".($default?"'".$this->db->escape($default)."'":"null").",";
$sql.= " ".($computed?"'".$this->db->escape($computed)."'":"null").",";
$sql .= " " . $user->id . ",";
$sql .= " " . $user->id . ",";
$sql .= " " . (is_object($user) ? $user->id : 0). ",";
$sql .= " " . (is_object($user) ? $user->id : 0). ",";
$sql .= "'" . $this->db->idate(dol_now()) . "',";
$sql.= " ".($enabled?"'".$this->db->escape($enabled)."'":"1");
$sql.=')';
@@ -727,6 +727,7 @@ class ExtraFields
if ($elementtype == 'thirdparty') $elementtype='societe';
if ($elementtype == 'contact') $elementtype='socpeople';
if ($elementtype == 'order_supplier') $elementtype='commande_fournisseur';
$array_name_label=array();

View File

@@ -16,6 +16,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.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
@@ -190,7 +191,12 @@ class Form
$morealt=' style="width: '.$cols.'"';
$cols='';
}
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'class="quatrevingtpercent"').$morealt.'">'.($editvalue?$editvalue:$value).'</textarea>';
$valuetoshow = ($editvalue?$editvalue:$value);
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'class="quatrevingtpercent"').$morealt.'">';
$ret.=dol_string_neverthesehtmltags($valuetoshow, array('textarea'));
$ret.='</textarea>';
}
else if ($typeofdata == 'day' || $typeofdata == 'datepicker')
{
@@ -288,7 +294,7 @@ class Form
$out='';
// Check parameters
if ($inputType == 'textarea') $value = dol_nl2br($value);
if (preg_match('/^text/',$inputType)) $value = dol_nl2br($value);
else if (preg_match('/^numeric/',$inputType)) $value = price($value);
else if ($inputType == 'day' || $inputType == 'datepicker') $value = dol_print_date($value, 'day');
@@ -1044,7 +1050,7 @@ class Form
*
* @param string $selected Preselected type
* @param string $htmlname Name of field in form
* @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client in (1,3)')
* @param string $filter Optional filters criteras (example: 's.rowid <> x', 's.client in (1,3)')
* @param string $showempty Add an empty field (Can be '1' or text to use on empty line like 'SelectThirdParty')
* @param int $showtype Show third party type in combolist (customer, prospect or supplier)
* @param int $forcecombo Force to use standard HTML select component without beautification
@@ -1064,6 +1070,13 @@ class Form
$num=0;
$outarray=array();
// Clean $filter that may contains sql conditions so sql code
if (function_exists('test_sql_and_script_inject')) {
if (test_sql_and_script_inject($filter, 3)>0) {
$filter ='';
}
}
// On recherche les societes
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
$sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
@@ -1090,8 +1103,9 @@ class Form
if (count($scrit) > 1) $sql.=")";
if (! empty($conf->barcode->enabled))
{
$sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'";
$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
}
$sql.= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
$sql.=")";
}
$sql.=$this->db->order("nom","ASC");
@@ -1341,7 +1355,7 @@ class Form
$out .= ajax_combobox($htmlid, $events, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
}
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>';
if ($htmlname != 'none' && ! $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlid.'" name="'.$htmlname.'" '.(!empty($moreparam) ? $moreparam : '').'>';
if ($showempty == 1) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>&nbsp;</option>';
if ($showempty == 2) $out.= '<option value="0"'.($selected=='0'?' selected':'').'>'.$langs->trans("Internal").'</option>';
$num = $this->db->num_rows($resql);
@@ -1403,7 +1417,7 @@ class Form
{
$out.= '<option value="-1"'.($showempty==2?'':' selected').' disabled>'.$langs->trans($socid?"NoContactDefinedForThirdParty":"NoContactDefined").'</option>';
}
if ($htmlname != 'none' || $options_only)
if ($htmlname != 'none' && ! $options_only)
{
$out.= '</select>';
}
@@ -1428,12 +1442,12 @@ class Form
* @param int $disabled If select list must be disabled
* @param array $include Array list of users id to include
* @param int $enableonly Array list of users id to be enabled. All other must be disabled
* @param int $force_entity 0 or Id of environment to force
* @param string $force_entity '0' or Ids of environment to force
* @return void
* @deprecated Use select_dolusers instead
* @see select_dolusers()
*/
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity=0)
function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity='0')
{
print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity);
}
@@ -1448,7 +1462,7 @@ class Form
* @param int $disabled If select list must be disabled
* @param array|string $include Array list of users id to include or 'hierarchy' to have only supervised users or 'hierarchyme' to have supervised + me
* @param array $enableonly Array list of users id to be enabled. If defined, it means that others will be disabled
* @param int $force_entity 0 or Id of environment to force
* @param string $force_entity '0' or Ids of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param string $morefilter Add more filters into sql request (Example: 'employee = 1')
@@ -1459,7 +1473,7 @@ class Form
* @return string HTML select string
* @see select_dolgroups
*/
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0)
function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0)
{
global $conf,$user,$langs;
@@ -1518,9 +1532,12 @@ class Form
if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX) || $noactive) $sql.= " AND u.statut <> 0";
if (! empty($morefilter)) $sql.=" ".$morefilter;
if(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)){
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) // MAIN_FIRSTNAME_NAME_POSITION is 0 means firstname+lastname
{
$sql.= " ORDER BY u.firstname ASC";
}else{
}
else
{
$sql.= " ORDER BY u.lastname ASC";
}
@@ -1567,9 +1584,11 @@ class Form
$out.= '>';
}
$fullNameMode = 0; //Lastname + firstname
if(empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)){
$fullNameMode = 1; //firstname + lastname
// $fullNameMode is 0=Lastname+Firstname (MAIN_FIRSTNAME_NAME_POSITION=1), 1=Firstname+Lastname (MAIN_FIRSTNAME_NAME_POSITION=0)
$fullNameMode = 0;
if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION))
{
$fullNameMode = 1; //Firstname+lastname
}
$out.= $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength);
@@ -1595,13 +1614,13 @@ class Form
}
if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
if ($obj->admin && ! $obj->entity)
if (! $obj->entity)
{
$out.=($moreinfo?' - ':' (').$langs->trans("AllEntities");
$moreinfo++;
}
else
{
{
$out.=($moreinfo?' - ':' (').($obj->label?$obj->label:$langs->trans("EntityNameNotDefined"));
$moreinfo++;
}
@@ -1643,7 +1662,7 @@ class Form
* @param int $disabled If select list must be disabled
* @param array $include Array list of users id to include or 'hierarchy' to have only supervised users
* @param array $enableonly Array list of users id to be enabled. All other must be disabled
* @param int $force_entity 0 or Id of environment to force
* @param int $force_entity '0' or Ids of environment to force
* @param int $maxlength Maximum length of string into list (0=no limit)
* @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status
* @param string $morefilter Add more filters into sql request
@@ -1654,7 +1673,7 @@ class Form
* @return string HTML select string
* @see select_dolgroups
*/
function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array())
function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity='0', $maxlength=0, $showstatus=0, $morefilter='', $showproperties=0, $listofuserid=array(), $listofcontactid=array(), $listofotherid=array())
{
global $conf, $user, $langs;
@@ -2630,7 +2649,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
$sql.= " WHERE p.entity IN (".getEntity('productprice').")";
$sql.= " WHERE pfp.entity IN (".getEntity('productprice').")";
$sql.= " AND p.tobuy = 1";
$sql.= " AND s.fournisseur = 1";
$sql.= " AND p.rowid = ".$productid;
@@ -3284,21 +3303,21 @@ class Form
if ($resql && $this->db->num_rows($resql) > 0) {
// Last seen cycle
$ref = 0;
while ($res = $this->db->fetch_array($resql, MYSQL_NUM)) {
while ($obj = $this->db->fetch_object($resql)){
//Same company ?
if ($socid == $res[5]) {
if ($socid == $obj->fk_soc) {
//Same cycle ?
if ($res[2] != $ref) {
if ($obj->situation_cycle_ref != $ref) {
// Just seen this cycle
$ref = $res[2];
$ref = $obj->situation_cycle_ref;
//not final ?
if ($res[4] != 1) {
if ($obj->situation_final != 1) {
//Not prov?
if (substr($res[1], 1, 4) != 'PROV') {
if ($selected == $res[0]) {
$opt .= '<option value="' . $res[0] . '" selected>' . $res[1] . '</option>';
if (substr($obj->facnumber, 1, 4) != 'PROV') {
if ($selected == $obj->rowid) {
$opt .= '<option value="' . $obj->rowid . '" selected>' . $obj->facnumber . '</option>';
} else {
$opt .= '<option value="' . $res[0] . '">' . $res[1] . '</option>';
$opt .= '<option value="' . $obj->rowid . '">' . $obj->facnumber . '</option>';
}
}
}
@@ -3773,7 +3792,7 @@ class Form
if ($("#" + inputname).attr("type") == "radio") { more = ":checked"; }
var inputvalue = $("#" + inputname + more).val();
if (typeof inputvalue == "undefined") { inputvalue=""; }
options += "&" + inputname + "=" + inputvalue;
options += "&" + inputname + "=" + encodeURIComponent(inputvalue);
});
}
var urljump = pageyes + (pageyes.indexOf("?") < 0 ? "?" : "") + options;
@@ -5609,22 +5628,31 @@ class Form
* @param int $width Force width of select box. May be used only when using jquery couch. Example: 250, 95%
* @param string $moreattrib Add more options on select component. Example: 'disabled'
* @param string $elemtype Type of element we show ('category', ...)
* @param string $placeholder String to use as placeholder
* @param int $addjscombo Add js combo
* @return string HTML multiselect string
* @see selectarray
*/
static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='',$elemtype='')
static function multiselectarray($htmlname, $array, $selected=array(), $key_in_label=0, $value_as_key=0, $morecss='', $translate=0, $width=0, $moreattrib='',$elemtype='', $placeholder='', $addjscombo=-1)
{
global $conf, $langs;
$out = '';
if ($addjscombo < 0) {
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) $addjscombo = 1;
else $addjscombo = 0;
}
// Add code for jquery to use multiselect
if (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
{
$tmpplugin=empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)?constant('REQUIRE_JQUERY_MULTISELECT'):$conf->global->MAIN_USE_JQUERY_MULTISELECT;
$out.="\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
<script type="text/javascript">
function formatResult(record) {'."\n";
<script type="text/javascript">'."\n";
if ($addjscombo == 1)
{
$out.= ' function formatResult(record) {'."\n";
if ($elemtype == 'category')
{
$out.=' //return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png'.'"> <a href="'.DOL_URL_ROOT.'/categories/viewcat.php?type=0&id=\'+record.id+\'">\'+record.text+\'</a></span>\';
@@ -5656,8 +5684,9 @@ class Form
formatSelection: formatSelection,
templateResult: formatSelection /* For 4.0 */
});
});
</script>';
});';
}
$out.=' </script>';
}
// Try also magic suggest
@@ -6025,7 +6054,7 @@ class Form
if (! empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || ! in_array($key, $excludelinksto)))
{
print '<div id="'.$key.'list"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)?' style="display:none"':'').'>';
print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax)?'':' style="display:none"').'>';
$sql = $possiblelink['sql'];
$resqllist = $this->db->query($sql);
@@ -6086,8 +6115,9 @@ class Form
{
$linktoelem='
<dl class="dropdown" id="linktoobjectname">
<dt><a href="#linktoobjectname">'.$langs->trans("LinkTo").'...</a></dt>
<dd>
';
if (! empty($conf->use_javascript_ajax)) $linktoelem.='<dt><a href="#linktoobjectname">'.$langs->trans("LinkTo").'...</a></dt>';
$linktoelem.='<dd>
<div class="multiselectlinkto">
<ul class="ulselectedfields">'.$linktoelemlist.'
</ul>
@@ -6100,7 +6130,9 @@ class Form
$linktoelem='';
}
print '<!-- Add js to show linkto box -->
if (! empty($conf->use_javascript_ajax))
{
print '<!-- Add js to show linkto box -->
<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery(".linkto").click(function() {
@@ -6110,7 +6142,8 @@ class Form
});
});
</script>
';
';
}
return $linktoelem;
}
@@ -6531,11 +6564,11 @@ class Form
* @param int $disabled If select list must be disabled
* @param string $include Array list of groups id to include
* @param int $enableonly Array list of groups id to be enabled. All other must be disabled
* @param int $force_entity 0 or Id of environment to force
* @param string $force_entity '0' or Ids of environment to force
* @return string
* @see select_dolusers
*/
function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0)
function select_dolgroups($selected='', $htmlname='groupid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity='0')
{
global $conf,$user,$langs;

View File

@@ -196,7 +196,7 @@ class FormActions
if (! empty($conf->agenda->enabled))
{
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:'').($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:($socid>0?'&socid='.$socid:'')).($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';
$buttontoaddnewevent.= $langs->trans("AddEvent");
$buttontoaddnewevent.= '</a>';
}
@@ -321,7 +321,7 @@ class FormActions
{
global $langs,$user,$form,$conf;
if (! is_object($form)) $form=new Form($db);
if (! is_object($form)) $form=new Form($this->db);
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
@@ -346,7 +346,7 @@ class FormActions
}
else
{
$out.=$form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', '', 1);
$out.=$form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200', 1);
}
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)

View File

@@ -59,7 +59,7 @@ class FormBarCode
$disable = '';
if ($conf->use_javascript_ajax)
if (!empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript" language="javascript">';
print 'jQuery(document).ready(function () {
@@ -79,19 +79,29 @@ class FormBarCode
{
$disable = 'disabled';
}
$select_encoder = '<form action="'.DOL_URL_ROOT.'/admin/barcode.php" method="post" id="form'.$idForm.'">';
$select_encoder.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$select_encoder.= '<input type="hidden" name="action" value="update">';
$select_encoder.= '<input type="hidden" name="code_id" value="'.$code_id.'">';
$select_encoder.= '<select id="select'.$idForm.'" class="flat" name="coder">';
if (!empty($conf->use_javascript_ajax))
{
$select_encoder = '<form action="'.DOL_URL_ROOT.'/admin/barcode.php" method="POST" id="form'.$idForm.'">';
$select_encoder.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$select_encoder.= '<input type="hidden" name="action" value="update">';
$select_encoder.= '<input type="hidden" name="code_id" value="'.$code_id.'">';
}
$selectname=(!empty($conf->use_javascript_ajax)?'coder':'coder'.$code_id);
$select_encoder.= '<select id="select'.$idForm.'" class="flat" name="'.$selectname.'">';
$select_encoder.= '<option value="0"'.($selected==0?' selected':'').' '.$disable.'>'.$langs->trans('Disable').'</option>';
$select_encoder.= '<option value="-1" disabled>--------------------</option>';
foreach($barcodelist as $key => $value)
{
$select_encoder.= '<option value="'.$key.'"'.($selected==$key?' selected':'').'>'.$value.'</option>';
}
$select_encoder.= '</select></form>';
$select_encoder.= '</select>';
if (!empty($conf->use_javascript_ajax))
{
$select_encoder.= '</form>';
}
return $select_encoder;
}

View File

@@ -589,8 +589,8 @@ class FormCompany
runJsCodeForEvent'.$htmlname.'(values);
}
});
/* Clean contact */
$("div#s2id_contactid>a>span").html(\'\');
$(this).trigger("blur");
});
// Function used to execute events when search_htmlname change
@@ -599,7 +599,8 @@ class FormCompany
var method = obj.method;
var url = obj.url;
var htmlname = obj.htmlname;
console.log("Run runJsCodeForEvent-'.$htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
var showempty = obj.showempty;
console.log("Run runJsCodeForEvent-'.$htmlname.' from selectCompaniesForNewContact id="+id+" method="+method+" showempty="+showempty+" url="+url+" htmlname="+htmlname);
$.getJSON(url,
{
action: method,

View File

@@ -520,7 +520,7 @@ class FormFile
$modellist=ModelePDFCards::liste_modeles($this->db);
}
}
elseif ($modulepart == 'agenda')
elseif ($modulepart == 'agenda' || $modulepart == 'actions')
{
if (is_array($genallowed)) $modellist=$genallowed;
else
@@ -560,7 +560,7 @@ class FormFile
$modellist=ModelePDFUserGroup::liste_modeles($this->db);
}
}
else //if ($modulepart != 'agenda')
else
{
// For normalized standard modules
$file=dol_buildpath('/core/modules/'.$modulepart.'/modules_'.$modulepart.'.php',0);
@@ -1392,6 +1392,11 @@ class FormFile
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$object_instance=new ExpenseReport($this->db);
}
else if ($modulepart == 'holiday')
{
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$object_instance=new Holiday($this->db);
}
foreach($filearray as $key => $file)
{
@@ -1421,7 +1426,8 @@ class FormFile
if ($modulepart == 'project') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'fichinter') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'user') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'expensereport') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $ref=(isset($reg[1])?$reg[1]:'');}
if ($modulepart == 'holiday') { preg_match('/(.*)\/[^\/]+$/',$relativefile,$reg); $id=(isset($reg[1])?$reg[1]:'');}
if (! $id && ! $ref) continue;
$found=0;

View File

@@ -299,7 +299,7 @@ class FormMail extends Form
{
$model_id=$this->param["models_id"];
}
$arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, ($model_id ? $model_id : -1)); // we set -1 if model_id empty
$arraydefaultmessage=$this->getEMailTemplate($this->db, $this->param["models"], $user, $outputlangs, $model_id); // If $model_id is empty, preselect the first one
}
//var_dump($this->param["models"]);
//var_dump($model_id);
@@ -908,7 +908,6 @@ class FormMail extends Form
$defaultmessage=preg_replace("/^(<br>)+/","",$defaultmessage);
$defaultmessage=preg_replace("/^\n+/","",$defaultmessage);
}
$out.= '<tr>';
$out.= '<td valign="top">'.$langs->trans("MailText").'</td>';
$out.= '<td>';
@@ -1003,7 +1002,7 @@ class FormMail extends Form
$sql.= " AND entity IN (".getEntity('c_email_templates').")";
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
if ($active >= 0) $sql.=" AND active = ".$active;
if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')";
if (! ($id > 0) && is_object($outputlangs)) $sql.= " AND (lang = '".$db->escape($outputlangs->defaultlang)."' OR lang IS NULL OR lang = '')";
if ($id > 0) $sql.= " AND rowid=".$id;
if ($id == -1) $sql.= " AND position=0";
$sql.= $db->order("position,lang,label","ASC");

View File

@@ -372,9 +372,9 @@ class FormOther
* @param string $morecss More CSS
* @return string Html combo list code
*/
function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='')
function select_salesrepresentatives($selected, $htmlname, $user, $showstatus=0, $showempty=1, $morecss='')
{
global $conf,$langs;
global $conf, $langs;
$langs->load('users');
$out = '';
@@ -396,17 +396,44 @@ class FormOther
// Get list of users allowed to be viewed
$sql_usr = "SELECT u.rowid, u.lastname, u.firstname, u.statut, u.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug WHERE u.rowid = ug.fk_user AND ug.entity IN (".getEntity('user')."))";
$sql_usr.= " OR u.entity = 0"; // Show always superadmin
}
}
else
{
$sql_usr.= " WHERE u.entity IN (".getEntity('user').")";
}
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.rowid = ".$user->id;
if (! empty($user->societe_id)) $sql_usr.=" AND u.fk_soc = ".$user->societe_id;
if (! empty($user->socid)) $sql_usr.=" AND u.fk_soc = ".$user->socid;
// Add existing sales representatives of thirdparty of external user
if (empty($user->rights->user->user->lire) && $user->societe_id)
if (empty($user->rights->user->user->lire) && $user->socid)
{
$sql_usr.=" UNION ";
$sql_usr.= "SELECT u2.rowid, u2.lastname, u2.firstname, u2.statut, u2.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u2, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql_usr.= " WHERE u2.entity IN (0,".$conf->entity.")";
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->societe_id;
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
if (! empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql_usr.= " WHERE u2.entity IS NOT NULL"; // Show all users
} else {
$sql_usr.= " WHERE EXISTS (SELECT ug2.fk_user FROM ".MAIN_DB_PREFIX."usergroup_user as ug2 WHERE u2.rowid = ug2.fk_user AND ug2.entity IN (".getEntity('user')."))";
}
}
else
{
$sql_usr.= " WHERE u2.entity IN (".getEntity('user').")";
}
$sql_usr.= " AND u2.rowid = sc.fk_user AND sc.fk_soc=".$user->socid;
}
$sql_usr.= " ORDER BY statut DESC, lastname ASC"; // Do not use 'ORDER BY u.statut' here, not compatible with the UNION.
//print $sql_usr;exit;

View File

@@ -224,7 +224,7 @@ class FormProjets
}
else if ($obj->fk_statut == 2)
{
if ($discard_close == 2) $disabled=1;
if ($discard_closed == 2) $disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
else if ( empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
@@ -294,22 +294,28 @@ class FormProjets
/**
* Output a combo list with projects qualified for a third party
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id task preselected
* @param string $htmlname Name of HTML select
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param string $show_empty Add an empty line ('1' or string to show for empty line)
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param string $morecss More css added to the select component
* @return int Nbr of project if OK, <0 if KO
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id task preselected
* @param string $htmlname Name of HTML select
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param string $show_empty Add an empty line ('1' or string to show for empty line)
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param string $morecss More css added to the select component
* @param User $usertofilter User object to use for filtering
* @return int Nbr of project if OK, <0 if KO
*/
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500')
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $usertofilter=null)
{
global $user,$conf,$langs;
if(is_null($usertofilter))
{
$usertofilter = $user;
}
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$out='';
@@ -318,10 +324,10 @@ class FormProjets
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
$projectsListId = false;
if (empty($user->rights->projet->all->lire))
if (empty($usertofilter->rights->projet->all->lire))
{
$projectstatic=new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1);
}
// Search all projects
@@ -366,7 +372,7 @@ class FormProjets
{
$obj = $this->db->fetch_object($resql);
// If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire))
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire))
{
// Do nothing
}

View File

@@ -749,7 +749,7 @@ function xml2php($xml)
}
//Let see if the new child is not in the array
if($tab==false && in_array($key,array_keys($array)))
if($tab === false && in_array($key,array_keys($array)))
{
//If this element is already in the array we will create an indexed array
$tmp = $array[$key];
@@ -758,7 +758,7 @@ function xml2php($xml)
$array[$key][] = $child;
$tab = true;
}
elseif($tab == true)
elseif($tab === true)
{
//Add an element in an existing array
$array[$key][] = $child;

View File

@@ -384,16 +384,16 @@ abstract class Stats
$row = $this->db->fetch_object($resql);
$result[$i]['year'] = $row->year;
$result[$i]['nb'] = $row->nb;
if($i>0 && $row->nb) $result[$i-1]['nb_diff'] = ($result[$i-1]['nb'] - $row->nb) / $row->nb * 100;
if($i>0 && $row->nb>0) $result[$i-1]['nb_diff'] = ($result[$i-1]['nb'] - $row->nb) / $row->nb * 100;
$result[$i]['total'] = $row->total;
if($i>0 && $row->total) $result[$i-1]['total_diff'] = ($result[$i-1]['total'] - $row->total) / $row->total * 100;
if($i>0 && $row->total>0) $result[$i-1]['total_diff'] = ($result[$i-1]['total'] - $row->total) / $row->total * 100;
$result[$i]['avg'] = $row->avg;
if($i>0 && $row->avg) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100;
if($i>0 && $row->avg>0) $result[$i-1]['avg_diff'] = ($result[$i-1]['avg'] - $row->avg) / $row->avg * 100;
// For some $sql only
if (isset($row->weighted))
{
$result[$i]['weighted'] = $row->weighted;
if($i>0 && $row->weighted) $result[$i-1]['avg_weighted'] = ($result[$i-1]['weighted'] - $row->weighted) / $row->weighted * 100;
if($i>0 && $row->weighted>0) $result[$i-1]['avg_weighted'] = ($result[$i-1]['weighted'] - $row->weighted) / $row->weighted * 100;
}
$i++;
}

View File

@@ -291,18 +291,20 @@ class Utils
$ok=0;
dol_syslog("Run command ".$fullcommandcrypted);
$handlein = popen($fullcommandclear, 'r');
$i=0;
while (!feof($handlein))
{
$i++; // output line number
$read = fgets($handlein);
// Exclude warning line we don't want
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
fwrite($handle,$read);
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
if ($handlein) {
$i=0;
while (!feof($handlein))
{
$i++; // output line number
$read = fgets($handlein);
// Exclude warning line we don't want
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
fwrite($handle,$read);
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
}
pclose($handlein);
}
pclose($handlein);
if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle);

View File

@@ -765,28 +765,36 @@ class DoliDBMysqli extends DoliDB
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
$sql.= $field_desc['type'];
if(preg_match("/^[^\s]/i",$field_desc['value']))
if (preg_match("/^[^\s]/i",$field_desc['value']))
{
if (! in_array($field_desc['type'],array('date','datetime')))
{
$sql.= "(".$field_desc['value'].")";
}
if(preg_match("/^[^\s]/i",$field_desc['attribute']))
$sql.= " ".$field_desc['attribute'];
if(preg_match("/^[^\s]/i",$field_desc['null']))
$sql.= " ".$field_desc['null'];
if(preg_match("/^[^\s]/i",$field_desc['default']))
}
if (isset($field_desc['attribute']) && preg_match("/^[^\s]/i",$field_desc['attribute']))
{
$sql.= " ".$field_desc['attribute'];
}
if (isset($field_desc['null']) && preg_match("/^[^\s]/i",$field_desc['null']))
{
$sql.= " ".$field_desc['null'];
}
if (isset($field_desc['default']) && preg_match("/^[^\s]/i",$field_desc['default']))
{
if(preg_match("/null/i",$field_desc['default']))
$sql.= " default ".$field_desc['default'];
else
$sql.= " default '".$field_desc['default']."'";
}
if(preg_match("/^[^\s]/i",$field_desc['extra']))
$sql.= " ".$field_desc['extra'];
if (isset($field_desc['extra']) && preg_match("/^[^\s]/i",$field_desc['extra']))
{
$sql.= " ".$field_desc['extra'];
}
$sql.= " ".$field_position;
dol_syslog(get_class($this)."::DDLAddField ".$sql,LOG_DEBUG);
if($this->query($sql)) {
if ($this->query($sql)) {
return 1;
}
return -1;

View File

@@ -400,6 +400,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
if (! empty($conf->global->MAIN_DISABLE_AJAX_COMBOX)) return '';
if (empty($conf->use_javascript_ajax)) return '';
if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) && ! defined('REQUIRE_JQUERY_MULTISELECT')) return '';
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) return '';
if (empty($minLengthToAutocomplete)) $minLengthToAutocomplete=0;
@@ -564,7 +565,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0,
* @param string $text_on Text if on
* @param string $text_off Text if off
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
* @return void
* @return string html for button on/off
*/
function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input=array())
{

View File

@@ -48,26 +48,38 @@ function societe_prepare_head(Societe $object)
$head[$h][2] = 'card';
$h++;
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$nbContact = 0; // TODO
$sql = "SELECT COUNT(p.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
$resql = $db->query($sql);
if ($resql)
if (empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES))
{
if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB))
{
$obj = $db->fetch_object($resql);
if ($obj) $nbContact = $obj->nb;
}
//$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$nbContact = 0; // TODO
$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
$sql = "SELECT COUNT(p.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
$resql = $db->query($sql);
if ($resql)
{
$obj = $db->fetch_object($resql);
if ($obj) $nbContact = $obj->nb;
}
$head[$h][0] = DOL_URL_ROOT.'/societe/contact.php?socid='.$object->id;
$head[$h][1] = $langs->trans('ContactsAddresses');
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}
}
else
{
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][1] = $langs->trans("ContactsAddresses");
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}
if ($object->client==1 || $object->client==2 || $object->client==3)
@@ -98,16 +110,6 @@ function societe_prepare_head(Societe $object)
$h++;
}
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
$nbContact = count($object->liste_contact(-1,'internal')) + count($object->liste_contact(-1,'external'));
$head[$h][1] = $langs->trans("ContactsAddresses");
if ($nbContact > 0) $head[$h][1].= ' <span class="badge">'.$nbContact.'</span>';
$head[$h][2] = 'contact';
$h++;
}
if (! empty($conf->projet->enabled) && (!empty($user->rights->projet->lire) ))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/project.php?socid='.$object->id;
@@ -398,7 +400,7 @@ function societe_admin_prepare_head()
* @param Translate $outputlangs Langs object for output translation
* @param int $entconv 0=Return value without entities and not converted to output charset, 1=Ready for html output
* @param int $searchlabel Label of country to search (warning: searching on label is not reliable)
* @return mixed String with country code or translated country name or Array('id','code','label')
* @return mixed Integer with country id or String with country code or translated country name or Array('id','code','label') or 'NotDefined'
*/
function getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
{
@@ -737,7 +739,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage='', $nocreatelin
}
else
{
print '<tr class="oddeven"><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr class="oddeven"><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
$db->free($result);
}
@@ -1211,6 +1213,8 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
global $param;
dol_include_once('/comm/action/class/actioncomm.class.php');
// Check parameters
if (! is_object($filterobj) && ! is_object($objcon)) dol_print_error('','BadParameter');
@@ -1259,6 +1263,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$sql.= " AND a.fk_element = o.rowid AND a.elementtype = 'product'";
if ($filterobj->id) $sql.= " AND a.fk_element = ".$filterobj->id;
}
//TODO check how ot work with new table actioncomm_resources and multiple contact affectation
if (is_object($objcon) && $objcon->id) $sql.= " AND a.fk_contact = ".$objcon->id;
// Condition on actioncode
if (! empty($actioncode))
@@ -1295,6 +1300,14 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
{
$obj = $db->fetch_object($resql);
$contactaction = new ActionComm($db);
$contactaction->id=$obj->id;
$result = $contactaction->fetchResources();
if ($result<0) {
dol_print_error($db);
setEventMessage("company.lib::show_actions_done Error fetch ressource",'errors');
}
//if ($donetodo == 'todo') $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
//if ($donetodo == 'done') $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '".$db->idate($now)."'))";
$tododone='';
@@ -1316,6 +1329,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
'userphoto'=>$obj->user_photo,
'contact_id'=>$obj->fk_contact,
'socpeopleassigned' => $contactaction->socpeopleassigned,
'lastname'=>$obj->lastname,
'firstname'=>$obj->firstname,
'fk_element'=>$obj->fk_element,
@@ -1468,7 +1482,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$out.=getTitleFieldOfList($langs->trans("Label"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
$out.=getTitleFieldOfList($langs->trans("Date"), 0, $_SERVER["PHP_SELF"], 'a.datep,a.id', '', $param, 'align="center"', $sortfield, $sortorder);
$out.=getTitleFieldOfList('');
$out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], 'a.fk_contact', '', $param, '', $sortfield, $sortorder);
$out.=getTitleFieldOfList($langs->trans("ActionOnContact"), 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
$out.=getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], 'a.percent', '', $param, 'align="center"', $sortfield, $sortorder);
$out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch ');
$out.='</tr>';
@@ -1615,10 +1629,28 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
$contactstatic->firstname=$histo[$key]['firstname'];
$contactstatic->id=$histo[$key]['contact_id'];
$out.='<td width="120">'.$contactstatic->getNomUrl(1,'',10).'</td>';
}
else
{
$out.='<td>&nbsp;</td>';
} elseif (isset($histo[$key]['socpeopleassigned']) && is_array($histo[$key]['socpeopleassigned']) && count($histo[$key]['socpeopleassigned']) > 0) {
$out .= '<td>';
foreach ( $histo[$key]['socpeopleassigned'] as $cid => $Tab ) {
$contact = new Contact($db);
$result = $contact->fetch($cid);
if ($result < 0)
dol_print_error($db, $contact->error);
if ($result > 0) {
$out .= $contact->getNomUrl(1);
if (isset($histo[$key]['acode']) && $histo[$key]['acode'] == 'AC_TEL') {
if (! empty($contact->phone_pro))
$out .= '(' . dol_print_phone($contact->phone_pro) . ')';
}
$out .= '<div class="paddingright"></div>';
}
}
$out .= '</td>';
}
else {
$out.='<td>&nbsp;</td>';
}
// Status

View File

@@ -1118,10 +1118,11 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
* @param int $nophperrors Disable all PHP output errors
* @param int $nohook Disable all hooks
* @param object $object Current object in use
* @param boolean $allowdotdot Allow to delete file path with .. inside. Never use this, it is reserved for migration purpose.
* @return boolean True if no error (file is deleted or if glob is used and there's nothing to delete), False if error
* @see dol_delete_dir
*/
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null)
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null,$allowdotdot=false)
{
global $db, $conf, $user, $langs;
global $hookmanager;
@@ -1133,10 +1134,10 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
// Security:
// We refuse transversal using .. and pipes into filenames.
if (preg_match('/\.\./',$file) || preg_match('/[<>|]/',$file))
if ((! $allowdotdot && preg_match('/\.\./',$file)) || preg_match('/[<>|]/',$file))
{
dol_syslog("Refused to delete file ".$file, LOG_WARNING);
return False;
return false;
}
if (empty($nohook))
@@ -1185,17 +1186,20 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
{
$rel_filetodelete = preg_replace('/^[\\/]/', '', $rel_filetodelete);
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$result = $ecmfile->fetch(0, '', $rel_filetodelete);
if ($result >= 0 && $ecmfile->id > 0)
if (is_object($db)) // $db may not be defined when lib is in a context with define('NOREQUIREDB',1)
{
$result = $ecmfile->delete($user);
}
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
dol_syslog("Try to remove also entries in database for full relative path = ".$rel_filetodelete, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($db);
$result = $ecmfile->fetch(0, '', $rel_filetodelete);
if ($result >= 0 && $ecmfile->id > 0)
{
$result = $ecmfile->delete($user);
}
if ($result < 0)
{
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
}
}
}
@@ -1235,7 +1239,7 @@ function dol_delete_dir($dir,$nophperrors=0)
if (preg_match('/\.\./',$dir) || preg_match('/[<>|]/',$dir))
{
dol_syslog("Refused to delete dir ".$dir, LOG_WARNING);
return False;
return false;
}
$dir_osencoded=dol_osencode($dir);
@@ -1536,6 +1540,11 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
$info = pathinfo($destfile);
$destfile = dol_sanitizeFileName($info['filename'].'.'.strtolower($info['extension']));
// We apply dol_string_nohtmltag also to clean file names (this remove duplicate spaces) because
// this function is also applied when we make try to download file (by the GETPOST(filename, 'alphanohtml') call).
$destfile = dol_string_nohtmltag($destfile);
$destfull = dol_string_nohtmltag($destfull);
$resupload = dol_move_uploaded_file($TFile['tmp_name'][$i], $destfull, $allowoverwrite, 0, $TFile['error'][$i], 0, $varfiles);
if (is_numeric($resupload) && $resupload > 0) // $resupload can be 'ErrorFileAlreadyExists'
@@ -1854,7 +1863,7 @@ function dol_uncompress($inputfile,$outputdir)
dol_syslog("Class ZipArchive is set so we unzip using ZipArchive to unzip into ".$outputdir);
$zip = new ZipArchive;
$res = $zip->open($inputfile);
if ($res === TRUE)
if ($res === true)
{
$zip->extractTo($outputdir.'/');
$zip->close();

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