2
0
forked from Wavyzz/dolibarr

Compare commits

...

802 Commits
9.0.3 ... 9.0

Author SHA1 Message Date
Laurent Destailleur
90854dc2bf FIX Use the wrong logo size on PDF 2023-07-30 19:53:56 +02:00
Laurent Destailleur
b44ddaa696 FIX Use the wrong logo size on PDF 2023-07-30 18:04:03 +02:00
Laurent Destailleur
4569cb82b2 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2022-03-10 15:52:04 +01:00
Laurent Destailleur
04d33f4594 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2022-03-10 15:51:42 +01:00
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
1541e20870 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-01-07 15:43:28 +01:00
Laurent Destailleur
53709cf509 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/utils.class.php
2022-01-07 15:40:05 +01:00
Laurent Destailleur
10e32c056e FIX avoid infinite loop on dump with popen 2022-01-07 15:35:33 +01:00
Laurent Destailleur
0a72aed3d7 Fix missing space before union 2021-12-23 13:35:38 +01:00
Laurent Destailleur
5e1cd459b1 Fix travis 2020-11-15 23:47:53 +01:00
Laurent Destailleur
0f435f9901 Merge pull request #15098 from atm-gauthier/9.0_fix_worklow_order_auto_validated_with_shipping_validate_must_no_consider_services
FIX : WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider serv…
2020-10-22 16:18:11 +02:00
Laurent Destailleur
a9117fe864 Update interface_20_modWorkflow_WorkflowManager.class.php 2020-10-22 16:18:00 +02:00
Laurent Destailleur
8ce929d509 Merge pull request #15069 from ATM-Consulting/fix/9.0_linked_object_on_supplier_proposal_events
FIX 9.0 - when users create an event from a supplier proposal, the "linked objects" section says "Deleted"
2020-10-22 16:10:49 +02:00
Got2be
c2ad40043f FIX : WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING must not consider services while STOCK_SUPPORTS_SERVICES is empty 2020-10-22 16:10:47 +02:00
Florian Mortgat
529dfb8dfb FIX 9.0 - supplier proposals as linked objects of events are not correctly fetched 2020-10-20 16:37:15 +02:00
Laurent Destailleur
74eac1d06a Fix include regression 2020-08-23 19:22:01 +02:00
Laurent Destailleur
03557b69c2 Merge pull request #14486 from atm-john/9.0_fix_infinite_fetch_loop
FIX : infinite fetch object linked loop
2020-08-23 19:14:08 +02:00
Laurent Destailleur
7a183ea026 Update pdf.lib.php 2020-08-23 19:13:30 +02:00
Laurent Destailleur
b44d6744f9 Update pdf.lib.php 2020-08-23 19:11:40 +02:00
Laurent Destailleur
7eb003c684 Update pdf.lib.php 2020-08-23 19:11:19 +02:00
John Botella
6e1702c1a5 Fix infinite fetch object linked loop 2020-08-17 15:00:31 +02:00
Laurent Destailleur
73ea5b0e2d Fix function to convert price to string 2020-08-06 02:50:24 +02:00
Laurent Destailleur
9cb5735165 FIX Bad address used for vendor on PDF standard of supplier payment 2020-08-06 02:05:55 +02:00
Laurent Destailleur
c8bff3a71e FIX Cannot redeclare class 2020-08-06 02:05:04 +02:00
Laurent Destailleur
9dc904f0a5 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-07-29 16:03:03 +02:00
Laurent Destailleur
491f72accc Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2020-07-29 16:02:07 +02:00
Laurent Destailleur
4a291f181f Fix regression 2020-07-29 13:47:04 +02:00
Laurent Destailleur
454a804b4e Merge pull request #14299 from atm-gauthier/9.0_hidden_unit
FIX : We need to see unit line on PDF even though it's an option
2020-07-29 13:18:17 +02:00
VERDOL Gauthier
25994e61bc FIX : We need to see unit line on PDF even though it's an option 2020-07-27 16:04:21 +02:00
Laurent Destailleur
4f5c5356c5 Merge pull request #14150 from atm-gauthier/9.0_deposit_amount_with_comma
FIX : create a deposit with amount using comma didn't work
2020-07-03 00:38:59 +02:00
Laurent Destailleur
18fa4c4105 Update card.php 2020-07-03 00:38:31 +02:00
gauthier
6553c40bea FIX : create a deposit with amount using comma didn't work 2020-06-30 11:23:55 +02: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
afacfa702d Merge pull request #13943 from atm-maxime/fix_pgsql_if
Fix SQL IF for PGSQL
2020-05-23 13:41:18 +02:00
Maxime Kohlhaas
f89195e39f Fix SQL IF for PGSQL 2020-05-21 23:23:59 +02:00
Laurent Destailleur
ca14f9a0fa Merge pull request #13901 from atm-maxime/fix_cron_globals
Fix cron globals reload, missing mysoc and langs
2020-05-18 15:02:00 +02:00
Laurent Destailleur
18a19dafe5 Update cron_run_jobs.php 2020-05-18 15:01:29 +02:00
Laurent Destailleur
3d385dd378 Merge pull request #13903 from atm-maxime/fix_actioncomm_fetch_entity
Fix : entity was missing in actioncomm fetch
2020-05-18 14:59:10 +02:00
Laurent Destailleur
2d1f151fb2 Merge pull request #13905 from atm-maxime/fix_expedition_fetch_entity
Fix : entity was missing in expedition fetch
2020-05-18 14:58:57 +02:00
Maxime Kohlhaas
3d9d5d0ad5 Fix : entity was missing in expedition fetch 2020-05-18 11:03:32 +02:00
Maxime Kohlhaas
cf96383bf9 Fix : entity was missing in actioncomm fetch 2020-05-18 10:44:55 +02:00
Maxime Kohlhaas
54af917afb Fix cron globals reload, missing mysoc and langs 2020-05-16 20:13:47 +02:00
Laurent Destailleur
e327d609d7 Merge pull request #13891 from aspangaro/9.0p1
FIX Site ec.europa.eu has moved to https://
2020-05-15 14:01:28 +02:00
Alexandre SPANGARO
3811586cd0 FIX Site ec.europa.eu has moved to https:// 2020-05-14 20:34:48 +02:00
Laurent Destailleur
cf039b26f9 Merge pull request #13887 from atm-florianm/FIX_9.0_fatal_during_migration_from_dolibarr_3.1_if_php7
FIX 9.0 - fatal during migration from 3.1 using PHP 7
2020-05-14 15:49:08 +02:00
Florian Mortgat
bd3504c473 FIX 9.0 - delete unused mandatory argument from migrate_clean_association: argument count mismatch causes a fatal error since php7 2020-05-13 10:26:44 +02:00
Laurent Destailleur
4a9c85ae39 Merge pull request #13869 from frederic34/patch-6
Fix dolistore search with csrf active
2020-05-12 02:59:06 +02:00
Frédéric FRANCE
4d50ba5e37 Fix dolistore search with csrf active 2020-05-11 20:42:47 +02:00
Laurent Destailleur
385f998254 Fix restore param --quick 2020-05-01 21:01:40 +02:00
Laurent Destailleur
8ed100ca87 Merge pull request #13776 from ATM-Consulting/9.0_backport_FIX_document_export
FIX Several pb in export of documents
2020-05-01 20:48:15 +02:00
Laurent Destailleur
82ace4b4ef FIX Several pb in export of documents
FIX Must escape shell
FIX Must exclude logs and some dirs for compressed backup
FIX gzip and bzip2 must use option -f
2020-04-30 11:52:30 +02:00
Laurent Destailleur
f4df3d01b2 Merge pull request #13733 from frederic34/patch-1
fix countable php7 warning
2020-04-24 14:51:45 +02:00
Frédéric FRANCE
1aafd4667b fix countable php7 warning 2020-04-24 11:57:23 +02:00
Laurent Destailleur
afbfd66ee9 Merge pull request #13581 from atm-maxime/fix_expedition_warning_count
Fix warning on shipment because of count func
2020-04-12 17:21:28 +02:00
Laurent Destailleur
e9ee7a23e6 Merge pull request #13573 from frederic34/patch-11
Update actioncomm.class.php
2020-04-12 16:42:07 +02:00
Maxime Kohlhaas
3ca0d48b37 Fix warning on shipment because of count func 2020-04-12 10:45:30 +02:00
Frédéric FRANCE
e2660fd31c Update actioncomm.class.php 2020-04-11 22:38:28 +02:00
Laurent Destailleur
c4d898e155 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/societe/class/societe.class.php
2020-04-10 02:01:31 +02:00
Laurent Destailleur
2ec60c9d55 Merge pull request #13508 from hregis/8.0_mc3
FIX missing member entity
2020-04-07 21:14:06 +02:00
Regis Houssin
34e434a17e FIX missing member entity 2020-04-06 16:36:11 +02:00
Laurent Destailleur
683ddac0d4 Merge pull request #13493 from ptibogxiv/patch-320
FIX child categories only with good entity rights
2020-04-05 02:40:43 +02:00
ptibogxiv
c7cdb64087 FIX child categories only with good entity rights
fix v9 to develop
display only categories with good entity rights ( intradolibarr or via REST API)
2020-04-04 11:07:48 +02:00
Laurent Destailleur
a923ef5a6d Merge pull request #13456 from atm-gauthier/9.0_fix_migrate_picture_path_script
FIX : picture migration script from doli 9.0
2020-04-02 12:50:23 +02:00
gauthier
04564e83ea FIX : picture migration script from doli 9.0 2020-03-31 10:31:18 +02:00
Laurent Destailleur
878c4fb106 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-03-30 19:53:40 +02:00
Laurent Destailleur
fbce8fcfe3 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/product/class/product.class.php
2020-03-30 19:53:31 +02:00
Laurent Destailleur
125e964352 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/product/class/product.class.php
2020-03-30 19:50:47 +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
Laurent Destailleur
06ad21f2e8 Merge pull request #13442 from fappels/9.0_newToken
Improve modulebuilder compatiblity with maintained versions.
2020-03-30 19:35:45 +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
Francis Appels
3eda785ca5 Add newline end of file 2020-03-30 10:36:49 +02:00
Francis Appels
076caa11ab Add token functions to improve modulebuilder compatiblity with maintained versions. 2020-03-30 10:28:20 +02:00
Laurent Destailleur
81ae6c45ea composer is a big mess 2020-03-26 03:47:58 +01:00
Laurent Destailleur
39f7742387 Update travis config 2020-03-26 03:46:39 +01:00
Laurent Destailleur
5fdf23bba8 Fix exclude fucking composer dependencies 2020-03-26 03:36:16 +01:00
Laurent Destailleur
84fc394e6f Fix exclude fucking composer dependencies 2020-03-26 03:29:29 +01:00
Laurent Destailleur
a7ba23d845 Merge pull request #13419 from atm-gauthier/9.0_search_status_on_bookmarks
FIX : when we filter a list on a view status, we want this filter to …
2020-03-25 18:44:40 +01:00
gauthier
81af385259 FIX : when we filter a list on a view status, we want this filter to be on bookmark that we create 2020-03-25 10:27:59 +01:00
Laurent Destailleur
7afbb5ce9c Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-03-11 17:00:01 +01:00
Laurent Destailleur
467dc2da7a Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2020-03-11 16:59:35 +01: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
d39820d1ac Merge pull request #13286 from ATM-Nicolas/fix_unexisting_link
FIX : Remove unexisting link
2020-03-06 14:14:00 +01:00
ATM-Nicolas
a9d7bbc2ed FIX : Remove unexisting link 2020-03-06 09:52:19 +01:00
Laurent Destailleur
52a92924de Merge pull request #13230 from atm-gauthier/fix_round_accountancy
FIX : round MT in accountancy books
2020-02-29 12:35:33 +01:00
gauthier
284a4189b3 FIX : round MT in accountancy books 2020-02-28 14:32:35 +01:00
Laurent Destailleur
530930b7aa Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-02-23 23:30:38 +01:00
Laurent Destailleur
ac2f6bdc42 Merge pull request #13178 from gmilad/patch-2
Update note.php
2020-02-23 22:45:00 +01:00
Laurent Destailleur
5648205beb Merge pull request #13181 from atm-maxime/8.0
Fix #10179 discount split
2020-02-23 22:43:21 +01:00
Maxime Kohlhaas
0ab16ed5ae Fix #10179 discount split 2020-02-23 16:50:24 +01:00
gmilad
559fc9f61e Update note.php
Fix : #13168
2020-02-22 13:07:25 +01:00
Laurent Destailleur
d6917b6b08 Merge pull request #13152 from fmarcet/9.0
FIX: Visualization rights correction on last modified contacts box
2020-02-21 18:14:09 +01:00
Ferran Marcet
9ff424e23b FIX: Visualization rights correction on last modified contacts box 2020-02-20 11:45:46 +01:00
Laurent Destailleur
88f0cc1331 Merge pull request #13113 from aspangaro/9.0_FEC
FIX: Force FEC export to txt format
2020-02-14 18:56:31 +01:00
Alexandre SPANGARO
72e59e6fe2 FIX: Force FEC export to txt format 2020-02-14 16:07:06 +01:00
Laurent Destailleur
102428a503 Merge pull request #13056 from atm-lena/FIX_cabyprodlist_filter
FIX CA by prod list filter
2020-02-08 16:09:18 +01:00
Laurent Destailleur
4b6276ff92 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-02-08 15:28:59 +01:00
Laurent Destailleur
14531bf160 Fix #13046 - Bad parenthesis on test 2020-02-08 15:28:40 +01:00
atm-lena
ecea726323 FIX CA by prod list filter 2020-02-07 15:01:37 +01:00
Laurent Destailleur
387db16217 FIX Filenames must not contains non ascii char or we will get non ascii
char into the SMTP header.

Conflicts:
	htdocs/core/class/CMailFile.class.php
2020-02-06 13:03:10 +01:00
Laurent Destailleur
b6efd098dd Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-02-05 19:37:03 +01:00
Laurent Destailleur
bf4fca0c7e Fix warning 2020-02-03 22:09:21 +01:00
Laurent Destailleur
42769e2e7d Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-01-23 17:30:30 +01:00
Laurent Destailleur
7ee37ddd3f FIX Error in log for email sending with smtps was not complete 2020-01-23 17:30:05 +01:00
Laurent Destailleur
3a9ef7c5e7 Merge pull request #12911 from aspangaro/9.0_FEC
FIX: FEC export format
2020-01-23 12:04:55 +01:00
Laurent Destailleur
cbe396b97c Update functions2.lib.php 2020-01-23 12:04:14 +01:00
Laurent Destailleur
1487158082 Update functions2.lib.php 2020-01-23 12:02:29 +01:00
Alexandre SPANGARO
7f47b48559 Move function to functions2.lib.php 2020-01-23 11:47:30 +01:00
Alexandre SPANGARO
5eeef771fa FIX: FEC export format 2020-01-23 06:20:31 +01:00
Laurent Destailleur
b513ad90eb Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-01-10 19:48:33 +01:00
Laurent Destailleur
e0a12edf31 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2020-01-10 19:48:10 +01:00
Laurent Destailleur
0625a7194f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2020-01-10 19:47:32 +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
4f2f2f0d73 Merge pull request #12815 from artis-auxilium/fix_massaction_checkbox
Fix massaction checkbox when product module disable
2020-01-10 00:22:02 +01:00
Dev2a
57c954f2e8 Fix Check array of action after kooks 2020-01-07 21:41:36 +01:00
Dev2a
2d67c2365f Fix Check right for service for arrayofmassaction
if product module disable, threre is no action for service
2020-01-07 18:59:58 +01:00
Laurent Destailleur
36e6036e9e Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-12-23 14:01:00 +01:00
Laurent Destailleur
76d23141fd Merge pull request #12727 from fappels/patch-1
Update 6.0.0-7.0.0.sql
2019-12-23 14:00:15 +01:00
Laurent Destailleur
cc8a291f28 Merge pull request #12730 from atm-maxime/fix_shipment_close
Fix prevent double action on shipment close
2019-12-17 19:35:25 +01:00
Maxime Kohlhaas
3e19702e39 Fix prevent double action on shipment close 2019-12-17 18:05:59 +01:00
Francis Appels
95b56f0518 Update 6.0.0-7.0.0.sql
timestamp NOT NULL can cause SQL error.
2019-12-17 12:19:35 +01:00
Laurent Destailleur
cdb730cf4a Merge pull request #12724 from atm-florian/9.0
fix: task document tab FATAL without thirdparty
2019-12-17 12:14:55 +01:00
Laurent Destailleur
03bb395ad8 Update document.php 2019-12-17 12:14:30 +01:00
florian HENRY
bb6523b75d fix task document banner without thirdparty FATAL 2019-12-17 10:49:56 +01:00
Laurent Destailleur
31a60ff30b Fix $db 2019-12-14 14:41:27 +01:00
Laurent Destailleur
d1daf94b81 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-12-14 14:34:14 +01:00
Laurent Destailleur
a8de7b850a Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/admin/system/filecheck.php
2019-12-14 14:33:46 +01:00
Laurent Destailleur
9f2a628c3b Remove bak file 2019-12-14 13:25:21 +01:00
Laurent Destailleur
3a4b4e1559 Merge pull request #12706 from frederic34/patch-22
Update generate_filelist_xml.php
2019-12-14 13:23:36 +01:00
Frédéric FRANCE
bac5c3800e Update api_setup.class.php 2019-12-13 14:46:27 +01:00
Frédéric FRANCE
50937f8ca1 Update filecheck.php 2019-12-13 12:56:48 +01:00
Frédéric FRANCE
18e3a4bcbb Update generate_filelist_xml.php 2019-12-13 12:56:02 +01:00
Frédéric FRANCE
6e64a20f9e Update filecheck.php 2019-12-13 11:16:46 +01:00
Frédéric FRANCE
030b78d79f Update generate_filelist_xml.php 2019-12-13 11:16:04 +01:00
Frédéric FRANCE
a923a48e64 Update filecheck.php 2019-12-13 10:44:12 +01:00
Frédéric FRANCE
cad54c6d7a Update generate_filelist_xml.php 2019-12-13 10:42:49 +01:00
Laurent Destailleur
22a297ed47 Merge pull request #12680 from glelarge/90/12665-mass_invoice_validation_with_stock_management
FIX #12665 Mass invoice validation with stock management (branch 9.0)
2019-12-10 19:27:36 +01:00
Laurent Destailleur
2103cacf9e Merge pull request #12679 from glelarge/80/12665-mass_invoice_validation_with_stock_management
FIX #12665 Mass invoice validation with stock management (branch 8.0)
2019-12-10 19:26:24 +01:00
Gérald Lelarge
97ec8b8e02 FIX #12665 Mass invoice validation with stock management
Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase
or decrease the stock.
A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this
validation manually one by one.
The invoices should not be validated.
2019-12-10 14:23:48 +01:00
Gérald Lelarge
5d61e53140 FIX #12665 Mass invoice validation with stock management
Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase
or decrease the stock.
A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this
validation manually one by one.
The invoices should not be validated.
2019-12-10 14:16:15 +01:00
Laurent Destailleur
e66013275d Merge pull request #12675 from frederic34/patch-6
doxygen and $db not defined
2019-12-10 11:35:46 +01:00
Frédéric FRANCE
f4674a7558 doxygen and $db bot defined 2019-12-10 07:51:39 +01:00
Laurent Destailleur
c0e23c7b71 Merge pull request #12670 from frederic34/patch-7
The variable $id seems to be never defined
2019-12-10 05:53:46 +01:00
Laurent Destailleur
7ba5c2e9d8 Merge pull request #12669 from frederic34/patch-6
typo
2019-12-10 05:53:13 +01:00
Frédéric FRANCE
de741f5dd0 The variable $id seems to be never defined 2019-12-09 23:22:13 +01:00
Frédéric FRANCE
a16e342af6 typo 2019-12-09 23:15:15 +01:00
Laurent Destailleur
314a13a8df Merge pull request #12668 from frederic34/patch-6
missing $db for line 711
2019-12-09 17:33:20 +01:00
Frédéric FRANCE
407fe902b4 missing $db for line 711 2019-12-09 16:42:57 +01:00
Laurent Destailleur
94ae8e07af Merge pull request #12642 from frederic34/patch-11
fix #12628
2019-12-09 13:54:20 +01:00
Laurent Destailleur
63a26ed436 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-12-09 13:25:49 +01:00
Laurent Destailleur
f2c7d3de2e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/lib/functions.lib.php
2019-12-09 13:25:23 +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
Frédéric FRANCE
cafe26cfc3 Update card.php 2019-12-06 23:23:57 +01:00
Laurent Destailleur
13acb8537d Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-12-03 22:38:10 +01:00
Laurent Destailleur
a75915a7a8 Fix regression 2019-12-03 22:37:58 +01:00
Laurent Destailleur
8006d08e6b Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-12-03 22:36:37 +01:00
Laurent Destailleur
60d3bd0fe9 Fix regression 2019-12-03 22:36:26 +01:00
Laurent Destailleur
d4e20bb3a4 Merge pull request #12616 from atm-gauthier/8.0_fix_bill_orders_with_unit
FIX : when we need to bill several orders, order lines unit is not on bill lines
2019-12-03 19:10:00 +01:00
gauthier
cec54d6ce0 FIX : when we need to bill several orders, order lines unit is not on bill lines 2019-12-03 16:40:35 +01:00
Laurent Destailleur
d6ef77e895 Merge pull request #12603 from atm-florianm/NEW_9.0_mysqldump_export_enable_using_--quick_option
NEW 9.0: enable user to use the mysqldump '--quick' option
2019-12-03 14:36:01 +01:00
Laurent Destailleur
072db96b11 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-12-03 13:48:38 +01:00
Laurent Destailleur
b5ce6131fb Merge pull request #12599 from atm-john/9.0_fix_user_comma_input
Fix user card : use comma in amounts inputs
2019-12-03 13:45:02 +01:00
Florian Mortgat
4846885eea NEW 9.0: enable user to use the mysqldump '--quick' option
(useful if the server has low RAM or large tables)
2019-12-02 16:54:05 +01:00
John Botella
4a33ee60f8 Fix user card : use comma in amounts inputs 2019-12-02 10:34:14 +01:00
Laurent Destailleur
87e81f1afd Merge pull request #12583 from atm-maxime/fix_supplier_proddesc
Fix #12044 : with replenish function, use product supplier desc in order
2019-12-01 11:51:22 +01:00
Laurent Destailleur
aa5dff9aae Merge pull request #12582 from atm-maxime/fix_remise_split
Fix #11849 : missing price2num in discount split
2019-12-01 10:54:30 +01:00
Laurent Destailleur
e1d4e14075 Merge pull request #12587 from atm-maxime/fix_expense_qtyupdate
Fix #12569 : update qty on expensereport prevented decimals
2019-12-01 10:53:57 +01:00
Maxime Kohlhaas
d76608729b Fix #12569 : update qty on expensereport prevented decimals 2019-12-01 10:50:28 +01:00
Laurent Destailleur
bf99e8af5d Fix phpcs 2019-12-01 10:33:55 +01:00
Maxime Kohlhaas
270f4c2500 Fix #12044 : with replenish function, use product supplier desc in order 2019-12-01 09:26:54 +01:00
Maxime Kohlhaas
a220d43bd6 Fix #11849 : missing price2num in discount split 2019-12-01 01:41:13 +01:00
Laurent Destailleur
1d564c2a39 Merge branch '8.0' of https://github.com/dolibarr/dolibarr into 9.0
Conflicts:
	htdocs/core/class/notify.class.php
2019-12-01 00:58:01 +01:00
Laurent Destailleur
bfb8a4e8da Merge pull request #12578 from Dolibarr/revert-12577-#12482
Revert "FIX#12482"
2019-12-01 00:55:13 +01:00
Laurent Destailleur
199b0c11af Merge pull request #12572 from atm-maxime/fix_deposit
Fix deposit line was not translated in deposit invoice
2019-12-01 00:44:17 +01:00
Laurent Destailleur
ec67fa4877 Merge pull request #12573 from atm-maxime/fix_vat_fiscal
Fix #11228 : VAT dates regarding fiscal year
2019-11-30 23:30:41 +01:00
Laurent Destailleur
47b35e9011 Merge pull request #12570 from atm-maxime/fix_margin_rights
Fix margin rights
2019-11-30 23:28:26 +01:00
Laurent Destailleur
20e941c585 Merge pull request #12579 from atm-maxime/fix_pdf_rouget
Fix PDF rouget for SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME
2019-11-30 23:26:43 +01:00
Maxime Kohlhaas
edb8bcb598 Fix PDF rouget for SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME 2019-11-30 22:58:32 +01:00
Laurent Destailleur
a352fd5a6e Revert "FIX#12482" 2019-11-30 21:00:56 +01:00
Laurent Destailleur
639e258140 Merge pull request #12577 from inoveaconseil/#12482
FIX#12482
2019-11-30 20:54:08 +01:00
Nicolas
f2ff443641 FIX #12482 2019-11-30 20:04:27 +01:00
Inovea Conseil
7077457d50 Merge remote-tracking branch 'Dolibarr/8.0' into 8.0 2019-11-30 19:59:42 +01:00
Maxime Kohlhaas
3c639772d9 Fix #11228 : VAT dates regarding fiscal year 2019-11-30 17:16:16 +01:00
Maxime Kohlhaas
558669dd88 Fix #6497 : deposit lines were not translated 2019-11-30 16:14:16 +01:00
Maxime Kohlhaas
2c165d0a61 Fix deposit date display in PDF 2019-11-30 15:53:50 +01:00
Maxime Kohlhaas
916954b301 Fix #12371 : access rights on contacts 2019-11-30 14:48:05 +01:00
Maxime Kohlhaas
9095482113 Fix margins access + menu display 2019-11-30 14:47:48 +01:00
Laurent Destailleur
7b828d1f0b Merge pull request #12563 from atm-maxime/fix_notification_user_diabled
Fix #12448 : notifications were sent to disabled user or contacts
2019-11-30 01:18:35 +01:00
Laurent Destailleur
f0cc559f4c Merge pull request #12562 from atm-maxime/fix_loan_update_rate
Fix #12502 : loan rate wasn't updatable
2019-11-30 01:11:00 +01:00
Maxime Kohlhaas
02b5da5db1 Fix #12448 : notifications were sent to disabled user or contacts 2019-11-30 00:57:21 +01:00
Maxime Kohlhaas
9116110737 Fix #12502 : loan rate wasn't updatable 2019-11-30 00:35:32 +01:00
Laurent Destailleur
8656143050 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-11-24 18:13:02 +01:00
Laurent Destailleur
98a7a5559f Fix bad fix 2019-11-24 18:12:40 +01:00
Laurent Destailleur
f2e01834a5 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-11-24 18:11:46 +01:00
Laurent Destailleur
27e4c66dd5 Fix empty 2019-11-24 18:11:11 +01:00
Laurent Destailleur
ece35538f0 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-11-22 14:49:29 +01:00
Laurent Destailleur
eeaef48349 Merge pull request #12488 from atm-gauthier/8.0_fix_recalcultva_only_if_not_ventil
FIX : we need to be able to recalculate tva only if invoice not ventil
2019-11-22 14:25:40 +01:00
Laurent Destailleur
4043356f3a Update card.php 2019-11-22 14:25:32 +01:00
gauthier
a8d02615a8 FIX : we need to be able to recalculate tva only if invoice not ventil 2019-11-21 14:58:20 +01:00
Laurent Destailleur
5b6f0cb101 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/class/extrafields.class.php
2019-11-18 21:19:10 +01:00
Laurent Destailleur
f696998093 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-11-18 19:02:25 +01:00
Laurent Destailleur
918f476c2b Fix backport fix not checking mandatory extrafields of type select 2019-11-18 19:02:12 +01:00
Laurent Destailleur
bb493c6515 Merge pull request #12438 from atm-gauthier/8.0_invoice_createfromclone
FIX : wrong invoice id for fetchObjetctLinked
2019-11-16 00:43:18 +01:00
Laurent Destailleur
ee800189a6 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-11-14 12:45:00 +01:00
Laurent Destailleur
9d963a7ca6 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-11-14 12:44:32 +01:00
gauthier
a5635825f3 FIX : wrong invoice id for fetchObjetctLinked 2019-11-14 12:09:32 +01:00
Laurent Destailleur
6b1d7f5382 Merge pull request #12432 from frederic34/patch-7
FIX #12385
2019-11-14 08:51:23 +01:00
Frédéric FRANCE
3ec7568559 FIX #12385 2019-11-13 20:44:21 +01:00
Laurent Destailleur
dae39e25d2 Merge pull request #12422 from aspangaro/9.0_p20191113
Missing language key
2019-11-13 18:33:30 +01:00
Alexandre SPANGARO
85e2546019 Missing language key 2019-11-13 15:25:23 +01:00
Alexandre SPANGARO
0497c399d7 Missing language key 2019-11-13 14:59:07 +01:00
Laurent Destailleur
f8e8d15606 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-11-12 10:19:01 +01:00
Laurent Destailleur
5f7b09c97f Merge pull request #12406 from atm-gauthier/8.0_useless_limit_on_select_conf
FIX : limit 20 prevent to see all products/services
2019-11-12 09:49:00 +01:00
gauthier
e2680f7637 FIX : limit 20 prevent to see all products/services 2019-11-12 09:42:27 +01:00
Laurent Destailleur
2b7a813e98 Merge pull request #12267 from ATM-Marc/FIX_8.0_trigger_closedir
FIX: triggers: directories read with opendir() never closed
2019-11-02 13:06:54 +01:00
Marc de Lima Lucio
85cef09e83 FIX: triggers: directories read with opendir() never closed 2019-10-30 14:46:46 +01:00
Laurent Destailleur
c2638f4148 Merge pull request #12238 from atm-maxime/fix_fetch_contact
Fix missing contact fetch on card
2019-10-30 03:04:01 +01:00
Laurent Destailleur
b7e81c5396 Merge pull request #12247 from frederic34/patch-21
HOLIDAY_APPROVEInDolibarr
2019-10-30 02:44:50 +01:00
Laurent Destailleur
149d63757f Space 2019-10-29 11:43:56 +01:00
Laurent Destailleur
e58ecaaa64 Merge branch '8.0' of https://github.com/dolibarr/dolibarr into 9.0
Conflicts:
	htdocs/product/stock/replenishorders.php
2019-10-29 11:43:35 +01:00
Laurent Destailleur
21d15c3bcb FIX Set unpaid of expense report 2019-10-29 11:35:33 +01:00
Laurent Destailleur
5e06fe0712 FIX Avoid fatal error when creating thumb from PDF 2019-10-29 11:11:13 +01:00
Frédéric FRANCE
30d416f8c0 Update agenda.lang 2019-10-28 20:16:27 +01:00
Maxime Kohlhaas
fced9ec690 Fix missing contact fetch on card 2019-10-27 12:04:01 +01:00
Juanjo Menent
7e9d6dc153 Fix With pagination it is possible that the searched product does not appear if there are many open supplier orders 2019-10-24 10:58:29 +02:00
Laurent Destailleur
40135e043e Merge pull request #12166 from frederic34/patch-13
fix cant add bookmark with csrf active
2019-10-20 12:43:39 +02:00
Laurent Destailleur
b5390bfb3c Merge pull request #12167 from frederic34/patch-14
Update main.lang
2019-10-20 12:41:06 +02:00
Laurent Destailleur
ce1b443212 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-18 14:26:09 +02:00
Frédéric FRANCE
f9c0e63f16 Update main.lang 2019-10-17 22:59:52 +02:00
Frédéric FRANCE
aeafdae34c Update main.lang 2019-10-17 22:58:47 +02:00
Frédéric FRANCE
d442134a51 fix cant add bookmark with csrf active 2019-10-17 21:15:34 +02:00
Laurent Destailleur
373d6d60e7 Add a message 2019-10-17 21:13:18 +02:00
Laurent Destailleur
9cd2406d50 Merge pull request #12156 from ATM-Marc/FIX_8.0_replenish_resql
FIX: stock replenish: fetching and freeing non existing SQL result set
2019-10-17 17:40:24 +02:00
Marc de Lima Lucio
d79340a632 FIX: stock replenish: fetching and freeing non existing SQL result set 2019-10-17 09:55:02 +02:00
Laurent Destailleur
93aa7e208d Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-16 17:10:19 +02:00
Laurent Destailleur
b47ebcca2b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-16 17:10:10 +02:00
Laurent Destailleur
cb29133a3d Merge pull request #12142 from frederic34/patch-18
fix propal list for external user
2019-10-16 13:22:29 +02:00
Frédéric FRANCE
6a8e8907ef Update list.php 2019-10-15 17:55:07 +02:00
Laurent Destailleur
6662b00575 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-10-14 23:50:40 +02:00
Laurent Destailleur
2d1bc90e57 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-10-14 23:50:06 +02:00
Laurent Destailleur
94aa98beed Merge pull request #12131 from frederic34/patch-21
FIX Sort on total without tax on supplier invoices list
2019-10-14 21:25:13 +02:00
Frédéric FRANCE
45b3d623bb Update list.php 2019-10-14 20:30:31 +02:00
Laurent Destailleur
a35173973c Merge pull request #12102 from frederic34/patch-13
fix translation for showemailing
2019-10-12 03:26:46 +02:00
Frédéric FRANCE
c3e8aec07c fix translation for showemailing
in lang files, it's ShowEMailing not ShowEmailing
2019-10-11 23:54:05 +02:00
Laurent Destailleur
7ea0af4067 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-11 15:53:38 +02:00
Laurent Destailleur
2a07ecf659 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-11 15:53:30 +02:00
Laurent Destailleur
a6fd864145 Merge pull request #12075 from frederic34/patch-13
doxygen
2019-10-11 15:52:11 +02:00
Frédéric FRANCE
0c8331b6d7 doxygen 2019-10-09 18:47:25 +02: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
bb84e4a236 Merge pull request #12037 from frederic34/patch-14
Fix list of expense report list for user when he has extrafields
2019-10-07 13:10:02 +02:00
Laurent Destailleur
611b045676 Merge pull request #12053 from atm-lena/9.0_fix_link_fetch
FIX : missing "$this->id" in "fetch" function
2019-10-07 12:38:05 +02:00
Laurent Destailleur
55508e25ec Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-07 12:27:06 +02:00
atm-lena
8c024b3786 FIX : missing "$this->id" in "fetch" function 2019-10-07 11:26:10 +02:00
Laurent Destailleur
3d20766392 Merge pull request #12047 from frederic34/patch-15
translation for holidays actioncomm
2019-10-07 10:23:29 +02:00
Frédéric FRANCE
37f6aa3395 Update list.php 2019-10-06 15:52:33 +02:00
Frédéric FRANCE
52da21912b Update agenda.lang 2019-10-06 13:21:04 +02:00
Frédéric FRANCE
21dcc549fa translation for holidays actioncomm 2019-10-06 10:09:06 +02:00
Frédéric FRANCE
55410a55ef Update list.php 2019-10-04 00:45:57 +02:00
Laurent Destailleur
d9aa816197 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-03 17:52:06 +02:00
Laurent Destailleur
75be637b0b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-10-03 17:50:57 +02:00
Laurent Destailleur
7412335217 Merge pull request #12031 from atm-lena/8.0_fix_missingbegin
FIX missing begin()
2019-10-03 17:50:35 +02:00
atm-lena
ae01bd8f07 FIX missing begin() 2019-10-03 17:23:16 +02:00
Laurent Destailleur
03614536f9 Merge pull request #12018 from frederic34/patch-12
backport commit for setmulticurrency
2019-10-03 15:54:01 +02:00
Frédéric FRANCE
ad3cbd17c2 backport commit for setmulticurrency
a489207122 (diff-48f18024fb928ce21b76ef02fc967c67)
2019-10-02 11:12:30 +02:00
Laurent Destailleur
4928a999a0 Merge pull request #11933 from atm-gauthier/fix_conf_to_allow_changeproducttype
FIX : change product type must be allowed if we activate hidden conf
2019-10-01 14:41:52 +02:00
Laurent Destailleur
d448998762 Update card.php 2019-10-01 14:41:25 +02:00
gauthier
2167e7ed98 FIX : hidden conf to prevent from changing product_type 2019-10-01 09:12:51 +02:00
Laurent Destailleur
4f356fa412 Merge pull request #11859 from altatof/avoir
FIX : allow standalone credit note even if no invoice
2019-09-30 18:12:55 +02:00
Laurent Destailleur
945dd0ae89 Update card.php 2019-09-30 18:12:43 +02:00
Laurent Destailleur
29d941cb6e Merge pull request #11918 from atm-gauthier/8.0_fix_discount_visibility_follows_invoice_sharing
FIX : If we share invoice, we need to see discount created from a deposit on each entity
2019-09-30 18:04:07 +02:00
Laurent Destailleur
5d45638248 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-09-27 14:02:23 +02:00
Laurent Destailleur
7f9ea2e223 Merge pull request #11929 from atm-florian/9.0
fix regex main.inc.php warning
2019-09-27 12:26:24 +02:00
Laurent Destailleur
de11801792 Merge pull request #11971 from ATM-Marc/FIX_8.0_shipping_errors
FIX: shipping card: missing user error messages when classifying closed or billed
2019-09-27 11:56:43 +02:00
Laurent Destailleur
59a099b176 Merge pull request #11954 from frederic34/patch-18
add missing error code in price parser
2019-09-27 11:35:42 +02:00
Laurent Destailleur
fe15871fe3 Merge pull request #11935 from atm-gauthier/8.0_chargesociale
FIX : wrong test
2019-09-27 11:35:00 +02:00
Laurent Destailleur
99cfea1ff4 Update paiement_charge.php 2019-09-27 11:34:50 +02:00
Marc de Lima Lucio
13f5decdf7 FIX: shipping card: missing user error messages when classifying closed or billed 2019-09-27 11:00:17 +02:00
Laurent Destailleur
ba1275332d Fix thousand separator for fr_NC 2019-09-25 13:03:43 +02:00
Frédéric FRANCE
26cd418320 Update price_parser.class.php 2019-09-24 10:28:27 +02:00
gauthier
575e4d11d0 FIX : wrong test 2019-09-19 17:28:51 +02:00
gauthier
d40534e8fa FIX : change product type must be allowed if we activate hidden conf 2019-09-19 15:21:52 +02:00
florian HENRY
3b555797d1 fix regex 2019-09-19 12:32:26 +02:00
florian HENRY
536e99e3c9 fix regex main.inc.php fatal 2019-09-19 09:59:05 +02:00
Laurent Destailleur
00d5cff00d Fix XSS injection into textarea 2019-09-18 14:44:31 +02:00
Laurent Destailleur
e52788eb75 Fix xss 2019-09-18 14:31:03 +02:00
Laurent Destailleur
771104bc68 Fix XSS 2019-09-18 14:25:53 +02:00
Laurent Destailleur
345ac28c89 Fix js injection
Conflicts:
	htdocs/core/lib/functions.lib.php
	htdocs/user/group/card.php
2019-09-18 14:21:02 +02:00
Laurent Destailleur
7b512587aa FIX XSS 2019-09-18 14:15:20 +02:00
Laurent Destailleur
2da5071642 Fix VAT in New caledonia is now called TGC 2019-09-18 13:12:22 +02:00
Laurent Destailleur
ab9dee631b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-09-17 12:20:05 +02:00
Laurent Destailleur
64c53e2e85 Fix "project i am contact for" filter 2019-09-17 12:19:33 +02:00
gauthier
2ac8bd4e16 FIX : If we share invoice, we need to see discount created from a deposit on each entity 2019-09-17 11:59:58 +02:00
Laurent Destailleur
697b25aa82 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-09-14 18:24:00 +02:00
Laurent Destailleur
56e070cd7f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/accountancy/index.php
2019-09-14 18:23:20 +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
Laurent Destailleur
7b73e2d57a FIX label of thirdparty is wrong on open project list 2019-09-13 11:05:50 +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
Christophe Battarel
c8cb5886f4 correction 2019-09-10 17:04:09 +02:00
Christophe Battarel
95417d4c86 allow standalone credit note even if no invoice 2019-09-10 16:24:04 +02:00
Laurent Destailleur
48aedcee20 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/lib/functions.lib.php
2019-09-10 15:31:29 +02:00
Laurent Destailleur
d4e26fcc55 FIX missing include (dol_convert_file not found) 2019-09-10 15:29:33 +02:00
Laurent Destailleur
f2b9517dac FIX #11834 2019-09-09 13:16:31 +02:00
Laurent Destailleur
ffc49705d3 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-09-03 17:42:04 +02:00
Laurent Destailleur
1a8f271bf4 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-09-03 17:41:56 +02:00
Laurent Destailleur
f1a16a68dc Merge pull request #11787 from aspangaro/9.0_balance
FIX Sens of the balance (Debit - Credit in accountancy not contrary)
2019-09-03 17:41:35 +02:00
Laurent Destailleur
4a76dfa6ff Fix link to setup 2019-08-30 18:23:43 +02:00
Alexandre SPANGARO
14b9460de0 FIX Sens of the balance (Debit - Credit in accountancy not contrary) 2019-08-29 16:27:25 +02:00
Laurent Destailleur
55505604c1 Merge pull request #11397 from atm-josselin/FIX_product_document_and_special_characters
FIX : filepath of generated documents doesn't handle products with sp…
2019-08-27 14:12:48 +02:00
Laurent Destailleur
8a4ac2cb07 Merge pull request #11760 from atm-john/FIX_module_product_disabled
FIX: remove disabled product type from product list
2019-08-27 12:38:21 +02:00
John Botella
c2f570ae60 FIX: remove disabled product type from product list 2019-08-27 11:54:20 +02:00
Laurent Destailleur
047298cded Merge pull request #11511 from atm-florianm/9.0_FIX_dispatched-products-array-bug
9.0 fix dispatched products array bug
2019-08-26 23:58:40 +02:00
Laurent Destailleur
c7f06fe50e Fix phpcs 2019-08-26 23:56:17 +02:00
Laurent Destailleur
b6db04a727 Fix add missing filter on entity on stock listing for product combo 2019-08-26 22:42:04 +02:00
Laurent Destailleur
952e395943 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-08-26 22:34:51 +02:00
Laurent Destailleur
76bd9a09a6 FIX #11570 2019-08-26 22:34:41 +02:00
Laurent Destailleur
f07d99ed9a Merge pull request #11730 from atm-ph/fix_9.0_missing_hooks
Fix wrong placement to print title and missing hook to print value
2019-08-26 17:14:50 +02:00
Laurent Destailleur
9d2942bb88 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-08-26 16:41:14 +02:00
Laurent Destailleur
dcfbba9af5 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/compta/sociales/class/chargesociales.class.php
2019-08-26 16:41:06 +02:00
Laurent Destailleur
60b8982a74 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-08-26 16:39:39 +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
Laurent Destailleur
11acedbe59 Merge pull request #11735 from ptibogxiv/patch-235
Fix load langs in takepos
2019-08-26 16:35:42 +02:00
Laurent Destailleur
238970c069 Merge pull request #11734 from hregis/8.0_mc2
FIX wrong parameters
2019-08-26 16:28:39 +02:00
ptibogxiv
73a6b45e23 Fix load langs in takepos 2019-08-24 13:26:01 +02:00
Regis Houssin
064ab389ed FIX wrong parameters (same error in branch 9, 10, develop) 2019-08-24 12:44:23 +02:00
atm-ph
f14f1c9190 Fix wrong placement to print title and missing hook to print value 2019-08-23 09:15:15 +02:00
Regis Houssin
2d59f6bb3d FIX avoid sql error if fk_project is empty during update 2019-08-23 07:59:36 +02:00
Florian Mortgat
fa29415e6a Moved repair payload from a specific script to install/repair.php 2019-08-22 14:06:18 +02:00
Laurent Destailleur
a35f010e55 FIX name and position of hook FIX #11710 2019-08-22 12:30:14 +02:00
Laurent Destailleur
b06dab6930 Fix add option to restore backward compatibility 2019-08-22 00:44:28 +02:00
Laurent Destailleur
ed7480ddbb Fix phpcs 2019-08-21 16:03:49 +02:00
Laurent Destailleur
1b21905c55 Fix test on uploaded modules
Conflicts:
	htdocs/admin/modules.php
2019-08-21 14:53:58 +02:00
Laurent Destailleur
3a0057f6a3 FIX too many record in sql request. Whena criteria is a filter, we must
use an inner join.
2019-08-18 23:59:24 +02:00
Laurent Destailleur
b1be6bf4f2 FIX #11422 Can't edit his own events with standard rights 2019-08-18 01:24:54 +02:00
Laurent Destailleur
18eb2a83fe FIX #11671 CVE-2019-15062 2019-08-17 22:17:27 +02:00
Laurent Destailleur
d21e557100 FIX #11671 CVE-2019-15062 2019-08-17 22:16:27 +02:00
Laurent Destailleur
b8406f842d Merge pull request #10655 from atm-quentin/FIX_credit_note_used_on_list
Fix total on list and amount opened on thirdparty card (for supplier)
2019-08-15 21:14:03 +02:00
Laurent Destailleur
a8afb4549a Merge pull request #11634 from fmarcet/9.0
FIX: Not showing MAIN_INVERT_SENDER_RECIPIENT when edit field
2019-08-15 20:22:27 +02:00
Laurent Destailleur
31fa26c2be Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-08-10 01:36:50 +02:00
Laurent Destailleur
c647195689 Merge pull request #11632 from atm-greg/FIX_delivery_Extrafields
FIX delivery extrafields
2019-08-10 01:28:46 +02:00
Laurent Destailleur
049a08f435 Merge pull request #11631 from frederic34/patch-9
Update admin.lang
2019-08-10 01:15:28 +02:00
Laurent Destailleur
cee92356c6 Merge pull request #11644 from frederic34/patch-11
Update price_parser.class.php
2019-08-10 01:11:02 +02:00
Laurent Destailleur
2a726441a0 Merge pull request #11635 from frederic34/patch-10
FIX Return code of pdf_einstein.modules.php and proformat
2019-08-10 01:09:48 +02:00
Frédéric FRANCE
69985339d8 Update price_parser.class.php 2019-08-06 11:47:34 +02:00
Frédéric FRANCE
7f23b77cbe Update pdf_proforma.modules.php 2019-08-05 15:00:06 +02:00
Frédéric FRANCE
fde526f59d Update pdf_einstein.modules.php 2019-08-05 14:58:50 +02:00
Ferran Marcet
32220dde2e FIX: Wrong variable. Must be PROJECT_HIDE_UNSELECTABLES 2019-08-05 14:12:19 +02:00
Ferran Marcet
cda8b15c7f FIX: Not showing MAIN_INVERT_SENDER_RECIPIENT when edit field 2019-08-05 14:00:15 +02:00
atm-greg
1d4fc32c20 fix second bad test 2019-08-05 13:13:56 +02:00
atm-greg
41c07b9b43 fix bad test in delivery card 2019-08-05 13:10:26 +02:00
Frédéric FRANCE
baa2e870d0 Update admin.lang
found in admin/company.php
2019-08-05 11:01:58 +02:00
Laurent Destailleur
5339bb71ac FIX Fatal situation if payment removed on expense report. Action
set_unpaid was not available.
2019-08-03 20:57:21 +02:00
Laurent Destailleur
7f42380f83 FIX Fatal situation if payment removed on expense report. Action
set_unpaid was not available.
2019-08-03 20:53:57 +02:00
Laurent Destailleur
e4f2728494 Merge pull request #11608 from atm-arnaud/8.0_FIX_workflow_propal_and_order_billed
FIX order or proposals billed if both workflow conf activated
2019-08-01 16:37:48 +02:00
Laurent Destailleur
cd0d5c41f5 Update interface_20_modWorkflow_WorkflowManager.class.php 2019-08-01 16:37:40 +02:00
atm-arnaud
f64092a1e8 FIX order or proposals billed if both workflow conf activated 2019-08-01 11:00:49 +02:00
Florian Mortgat
3ef257f4f2 Removed commented out code from the new migration script 2019-07-31 09:21:00 +02:00
Laurent Destailleur
9baf21f492 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-30 22:03:13 +02:00
Laurent Destailleur
754ed1b93b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
2019-07-30 22:03:02 +02:00
Laurent Destailleur
6b789a13a1 Merge pull request #11562 from atm-quentin/FIX_pdf_cheque
FIX name was able to be in field but went back to new line
2019-07-30 22:00:58 +02:00
Laurent Destailleur
ed7a57e3ef Merge pull request #11571 from atm-john/9.0_fix_showOutputField
Fix sellist showOuputField
2019-07-30 21:40:37 +02:00
Laurent Destailleur
9a87e27176 Merge pull request #11566 from atm-florianm/FIX_workflow_amount_comparison_fails_due_to_floating_point_val_precision_arithmetic_drift
FIX: floating point precision errors in the triggers of the workflow module
2019-07-30 21:23:43 +02:00
Laurent Destailleur
fe8ced58c8 Update interface_20_modWorkflow_WorkflowManager.class.php 2019-07-30 21:19:33 +02:00
Laurent Destailleur
64118a4ae3 Merge pull request #11573 from atm-maxime/8.0
Fix var declaration #11429
2019-07-30 20:56:23 +02:00
Laurent Destailleur
cb07d80681 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-30 20:37:55 +02:00
Laurent Destailleur
5f2439bf0a Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-30 20:37:44 +02:00
Laurent Destailleur
9e622fe042 Merge pull request #11572 from atm-maxime/fix_holiday_update_solde
Fix holiday counter auto update
2019-07-30 20:12:30 +02:00
Laurent Destailleur
ea92ba2a78 Update holiday.class.php 2019-07-30 20:11:43 +02:00
Laurent Destailleur
a5e0dd56f4 Merge pull request #11580 from aspangaro/9.0_FEC
FIX FEC Format - Save translation of the journal label in database & nowrap on amount
2019-07-30 16:10:32 +02:00
Laurent Destailleur
941b2c5325 Merge pull request #11581 from aspangaro/9.0_adh
FIX Language key
2019-07-30 15:58:30 +02:00
Laurent Destailleur
c080878083 Merge pull request #11585 from ATM-Marc/FIX_9.0_expedition_printObjectLine_loop
FIX: expedition card: infinite loop for printObjectLine hook if return > 0
2019-07-30 15:58:09 +02:00
Laurent Destailleur
24695a9112 Merge pull request #11595 from ATM-Marc/FIX_8.0_import_bad_categories
FIX: categories import: prevent mismatch between category type and object type
2019-07-30 15:56:36 +02:00
Laurent Destailleur
bb885cadf2 Merge pull request #11563 from atm-quentin/FIX_sociales_redirect_index
FIX wrong path sociales/index.php doesnt exist anymore
2019-07-30 15:43:42 +02:00
Laurent Destailleur
5ef5c5521f Merge pull request #11597 from atm-florianm/8.0-FIX_missing_prefix_replacement_in_database_function_initialization
FIX issue #9300: install error with PostgreSQL using custom table prefix
2019-07-30 15:38:22 +02:00
Marc de Lima Lucio
703506c0e2 FIX: import filter error 2019-07-30 14:11:21 +02:00
Florian Mortgat
de293c4ef2 FIX issue #9300: install error with PostgreSQL when using custom table prefix 2019-07-30 14:09:03 +02:00
Laurent Destailleur
6aefa648e7 FIX CVE-2019-11199 2019-07-30 14:00:43 +02:00
Marc de Lima Lucio
449ef92007 FIX: categories import: prevent mismatch between category type and object type 2019-07-30 12:31:03 +02:00
Marc de Lima Lucio
87fc3c3968 FIX: expedition card: infinite loop for printObjectLine hook if return > 0 2019-07-29 13:56:35 +02:00
Florian Mortgat
858e8a826f FIX: use rounding to compare the amounts 2019-07-29 09:47:28 +02:00
Alexandre SPANGARO
7a9f2b43c5 FIX Language key 2019-07-29 07:05:18 +02:00
Alexandre SPANGARO
bb168d7f54 Merge branch '9.0' into 9.0_FEC 2019-07-29 06:54:48 +02:00
Alexandre SPANGARO
cd22cc70c8 FIX FEC Format - Save translation of the journal 2019-07-29 06:41:51 +02:00
Alexandre SPANGARO
a2fc3689da Nowrap on amount 2019-07-28 22:59:43 +02:00
Maxime Kohlhaas
43adb51932 Fix var declaration #11429 2019-07-27 22:06:08 +02:00
Maxime Kohlhaas
37ad5308e6 Fix holiday counter auto update 2019-07-27 19:19:13 +02:00
ATM john
581ae226ff Fix sellist showOuputField 2019-07-27 18:25:25 +02:00
Laurent Destailleur
471a947e8a FIX Attachment was lost when we validate an expense report
Conflicts:
	htdocs/expensereport/class/expensereport.class.php
2019-07-26 16:33:32 +02:00
Laurent Destailleur
8b81702dd7 Fix API 404 errors 2019-07-26 13:23:42 +02:00
Laurent Destailleur
c61f8e965d Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-26 13:16:59 +02:00
Laurent Destailleur
e92c6c87a0 FIX API return 404 sometimes even if API exists 2019-07-26 13:16:49 +02:00
atm-quentin
f7c739bba9 FIX wrong path sociales/index.php doesnt exist anymore 2019-07-26 12:12:08 +02:00
atm-quentin
1f7cd1a3f8 FIX name was able to be in field but went back to new line 2019-07-26 11:05:16 +02:00
Laurent Destailleur
0d79905b0a Merge pull request #11539 from hregis/9.0_bug2
FIX duplicate on the check (TODO field $onetrtd not used ?)
2019-07-25 17:56:42 +02:00
Laurent Destailleur
8241bc414a Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/lib/files.lib.php
2019-07-25 17:52:17 +02:00
Laurent Destailleur
fe9ddd7649 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/lib/files.lib.php
2019-07-25 17:50:07 +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
Laurent Destailleur
6e3fad8f83 Fix phpcs 2019-07-25 17:42:44 +02:00
Laurent Destailleur
27c6bfe9db Merge pull request #11548 from aspangaro/9.0pa
FIX FEC Format - Missing date_creation in general ledger when you add a new transaction
2019-07-25 17:37:05 +02:00
Laurent Destailleur
2f08715d5a Merge pull request #11559 from atm-florianm/FIX_product.lib.php_needed_for_pdf_generation
FIX: tk9877 - PDF rouget requires product.lib.php
2019-07-25 17:34:25 +02:00
Florian Mortgat
65e9d8f239 FIX: tk9877 - PDF rouget requires product.lib.php (otherwise measuring_units_string() is not defined) 2019-07-25 11:14:59 +02:00
Alexandre SPANGARO
2162f2331d Try to fix travis 2019-07-24 06:57:42 +02:00
atm-josselin
0a1f4b7931 FIX : correct error in files with multiple spaces 2019-07-23 09:45:17 +02:00
Laurent Destailleur
47ec88c8b5 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-22 19:06:57 +02:00
Laurent Destailleur
5dcf4d6646 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-22 19:06:48 +02:00
Laurent Destailleur
b4e0c5ef6c Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-07-22 18:51:32 +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
f39f710fd9 Merge pull request #11538 from atm-maxime/fix_agenda_list_filter
Fix lost filter in action list
2019-07-22 18:44:22 +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
56851f475e Merge pull request #11529 from atm-ph/fix_9.0_missing_hook
Fix missing hook
2019-07-22 18:41:55 +02:00
Laurent Destailleur
9c2527535b Merge pull request #11536 from atm-florian/9.0
fix warining message
2019-07-22 18:33:23 +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
Alexandre SPANGARO
7bdfd83288 FIX FEC Format - Missing date_creation in general ledger when you add a new transaction 2019-07-22 15:15:08 +02:00
Regis Houssin
6409cc06ae FIX duplicate on the check (TODO field $onetrtd not used ?) 2019-07-22 11:44:56 +02:00
Florian Mortgat
c9e70ed1c1 Fix problems detected by travis-ci 2019-07-22 09:30:43 +02:00
Maxime Kohlhaas
7ec8b48b18 Fix lost filter in action list 2019-07-21 22:21:11 +02:00
florian HENRY
b046bcc197 fix warning php 2019-07-20 15:19:25 +02:00
florian HENRY
d03d79222e fix warning php 2019-07-20 15:15:48 +02:00
florian HENRY
d88fec52bf fix warining message 2019-07-20 15:07:59 +02:00
gauthier
cd7d3f1a36 FIX : search by phone pro 2019-07-19 15:41:44 +02:00
Laurent Destailleur
98ae66b387 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-19 13:31:25 +02:00
Laurent Destailleur
1f308915ee Fix trans 2019-07-19 13:23:17 +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
atm-ph
a03bb00254 Fix missing hook 2019-07-19 11:26:21 +02:00
Laurent Destailleur
9b8b3b1ffc Merge pull request #11527 from atm-ph/fix_9.0_missing_trigger
Fix missing trigger call
2019-07-19 04:06:35 +02:00
Laurent Destailleur
e5801c0b68 Update bonprelevement.class.php 2019-07-19 04:06:22 +02:00
atm-ph
fcd95ce073 Fix missing trigger call 2019-07-18 18:07:17 +02:00
Laurent Destailleur
5e204f0f67 Merge 2019-07-18 17:51:32 +02:00
Laurent Destailleur
b044d95acf Merge 2019-07-18 17:50:15 +02:00
Laurent Destailleur
b0baba3293 Merge pull request #11526 from atm-ph/fix_9.0_missing_hook
Fix missing hook then can't interact with actions
2019-07-18 17:24:08 +02:00
Laurent Destailleur
b3182f65bc Update create.php 2019-07-18 17:23:52 +02:00
Laurent Destailleur
e548872133 Update prelevement.php 2019-07-18 17:23:05 +02:00
Laurent Destailleur
a20a121558 Merge pull request #11522 from atm-john/9.0_fix_action_list_contact_assigned
FIX: socpeople assigned list in action com list
2019-07-18 17:20:41 +02:00
Florian Mortgat
dbd68027f8 New script that links "orphaned" dispatch lines to order lines
(the "orphans" are dispatch lines that were created in old versions of Dolibarr which didn’t have fk_commandefourndet in llx_commande_fournisseur_dispatch)
2019-07-18 17:03:16 +02:00
Florian Mortgat
e404069d26 Revert "FIX: calculation of $products_dispatched"
This reverts commit 75ae611f9e.
2019-07-18 17:00:57 +02:00
Florian Mortgat
770b419769 Revert "FIX: wrong display (and hidden input) for already dispatched quantity"
This reverts commit b155fdc014.
2019-07-18 17:00:46 +02:00
atm-ph
984fe98342 Fix missing hook 2019-07-18 16:12:42 +02:00
atm-ph
c961a397c4 Fix missing hook then can't interact with actions 2019-07-18 15:40:50 +02:00
John Botella
b5d348356d Fix socpeople assigned list in action com list 2019-07-17 16:49:41 +02:00
Laurent Destailleur
a3b746bcb9 Merge pull request #11517 from hregis/9.0_bug2
FIX better compatibility with Multicompany
2019-07-16 17:10:47 +03:00
Laurent Destailleur
77300e1210 Merge pull request #11518 from ATM-Marc/FIX_9.0_propal_clone_hook
FIX: propal createFrom hook: undefined parameter attached
2019-07-16 17:04:53 +03:00
Laurent Destailleur
a03a8da2fd Merge pull request #11519 from atm-gauthier/8.0_fix_addline_cmdfourn_qty_inf_0
FIX : we need to be able to add freeline with qty between 0 & 1 in su…
2019-07-16 17:02:59 +03:00
gauthier
c72a59ad36 FIX : we need to be able to add freeline with qty between 0 & 1 in supplierorder line 2019-07-16 14:55:19 +02:00
Marc de Lima Lucio
464bda996c FIX: propal createFrom hook: undefined parameter attached 2019-07-16 13:59:00 +02:00
Laurent Destailleur
917799914e Merge pull request #11433 from atm-florianm/FIX_increase_stock_on_shipment_delete_when_STOCK_CALCULATE_ON_SHIPMENT_CLOSE_is_set
FIX: stock increase on shipment deletion if STOCK_CALCULATE_ON_SHIPMENT_CLOSE is set
2019-07-16 13:52:50 +03:00
Regis Houssin
c9fe91138d FIX better compatibility with Multicompany 2019-07-16 12:39:43 +02:00
Laurent Destailleur
617d10bf2a Merge pull request #11512 from atm-florianm/9.0_FIX_missing-hooks-in-supplier-product-list-and-supplier-product-dispatch
9.0 fix missing hooks in supplier product list and supplier product dispatch
2019-07-16 13:27:53 +03:00
Laurent Destailleur
de2c189138 Merge pull request #11516 from atm-john/9.0_fix_fourn_code_preload
FIX The proposed new supplier code does not work
2019-07-16 13:25:41 +03:00
John Botella
70ff806fdf fix fourn code preload 2019-07-16 10:46:58 +02:00
Laurent Destailleur
5d74c81941 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-15 23:48:40 +02:00
Laurent Destailleur
d694360c66 Fix warning 2019-07-15 23:46:54 +02:00
Laurent Destailleur
41d9e93b3f Merge pull request #11510 from hregis/9.0_bug2
FIX avoid conflict with "$classname" in card.php
2019-07-15 17:03:24 +03:00
Florian Mortgat
b155fdc014 FIX: wrong display (and hidden input) for already dispatched quantity 2019-07-15 12:00:06 +02:00
atm-florian.m
75ae611f9e FIX: calculation of $products_dispatched
After the DB retrieval method was changed from fetch_row to fetch_object, the indices used became wrong.
2019-07-15 12:00:06 +02:00
atm-florian.m
8aa147a4e5 # missing hooks from dispatch.php and list.php 2019-07-15 11:59:22 +02:00
atm-florian.m
ae540cb25e FIX: add missing hook calls 2019-07-15 11:59:22 +02:00
Regis Houssin
294bc5dcb5 FIX avoid conflict with "$classname" in card.php 2019-07-15 10:19:06 +02:00
Laurent Destailleur
3bfc1938d3 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/class/commonobject.class.php
2019-07-14 00:13:16 +02:00
Laurent Destailleur
b66ad24d85 Fix save of doc template for recuring invoices. 2019-07-14 00:10:15 +02:00
Laurent Destailleur
8090a8abb6 Fix param [] -> null 2019-07-14 00:07:27 +02:00
Laurent Destailleur
39e77dbdc6 Merge pull request #11461 from ATM-Nicolas/fix_template_invoice_edit_modelpdf
FIX : We must save code instead of value in database…
2019-07-14 00:19:13 +03:00
Laurent Destailleur
5ccb397af9 Merge pull request #11473 from hregis/9.0_security
FIX better compatibility with multicompany transverse mode
2019-07-13 23:42:36 +03:00
Laurent Destailleur
f285bed2ff Merge pull request #11479 from atm-gauthier/8.0_fix_report_by_tva
FIX : accounting mode must be taken from global conf, because there's…
2019-07-13 23:40:15 +03:00
Laurent Destailleur
b6571d9fc3 Update byratecountry.php 2019-07-13 22:39:25 +02:00
Laurent Destailleur
edd51bb150 Merge pull request #11469 from atm-maxime/fix_prelevement_rum
Fix : use RUM if defined in bank account
2019-07-13 23:34:31 +03:00
Laurent Destailleur
f34d96b5fb Merge pull request #11475 from atm-lena/9.0_fix_help_text
FIX help text
2019-07-13 23:32:35 +03:00
Laurent Destailleur
4dabdfa5ac Merge pull request #11483 from inoveaconseil/FIX_update_price
FIX element name in update_price
2019-07-13 23:30:17 +03:00
Laurent Destailleur
f041110a7e Update commonobject.class.php 2019-07-13 22:29:50 +02:00
Laurent Destailleur
db2e1d88a3 Merge pull request #11499 from hregis/9.0_bug2
FIX __INFOS__ tag not exists
2019-07-13 22:48:05 +03:00
Regis Houssin
332abd2a9f FIX __INFOS__ tag not exists 2019-07-13 11:02:45 +02:00
atm-florian.m
4f03165806 FIX: outdated phpdoc 2019-07-11 12:28:24 +02:00
Nicolas ZABOURI
abd0abf115 FIX element name in update_price 2019-07-10 18:36:12 +02:00
gauthier
cce8f98afc FIX : accounting mode must be taken from global conf, because there's no way to choose a mode with interface 2019-07-10 16:33:03 +02:00
atm-lena
a3f5397988 FIX help text 2 2019-07-10 15:55:50 +02:00
atm-lena
cebf81a514 FIX helpp text 2019-07-10 15:18:25 +02:00
Regis Houssin
41b004c2b8 FIX better compatibility with multicompany transverse mode 2019-07-10 12:16:32 +02:00
Maxime Kohlhaas
0aa42fefae Fix : use RUM if defined in bank account 2019-07-09 18:13:11 +02:00
ATM-Nicolas
3d076d8bf9 FIX : We must save code instead of value in database for template invoice modelpdf 2019-07-05 11:16:12 +02:00
atm-florian.m
8030735ded Merge branch 'FIX_add_checkbox_on_shipment_delete_confirm_dialog_to_ask_if_stock_should_be_incremented' into FIX_increase_stock_on_shipment_delete_when_STOCK_CALCULATE_ON_SHIPMENT_CLOSE_is_set
(taking PR comments into account)
2019-07-04 15:35:22 +02:00
atm-florian.m
64d1ebf59c FIX: on shipment delete confirm dialog, a new checkbox allows the user to choose if they want their stock re-incremented after the deletion. 2019-07-04 15:06:39 +02:00
Laurent Destailleur
8b0b824471 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-07-04 12:22:48 +02:00
Laurent Destailleur
ee0a65e7fa Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/comm/action/card.php
2019-07-04 12:22:40 +02:00
Laurent Destailleur
f8de11492e Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-07-04 12:21:25 +02:00
Laurent Destailleur
bc309ace38 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-07-04 12:21:16 +02:00
Laurent Destailleur
d04b19549e Merge pull request #11453 from atm-greg/FIX_9.0_selectForFormsList_for_invoices
fix case objecttmp is an invoice in selectForFormsList
2019-07-04 12:20:56 +02:00
Laurent Destailleur
63c93be94e Update html.form.class.php 2019-07-04 12:20:34 +02:00
Laurent Destailleur
a9dfca70cf Merge pull request #11452 from atm-florianm/FIX_minor_spelling_issues
FIX: minor spelling issues
2019-07-04 12:19:26 +02:00
Laurent Destailleur
554c76e232 Merge pull request #11451 from fmarcet/8.0
FIX: When saving an action it didn't save the label based on the type of event
2019-07-04 12:18:08 +02:00
Laurent Destailleur
125c2a65c0 Merge pull request #11445 from atm-john/9.0_fix_dictionary
Fix missing hidden input and short label
2019-07-04 10:54:16 +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
Laurent Destailleur
5fde7da183 Merge pull request #11439 from atm-quentin/FIX_empty_product_use_units
FIX empty product_use_units in product configuration
2019-07-04 10:38:15 +02:00
atm-greg
2f5b9ccb22 fix case objecttmp is an invoice 2019-07-03 17:00:18 +02:00
atm-florian.m
3e53a06b2e minor spelling issues 2019-07-03 16:17:47 +02:00
Ferran Marcet
433835860c FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized 2019-07-03 13:12:41 +02:00
Laurent Destailleur
9d50c67208 FIX option EXPORT_LABEL_FOR_SELECT to restore compatibility in export 2019-07-02 18:06:51 +02:00
John Botella
a75a2ae8e4 Fix missing hidden input and short label 2019-07-02 15:44:42 +02:00
Maxime Kohlhaas
6b43c325c7 Fix wrong column for filters on invoice template list 2019-07-02 10:53:47 +02:00
atm-quentin
8cdb251ca5 FIX product_use_units was set to 0 each time a conf in block other was set 2019-07-02 10:18:03 +02:00
Laurent Destailleur
ef27e32f53 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/filefunc.inc.php
2019-07-01 13:27:57 +02:00
Laurent Destailleur
3abaecfd77 Prepare 8.0.7 2019-07-01 13:27:18 +02:00
atm-florian.m
c45b191330 FIX: when STOCK_CALCULATE_ON_SHIPMENT_CLOSE is set, deleting a "closed" shipment now increases stock as expected 2019-07-01 10:26:03 +02:00
atm-josselin
c24a95b7ad Sanitize at creation of the product instead of the creation of the filepath 2019-07-01 09:31:01 +02:00
Laurent Destailleur
6537faa35e Fix merge 2019-06-29 23:26:14 +02:00
Laurent Destailleur
0aeb27ba97 Fix merge 2019-06-29 23:25:07 +02:00
Laurent Destailleur
fb42333b3e Merge branch '9.0' of github.com:Dolibarr/dolibarr into 9.0 2019-06-29 23:20:07 +02:00
Laurent Destailleur
81bb85c4df Merge 2019-06-29 23:19:47 +02:00
Laurent Destailleur
fdc958a172 Fix launch of ISCC.ex if not into path 2019-06-29 23:17:36 +02:00
Laurent Destailleur
854bbf8405 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-28 14:09:00 +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
Laurent Destailleur
a8837f5645 Merge pull request #11413 from atm-quentin/FIX_ending_slash
FIX ending slash
2019-06-27 20:23:22 +02:00
Maxime Kohlhaas
fc1d4704a5 Fix invoice list filter on withdrawal card 2019-06-27 17:33:47 +02:00
Laurent Destailleur
abbc9062ef Merge 2019-06-27 13:54:31 +02:00
Laurent Destailleur
fa986e311d Merge 2019-06-27 13:45:21 +02:00
Laurent Destailleur
d69b20311b FIX If the replacement invoice has been deleted we can reopen 2019-06-27 01:13:46 +02:00
Laurent Destailleur
be695a8e1a Fix link for situations 2019-06-27 00:51:03 +02:00
Laurent Destailleur
244d21bd2b Fix trans 2019-06-27 00:45:17 +02:00
Laurent Destailleur
12d3a7021f Prepare 8.0.5 2019-06-26 18:50:31 +02:00
atm-quentin
49db277368 FIX ending slash 2019-06-26 16:42:14 +02:00
Laurent Destailleur
f2ea78f2ec Removed useless files 2019-06-25 23:26:55 +02:00
Laurent Destailleur
70319031ba Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-25 23:21:10 +02:00
Laurent Destailleur
07fb930a79 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-25 23:20:27 +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
1ae9d94de9 Add info on signature generator 2019-06-25 23:15:30 +02:00
Laurent Destailleur
6790930283 Add info on signature generator 2019-06-25 23:11:49 +02:00
Laurent Destailleur
d5479cd9ae Fix import of ledger 2019-06-25 22:37:13 +02:00
Laurent Destailleur
ad725b3bb0 Doc 2019-06-25 22:27:35 +02:00
Laurent Destailleur
20471c54e1 Fix import code (regex of data imported + import of constant)
Conflicts:
	htdocs/core/modules/import/import_csv.modules.php
	htdocs/core/modules/import/import_xlsx.modules.php
2019-06-25 22:27:00 +02:00
Laurent Destailleur
d41850c7cd Fix purge of old files 2019-06-25 20:02:14 +02:00
Laurent Destailleur
4696d35bcb Fix we need to keep temp dir 2019-06-25 19:02:24 +02:00
Laurent Destailleur
1277e36179 Prepare 9.0.4 2019-06-25 13:30:18 +02:00
Laurent Destailleur
c9883eecd2 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/fichinter/list.php
2019-06-25 13:23:19 +02:00
Laurent Destailleur
144f2a5159 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/fichinter/list.php
2019-06-25 13:15:57 +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
d85ec982e5 Fix do not output log in arhived log for draft documents 2019-06-24 23:39:44 +02:00
Laurent Destailleur
862e20e820 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
2019-06-24 16:37:29 +02:00
Laurent Destailleur
ae1ad80994 Fix count 2019-06-24 16:32:42 +02:00
Laurent Destailleur
70f19b3a3d Fix counter of record 2019-06-24 16:31:56 +02:00
Laurent Destailleur
43123d6a87 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-24 16:13:36 +02:00
Laurent Destailleur
b98874848f Fix backport 9.0 2019-06-24 16:12:54 +02:00
Laurent Destailleur
84575df7e6 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-24 16:12:29 +02:00
Laurent Destailleur
3d185b6818 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/adherents/class/adherent.class.php
	htdocs/core/actions_massactions.inc.php
	htdocs/core/tpl/massactions_pre.tpl.php
2019-06-24 16:12:20 +02:00
atm-josselin
7a17c43b26 FIX : filepath of generated documents doesn't handle products with special characters 2019-06-24 16:05:24 +02:00
Laurent Destailleur
3c4956838e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
	htdocs/core/tpl/massactions_pre.tpl.php
2019-06-24 15:44:44 +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
Laurent Destailleur
7bbbe49b70 Merge pull request #11389 from atm-john/9.0_fix_ancor
Fix send mail ancor
2019-06-24 15:29:36 +02:00
Laurent Destailleur
7e10208619 Merge pull request #11380 from atm-florian/9.0
fix depending extrafeilds list
2019-06-24 15:23:48 +02:00
Laurent Destailleur
0854984a08 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/holiday/card.php
2019-06-23 18:09:49 +02:00
Laurent Destailleur
b153019000 FIX security (a user can read leave or holiday of other without perm. 2019-06-23 18:08:24 +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
c725db166d Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-21 11:26:44 +02:00
Laurent Destailleur
70c950bd7c Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/modules/modAdherent.class.php
2019-06-21 11:26:25 +02:00
Laurent Destailleur
9093be2f0a FIX Add missing end date of subscription in export 2019-06-21 11:23:49 +02:00
John Botella
e5298d0666 Fix send mail ancor 2019-06-21 11:20:04 +02:00
florian HENRY
0865bdb60f fix depending extrafeilds list 2019-06-20 12:16:48 +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
26c12c61a7 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-20 03:39:56 +02:00
Laurent Destailleur
4574ad2eeb Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
2019-06-20 03:39:48 +02:00
Laurent Destailleur
53688e2d0f Merge pull request #11353 from fmarcet/8.0
FIX: Wrong stock movement on supplier credit notes
2019-06-20 03:11:28 +02:00
Laurent Destailleur
d840c8f831 Merge pull request #11348 from frederic34/patch-5
Update companies.lang
2019-06-20 03:05:43 +02:00
Laurent Destailleur
4c7a689fb5 Merge pull request #11373 from atm-john/8.0_fix_var_name
FIX var name
2019-06-20 02:57:39 +02:00
Laurent Destailleur
33f39bdfcb Merge pull request #11368 from atm-gauthier/8.0_fix_facfourn_fetch_in_right_entity
FIX : we need to fetch fourn invoice with ref in current entity
2019-06-20 02:48:42 +02:00
John Botella
31a53b72ae FIX var name 2019-06-19 16:55:45 +02:00
gauthier
3ad13adf31 FIX : better syntax 2019-06-19 10:43:42 +02:00
gauthier
7331e43db8 FIX : we need to fetch fourn invoice with ref in current entity 2019-06-19 10:19:33 +02:00
Laurent Destailleur
20e00ca290 FIX if last char of customercode is accent making the truncate of first
chars wrong.
2019-06-18 19:41:16 +02:00
Laurent Destailleur
ae00743590 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-18 16:04:48 +02:00
Laurent Destailleur
81bca34a08 FIX A user may read holiday and expense report without permissions 2019-06-18 16:04:25 +02:00
Laurent Destailleur
6e9874b95a FIX A user may read holiday and expense report without permissions 2019-06-18 16:01:24 +02:00
Laurent Destailleur
6afda6a47a FIX invalid link on user.fk_user 2019-06-18 15:57:22 +02:00
Laurent Destailleur
27f52dd0bd Fix columns in csv 2019-06-18 14:32:35 +02:00
Laurent Destailleur
f6f66f2a77 Fix syntax error 2019-06-17 18:11:38 +02:00
Ferran Marcet
c62f370959 FIX: Wrong stock movement on supplier credit notes 2019-06-17 16:30:56 +02:00
Frédéric FRANCE
a399e3f63d Update companies.lang 2019-06-17 13:33:44 +02:00
Laurent Destailleur
c0a30d1ff5 FIX #11325 FIX #5249
Conflicts:
	htdocs/projet/tasks/time.php
2019-06-16 22:21:38 +02:00
Laurent Destailleur
5a4f2fa0b3 Merge pull request #11342 from simnandez/9.0
FIX: #11335
2019-06-16 17:25:02 +02:00
Juanjo Menent
a73ae49c4d FIX: #11296 2019-06-14 18:56:30 +02:00
Juanjo Menent
8afffc8762 FIX: #11335 2019-06-14 18:28:01 +02:00
Laurent Destailleur
239e41f6c4 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-14 13:57:49 +02:00
Laurent Destailleur
1d2c9c9df4 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-14 13:57:23 +02:00
Laurent Destailleur
a163623dc6 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-14 13:57:17 +02:00
Laurent Destailleur
e6b6246fea Merge pull request #11334 from atm-florianm/8.0_FIX-print-dictionaries-escape
FIX: in edit mode, dictionary inputs do not escape the string inside …
2019-06-14 13:36:06 +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
atm-florian.m
787e1319b9 FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes 2019-06-13 16:21:07 +02:00
Laurent Destailleur
9a5ac7d1c7 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-13 12:12:57 +02:00
Laurent Destailleur
3e6b7208cc Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-13 12:12:37 +02:00
Laurent Destailleur
319bc7ec8a Fix syntax error 2019-06-13 12:12:20 +02:00
Laurent Destailleur
4b1f0d1ac2 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
	htdocs/core/class/html.formother.class.php
2019-06-13 12:11:31 +02:00
Laurent Destailleur
b6f477fc83 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-13 12:07:24 +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
4f5f03b893 Merge pull request #11326 from atm-greg/FIX_massaction_presend
Fix massaction presend
2019-06-12 12:37:03 +02:00
Laurent Destailleur
0bf7512f28 Update actions_massactions.inc.php 2019-06-12 12:33:31 +02:00
atm-greg
47746fd17d fix template type 2019-06-12 12:30:49 +02:00
atm-greg
9ba102b6b9 bad object used 2019-06-12 12:08:16 +02:00
atm-greg
25031e534d fix massaction presend 2019-06-12 12:05:02 +02:00
Laurent Destailleur
afe1ec633b Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-12 10:07:21 +02:00
Laurent Destailleur
2d52537106 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-06-12 10:07:08 +02:00
Laurent Destailleur
1b6b471cb7 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-12 10:06:43 +02:00
Laurent Destailleur
8447259f25 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-12 10:06:34 +02:00
Laurent Destailleur
420f3bbdab FIX #11316 2019-06-12 10:05:53 +02:00
Laurent Destailleur
8f612bc1b2 Merge pull request #11314 from atm-maxime/fix_missing_hookparam
Fix missing massaction hook params
2019-06-12 09:21:15 +02:00
Maxime Kohlhaas
0ce2c2aab5 Fix missing massaction hook params 2019-06-10 10:11:26 +02:00
Laurent Destailleur
91a5547362 Merge pull request #11307 from frederic34/patch-7
Warning: A non-numeric value encountered
2019-06-07 18:11:09 +02:00
Laurent Destailleur
b36f80ab2e Merge pull request #11306 from frederic34/patch-6
Parameter must be array or object that implements Countable
2019-06-07 18:10:03 +02:00
Laurent Destailleur
b73d287953 Update agenda.lib.php 2019-06-07 18:09:43 +02:00
Laurent Destailleur
4ed7e281c5 Merge pull request #11301 from frederic34/patch-5
avoid warning with php 7.2
2019-06-07 15:08:49 +02:00
Laurent Destailleur
63d9e963b8 Merge pull request #11310 from atm-josselin/FIX_display_intervention_model_button
Display the intervention button only in develop mode
2019-06-07 15:08:07 +02:00
Laurent Destailleur
2e201abac0 Merge pull request #11308 from atm-maxime/8.0
Fix multicurrency setup page
2019-06-07 15:07:42 +02:00
Laurent Destailleur
deb9ac25a8 Merge branch '9.0' of https://github.com/dolibarr/dolibarr into 9.0 2019-06-06 19:08:26 +02:00
Laurent Destailleur
3ff154c1d0 Fix sql error 2019-06-06 19:05:47 +02:00
atm-josselin
c8ab7dee45 Display the intervention button only in develop mode 2019-06-06 16:34:44 +02:00
Maxime Kohlhaas
9c7c1ddceb Fix multicurrency setup page 2019-06-06 11:20:10 +02:00
Frédéric FRANCE
ad95b66842 Warning: A non-numeric value encountered 2019-06-06 10:12:01 +02:00
Frédéric FRANCE
f11db8396a Parameter must be array or object that implements Countable
warning with php 7.2
2019-06-06 09:49:32 +02:00
Frédéric FRANCE
ca6a624112 avoid warning with php 7.2 2019-06-05 13:55:47 +02:00
Laurent Destailleur
ab77051317 Fix time delay for purge 2019-06-04 20:03:27 +02:00
Laurent Destailleur
ba68e3d7ff Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/website/class/website.class.php
2019-06-04 18:47:22 +02:00
Laurent Destailleur
36df2f1026 Fix css 2019-06-04 18:45:01 +02:00
Laurent Destailleur
7b3242693b FIX default value for duration of validity can be set from generic
feature.
2019-06-04 18:17:07 +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
094719e099 Fix prefix 2019-06-02 15:53:16 +02:00
Laurent Destailleur
fc37c393ce Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
2019-06-02 12:36:48 +02:00
Laurent Destailleur
57cfb4b007 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
	htdocs/website/class/website.class.php
2019-06-02 12:36:07 +02:00
Laurent Destailleur
a20d824b97 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-02 12:30:34 +02:00
Laurent Destailleur
300f46cb01 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-06-02 12:30:25 +02:00
Laurent Destailleur
a1a9313487 Merge pull request #11292 from atm-maxime/fix_invoice_from_contract2
Fix : only invoice active lines of a contract
2019-06-02 12:29:13 +02:00
Laurent Destailleur
4bbef9b478 Update card.php 2019-06-02 12:29:05 +02:00
Laurent Destailleur
7020e1ef29 Update card.php 2019-06-02 12:27:32 +02:00
Laurent Destailleur
db7ea5f52a Merge pull request #11284 from atm-maxime/fix_buld_invoice_refclient
Fix : add refclient on bulk invoicing
2019-06-02 12:21:24 +02:00
Laurent Destailleur
2b3c5902e6 Merge pull request #11281 from atm-maxime/fix_warning_resource
Fix : warnings in resource module
2019-06-02 12:17:19 +02:00
Laurent Destailleur
cb927847ab Update dolresource.class.php 2019-06-02 12:16:12 +02:00
Laurent Destailleur
40b212d5cc Merge pull request #11280 from atm-maxime/fix_warning_page_var
Fix : avoid warning and uniformize $page var use
2019-06-02 12:14:47 +02:00
Laurent Destailleur
190cf8aba5 Merge pull request #11279 from atm-maxime/fix_tag_missing_right
Fix : missing rights test to display tag create link
2019-06-02 12:14:22 +02:00
Laurent Destailleur
3e9fbf0148 Update index.php 2019-06-02 12:14:07 +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
916d3ce931 Fix : only invoice active lines of a contract 2019-06-02 11:00:58 +02:00
Maxime Kohlhaas
d47913ed19 Fix : add refclient on bulk invoicing 2019-05-31 16:33:32 +02:00
Maxime Kohlhaas
0372276a7b Fix : warnings in resource module 2019-05-31 16:04:12 +02:00
Maxime Kohlhaas
6dd01e86e9 Fix : avoid warning and uniformize var use 2019-05-31 15:53:23 +02:00
Maxime Kohlhaas
9ab2f44946 Fix : missing rights test to display tag create link 2019-05-31 15:14:56 +02:00
Maxime Kohlhaas
15fd24a511 Fix : remove hardcoded llx_ prefix 2019-05-31 12:14:51 +02:00
Laurent Destailleur
f2088a084f Fix error management 2019-05-31 11:53:30 +02:00
Laurent Destailleur
12c1531b3b Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-31 11:39:06 +02:00
Laurent Destailleur
cd75794aaa FIX #11169 #11202 2019-05-31 11:38:54 +02:00
Laurent Destailleur
dedd85c8b5 Merge pull request #11271 from hregis/9.0_security
FIX missing llx_const encrypt
2019-05-31 10:56:24 +02:00
Regis Houssin
bdd54ae245 FIX missing llx_const encrypt 2019-05-30 11:42:28 +02:00
Laurent Destailleur
69efc54fb6 Merge pull request #11263 from atm-arnaud/9.0_FIX_productaccount_buy_page
FIX productaccount buylist with pages
2019-05-29 13:52:53 +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
Laurent Destailleur
912e29a746 FIX #11244 2019-05-29 11:06:01 +02:00
Laurent Destailleur
3c05cfe690 Fix useless test 2019-05-29 10:50:33 +02:00
Laurent Destailleur
b46b675b7c Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-29 10:36:00 +02:00
Laurent Destailleur
a491de01b3 Merge pull request #11244 from altatof/8.0
FIX : do not include tpl from disabled modules
2019-05-29 10:35:39 +02:00
Laurent Destailleur
a26c8c0714 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-29 09:55:55 +02:00
Laurent Destailleur
6e9cd819c1 Fix phpcs 2019-05-29 09:55:09 +02:00
Laurent Destailleur
35b021f203 Fix phpcs 2019-05-29 09:53:54 +02:00
atm-arnaud
a853764f6d FIX productaccount buylist with pages 2019-05-28 15:03:36 +02:00
Laurent Destailleur
2352463c21 Fix link to change validator is on validate status only 2019-05-28 13:23:12 +02:00
Laurent Destailleur
666e4fdb5f Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-27 20:22:21 +02:00
Laurent Destailleur
991e247e30 Fix edit of validator 2019-05-27 20:21:50 +02:00
Laurent Destailleur
f5d51dab5f Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/holiday/card.php
2019-05-27 20:14:37 +02:00
Laurent Destailleur
02fc896612 FIX Even with permission, can't validate leave once validator defined. 2019-05-27 20:12:33 +02:00
Laurent Destailleur
1c6ddd25c4 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-27 19:23:54 +02:00
Laurent Destailleur
7db643fff0 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-05-27 19:23:09 +02:00
Laurent Destailleur
93c395fe10 FIX confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL 2019-05-27 19:22:51 +02:00
Laurent Destailleur
7964bb12ce FIX Use of cron with multicompany 2019-05-27 18:13:33 +02:00
Laurent Destailleur
4596ec7d38 FIX Use of cron with multicompany 2019-05-27 18:11:15 +02:00
Laurent Destailleur
71da27f333 Add error message 2019-05-27 16:40:06 +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
08a731ab39 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-26 15:25:37 +02:00
Laurent Destailleur
45aaafd4d6 Fix email not set in paybox payment 2019-05-26 15:25:26 +02:00
Laurent Destailleur
a40e5ca66c Fix phpcs 2019-05-26 11:36:16 +02:00
Laurent Destailleur
c04d082ad1 FIX Import of chart of account 2019-05-24 18:14:15 +02:00
Laurent Destailleur
bad565cc64 Fix syntax error 2019-05-24 18:13:24 +02:00
Laurent Destailleur
0fc7ad7c1f Add one param to fetch of accounting account to solve chart import 2019-05-24 18:05:29 +02:00
Laurent Destailleur
769fbdb429 FIX the id was not loaded in fetch of accounting system 2019-05-24 17:39:37 +02:00
Laurent Destailleur
49991eabf8 Fix import of accounting account from ref in import profiles 2019-05-24 17:09:18 +02:00
Laurent Destailleur
63824861a6 Fix import of chart of account. The account parent was not managed. 2019-05-24 16:58:06 +02:00
Christophe Battarel
83d883c36a finally eldy is always right 2019-05-24 15:14:34 +02:00
Christophe Battarel
4863ddcb00 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr into 8.0 2019-05-24 15:13:23 +02:00
Laurent Destailleur
89455672a2 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	htdocs/compta/facture/class/facture.class.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
2019-05-24 14:58:21 +02:00
Laurent Destailleur
7a0c6859bd Merge pull request #11240 from ATM-Marc/FIX_8.0_crabe_situation_vat
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
2019-05-24 12:57:01 +02:00
Christophe Battarel
545cdd0762 test include return on FALSE 2019-05-24 12:54:24 +02:00
Laurent Destailleur
5d6e4a444a Merge pull request #11237 from ATM-Marc/FIX_8.0_situation_discount
FIX: situation invoices: block progress percentage change for discount lines
2019-05-24 12:53:34 +02:00
Christophe Battarel
abc7c2f0f8 test include return on TRUE 2019-05-24 12:33:40 +02:00
Christophe Battarel
aaaad71347 FIX : do not include disabled modules tpl 2019-05-24 12:10:58 +02:00
Marc de Lima Lucio
49385fcab3 FIX: situation invoices: bad detailed VAT in situations following the first one 2019-05-23 14:37:40 +02:00
Marc de Lima Lucio
54f8c98b27 FIX: remove isolated transaction commit 2019-05-22 11:12:02 +02:00
Marc de Lima Lucio
66dd7e30ae FIX: situation invoices: block progress percentage change for discount lines 2019-05-22 10:46:38 +02:00
Laurent Destailleur
f99f1d83c2 Merge pull request #11229 from frederic34/patch-7
target _blank depend of mime
2019-05-21 22:42:36 +02:00
Laurent Destailleur
16f7d96ed1 Merge pull request #11231 from ATM-Marc/FIX_8.0_extrafields_search
FIX: extrafield list search: SQL error when field is multiselect
2019-05-21 22:38:14 +02:00
Laurent Destailleur
a7f5f3fb94 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-21 21:16:54 +02:00
Laurent Destailleur
dcf77520ea FIX Error management when MAILING_NO_USING_PHPMAIL is set 2019-05-21 21:16:06 +02:00
Marc de Lima Lucio
18a6ed17cf FIX: extrafield list search: SQL error when field is multiselect 2019-05-21 14:49:23 +02:00
Laurent Destailleur
5131e7a5b7 Fix SQL injection 2019-05-21 14:39:38 +02:00
Laurent Destailleur
61ead06950 Fix Injection 2019-05-21 14:35:05 +02:00
Laurent Destailleur
479f8616e1 Fix sanitize data 2019-05-21 14:03:28 +02:00
Laurent Destailleur
f283e24b48 Fix the noexe must be added for dangerous extension like js and shells 2019-05-21 13:53:12 +02:00
Frédéric FRANCE
84781cabac target _blank depend of mime
target _blank is added in the previous line depending on mimtype
2019-05-21 13:11:17 +02:00
Laurent Destailleur
ebf252f8a3 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-20 15:40:50 +02:00
Laurent Destailleur
2a2fcf6784 FIX only profid1 to 4 were editable for pdf option to show. Not 5 and 6. 2019-05-20 15:38:33 +02:00
Laurent Destailleur
ea5ffbb0bf Merge pull request #11216 from atm-florian/8.0
fix:  #11187
2019-05-19 02:19:12 +02:00
Laurent Destailleur
71ef8c881b Merge branch '8.0' of https://github.com/dolibarr/dolibarr into 9.0
Conflicts:
	htdocs/modulebuilder/template/class/myobject.class.php
2019-05-19 02:06:20 +02:00
florian HENRY
e4d87ab2e7 fix: #11189 2019-05-19 02:05:13 +02:00
Laurent Destailleur
7738787729 Merge branch '7.0' of https://github.com/dolibarr/dolibarr into 8.0
Conflicts:
	htdocs/core/actions_sendmails.inc.php
2019-05-19 02:03:16 +02:00
florian HENRY
6e7fe1a6c2 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr into 8.0 2019-05-19 01:58:38 +02:00
florian HENRY
4311a1ece8 fix: #11187 2019-05-19 01:58:20 +02:00
Laurent Destailleur
0f3ae6dc39 Merge pull request #11215 from ATM-Marc/FIX_8.0_invoice_default_product_type
FIX: invoice class: bad SQL request if product type not set
2019-05-19 01:58:13 +02:00
Laurent Destailleur
2fd3eb8bdf Update facture.class.php 2019-05-19 01:58:01 +02:00
Laurent Destailleur
684cbbdddb Merge pull request #11212 from ATM-Marc/FIX_8.0_modulebuilder_foreignkey
FIX: modulebuilder: hardcoded llx_
2019-05-19 01:55:02 +02:00
Laurent Destailleur
234ad4c76a Merge pull request #11214 from atm-maxime/7.0
Fix #8344
2019-05-19 01:53:13 +02:00
Laurent Destailleur
32485c2782 Fix phpcs 2019-05-19 01:45:33 +02:00
ATM-Marc
83c38570e9 FIX: invoice class: bad SQL request if product type not set 2019-05-19 01:01:21 +02:00
Maxime Kohlhaas
1d980342ec Fix #8344 2019-05-19 00:05:23 +02:00
Laurent Destailleur
3e3ed6f9e7 Fix phpcs 2019-05-18 20:11:51 +02:00
ATM-Marc
9b805f742b FIX: modulebuilder: hardcoded llx_ 2019-05-18 20:09:00 +02:00
Laurent Destailleur
34b5399329 Merge pull request #11209 from atm-maxime/fix_holiday_missing_stats
Fix holiday missing stats
2019-05-18 19:33:36 +02:00
Maxime Kohlhaas
4f64250ad6 Fix menu links for holidays 2019-05-18 17:12:25 +02:00
Maxime Kohlhaas
ea4dcbc77a Add translation 2019-05-18 17:07:55 +02:00
Maxime Kohlhaas
6c195d7bdf Add warning delay for holidays 2019-05-18 17:07:29 +02:00
Maxime Kohlhaas
ea1efa5e88 Fix missing dashboard stats for holidays 2019-05-18 17:06:33 +02:00
Maxime Kohlhaas
28a4785b3a Fix missing TOKEN 2019-05-18 17:06:23 +02:00
Laurent Destailleur
6c4a4c34c4 Merge branch '8.0' of https://github.com/dolibarr/dolibarr into 9.0 2019-05-18 02:26:40 +02:00
Laurent Destailleur
d4f356c8f6 Merge pull request #11200 from atm-maxime/fix_project_beluga
Fix project beluga order status
2019-05-18 02:16:50 +02:00
Maxime Kohlhaas
095fd2769a Fix project beluga order status 2019-05-18 01:11:34 +02:00
Laurent Destailleur
92dbc3ec1f Merge pull request #11199 from atm-maxime/fix_resource_deletefile
Fix resource delete with attached file
2019-05-18 00:59:35 +02:00
Laurent Destailleur
b5187db6d0 Merge pull request #11198 from atm-maxime/fix_api_varname
Fix varnames in invoice api
2019-05-18 00:59:03 +02:00
Laurent Destailleur
68118e55dc Update api_invoices.class.php 2019-05-18 00:58:43 +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
Laurent Destailleur
590ee589c1 Merge pull request #11192 from atm-maxime/fix_usertab_hr
Fix : display hr tab on user if rights to read all
2019-05-18 00:48:06 +02:00
Maxime Kohlhaas
aed71be7f1 Fix resource delete with attached file 2019-05-18 00:47:32 +02:00
Maxime Kohlhaas
1af69d4c8f Fix varnames in invoice api 2019-05-18 00:40:29 +02:00
ATM-Marc
b85ed3e0b7 FIX: mail presend: can overwrite a file previously uploaded 2019-05-18 00:11:15 +02:00
Maxime Kohlhaas
2a2f0557cf Fix : display hr tab on user if rights to read all 2019-05-17 17:07:38 +02:00
Laurent Destailleur
e2408fb54d Merge pull request #11170 from atm-greg/Fix_margin_calculation_on_display
fix useless calculation
2019-05-13 20:20:01 +02:00
Laurent Destailleur
9242c1a630 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts:
	ChangeLog
	htdocs/contrat/services_list.php
	htdocs/core/lib/files.lib.php
	htdocs/filefunc.inc.php
	htdocs/product/list.php
2019-05-13 12:22:14 +02:00
atm-greg
644f247910 fix useless calculation 2019-05-13 12:02:46 +02:00
Laurent Destailleur
1626c9fb6e Merge pull request #11145 from atm-gauthier/8.0_fix_filename_with_two_spaces
FIX : use dol_sanitizeFileName() function to remove double spaces in …
2019-05-13 12:01:05 +02:00
Laurent Destailleur
c67d79a4e2 Update files.lib.php 2019-05-13 12:00:13 +02:00
Juanjo Menent
072a455ca4 Prepare 8.0.6 2019-05-11 22:55:42 +02:00
Juanjo Menent
7041c3246e Prepare 8.0.5 2019-05-11 22:35:56 +02:00
Juanjo Menent
40229c9d96 Merge pull request #11166 from simnandez/8.0
Merge branch '7.0' into 8.0
2019-05-11 18:06:20 +02:00
Juanjo Menent
f4ca6916cd Merge remote-tracking branch 'upstream/7.0' into 8.0
# Conflicts:
#	htdocs/contrat/services_list.php
#	htdocs/expensereport/list.php
#	htdocs/projet/list.php
2019-05-11 17:31:23 +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
Laurent Destailleur
eed2b97913 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 9.0 2019-05-10 17:40:53 +02:00
Laurent Destailleur
069df82380 FIX javascript error when ckeditor module not enabled 2019-05-10 17:40:34 +02:00
Laurent Destailleur
46ecdb8d4d Merge pull request #11155 from simnandez/9.0
FIX: #11097
2019-05-10 16:27:59 +02:00
Laurent Destailleur
95326c3d63 Update list.php 2019-05-10 16:27:38 +02:00
Laurent Destailleur
22c548e80b Fix sql 2019-05-10 14:46:43 +02:00
Laurent Destailleur
14b11b3cc5 Prepare 9.0.4 2019-05-10 14:43:01 +02:00
Laurent Destailleur
5625c94c44 Fix missing label on project tooltip 2019-05-10 14:40:15 +02:00
Juanjo Menent
72dd3705ed Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-05-10 09:13:33 +02:00
Juanjo Menent
2df026b903 FIX: #11032 2019-05-09 20:59:22 +02:00
Juanjo Menent
e36df726a1 Merge remote-tracking branch 'upstream/9.0' into 9.0 2019-05-09 20:42:04 +02:00
Juanjo Menent
2b182c1cc1 FIX: #11097 2019-05-09 20:39:30 +02:00
gauthier
f661b926fa FIX : use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
Example : if you upload a file like "my  file.pdf" (with 2 spaces), it's impossible to download it after. then we have to remove at least 1 space
2019-05-07 14:33:17 +02:00
Juanjo Menent
1b5cabad71 Fix: #10956 2019-04-12 18:50:48 +02:00
atm-quentin
6deba39c6a FIX credit note can be split 2019-04-12 10:16:13 +02:00
atm-quentin
7ae6472e36 Merge branch '8.0' of github.com:Dolibarr/dolibarr into FIX_credit_note_used_on_list 2019-04-12 09:20:16 +02:00
atm-quentin
dc7a2fbb30 FIX placement function 2019-02-25 10:01:26 +01:00
atm-quentin
7850925441 FIX amount opened on thirdparty card dont care of credit note not converted 2019-02-22 15:10:41 +01:00
atm-quentin
57fff10766 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr into FIX_credit_note_used_on_list 2019-02-22 15:10:29 +01:00
atm-quentin
b6deda1111 FIX credit note used on list 2019-02-18 12:28:18 +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
245 changed files with 4989 additions and 3491 deletions

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

@@ -3,6 +3,7 @@
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
# We use dist: trusty to have php 5.4+ available
os: linux
dist: trusty
sudo: required
@@ -119,6 +120,7 @@ install:
composer self-update
composer -n init
composer -n config vendor-dir htdocs/includes
composer -n config -g vendor-dir htdocs/includes
echo
- |
@@ -299,7 +301,7 @@ script:
# Ensure we catch errors
set -e
#parallel-lint --exclude htdocs/includes --blame .
parallel-lint --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
parallel-lint --exclude htdocs/includes/myclabs --exclude htdocs/includes/webmozart --exclude htdocs/includes/phpspec --exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/phpexcel/Classes/PHPExcel/Shared --exclude htdocs/includes/sebastian --exclude htdocs/includes/squizlabs/php_codesniffer/tests --exclude htdocs/includes/jakub-onderka/php-parallel-lint/tests --exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/phpunit/php-token-stream/tests --exclude htdocs/includes/composer/autoload_static.php --blame .
set +e
echo

169
ChangeLog
View File

@@ -3,6 +3,56 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 9.0.4 compared to 9.0.3 *****
FIX: #5249
FIX: #11025
FIX: #11032
FIX: #11097
FIX: #11169
FIX: #11202
FIX: #11244
FIX: #11296
FIX: #11316
FIX: #11335
FIX: Add missing end date of subscription in export
FIX: A user may read holiday and expense report without permissions
FIX: better syntax
FIX: condition
FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
FIX: default value for duration of validity can be set from generic
FIX: do not include tpl from disabled modules
FIX: Error management when MAILING_NO_USING_PHPMAIL is set
FIX: Even with permission, can't validate leave once validator defined.
FIX: extrafield list search: SQL error when field is multiselect
FIX: if last char of customercode is accent making the truncate of first
FIX: Import of chart of account
FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
FIX: invalid link on user.fk_user
FIX: invoice class: bad SQL request if product type not set
FIX: javascript error when ckeditor module not enabled
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
FIX: mass send mail
FIX: missing compatibility with multicompany transverse mode
FIX: missing llx_const encrypt
FIX: modulebuilder: hardcoded llx_
FIX: Not showing Contract and Project columns on ficheinter list
FIX: only profid1 to 4 were editable for pdf option to show. Not 5 and 6.
FIX: productaccount buylist with pages
FIX: remove isolated transaction commit
FIX: security (a user can read leave or holiday of other without perm.
FIX: situation invoices: bad detailed VAT in situations following the first one
FIX: situation invoices: block progress percentage change for discount lines
FIX: syntax error
FIX: the id was not loaded in fetch of accounting system
FIX: try to use WHERE EXISTS instead of DISTINCT
FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
FIX: Use of cron with multicompany
FIX: var name
FIX: we need to fetch fourn invoice with ref in current entity
FIX: Wrong stock movement on supplier credit notes
FIX: Import of record in ledger
***** ChangeLog for 9.0.3 compared to 9.0.2 *****
FIX: #11013
FIX: #11041
@@ -255,6 +305,125 @@ Following changes may create regressions for some external modules, but were nec
* Remove the no more used and deprecated dol_print_graph function
***** ChangeLog for 8.0.6 compared to 8.0.5 *****
FIX: #11244
FIX: #11316
FIX: Add missing end date of subscription in export
FIX: A user may read holiday and expense report without permissions
FIX: better syntax
FIX: condition
FIX: confirmation of mass email sending + option MAILING_NO_USING_PHPMAIL
FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
FIX: default value for duration of validity can be set from generic
FIX: do not include tpl from disabled modules
FIX: Error management when MAILING_NO_USING_PHPMAIL is set
FIX: Even with permission, can't validate leave once validator defined.
FIX: extrafield list search: SQL error when field is multiselect
FIX: if last char of customercode is accent making the truncate of first
FIX: in edit mode, dictionary inputs do not escape the string inside the 'value' attribute, causing errors if there are any double quotes
FIX: invalid link on user.fk_user
FIX: invoice class: bad SQL request if product type not set
FIX: mail presend: can overwrite a file previously uploaded
FIX: mail presend: can overwrite a file previously uploaded (Issue #11056)
FIX: mass send mail
FIX: missing compatibility with multicompany transverse mode
FIX: modulebuilder: hardcoded llx_
FIX: Not showing Contract and Project columns on ficheinter list
FIX: remove isolated transaction commit
FIX: security (a user can read leave or holiday of other without perm.
FIX: situation invoices: bad detailed VAT in situations following the first one
FIX: situation invoices: block progress percentage change for discount lines
FIX: syntax error
FIX: try to use WHERE EXISTS instead DISTINCT
FIX: use dol_sanitizeFileName() function to remove double spaces in filenames, as well as done on document.php when we want to download pdf
FIX: var name
FIX: we need to fetch fourn invoice with ref in current entity
FIX: Wrong stock movement on supplier credit notes
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
FIX: #10381
FIX: #10460 compatibility with MariaDB 10.4
FIX: #11025
FIX: Accountancy - Add transaction with multicompany use all the time 1st entity
FIX: Accountancy - Format EBP import
FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work
FIX: actioncomm: sort events by date after external calendars and hook
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
FIX: add fk_unit on addline action
FIX: avoid php warning
FIX: bad sql request
FIX: better method
FIX: better test
FIX: better test on fetch
FIX: broken external authentication module feature and avoid warning
FIX: Can not create contract with numbering module without autogen rule
FIX: can't add lines on invoices
FIX: Can't generate invoice pdf
FIX: Can't insert if there is extrafields mandatory on another entity.
FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar
FIX: Check for old picture name if the new one was not found
FIX: Civility not saved when creating a member.
FIX: $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
FIX: could not create several superadmin in transversal mode
FIX: credit note can have negative value
FIX: Default value on sales representative on third party creation
FIX: Don't show journal:getNomUrl without data
FIX: Erreur dans le Total
FIX: error messages not displayed
FIX: expedition: reset status on rollback + replace hardcoded status with const
FIX: Fix PHP warning "count(): Parameter must be an array..."
FIX: fk_default_warehouse missing in group by
FIX: function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it
FIX: holidays get natural_search if search params are set only
FIX: if empty error message, we just see "error" displayed
FIX: if(!method_exists(dol_loginfunction))
FIX: If we build one invoice for several orders, we must put the ref of order on the line to not lose information.
FIX: in fact expensereport must be in $check array
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: line edit template: keep fk_parent_line
FIX: Loan impossible to account
FIX: Mark credit note as available for credit note in other currency
FIX: missing access security checking with multicompany
FIX: missing entity filter and wrong var name
FIX: missing entity filter in function "build_filterField()" (export)
FIX: Missing field in import/export of users
FIX: missing hook completeTabsHead in margins module
FIX: missing $ismultientitymanaged for previous/next ref
FIX: Missing province in export of invoice
FIX: multicompany compatibility
FIX: must fetch member in current entity
FIX: need an order by in case we found other invoice with same number but not same date
FIX: need to round with 2 decimals to avoid movements not correctly balanced
FIX: no need to test anything to display documents tabs on expense report
FIX: positive values creating diff on addline rounding
FIX: problem with multicompany transverse mode
FIX: Product accountancey sell intra code must be visible if main feature level 1
FIX: project_title for display of getNomUrl()
FIX: quick search for supplier orders
FIX: Remane of project
FIX: same thing here
FIX: Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: several hooks in shipping/delivery cards
FIX: shipping default warehouse if only one warehouse
FIX: SQL injection on rowid of dict.php
FIX: 'statut' is ignored when updating a user with the REST API.
FIX: supplier invoice payment total dont care about deposit or credit
FIX: supplier invoice product stats total ht is line total not invoice total
FIX: The minimum amount filter does not work in the VAT report per customer
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
FIX: Update/delete currency on same languages
FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9
FIX: useless join
FIX: we need to keep originline special_code
FIX: we want to be able to reopen fourn credit note
FIX: when 2 extra fields are mandatory in 2 different entities
FIX: when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
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)
FIX: wrong redirect link on holiday refuse
FIX: wrong test enabled
FIX: Wrong variable name
FIX: XSS
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
FIX: #10030 better german chart
FIX: #10036

View File

@@ -72,7 +72,7 @@ while ($i < $argc)
if (empty($release))
{
print "Error: Missing release paramater\n";
print "Error: Missing release parameter\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
exit -1;
}
@@ -121,6 +121,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)
@@ -163,7 +164,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
// Need to ignore document custom etc. Note: this also ignore natively symbolic links.
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
*/
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
$dir='';

View File

@@ -361,12 +361,12 @@ if ($nboftargetok) {
}
if (! $BUILD || $BUILD eq '0-rc') # For a major version
{
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log `git rev-list --boundary '.$MAJOR.'.'.$MINOR.'..origin/develop | grep ^- | cut -c2- | head -n 1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
else # For a maintenance release
{
#print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
print 'cd ~/git/dolibarr_'.$MAJOR.'.'.$MINOR.'; git log '.$MAJOR.'.'.$MINOR.'.'.($BUILD-1).'.. | grep -v "Merge branch" | grep -v "Merge pull" | grep "^ " | sed -e "s/^[0-9a-z]* *//" | grep -e \'^FIX\|NEW\|CLOSE\' | sort -u | sed \'s/FIXED:/FIX:/g\' | sed \'s/FIXED :/FIX:/g\' | sed \'s/FIX :/FIX:/g\' | sed \'s/FIX /FIX: /g\' | sed \'s/NEW :/NEW:/g\' | sed \'s/NEW /NEW: /g\' > /tmp/aaa';
}
print "\n";
@@ -387,6 +387,8 @@ if ($nboftargetok) {
#-----------------------
if ($CHOOSEDTARGET{'-CHKSUM'})
{
chdir("$SOURCE");
$ret=`git ls-files . --exclude-standard --others`;
if ($ret)
{

View File

@@ -279,7 +279,8 @@ if ($result)
if ($search_desc > 0) $param.="&search_desc=".urlencode($search_desc);
if ($search_current_account > 0) $param.="&search_current_account=".urlencode($search_current_account);
if ($search_current_account_valid && $search_current_account_valid != '-1') $param.="&search_current_account_valid=".urlencode($search_current_account_valid);
if ($accounting_product_mode) $param.="&accounting_product_mode=".urlencode($accounting_product_mode);
print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -164,7 +164,7 @@ if ($action == 'export_csv')
print $object->get_compte_desc($line->numero_compte) . $sep;
print price($line->debit) . $sep;
print price($line->credit) . $sep;
print price($line->credit - $line->debit) . $sep;
print price($line->debit - $line->credit) . $sep;
print "\n";
}
@@ -235,7 +235,7 @@ if ($action != 'export_csv')
print $langs->trans('to');
print $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, '');
print '</td>';
print '<td align="right" class="liste_titre">';
print '<td class="liste_titre right">';
$searchpicto=$form->showFilterAndCheckAddButtons(0);
print $searchpicto;
print '</td>';
@@ -274,7 +274,7 @@ if ($action != 'export_csv')
{
// Affiche un Sous-Total par compte comptable
if ($displayed_account != "") {
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
}
@@ -293,10 +293,10 @@ if ($action != 'export_csv')
print '<td>' . length_accountg($line->numero_compte) . '</td>';
print '<td>' . $description . '</td>';
print '<td align="right">' . price($line->debit) . '</td>';
print '<td align="right">' . price($line->credit) . '</td>';
print '<td align="right">' . price($line->credit - $line->debit) . '</td>';
print '<td align="center">' . $link;
print '<td class="nowrap right">' . price($line->debit) . '</td>';
print '<td class="nowrap right">' . price($line->credit) . '</td>';
print '<td class="nowrap right">' . price($line->debit - $line->credit) . '</td>';
print '<td class="center">' . $link;
print '</td>';
print "</tr>\n";
@@ -305,11 +305,11 @@ if ($action != 'export_csv')
$sous_total_credit += $line->credit;
}
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap" align="right">' . price($sous_total_debit) . '</td><td class="nowrap" align="right">' . price($sous_total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($sous_total_credit - $sous_total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("SubTotal") . ':</td><td class="nowrap right">' . price($sous_total_debit) . '</td><td class="nowrap right">' . price($sous_total_credit) . '</td><td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';
print '<tr class="liste_total"><td align="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap" align="right">' . price($total_debit) . '</td><td class="nowrap" align="right">' . price($total_credit) . '</td><td class="nowrap" align="right">' . price(price2num($total_credit - $total_debit)) . '</td>';
print '<tr class="liste_total"><td class="right" colspan="2">' . $langs->trans("AccountBalance") . ':</td><td class="nowrap right">' . price($total_debit) . '</td><td class="nowrap right">' . price($total_credit) . '</td><td class="nowrap right">' . price(price2num($total_debit - $total_credit)) . '</td>';
print "<td>&nbsp;</td>\n";
print '</tr>';

View File

@@ -641,8 +641,8 @@ if ($action == 'create')
print '<td>' . $accountingaccount->getNomUrl(0,1,1,'',0) . '</td>';
print '<td>' . length_accounta($line->subledger_account) . '</td>';
print '<td>' . $line->label_operation. '</td>';
print '<td align="right">' . price($line->debit) . '</td>';
print '<td align="right">' . price($line->credit) . '</td>';
print '<td class="nowrap right">' . price($line->debit) . '</td>';
print '<td class="nowrap right">' . price($line->credit) . '</td>';
print '<td align="center">';
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . $line->piece_num . '&mode='.$mode.'">';
@@ -675,7 +675,7 @@ if ($action == 'create')
print $formaccounting->select_account($accountingaccount_number, 'accountingaccount_number', 1, array (), 1, 1, '');
print '</td>';
print '<td>';
// TODO For the moment we keep a fre input text instead of a combo. The select_auxaccount has problem because it does not
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because it does not
// use setup of keypress to select thirdparty and this hang browser on large database.
if (! empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX))
{

View File

@@ -683,7 +683,7 @@ if ($num > 0)
// Amount debit
if (! empty($arrayfields['t.debit']['checked']))
{
print '<td align="right">' . ($line->debit ? price($line->debit) : ''). '</td>';
print '<td class="nowrap right">' . ($line->debit ? price($line->debit) : ''). '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totaldebitfield']=$totalarray['nbfield'];
$totalarray['totaldebit'] += $line->debit;
@@ -692,7 +692,7 @@ if ($num > 0)
// Amount credit
if (! empty($arrayfields['t.credit']['checked']))
{
print '<td align="right">' . ($line->credit ? price($line->credit) : '') . '</td>';
print '<td class="nowrap right">' . ($line->credit ? price($line->credit) : '') . '</td>';
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalcreditfield']=$totalarray['nbfield'];
$totalarray['totalcredit'] += $line->credit;
@@ -754,8 +754,8 @@ if ($num > 0)
if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
}
elseif ($totalarray['totaldebitfield'] == $i) print '<td align="right">'.price($totalarray['totaldebit']).'</td>';
elseif ($totalarray['totalcreditfield'] == $i) print '<td align="right">'.price($totalarray['totalcredit']).'</td>';
elseif ($totalarray['totaldebitfield'] == $i) print '<td class="nowrap right">'.price($totalarray['totaldebit']).'</td>';
elseif ($totalarray['totalcreditfield'] == $i) print '<td class="nowrap right">'.price($totalarray['totalcredit']).'</td>';
else print '<td></td>';
}
print '</tr>';

View File

@@ -38,6 +38,7 @@
*/
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
class AccountancyExport
{
@@ -658,9 +659,9 @@ class AccountancyExport
print $end_line;
foreach ( $objectLines as $line ) {
$date_creation = dol_print_date($line->date_creation, '%d%m%Y');
$date_doc = dol_print_date($line->doc_date, '%d%m%Y');
$date_valid = dol_print_date($line->date_validated, '%d%m%Y');
$date_creation = dol_print_date($line->date_creation, '%Y%m%d');
$date_doc = dol_print_date($line->doc_date, '%Y%m%d');
$date_valid = dol_print_date($line->date_validated, '%Y%m%d');
// FEC:JournalCode
print $line->code_journal . $separator;
@@ -696,10 +697,10 @@ class AccountancyExport
print $line->label_operation . $separator;
// FEC:Debit
print price2num($line->debit) . $separator;
print price2fec($line->debit) . $separator;
// FEC:Credit
print price2num($line->credit) . $separator;
print price2fec($line->credit) . $separator;
// FEC:EcritureLet
print $line->lettering_code . $separator;

View File

@@ -83,13 +83,13 @@ class AccountancySystem
if ($rowid > 0 || $ref)
{
$sql = "SELECT a.pcg_version, a.label, a.active";
$sql = "SELECT a.rowid, a.pcg_version, a.label, a.active";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_system as a";
$sql .= " WHERE";
if ($rowid) {
$sql .= " a.rowid = '" . $rowid . "'";
} elseif ($ref) {
$sql .= " a.pcg_version = '" . $ref . "'";
$sql .= " a.pcg_version = '" . $this->db->escape($ref) . "'";
}
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);

View File

@@ -149,12 +149,13 @@ class AccountingAccount extends CommonObject
/**
* Load record in memory
*
* @param int $rowid Id
* @param string $account_number Account number
* @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
* @param int $rowid Id
* @param string $account_number Account number
* @param int|boolean $limittocurrentchart 1 or true=Load record only if it is into current active char of account
* @param string $limittoachartaccount 'ABC'=Load record only if it is into chart account with code 'ABC'.
* @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, $limittoachartaccount = '')
{
global $conf;
@@ -172,6 +173,9 @@ class AccountingAccount extends CommonObject
if (! empty($limittocurrentchart)) {
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')';
}
if (! empty($limittoachartaccount)) {
$sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'";
}
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
$result = $this->db->query($sql);

View File

@@ -324,8 +324,8 @@ class BookKeeping extends CommonObject
$sql .= ", piece_num";
$sql .= ', entity';
$sql .= ") VALUES (";
$sql .= "'" . $this->db->idate($this->doc_date) . "'";
$sql .= ", ".(! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'" . $this->db->idate($this->date_lim_reglement) . "'");
$sql .= "'".$this->db->idate($this->doc_date)."'";
$sql .= ", ".(! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'".$this->db->idate($this->date_lim_reglement)."'");
$sql .= ",'" . $this->db->escape($this->doc_type) . "'";
$sql .= ",'" . $this->db->escape($this->doc_ref) . "'";
$sql .= "," . $this->fk_doc;
@@ -341,7 +341,7 @@ class BookKeeping extends CommonObject
$sql .= "," . $this->montant;
$sql .= ",'" . $this->db->escape($this->sens) . "'";
$sql .= ",'" . $this->db->escape($this->fk_user_author) . "'";
$sql .= ",'" . $this->db->idate($now). "'";
$sql .= ",'".$this->db->idate($now)."'";
$sql .= ",'" . $this->db->escape($this->code_journal) . "'";
$sql .= ",'" . $this->db->escape($this->journal_label) . "'";
$sql .= "," . $this->db->escape($this->piece_num);
@@ -472,14 +472,15 @@ class BookKeeping extends CommonObject
*/
public function createStd(User $user, $notrigger = false, $mode='')
{
global $conf;
global $conf, $langs;
$langs->loadLangs(array("accountancy", "bills", "compta"));
dol_syslog(__METHOD__, LOG_DEBUG);
$error = 0;
// Clean parameters
if (isset($this->doc_type)) {
$this->doc_type = trim($this->doc_type);
}
@@ -546,10 +547,10 @@ class BookKeeping extends CommonObject
$now = dol_now();
// Check parameters
// Put here code to add control on parameters values
$this->journal_label = $langs->trans($this->journal_label);
// Insert request
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.'(';
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . $mode.' (';
$sql .= 'doc_date,';
$sql .= 'date_lim_reglement,';
$sql .= 'doc_type,';
@@ -573,7 +574,7 @@ class BookKeeping extends CommonObject
$sql .= 'piece_num,';
$sql .= 'entity';
$sql .= ') VALUES (';
$sql .= ' ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : "'" . $this->db->idate($this->doc_date) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) == 0 ? 'NULL' : "'".$this->db->idate($this->doc_date)."'") . ',';
$sql .= ' ' . (! isset($this->date_lim_reglement) || dol_strlen($this->date_lim_reglement) == 0 ? 'NULL' : "'" . $this->db->idate($this->date_lim_reglement) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_type) ? 'NULL' : "'" . $this->db->escape($this->doc_type) . "'") . ',';
$sql .= ' ' . (! isset($this->doc_ref) ? 'NULL' : "'" . $this->db->escape($this->doc_ref) . "'") . ',';
@@ -590,7 +591,7 @@ class BookKeeping extends CommonObject
$sql .= ' ' . (! isset($this->montant) ? 'NULL' : $this->montant ). ',';
$sql .= ' ' . (! isset($this->sens) ? 'NULL' : "'" . $this->db->escape($this->sens) . "'") . ',';
$sql .= ' ' . $user->id . ',';
$sql .= ' ' . "'" . $this->db->idate($now) . "',";
$sql .= ' ' . "'".$this->db->idate($now)."',";
$sql .= ' ' . (empty($this->code_journal) ? 'NULL' : "'" . $this->db->escape($this->code_journal) . "'") . ',';
$sql .= ' ' . (empty($this->journal_label) ? 'NULL' : "'" . $this->db->escape($this->journal_label) . "'") . ',';
$sql .= ' ' . (empty($this->piece_num) ? 'NULL' : $this->db->escape($this->piece_num)).',';
@@ -1163,7 +1164,7 @@ class BookKeeping extends CommonObject
// Update request
$sql = 'UPDATE ' . MAIN_DB_PREFIX . $this->table_element . $mode.' SET';
$sql .= ' doc_date = ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) != 0 ? "'" . $this->db->idate($this->doc_date) . "'" : 'null') . ',';
$sql .= ' doc_date = ' . (! isset($this->doc_date) || dol_strlen($this->doc_date) != 0 ? "'".$this->db->idate($this->doc_date)."'" : 'null') . ',';
$sql .= ' doc_type = ' . (isset($this->doc_type) ? "'" . $this->db->escape($this->doc_type) . "'" : "null") . ',';
$sql .= ' doc_ref = ' . (isset($this->doc_ref) ? "'" . $this->db->escape($this->doc_ref) . "'" : "null") . ',';
$sql .= ' fk_doc = ' . (isset($this->fk_doc) ? $this->fk_doc : "null") . ',';
@@ -1687,34 +1688,36 @@ class BookKeeping extends CommonObject
* @param string $piece_num Piece num
* @return int int <0 if KO, >0 if OK
*/
public function transformTransaction($direction=0,$piece_num='')
public function transformTransaction($direction = 0, $piece_num = '')
{
$error = 0;
$this->db->begin();
if ($direction==0)
if ($direction==0)
{
$next_piecenum=$this->getNextNumMvt();
$now = dol_now();
if ($next_piecenum < 0) {
$error++;
}
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'(doc_date, doc_type,';
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . ' (doc_date, doc_type,';
$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 .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation)';
$sql .= ' SELECT doc_date, doc_type,';
$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;
$sql .= ' montant, sens, fk_user_author, import_key, code_journal, journal_label, ' . $next_piecenum . ", '".$this->db->idate($now)."'";
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $this->db->escape($piece_num);
$resql = $this->db->query($sql);
if (! $resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
$sql = 'DELETE FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $this->db->escape($piece_num);
$resql = $this->db->query($sql);
if (! $resql) {
$error ++;
@@ -1722,29 +1725,29 @@ class BookKeeping extends CommonObject
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
} elseif ($direction==1) {
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $piece_num;
$resql = $this->db->query($sql);
if (! $resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element.'_tmp(doc_date, doc_type,';
$sql = 'INSERT INTO ' . MAIN_DB_PREFIX . $this->table_element . '_tmp (doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, 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 .= ' SELECT doc_date, doc_type,';
$sql .= ' doc_ref, fk_doc, fk_docdet, 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 .= ' FROM '.MAIN_DB_PREFIX . $this->table_element.' WHERE piece_num = '.$piece_num;
$sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element.' WHERE piece_num = ' . $piece_num;
$resql = $this->db->query($sql);
if (! $resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
}
$sql = 'DELETE FROM '.MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num;
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . '_tmp WHERE piece_num = ' . $piece_num;
$resql = $this->db->query($sql);
if (! $resql) {
$error ++;

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016-2018 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
@@ -47,6 +48,7 @@ if ($user->societe_id > 0)
llxHeader('', $langs->trans("AccountancyArea"));
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy');
dol_fiche_head();
$step = 0;
@@ -165,6 +167,7 @@ else
{
print $langs->trans("Module10Desc")."<br>\n";
}
dol_fiche_end();
// End of page
llxFooter();

View File

@@ -719,7 +719,7 @@ if (! $error && $action == 'writebookkeeping') {
}
}
if (price2num($totaldebit) != price2num($totalcredit))
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))
{
$error++;
$errorforline++;

View File

@@ -359,7 +359,7 @@ if ($action == 'writebookkeeping') {
}
// Protection against a bug on line before
if (price2num($totaldebit) != price2num($totalcredit))
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))
{
$error++;
$errorforline++;

View File

@@ -519,7 +519,7 @@ if ($action == 'writebookkeeping') {
}
// Protection against a bug on lines before
if (! $errorforline && (price2num($totaldebit) != price2num($totalcredit)))
if (! $errorforline && (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')))
{
$error++;
$errorforline++;

View File

@@ -478,7 +478,7 @@ if ($action == 'writebookkeeping') {
}
// Protection against a bug on lines before
if (! $errorforline && (price2num($totaldebit) != price2num($totalcredit)))
if (! $errorforline && (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')))
{
$error++;
$errorforline++;

View File

@@ -55,7 +55,7 @@ if ($conf->global->ACCOUNTING_EXPORT_MODELCSV == "11" && $type_export == "genera
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
$completefilename = $siren . "FEC" . $endaccountingperiod . "." . $format;
$completefilename = $siren . "FEC" . $endaccountingperiod . ".txt";
}
else
{

View File

@@ -212,7 +212,7 @@ if ($conf->facture->enabled)
{
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
print '<td>';
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS');
$form->select_produits($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
print '</td>';
}
print "</tr>\n";

View File

@@ -646,7 +646,7 @@ if (empty($reshook))
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
$error++;
}
else {
@@ -1161,7 +1161,7 @@ else
}
// Morphy
$morphys["phy"] = $langs->trans("Physical");
$morphys["mor"] = $langs->trans("Morale");
$morphys["mor"] = $langs->trans("Moral");
print '<tr><td><span class="fieldrequired">'.$langs->trans("Nature").'</span></td><td>';
print $form->selectarray("morphy", $morphys, (GETPOSTISSET("morphy")?GETPOST("morphy",'alpha'):$object->morphy));
print "</td></tr>";

View File

@@ -75,7 +75,7 @@ if ($id)
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'rowid', $linkback);
dol_banner_tab($object, 'id', $linkback);
print '<div class="fichecenter">';

View File

@@ -120,6 +120,12 @@ $modules=array(
'img' => 'trip'
)*/
),
'holiday' => array(
array(
'code' => 'MAIN_DELAY_HOLIDAYS',
'img' => 'holiday'
),
),
);
$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly"));

View File

@@ -1889,6 +1889,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
{
print '<textarea cols="30" rows="'.ROWS_2.'" class="flat" name="'.$fieldlist[$field].'">'.(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'</textarea>';
}
else{
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
}
print '</td>';
}
elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) {
@@ -1951,7 +1954,13 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
}
else
{
if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position';
$fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'';
if ($fieldlist[$field]=='sortorder')
{
$fieldlist[$field]='position';
}
$classtd=''; $class='';
if ($fieldlist[$field]=='code') $classtd='width100';
@@ -1972,7 +1981,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
}
if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
$langs->load("bills");
$transkey="PaymentCondition".strtoupper($obj->code);
$transkey="PaymentConditionShort".strtoupper($obj->code);
}
if ($transkey && $langs->trans($transkey) != $transkey)
{
@@ -1982,8 +1991,11 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
}
if (! $transfound)
{
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.(isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'').'" name="'.$fieldlist[$field].'">';
print '<input type="text" class="flat'.($class?' '.$class:'').'" value="'.dol_escape_htmltag($fieldValue).'" name="'.$fieldlist[$field].'">';
}
else{
print '<input type="hidden" name="'.$fieldlist[$field].'" value="'.$transkey.'">';
}
print '</td>';
}
}

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2017 Oscss-Shop <support@oscss-shop.fr>.
* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modifyion 2.0 (the "License");
* it under the terms of the GNU General Public License as published bypliance with the License.
@@ -17,6 +18,9 @@
*/
if (!defined('REQUIRE_JQUERY_BLOCKUI')) define('REQUIRE_JQUERY_BLOCKUI', 1);
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', 1);
}
/**

View File

@@ -66,8 +66,8 @@ else
if ($action == 'add' || GETPOST("modify"))
{
$external_rss_title = "external_rss_title_" . GETPOST("norss");
$external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss");
$external_rss_title = "external_rss_title_" . GETPOST("norss", 'int');
$external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss", 'int');
if (! empty($_POST[$external_rss_urlrss]))
{
@@ -95,7 +95,7 @@ if ($action == 'add' || GETPOST("modify"))
{
// Ajoute boite box_external_rss dans definition des boites
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)";
$sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss").' ('.GETPOST($external_rss_title)).")')";
$sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')";
if (! $db->query($sql))
{
dol_print_error($db);
@@ -103,8 +103,8 @@ if ($action == 'add' || GETPOST("modify"))
}
}
$result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"),GETPOST($external_rss_title),'chaine',0,'',$conf->entity);
if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),GETPOST($external_rss_urlrss),'chaine',0,'',$conf->entity);
$result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss", 'int'), GETPOST($external_rss_title, 'alpha'), 'chaine', 0, '', $conf->entity);
if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss", 'int'), GETPOST($external_rss_urlrss, 'alpha'), 'chaine', 0, '', $conf->entity);
if ($result1 && $result2)
{
@@ -122,13 +122,13 @@ if ($action == 'add' || GETPOST("modify"))
if ($_POST["delete"])
{
if(GETPOST("norss"))
if (GETPOST("norss", 'int'))
{
$db->begin();
// Supprime boite box_external_rss de definition des boites
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def";
$sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss"))." %'";
$sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss", 'int'))." %'";
$resql=$db->query($sql);
if ($resql)
@@ -168,8 +168,8 @@ if ($_POST["delete"])
}
$result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . GETPOST("norss"),$conf->entity);
if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),$conf->entity);
$result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . GETPOST("norss", 'int'), $conf->entity);
if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . GETPOST("norss", 'int'), $conf->entity);
if ($result1 && $result2)
{
@@ -270,13 +270,13 @@ if ($resql)
print '<tr class="oddeven">';
print "<td width=\"100px\">".$langs->trans("Title")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_" . $idrss . "\" value=\"" . $conf->global->$keyrsstitle . "\"></td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_title_" . $idrss . "\" value=\"" . dol_escape_htmltag($conf->global->$keyrsstitle) . "\"></td>";
print "</tr>";
print '<tr class="oddeven">';
print "<td>".$langs->trans("URL")."</td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_" . $idrss . "\" value=\"" . $conf->global->$keyrssurl . "\"></td>";
print "<td><input type=\"text\" class=\"flat minwidth300\" name=\"external_rss_urlrss_" . $idrss . "\" value=\"" . dol_escape_htmltag($conf->global->$keyrssurl) . "\"></td>";
print "</tr>";

View File

@@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
/* Copyright (C) 2011-2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* 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
@@ -55,7 +55,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask')
{
$maskconst = GETPOST('maskconstholidaty','alpha');
$maskconst = GETPOST('maskconstholiday','alpha');
$maskvalue = GETPOST('maskholiday','alpha');
if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);

View File

@@ -50,7 +50,7 @@ $confirm = GETPOST('confirm','alpha'); // Result of a confirmation
$id = GETPOST('id','int');
$rowid = GETPOST('rowid','alpha');
$search_label=GETPOST('search_label','alpha');
$search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)'
$search_type_template=GETPOST('search_type_template','alpha');
$search_lang=GETPOST('search_lang','alpha');
$search_fk_user=GETPOST('search_fk_user','intcomma');
@@ -262,6 +262,7 @@ if (empty($reshook))
{
//var_dump($i.' - '.$listfieldvalue[$i].' - '.$_POST[$listfieldvalue[$i]].' - '.$value);
$keycode=$listfieldvalue[$i];
if ($value == 'label') $_POST[$keycode] = dol_escape_htmltag($_POST[$keycode]);
if ($value == 'lang') $keycode='langcode';
if ($value == 'entity') $_POST[$keycode] = $conf->entity;
if ($i) $sql.=",";
@@ -666,8 +667,6 @@ if ($resql)
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value)
{
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$showfield=1; // By defaut
$align="left";
$sortable=1;
@@ -694,7 +693,7 @@ if ($resql)
if ($fieldlist[$field]=='content') { $valuetoshow=$langs->trans("Content"); $showfield=0;}
if ($fieldlist[$field]=='content_lines') { $valuetoshow=$langs->trans("ContentLines"); $showfield=0; }
// Affiche nom du champ
// Show fields
if ($showfield)
{
if (! empty($tabhelp[$id][$value]))
@@ -812,6 +811,10 @@ if ($resql)
$showfield=1;
$align="left";
$valuetoshow=$obj->{$fieldlist[$field]};
if ($value == 'label' || $value == 'topic')
{
$valuetoshow = dol_escape_htmltag($valuetoshow);
}
if ($value == 'type_template')
{
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;

View File

@@ -130,13 +130,13 @@ if ($action=='install')
}
else
{
if (! preg_match('/\.zip$/i',$original_file))
if (! $error && ! preg_match('/\.zip$/i', $original_file))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage",$original_file), null, 'errors');
$error++;
}
if (! preg_match('/module_.*\-[\d]+\.[\d]+.*$/i',$original_file))
if (! $error && ! preg_match('/^(module[a-zA-Z0-9]*|theme)_.*\-([0-9][0-9\.]*)\.zip$/i', $original_file))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), null, 'errors');
@@ -180,13 +180,13 @@ if ($action=='install')
{
// Now we move the dir of the module
$modulename=preg_replace('/module_/', '', $original_file);
$modulename=preg_replace('/\-[\d]+\.[\d]+.*$/', '', $modulename);
$modulename=preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename);
// Search dir $modulename
$modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename;
$modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename; // Example .../mymodule
//var_dump($modulenamedir);
if (! dol_is_dir($modulenamedir))
{
$modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename;
$modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename; // Example .../htdocs/mymodule
//var_dump($modulenamedir);
if (! dol_is_dir($modulenamedir))
{
@@ -195,10 +195,16 @@ if ($action=='install')
}
}
if (! $error)
{
// TODO Make more test
}
// Now we install the module
if (! $error)
{
//var_dump($dirins);
@dol_delete_dir_recursive($dirins.'/'.$modulename);
@dol_delete_dir_recursive($dirins.'/'.$modulename); // delete the zip file
dol_syslog("Uncompress of module file is a success. We copy it from ".$modulenamedir." into target dir ".$dirins.'/'.$modulename);
$result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1);
if ($result <= 0)

View File

@@ -49,15 +49,14 @@ $action = GETPOST('action', 'alpha');
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
$value=GETPOST($code, 'alpha');
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
dol_print_error($db);
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
@@ -66,12 +65,11 @@ if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
$code=$reg[1];
if (dolibarr_del_const($db, $code, 0) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
dol_print_error($db);
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012-2107 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
@@ -61,6 +62,8 @@ if ($action == 'update')
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", $_POST["MAIN_PROFID5_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", $_POST["MAIN_PROFID6_IN_ADDRESS"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'', $conf->entity);
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'', $conf->entity);
@@ -177,76 +180,25 @@ if ($action == 'edit') // Edit
print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
print '</td></tr>';
// Show prof id 1 in address into pdf
if (! $noCountryCode)
// Show prof id in address into pdf
for($i=1; $i<=6; $i++)
{
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
if ($pid1 == '-') $pid1=false;
}
else
{
$pid1 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid1)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.'</td><td>';
print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode);
print '</td></tr>';
}
// Show prof id 2 in address into pdf
if (! $noCountryCode)
{
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
if ($pid2 == '-') $pid2=false;
}
else
{
$pid2 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid2)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.'</td><td>';
print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode);
print '</td></tr>';
}
// Show prof id 3 in address into pdf
if (! $noCountryCode)
{
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
if ($pid3 == '-') $pid3=false;
}
else
{
$pid3 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid3)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.'</td><td>';
print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode);
print '</td></tr>';
}
// Show prof id 4 in address into pdf
if (! $noCountryCode)
{
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
if ($pid4 == '-') $pid4=false;
}
else
{
$pid4 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid4)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.'</td><td>';
print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode);
print '</td></tr>';
if (! $noCountryCode)
{
$pid=$langs->transcountry("ProfId".$i, $mysoc->country_code);
if ($pid == '-') $pid=false;
}
else
{
$pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';
$keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS';
print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant)?$conf->global->$keyforconstant:0, 1, $noCountryCode);
print '</td></tr>';
}
}
print '</table>';
@@ -328,6 +280,12 @@ if ($action == 'edit') // Edit
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
print '</td></tr>';
//Invert sender and recipient
print '<tr class="oddeven"><td>'.$langs->trans("SwapSenderAndRecipientOnPDF").'</td><td>';
print $form->selectyesno('MAIN_INVERT_SENDER_RECIPIENT',(! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT))?$conf->global->MAIN_INVERT_SENDER_RECIPIENT:0,1);
print '</td></tr>';
// Place customer adress to the ISO location
print '<tr class="oddeven"><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
@@ -419,77 +377,26 @@ else // Show
print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
print '</td></tr>';
// Show prof id 1 in address into pdf
if (! $noCountryCode)
{
$pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
if ($pid1 == '-') $pid1=false;
}
else
{
$pid1 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid1)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.'</td><td>';
print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1);
print '</td></tr>';
}
// Show prof id 2 in address into pdf
if (! $noCountryCode)
{
$pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
if ($pid2 == '-') $pid2=false;
}
else
{
$pid2 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid2)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.'</td><td>';
print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1);
print '</td></tr>';
}
// Show prof id 3 in address into pdf
if (! $noCountryCode)
{
$pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
if ($pid3 == '-') $pid3=false;
}
else
{
$pid3 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid3)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.'</td><td>';
print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1);
print '</td></tr>';
}
// Show prof id 4 in address into pdf
if (! $noCountryCode)
{
$pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
if ($pid4 == '-') $pid4=false;
}
else
{
$pid4 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid4)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.'</td><td>';
print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1);
print '</td></tr>';
}
// Show prof id in address into pdf
for ($i=1; $i<=6; $i++)
{
if (! $noCountryCode)
{
$pid=$langs->transcountry("ProfId".$i, $mysoc->country_code);
if ($pid == '-') $pid=false;
}
else
{
$pid = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
}
if ($pid)
{
print '<tr class="oddeven"><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid.'</td><td>';
$keyforconstant = 'MAIN_PROFID'.$i.'_IN_ADDRESS';
print yn($conf->global->$keyforconstant, 1);
print '</td></tr>';
}
}
print '</table>'."\n";
print '</div>';

View File

@@ -36,7 +36,13 @@ $action=GETPOST('action','alpha');
if ($action == 'convert')
{
$db->query("alter table ".$_GET["table"]." ENGINE=INNODB");
$sql="ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
$db->query($sql);
}
if ($action == 'convertutf8')
{
$sql="ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
$db->query($sql);
}
@@ -111,9 +117,9 @@ else
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
print '<td>'.$obj->Engine.'</td>';
if (isset($row[1]) && $row[1] == "MyISAM")
if (isset($obj->Engine) && $obj->Engine == "MyISAM")
{
print '<td><a href="database-tables.php?action=convert&amp;table='.$row[0].'">'.$langs->trans("Convert").'</a></td>';
print '<td><a class="reposition" href="database-tables.php?action=convert&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDB</a></td>';
}
else
{
@@ -127,7 +133,12 @@ else
print '<td align="right">'.$obj->Index_length.'</td>';
print '<td align="right">'.$obj->Auto_increment.'</td>';
print '<td align="right">'.$obj->Check_time.'</td>';
print '<td align="right">'.$obj->Collation.'</td>';
print '<td align="right">'.$obj->Collation;
if (isset($obj->Collation) && ($obj->Collation == "utf8mb4_general_ci" || $obj->Collation == "utf8mb4_unicode_ci"))
{
print '<br><a class="reposition" href="database-tables.php?action=convertutf8&amp;table='.$obj->Name.'">'.$langs->trans("Convert").' UTF8</a>';
}
print '</td>';
print '</tr>';
$i++;
}

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015-2019 Frederic France <frederic.france@netlogic.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -214,7 +214,7 @@ if (! $error && $xml)
$includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']);
// Defined qualified files (must be same than into generate_filelist_xml.php)
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);

View File

@@ -29,15 +29,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("admin");
$action=GETPOST('action','alpha');
$action=GETPOST('action', 'alpha');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST('page', 'int');
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="date";
if (empty($page) || $page == -1) { $page = 0; }
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$offset = $limit * $page;
if (! $user->admin)
@@ -50,10 +50,20 @@ if (! $user->admin)
if ($action == 'delete')
{
$file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
$ret=dol_delete_file($file, 1);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha')))
{
$file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
$ret=dol_delete_file($file, 1);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
else
{
$file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha'));
$ret=dol_delete_file($file, 1);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
$action='';
}
@@ -70,7 +80,7 @@ $type=$db->type;
//var_dump($db);
$help_url='EN:Backups|FR:Sauvegardes|ES:Copias_de_seguridad';
llxHeader('','',$help_url);
llxHeader('', '', $help_url);
?>
<script type="text/javascript">
@@ -110,11 +120,11 @@ jQuery(document).ready(function() {
</script>
<?php
print load_fiche_titre($langs->trans("Backup"),'','title_setup');
print load_fiche_titre($langs->trans("Backup"), '', 'title_setup');
//print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup');
print '<div class="center">';
print $langs->trans("BackupDesc",DOL_DATA_ROOT);
print '<div class="center opacitymedium">';
print $langs->trans("BackupDesc", DOL_DATA_ROOT);
print '</div>';
print '<br>';
@@ -128,7 +138,7 @@ print '<br>';
<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>
<?php
print $langs->trans("BackupDesc3",$dolibarr_main_db_name).'<br>';
print $langs->trans("BackupDesc3", $dolibarr_main_db_name).'<br>';
//print $langs->trans("BackupDescY").'<br>';
print '<br>';
?>
@@ -166,7 +176,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
</div>
<?php
}
else if (in_array($type, array('pgsql')))
elseif (in_array($type, array('pgsql')))
{
?>
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
@@ -234,6 +244,14 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
<option value="ORACLE">ORACLE</option>
<option value="POSTGRESQL">POSTGRESQL</option>
</select> <br>
<input type="checkbox" name="use_mysql_quick_param" value="yes" id="checkbox_use_quick" />
<label for="checkbox_use_quick">
<?php echo $form->textwithpicto(
$langs->trans('ExportUseMySQLQuickParameter'),
$langs->trans('ExportUseMySQLQuickParameterHelp')
); ?>
</label>
<br/>
<!-- <input type="checkbox" name="drop_database" value="yes"
id="checkbox_drop_database" /> <label for="checkbox_drop_database"><?php echo $langs->trans("AddDropDatabase"); ?></label>
-->
@@ -446,8 +464,10 @@ print "\n";
<br>
<div align="center"><input type="submit" class="button"
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br>
<div class="center">
<input type="submit" class="button reposition" value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo">
<input type="hidden" name="page_y" value="<?php echo GETPOST('page_y', 'int'); ?>">
<br>
<br>
<?php
@@ -459,7 +479,7 @@ if (! empty($_SESSION["commandbackuplastdone"]))
//print $paramclear;
// Now run command and show result
// Now show result
print '<b>'.$langs->trans("BackupResult").':</b> ';
print $_SESSION["commandbackupresult"];
@@ -469,7 +489,7 @@ if (! empty($_SESSION["commandbackuplastdone"]))
}
if (! empty($_SESSION["commandbackuptorun"]))
{
print '<br><font class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser",$dolibarr_main_db_user,$dolibarr_main_db_user).':</font><br>'."\n";
print '<br><font class="warning">'.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).':</font><br>'."\n";
print '<textarea id="commandbackuptoruntext" rows="'.ROWS_2.'" class="centpercent">'.$_SESSION["commandbackuptorun"].'</textarea><br>'."\n";
print ajax_autoselect("commandbackuptoruntext", 0);
print '<br>';
@@ -498,8 +518,8 @@ print '</table>';
<div class="ficheaddleft">
<?php
$filearray=dol_dir_list($conf->admin->dir_output.'/backup','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
$result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/',1,0,$langs->trans("NoBackupFileAvailable"),0,$langs->trans("PreviousDumpFiles"));
$filearray=dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
print '<br>';
?>
@@ -519,7 +539,7 @@ print '<br>';
<fieldset><legend class="legendforfieldsetstep" style="font-size: 3em">2</legend>
<?php
print $langs->trans("BackupDesc2",DOL_DATA_ROOT).'<br>';
print $langs->trans("BackupDesc2", DOL_DATA_ROOT).'<br>';
print $langs->trans("BackupDescX").'<br><br>';
?>
@@ -575,7 +595,7 @@ print "\n";
?>
<br>
<div align="center"><input type="submit" class="button"
<div class="center"><input type="submit" class="button reposition"
value="<?php echo $langs->trans("GenerateBackup") ?>" id="buttonGo" /><br>
<br>
</div>
@@ -586,8 +606,8 @@ print "\n";
<div class="ficheaddleft">
<?php
$filearray=dol_dir_list($conf->admin->dir_output.'/documents','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
$result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'documents/',1,0,$langs->trans("NoBackupFileAvailable"),0,$langs->trans("PreviousDumpFiles"));
$filearray=dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1);
$result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
print '<br>';
?>
@@ -598,9 +618,6 @@ print '<br>';
</fieldset>
</form>
<?php
// End of page

View File

@@ -30,20 +30,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$langs->load("admin");
$action=GETPOST('action','alpha');
$what=GETPOST('what','alpha');
$export_type=GETPOST('export_type','alpha');
$file=GETPOST('zipfilename_template','alpha');
$action=GETPOST('action', 'alpha');
$what=GETPOST('what', 'alpha');
$export_type=GETPOST('export_type', 'alpha');
$file=GETPOST('zipfilename_template', 'alpha');
$compression = GETPOST('compression');
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST("page",'int');
$file = dol_sanitizeFileName($file);
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST("page", 'int');
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="date";
if ($page < 0) { $page = 0; }
elseif (empty($page)) $page = 0;
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$offset = $limit * $page;
if (! $user->admin) accessforbidden();
@@ -57,10 +59,11 @@ $errormsg='';
if ($action == 'delete')
{
$file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
$ret=dol_delete_file($file, 1);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$filerelative = dol_sanitizeFileName(GETPOST('urlfile', 'alpha'));
$filepath=$conf->admin->dir_output.'/'.$filerelative;
$ret=dol_delete_file($filepath, 1);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", $filerelative), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", $filerelative), null, 'errors');
$action='';
}
@@ -109,21 +112,27 @@ $utils = new Utils($db);
if ($compression == 'zip')
{
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression);
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/');
if ($ret < 0)
{
$errormsg = $langs->trans("ErrorFailedToWriteInDir",$outputfile);
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
}
}
elseif (in_array($compression, array('gz', 'bz')))
{
$file = substr($file, 0, strrpos($file, '.'));
$userlogin = ($user->login ? $user->login : 'unknown');
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
$file = substr($file, 0, strrpos($file, '.'));
$file .= '.tar';
$cmd = 'tar -cf '.$outputdir."/".$file." --exclude=documents/admin/documents -C ".DOL_DATA_ROOT." ".DOL_DATA_ROOT."/../documents/";
exec($cmd, $out, $retval);
//var_dump($cmd, DOL_DATA_ROOT);exit;
if ($retval != 0)
// We also exclude '/temp/' dir and 'documents/admin/documents'
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$result = $utils->executeCLI($cmd, $outputfile);
$retval = $result['error'];
if ($result['result'] || ! empty($retval))
{
$langs->load("errors");
dol_syslog("Documents tar retval after exec=".$retval, LOG_ERR);
@@ -133,15 +142,17 @@ elseif (in_array($compression, array('gz', 'bz')))
{
if ($compression == 'gz')
{
$cmd = "gzip " . $outputdir."/".$file;
$cmd = "gzip -f " . $outputdir."/".$file;
}
if ($compression == 'bz')
{
$cmd = "bzip2 " . $outputdir."/".$file;
$cmd = "bzip2 -f " . $outputdir."/".$file;
}
exec($cmd, $out, $retval);
if ($retval != 0)
$result = $utils->executeCLI($cmd, $outputfile);
$retval = $result['error'];
if ($result['result'] || ! empty($retval))
{
$errormsg = 'Error '.$compression.' generation return '.$retval;
unlink($outputdir."/".$file);
@@ -163,4 +174,3 @@ header("Location: dolibarr_export.php");
$time_end = time();
$db->close();

View File

@@ -48,6 +48,17 @@ if (! empty($conf->syslog->enabled))
*/
if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allfiles' || $confirm == 'yes') )
{
// Increase limit of time. Works only if we are not in safe mode
$ExecTimeLimit=600;
if (!empty($ExecTimeLimit))
{
$err=error_reporting();
error_reporting(0); // Disable all errors
//error_reporting(E_ALL);
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err);
}
require_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php';
$utils = new Utils($db);
$result = $utils->purgeFiles($choice);

View File

@@ -953,7 +953,7 @@ class Setup extends DolibarrApi
$includecustom=(empty($xml->dolibarr_htdocs_dir[0]['includecustom'])?0:$xml->dolibarr_htdocs_dir[0]['includecustom']);
// Defined qualified files (must be same than into generate_filelist_xml.php)
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
$regextoinclude='\.(php|php3|php4|php5|phtml|phps|phar|inc|css|scss|html|xml|js|json|tpl|jpg|jpeg|png|gif|ico|sql|lang|txt|yml|bak|md|mp3|mp4|wav|mkv|z|gz|zip|rar|tar|less|svg|eot|woff|woff2|ttf|manifest)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);

View File

@@ -88,18 +88,21 @@ if (preg_match('/api\/index\.php\/explorer/', $_SERVER["PHP_SELF"]) && ! empty($
// index.php/xxx called by any REST client to run API
$reg=array();
preg_match('/index\.php\/([^\/]+)(.*)$/', $_SERVER["PHP_SELF"], $reg);
// .../index.php/categories?sortfield=t.rowid&sortorder=ASC
// Set the flag to say to refresh (when we reload the explorer, production must be for API call only)
$refreshcache=false;
// When in production mode, a file api/temp/routes.php is created with the API available of current call.
// But, if we set $refreshcache to false, so it may have only one API in the routes.php file if we make a call for one API without
// using the explorer. And when we make another call for another API, the API is not into the api/temp/routes.php and a 404 is returned.
// So we force refresh to each call.
$refreshcache=(empty($conf->global->API_PRODUCTION_DO_NOT_ALWAYS_REFRESH_CACHE) ? true : false);
if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root'))
{
$refreshcache=true;
}
$api = new DolibarrApi($db, '', $refreshcache);
//var_dump($api->r->apiVersionMap);
@@ -115,7 +118,7 @@ UploadFormat::$allowedMimeTypes = array('image/jpeg', 'image/png', 'text/plain',
// Call Explorer file for all APIs definitions
// Call Explorer file for all APIs definitions (this part is slow)
if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $reg[2] == '/swagger.json/root' || $reg[2] == '/resources.json' || $reg[2] == '/resources.json/root'))
{
// Scan all API files to load them
@@ -253,5 +256,6 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/swagger.json' &&
//var_dump($api->r->apiVersionMap);
//exit;
// Call API (we suppose we found it)
// Call API (we suppose we found it).
// The handle will use the file api/temp/routes.php to get data to run the API. If the file exists and the entry for API is not found, it will return 404.
$api->r->handle();

View File

@@ -61,7 +61,7 @@ function printBookmarksList($aDb, $aLangs)
{
foreach($_POST as $key => $val)
{
if (preg_match('/^search_/', $key) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
if ((preg_match('/^search_/', $key) || in_array($key, array('viewstatut')) ) && $val != '') $tmpurl.=($tmpurl?'&':'').$key.'='.$val;
}
}
$url.=($tmpurl?'?'.$tmpurl:'');
@@ -72,6 +72,7 @@ function printBookmarksList($aDb, $aLangs)
$ret.= '<!-- form with POST method by default, will be replaced with GET for external link by js -->'."\n";
$ret.= '<form id="actionbookmark" name="actionbookmark" method="POST" action="">';
$ret.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.= '<select name="bookmark" id="boxbookmark" class="flat boxcombo vmenusearchselectcombo" alt="Bookmarks">';
$ret.= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
$ret.= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';

View File

@@ -49,11 +49,11 @@ switch($action)
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
if ( $_POST['hdnSource'] == 'LISTE' )
{
$sql.= " AND p.rowid = ".$_POST['selProduit'];
$sql.= " AND p.rowid = ".((int) GETPOST('selProduit', 'int'));
}
else if ( $_POST['hdnSource'] == 'REF' )
{
$sql.= " AND p.ref = '".$_POST['txtRef']."'";
$sql.= " AND p.ref = '".$db->escape(GETPOST('txtRef', 'alpha'))."'";
}
$result = $db->query($sql);

View File

@@ -917,7 +917,8 @@ class Categorie extends CommonObject
{
// phpcs:enable
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
$sql.= " WHERE fk_parent = ".$this->id;
$sql .= " WHERE fk_parent = ".$this->id;
$sql .= " AND entity IN (".getEntity('category').")";
$res = $this->db->query($sql);
if ($res)

View File

@@ -65,9 +65,12 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss);
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'"><span class="valignmiddle">'.$langs->trans("NewCategory").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
$newcardbutton='';
if (! empty($user->rights->categorie->creer)) {
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'"><span class="valignmiddle">'.$langs->trans("NewCategory").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
}
print load_fiche_titre($title, $newcardbutton);

View File

@@ -7,7 +7,8 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* 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
@@ -248,7 +249,10 @@ if ($action == 'add')
{
$object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n";
}
else $object->label = $cactioncomm->libelle;
else {
$cactioncomm->fetch($object->type_code);
$object->label = $cactioncomm->label;
}
}
}
$object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0;
@@ -268,7 +272,7 @@ if ($action == 'add')
$object->datep = $datep;
$object->datef = $datef;
$object->percentage = $percentage;
$object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60;
$object->duree=(((int) GETPOST('dureehour') * 60) + (int) GETPOST('dureemin')) * 60;
$transparency=(GETPOST("transparency")=='on'?1:0);

View File

@@ -572,6 +572,7 @@ class ActionComm extends CommonObject
$sql = "SELECT a.id,";
$sql.= " a.id as ref,";
$sql.= " a.entity,";
$sql.= " a.ref_ext,";
$sql.= " a.datep,";
$sql.= " a.datep2,";
@@ -608,6 +609,7 @@ class ActionComm extends CommonObject
$obj = $this->db->fetch_object($resql);
$this->id = $obj->id;
$this->entity = $obj->entity;
$this->ref = $obj->ref;
$this->ref_ext = $obj->ref_ext;
@@ -774,7 +776,7 @@ class ActionComm extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
if (!$res) {
$this->error=$this->db->lasterror();
$error++;
}
@@ -785,7 +787,7 @@ class ActionComm extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$res=$this->db->query($sql);
if ($res < 0) {
if (!$res) {
$this->error=$this->db->lasterror();
$error++;
}
@@ -1262,10 +1264,12 @@ class ActionComm extends CommonObject
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
if ((!$user->rights->agenda->allactions->read && $this->author->id != $user->id) || (!$user->rights->agenda->myactions->read && $this->author->id == $user->id))
$option = 'nolink';
if ((!$user->rights->agenda->allactions->read && $this->authorid != $user->id) || (!$user->rights->agenda->myactions->read && $this->authorid == $user->id))
{
$option = 'nolink';
}
$label = $this->label;
$label = $this->label;
if (empty($label)) $label=$this->libelle; // For backward compatibility
$result='';

View File

@@ -43,7 +43,7 @@ $action=GETPOST('action','alpha');
$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'actioncommlist'; // To manage different context of search
$resourceid=GETPOST("search_resourceid","int")?GETPOST("search_resourceid","int"):GETPOST("resourceid","int");
$pid=GETPOST("search_projectid",'int',3)?GETPOST("search_projectid",'int',3):GETPOST("projectid",'int',3);
$status=GETPOST("search_status",'alpha')?GETPOST("search_status",'alpha'):GETPOST("status",'alpha');
$status=(GETPOST("search_status",'alpha') != '')?GETPOST("search_status",'alpha'):GETPOST("status",'alpha');
$type=GETPOST('search_type','alphanohtml')?GETPOST('search_type','alphanohtml'):GETPOST('type','alphanohtml');
$optioncss = GETPOST('optioncss','alpha');
$year=GETPOST("year",'int');
@@ -92,7 +92,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1 || $page == null) { $page = 0 ; }
if (empty($page) || $page == -1) { $page = 0 ; }
$offset = $limit * $page ;
if (! $sortorder)
{
@@ -524,6 +524,7 @@ if ($resql)
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
$caction=new CActionComm($db);
$arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1);
$contactListCache = array();
while ($i < min($num,$limit))
{
@@ -634,7 +635,34 @@ if ($resql)
// Contact
if (! empty($arrayfields['a.fk_contact']['checked'])) {
print '<td>';
if ($obj->fk_contact > 0)
$actionstatic->fetchResources();
if(!empty($actionstatic->socpeopleassigned))
{
$contactList = array();
foreach ($actionstatic->socpeopleassigned as $socpeopleId => $socpeopleassigned)
{
if(!isset($contactListCache[$socpeopleassigned['id']]))
{
// if no cache found we fetch it
$contact = new Contact($db);
if($contact->fetch($socpeopleassigned['id'])>0)
{
$contactListCache[$socpeopleassigned['id']] = $contact->getNomUrl(1,'',28);
$contactList[] = $contact->getNomUrl(1,'',28);
}
}
else{
// use cache
$contactList[] = $contactListCache[$socpeopleassigned['id']];
}
}
if(!empty($contactList)){
print implode(', ', $contactList);
}
}
elseif ($obj->fk_contact > 0) //keep for retrocompatibility with faraway event
{
$contactstatic->id=$obj->fk_contact;
$contactstatic->email=$obj->email;

View File

@@ -1189,32 +1189,32 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
}
$ids1='';$ids2='';
if (count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h]));
if (count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h]));
if (is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) $ids1=join(',',array_keys($cases1[$h]));
if (is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) $ids2=join(',',array_keys($cases2[$h]));
if ($h == $begin_h) echo '<td class="'.$style.'_peruserleft cal_peruser'.($var?' cal_impair '.$style.'_impair':'').'">';
else echo '<td class="'.$style.' cal_peruser'.($var?' cal_impair '.$style.'_impair':'').'">';
if (count($cases1[$h]) == 1) // only 1 event
if (is_array($cases1[$h]) && count($cases1[$h]) == 1) // only 1 event
{
$output = array_slice($cases1[$h], 0, 1);
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
if ($output[0]['string']) $title1.=($title1?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color1 = $output[0]['color'];
}
else if (count($cases1[$h]) > 1)
else if (is_array($cases1[$h]) && count($cases1[$h]) > 1)
{
$title1=$langs->trans("Ref").' '.$ids1.($title1?' - '.$title1:'');
$color1='222222';
}
if (count($cases2[$h]) == 1) // only 1 event
if (is_array($cases2[$h]) && count($cases2[$h]) == 1) // only 1 event
{
$output = array_slice($cases2[$h], 0, 1);
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
if ($output[0]['string']) $title2.=($title2?' - ':'').$output[0]['string'];
if ($output[0]['color']) $color2 = $output[0]['color'];
}
else if (count($cases2[$h]) > 1)
else if (is_array($cases2[$h]) && count($cases2[$h]) > 1)
{
$title2=$langs->trans("Ref").' '.$ids2.($title2?' - '.$title2:'');
$color2='222222';

View File

@@ -42,7 +42,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1 || $page == null) { $page = 0 ; }
if (empty($page) || $page == -1) { $page = 0 ; }
$offset = $limit * $page ;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="a.datep";

View File

@@ -477,7 +477,7 @@ if ($object->id > 0)
print '</td><td>';
if ($action == 'editshipping')
{
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->shipping_method_id,'shipping_method_id');
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->shipping_method_id,'shipping_method_id', 1);
}
else
{

View File

@@ -471,13 +471,13 @@ if (empty($reshook))
if ($result)
{
setEventMessages($langs->trans("MailSuccessfulySent",$mailfile->getValidAddress($object->email_from,2),$mailfile->getValidAddress($object->sendto,2)), null, 'mesgs');
$action = '';
}
else
{
setEventMessages($langs->trans("ResultKo").'<br>'.$mailfile->error.' '.$result, null, 'errors');
$action = 'test';
}
$action='';
}
}
@@ -835,7 +835,7 @@ else
{
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
// You ensure that every user is using its own SMTP server when using the mass emailing module.
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails.php">';
$linktoadminemailbefore='<a href="'.DOL_URL_ROOT.'/admin/mails_emailing.php">';
$linktoadminemailend='</a>';
setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings');
setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings');
@@ -870,7 +870,7 @@ else
}
$text.=$langs->trans('ConfirmSendingEmailing').'<br>';
$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,300);
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('SendMailing'), $text, 'sendallconfirmed', $formquestion, '', 1, 330, 600);
}
}

View File

@@ -548,7 +548,7 @@ class Mailing extends CommonObject
$result = '';
$companylink = '';
$label = '<u>' . $langs->trans("ShowEmailing") . '</u>';
$label = '<u>' . $langs->trans("ShowEMailing") . '</u>';
$label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->ref;
@@ -567,7 +567,7 @@ class Mailing extends CommonObject
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowEmailing");
$label=$langs->trans("ShowEMailing");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';

View File

@@ -321,7 +321,7 @@ if (empty($reshook))
$datep = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$date_delivery = dol_mktime(12, 0, 0, GETPOST('date_livraisonmonth'), GETPOST('date_livraisonday'), GETPOST('date_livraisonyear'));
$duration = GETPOST('duree_validite');
$duration = GETPOST('duree_validite', 'int');
if (empty($datep)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
@@ -1544,7 +1544,7 @@ if ($action == 'create')
print '</td></tr>';
// Validaty duration
print '<tr><td class="fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td><input name="duree_validite" size="5" value="' . $conf->global->PROPALE_VALIDITY_DURATION . '"> ' . $langs->trans("days") . '</td></tr>';
print '<tr><td class="fieldrequired">' . $langs->trans("ValidityDuration") . '</td><td><input name="duree_validite" class="width50" value="' . (GETPOST('duree_validite', 'int') ? GETPOST('duree_validite', 'int') : $conf->global->PROPALE_VALIDITY_DURATION) . '"> ' . $langs->trans("days") . '</td></tr>';
// Terms of payment
print '<tr><td class="nowrap fieldrequired">' . $langs->trans('PaymentConditionsShort') . '</td><td>';

View File

@@ -1316,9 +1316,9 @@ class Propal extends CommonObject
// Hook of thirdparty module
if (is_object($hookmanager))
{
$parameters=array('objFrom'=>$this,'clonedObj'=>$clonedObj);
$parameters=array('objFrom'=>$this,'clonedObj'=>$object);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$clonedObj,$action); // Note that $action and $object may have been modified by some hooks
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
}

View File

@@ -265,13 +265,12 @@ $sql.= " ava.rowid as availability,";
$sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= ' p.rowid, p.entity, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
$sql.= ' p.datec as date_creation, p.tms as date_update,';
$sql.= " pr.rowid as project_id, pr.ref as project_ref,";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
$sql.= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
$sql.= ' u.login';
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
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
@@ -760,6 +759,12 @@ if ($resql)
$objectstatic->id=$obj->rowid;
$objectstatic->ref=$obj->ref;
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
$companystatic->email=$obj->email;
print '<tr class="oddeven">';
if (! empty($arrayfields['p.ref']['checked']))
@@ -812,20 +817,16 @@ if ($resql)
{
// Project ref
print '<td class="nocellnopadd nowrap">';
if ($obj->project_id) {
$projectstatic->fetch($obj->project_id);
if ($obj->project_id > 0) {
$projectstatic->id=$obj->project_id;
$projectstatic->ref=$obj->project_ref;
$projectstatic->title=$obj->project_label;
print $projectstatic->getNomUrl(1);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
$companystatic->id=$obj->socid;
$companystatic->name=$obj->name;
$companystatic->client=$obj->client;
$companystatic->code_client=$obj->code_client;
$companystatic->email=$obj->email;
// Thirdparty
if (! empty($arrayfields['s.nom']['checked']))
{
@@ -971,9 +972,7 @@ if ($resql)
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$companystatic->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{

View File

@@ -61,8 +61,10 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
//if ($user->rights->societe->creer)
//if ($user->rights->facture->creer)
$amount_ttc_1=GETPOST('amount_ttc_1');
$amount_ttc_2=GETPOST('amount_ttc_2');
$amount_ttc_1 = GETPOST('amount_ttc_1');
$amount_ttc_1 = price2num($amount_ttc_1);
$amount_ttc_2 = GETPOST('amount_ttc_2');
$amount_ttc_2 = price2num($amount_ttc_2);
$error=0;
$remid=GETPOST("remid")?GETPOST("remid"):0;
@@ -119,7 +121,7 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$newdiscount2->datec=$discount->datec;
$newdiscount1->tva_tx=$discount->tva_tx;
$newdiscount2->tva_tx=$discount->tva_tx;
$newdiscount1->amount_ttc=$_POST["amount_ttc_1"];
$newdiscount1->amount_ttc=$amount_ttc_1;
$newdiscount2->amount_ttc=price2num($discount->amount_ttc-$newdiscount1->amount_ttc);
$newdiscount1->amount_ht=price2num($newdiscount1->amount_ttc/(1+$newdiscount1->tva_tx/100),'MT');
$newdiscount2->amount_ht=price2num($newdiscount2->amount_ttc/(1+$newdiscount2->tva_tx/100),'MT');

View File

@@ -1436,11 +1436,11 @@ if ($action == 'create' && $user->rights->commande->creer)
if ($element == 'order' || $element == 'commande') {
$element = $subelement = 'commande';
}
if ($element == 'propal') {
elseif ($element == 'propal') {
$element = 'comm/propal';
$subelement = 'propal';
}
if ($element == 'contract') {
elseif ($element == 'contract') {
$element = $subelement = 'contrat';
}

View File

@@ -243,11 +243,10 @@ $sql.= " state.code_departement as state_code, state.nom as state_name,";
$sql.= ' c.rowid, c.ref, c.total_ht, c.tva as total_tva, c.total_ttc, c.ref_client,';
$sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
$sql.= ' c.date_creation as date_creation, c.tms as date_update,';
$sql.= " p.rowid as project_id, p.ref as project_ref";
$sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
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
@@ -957,10 +956,14 @@ if ($resql)
// Project
if (! empty($arrayfields['p.project_ref']['checked']))
{
$projectstatic->id=$obj->project_id;
$projectstatic->ref=$obj->project_ref;
print '<td>';
if ($obj->project_id > 0) print $projectstatic->getNomUrl(1);
print '<td class="nocellnopadd nowrap">';
if ($obj->project_id > 0)
{
$projectstatic->id=$obj->project_id;
$projectstatic->ref=$obj->project_ref;
$projectstatic->title=$obj->project_label;
print $projectstatic->getNomUrl(1);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}

View File

@@ -303,7 +303,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
$reshook = $hookmanager->executeHooks('printObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if(empty($reshook)){
print $hookmanager->resPrint;
$solde = isset($hookmanager->resArray['solde']) ? $hookmanager->resArray['solde'] : $solde;
$solde = isset($hookmanager->resArray['solde']) ? $hookmanager->resArray['solde'] : $solde;
}
// solde

View File

@@ -183,7 +183,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print $socialcontrib->getNomUrl(1,'20');
print '</td>';
// Type
print '<td><a href="../sociales/index.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
// Expected to pay
print '<td align="right">'.price($obj->total).'</td>';
// Ref payment

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Pierre-Henry Favre <support@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/compta/compta-files.php
* \file htdocs/compta/accounting-files.php
* \ingroup compta
* \brief Page to show portoflio and files of a thirdparty and download it
*/
@@ -25,15 +25,14 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/salaries/class/paymentsalary.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$langs->loadLangs(array("accountancy","bills"));
$langs->loadLangs(array("accountancy", "bills", "companies", "salaries"));
$date_start =GETPOST('date_start', 'alpha');
$date_startDay= GETPOST('date_startday', 'int');
@@ -45,7 +44,7 @@ $date_stopDay= GETPOST('date_stopday', 'int');
$date_stopMonth= GETPOST('date_stopmonth', 'int');
$date_stopYear= GETPOST('date_stopyear', 'int');
//FIXME doldate
$date_stop=($date_stopDay)?dol_mktime(0, 0, 0, $date_stopMonth, $date_stopDay, $date_stopYear):strtotime($date_stop);
$date_stop=($date_stopDay)?dol_mktime(23, 59, 59, $date_stopMonth, $date_stopDay, $date_stopYear):strtotime($date_stop);
$action =GETPOST('action', 'alpha');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -65,6 +64,7 @@ if (! $sortorder) $sortorder="DESC";
$arrayfields=array(
'type'=>array('label'=>"Type", 'checked'=>1),
'date'=>array('label'=>"Date", 'checked'=>1),
//...
);
@@ -74,8 +74,9 @@ if (empty($conf->comptabilite->enabled) && empty($conf->accounting->enabled)) {
accessforbidden();
}
if ($user->societe_id > 0)
{
accessforbidden();
}
/*
@@ -90,157 +91,211 @@ $entity = GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity;
$filesarray=array();
$result=false;
if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
$sql="SELECT rowid as id, facnumber as ref,paye as paid, total_ttc, fk_soc, datef as date, 'Invoice' as item FROM ".MAIN_DB_PREFIX."facture";
$sql.=" WHERE datef between ".$wheretail;
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND fk_statut <> ".Facture::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, ref, paye as paid, total_ttc, fk_soc, datef as date, 'SupplierInvoice' as item FROM ".MAIN_DB_PREFIX."facture_fourn";
$sql.=" WHERE datef between ".$wheretail;
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND fk_statut <> ".FactureFournisseur::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, ref, paid, total_ttc, fk_user_author as fk_soc, date_fin as date,'ExpenseReport' as item FROM ".MAIN_DB_PREFIX."expensereport";
$sql.=" WHERE date_fin between ".$wheretail;
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND fk_statut <> ".ExpenseReport::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, ref,paid,amount as total_ttc, '0' as fk_soc, datedon as date,'Donation' as item FROM ".MAIN_DB_PREFIX."don";
$sql.=" WHERE datedon between ".$wheretail;
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND fk_statut <> ".Don::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, label as ref, 1 as paid, amount as total_ttc, fk_user as fk_soc,datep as date,'SalaryPayment' as item FROM ".MAIN_DB_PREFIX."payment_salary";
$sql.=" WHERE datep between ".$wheretail;
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
//$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT rowid as id, libelle as ref, paye as paid, amount as total_ttc, 0 as fk_soc, date_creation as date, 'SocialContributions' as item FROM ".MAIN_DB_PREFIX."chargesociales";
$sql.=" WHERE date_creation between ".$wheretail;
$sql.=" AND entity IN (".($entity==1?'0,1':$entity).')';
//$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT;
$sql.= $db->order($sortfield, $sortorder);
if (($action=="searchfiles" || $action=="dl" )) {
$resd = $db->query($sql);
$files=array();
$link='';
if ($resd)
if (empty($date_start))
{
$numd = $db->num_rows($resd);
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart")), null, 'errors');
$error++;
}
if (empty($date_stop))
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors');
$error++;
}
$tmpinvoice=new Facture($db);
$tmpinvoicesupplier=new FactureFournisseur($db);
$tmpdonation=new Don($db);
if (! $error)
{
$wheretail=" '".$db->idate($date_start)."' AND '".$db->idate($date_stop)."'";
$upload_dir ='';
$i=0;
while ($i < $numd)
$sql="SELECT t.rowid as id, t.facnumber as ref, t.paye as paid, total as total_ht, total_ttc, tva as total_vat, fk_soc, t.datef as date, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum";
$sql.=" FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql.=" WHERE datef between ".$wheretail;
$sql.=" AND t.entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND t.fk_statut <> ".Facture::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT t.rowid as id, t.ref, paye as paid, total_ht, total_ttc, total_tva as total_vat, fk_soc, datef as date, 'SupplierInvoice' as item, s.nom as thirdparty_name, s.code_fournisseur as thirdparty_code, c.code as country_code, s.tva_intra as vatnum";
$sql.=" FROM ".MAIN_DB_PREFIX."facture_fourn as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
$sql.=" WHERE datef between ".$wheretail;
$sql.=" AND t.entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND t.fk_statut <> ".FactureFournisseur::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT t.rowid as id, t.ref, paid, total_ht, total_ttc, total_tva as total_vat, fk_user_author as fk_soc, date_fin as date, 'ExpenseReport' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
$sql.=" FROM ".MAIN_DB_PREFIX."expensereport as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user_author LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql.=" WHERE date_fin between ".$wheretail;
$sql.=" AND t.entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND t.fk_statut <> ".ExpenseReport::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT t.rowid as id, t.ref, paid, amount as total_ht, amount as total_ttc, 0 as total_vat, 0 as fk_soc, datedon as date, 'Donation' as item, t.societe as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
$sql.=" FROM ".MAIN_DB_PREFIX."don as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = t.fk_country";
$sql.=" WHERE datedon between ".$wheretail;
$sql.=" AND t.entity IN (".($entity==1?'0,1':$entity).')';
$sql.=" AND t.fk_statut <> ".Don::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT t.rowid as id, t.label as ref, 1 as paid, amount as total_ht, amount as total_ttc, 0 as total_vat, t.fk_user as fk_soc, datep as date, 'SalaryPayment' as item, CONCAT(CONCAT(u.lastname, ' '), u.firstname) as thirdparty_name, '' as thirdparty_code, c.code as country_code, '' as vatnum";
$sql.=" FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = t.fk_user LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = u.fk_country";
$sql.=" WHERE datep between ".$wheretail;
$sql.=" AND t.entity IN (".($entity==1?'0,1':$entity).')';
//$sql.=" AND fk_statut <> ".PaymentSalary::STATUS_DRAFT;
$sql.=" UNION ALL";
$sql.=" SELECT t.rowid as id, t.libelle as ref, paye as paid, amount as total_ht, amount as total_ttc, 0 as total_tva, 0 as fk_soc, date_creation as date, 'SocialContributions' as item, '' as thirdparty_name, '' as thirdparty_code, '' as country_code, '' as vatnum";
$sql.=" FROM ".MAIN_DB_PREFIX."chargesociales as t";
$sql.=" WHERE date_creation between ".$wheretail;
$sql.=" AND t.entity IN (".($entity==1?'0,1':$entity).')';
//$sql.=" AND fk_statut <> ".ChargeSociales::STATUS_DRAFT;
$sql.= $db->order($sortfield, $sortorder);
//print $sql;
$resd = $db->query($sql);
$files=array();
$link='';
if ($resd)
{
$objd = $db->fetch_object($resd);
$numd = $db->num_rows($resd);
switch($objd->item)
{
case "Invoice":
$subdir=dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->facture->dir_output.'/'.$subdir;
$link="document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "SupplierInvoice":
$tmpinvoicesupplier->fetch($objd->id);
$subdir=get_exdir($tmpinvoicesupplier->id, 2, 0, 0, $tmpinvoicesupplier, 'invoice_supplier').'/'.dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
$link="document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "ExpenseReport":
$subdir=dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->expensereport->dir_output.'/'.$subdir;
$link="document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "SalaryPayment":
$subdir=dol_sanitizeFileName($objd->id);
$upload_dir = $conf->salaries->dir_output.'/'.$subdir;
$link="document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "Donation":
$tmpdonation->fetch($objp->id);
$subdir=get_exdir(0, 0, 0, 1, $tmpdonation, 'donation'). '/'. dol_sanitizeFileName($objd->id);
$upload_dir = $conf->don->dir_output . '/' . $subdir;
$link="document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "SocialContributions":
$subdir=dol_sanitizeFileName($objd->id);
$upload_dir = $conf->tax->dir_output . '/' . $subdir;
$link="document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
default:
$subdir='';
$upload_dir='';
$link='';
break;
}
$tmpinvoice=new Facture($db);
$tmpinvoicesupplier=new FactureFournisseur($db);
$tmpdonation=new Don($db);
if (!empty($upload_dir))
$upload_dir ='';
$i=0;
while ($i < $numd)
{
$result=true;
$files=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview\.png)$', '', SORT_ASC, 1);
//var_dump($upload_dir);
if (count($files) < 1)
$objd = $db->fetch_object($resd);
switch($objd->item)
{
$nofile['date']=$db->idate($objd->date);
$nofile['paid']=$objd->paid;
$nofile['amount']=$objd->total_ttc;
$nofile['ref']=$objd->ref;
$nofile['fk']=$objd->fk_soc;
$nofile['item']=$objd->item;
$filesarray[]=$nofile;
case "Invoice":
$subdir = '';
$subdir.=($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->facture->dir_output.'/'.$subdir;
$link="document.php?modulepart=facture&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "SupplierInvoice":
$tmpinvoicesupplier->fetch($objd->id);
$subdir = get_exdir($tmpinvoicesupplier->id, 2, 0, 1, $tmpinvoicesupplier, 'invoice_supplier'); // TODO Use first file
$subdir.=($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->fournisseur->facture->dir_output.'/'.$subdir;
$link="document.php?modulepart=facture_fournisseur&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "ExpenseReport":
$subdir = '';
$subdir.=($subdir ? '/' : '').dol_sanitizeFileName($objd->ref);
$upload_dir = $conf->expensereport->dir_output.'/'.$subdir;
$link="document.php?modulepart=expensereport&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "SalaryPayment":
$subdir = '';
$subdir.=($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->salaries->dir_output.'/'.$subdir;
$link="document.php?modulepart=salaries&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "Donation":
$tmpdonation->fetch($objp->id);
$subdir=get_exdir(0, 0, 0, 0, $tmpdonation, 'donation');
$subdir.=($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->don->dir_output . '/' . $subdir;
$link="document.php?modulepart=don&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
case "SocialContributions":
$subdir = '';
$subdir.=($subdir ? '/' : '').dol_sanitizeFileName($objd->id);
$upload_dir = $conf->tax->dir_output . '/' . $subdir;
$link="document.php?modulepart=tax&file=".str_replace('/', '%2F', $subdir).'%2F';
break;
default:
$subdir='';
$upload_dir='';
$link='';
break;
}
else
{
foreach ($files as $key => $file)
{
$file['date']=$db->idate($objd->date);
$file['paid']=$objd->paid;
$file['amount']=$objd->total_ttc;
$file['ref']=$objd->ref;
$file['fk']=$objd->fk_soc;
$file['item']=$objd->item;
$file['link']=$link.$file['name'];
$file['relpathnamelang'] = $langs->trans($file['item']).'/'.$file['name'];
$filesarray[]=$file;
if (!empty($upload_dir))
{
$result=true;
$files=dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview\.png)$', '', SORT_ASC, 1);
//var_dump($upload_dir);
if (count($files) < 1)
{
$nofile['id']=$objd->id;
$nofile['date']=$db->idate($objd->date);
$nofile['paid']=$objd->paid;
$nofile['amount_ht']=$objd->total_ht;
$nofile['amount_ttc']=$objd->total_ttc;
$nofile['amount_vat']=$objd->total_vat;
$nofile['ref']=($objd->ref ? $objd->ref : $objd->id);
$nofile['fk']=$objd->fk_soc;
$nofile['item']=$objd->item;
$nofile['thirdparty_name']=$objd->thirdparty_name;
$nofile['thirdparty_code']=$objd->thirdparty_code;
$nofile['country_code']=$objd->country_code;
$nofile['vatnum']=$objd->vatnum;
$filesarray[]=$nofile;
}
else
{
foreach ($files as $key => $file)
{
$file['id']=$objd->id;
$file['date']=$db->idate($objd->date);
$file['paid']=$objd->paid;
$file['amount_ht']=$objd->total_ht;
$file['amount_ttc']=$objd->total_ttc;
$file['amount_vat']=$objd->total_vat;
$file['ref']=($objd->ref ? $objd->ref : $objd->id);
$file['fk']=$objd->fk_soc;
$file['item']=$objd->item;
$file['thirdparty_name']=$objd->thirdparty_name;
$file['thirdparty_code']=$objd->thirdparty_code;
$file['country_code']=$objd->country_code;
$file['vatnum']=$objd->vatnum;
$file['link']=$link.$file['name'];
$file['relpathnamelang'] = $langs->trans($file['item']).'/'.$file['name'];
$filesarray[]=$file;
}
}
}
$i++;
}
$i++;
}
}
else
{
dol_print_error($db);
}
else
{
dol_print_error($db);
}
$db->free($resd);
$db->free($resd);
}
}
/*
* cleanup of old ZIP
*/
//FIXME
/*
*ZIP creation
*/
if ($result && $action == "dl")
$dirfortmpfile = ($conf->accounting->dir_temp ? $conf->accounting->dir_temp : $conf->comptabilite->dir_temp);
if (empty($dirfortmpfile))
{
$dirfortmpfile = ($conf->accounting->dir_temp ? $conf->accounting->dir_temp : $conf->compta->dir_temp);
setEventMessages($langs->trans("ErrorNoAccountingModuleEnabled"), null, 'errors');
$error++;
}
if ($result && $action == "dl" && ! $error)
{
if (! extension_loaded('zip'))
{
setEventMessages('PHPZIPExtentionNotLoaded', null, 'errors');
exit;
}
dol_mkdir($dirfortmpfile);
$log='date,type,ref,total,paid,filename,item_id'."\n";
$log=$langs->transnoentitiesnoconv("Type").','.$langs->transnoentitiesnoconv("Date").','.$langs->transnoentitiesnoconv("Ref").','.$langs->transnoentitiesnoconv("TotalHT").','.$langs->transnoentitiesnoconv("TotalTTC").','.$langs->transnoentitiesnoconv("TotalVAT").','.$langs->transnoentitiesnoconv("Paid").',filename,item_id,'.$langs->transnoentitiesnoconv("ThirdParty").','.$langs->transnoentitiesnoconv("Code").','.$langs->transnoentitiesnoconv("Country").','.$langs->transnoentitiesnoconv("VATIntra")."\n";
$zipname = $dirfortmpfile.'/'.dol_print_date($date_start, 'dayrfc')."-".dol_print_date($date_stop, 'dayrfc').'_export.zip';
dol_delete_file($zipname);
@@ -249,10 +304,10 @@ if ($result && $action == "dl")
$res = $zip->open($zipname, ZipArchive::OVERWRITE|ZipArchive::CREATE);
if ($res)
{
foreach ($filesarray as $key=> $file)
foreach ($filesarray as $key => $file)
{
if (file_exists($file["fullname"])) $zip->addFile($file["fullname"], $file["relpathnamelang"]); //
$log.=dol_print_date($file['date'], 'dayrfc').','.$file['item'].','.$file['ref'].','.$file['amount'].','.$file['paid'].','.$file["name"].','.$file['fk']."\n";
$log.=$file['item'].','.dol_print_date($file['date'], 'dayrfc').','.$file['ref'].','.$file['amount_ht'].','.$file['amount_ttc'].','.$file['amount_vat'].','.$file['paid'].','.$file["name"].','.$file['fk'].','.$file['thirdparty_name'].','.$file['thirdparty_code'].','.$file['country_code'].',"'.$file['vatnum'].'"'."\n";
}
$zip->addFromString('transactions.csv', $log);
$zip->close();
@@ -267,6 +322,10 @@ if ($result && $action == "dl")
exit();
}
else
{
setEventMessages($langs->trans("FailedToOpenFile", $zipname), null, 'errors');
}
}
@@ -283,7 +342,7 @@ llxHeader('', $title, $help_url);
$h=0;
$head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
$head[$h][1] = $langs->trans("AccountancyFiles");
$head[$h][1] = $langs->trans("AccountantFiles");
$head[$h][2] = 'AccountancyFiles';
dol_fiche_head($head, 'AccountancyFiles');
@@ -293,45 +352,20 @@ print '<form name="searchfiles" action="?action=searchfiles'.$tail.'" method="PO
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print $langs->trans("ReportPeriod").': '.$form->selectDate($date_start, 'date_start', 0, 0, 0, "", 1, 1, 0);
print ' - '.$form->selectDate($date_stop, 'date_stop', 0, 0, 0, "", 1, 1, 0)."\n</a>";
// Multicompany
/*if (! empty($conf->multicompany->enabled) && is_object($mc))
{
print '<br>';
// This is now done with hook formObjectOptions. Keep this code for backward compatibility with old multicompany module
if (method_exists($mc, 'formObjectOptions'))
{
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) // condition must be same for create and edit mode
{
print "<tr>".'<td>'.$langs->trans("Entity").'</td>';
print "<td>".$mc->select_entities($entity);
print "</td></tr>\n";
}
else
{
print '<input type="hidden" name="entity" value="'.$conf->entity.'" />';
}
}
$object = new stdClass();
// Other attributes
$parameters=array('objectsrc' => null, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook))
{
print $object->showOptionals($extrafields, 'edit');
}
}*/
// Export is for current company only !
if (! empty($conf->multicompany->enabled) && is_object($mc))
{
print ' &nbsp; - &nbsp; '.$langs->trans("Entity").' : ';
print '<span class="marginleftonly marginrightonly">('.$langs->trans("Entity").' : ';
$mc->dao->getEntities();
$mc->dao->fetch($conf->entity);
print $mc->dao->label;
print "<br>\n";
print ")</span>\n";
}
print '<input class="button" type="submit" value="'.$langs->trans("Refresh").'" /></form>'."\n";
print '<input class="button" type="submit" name="search" value="'.$langs->trans("Search").'">';
print '</form>'."\n";
dol_fiche_end();
@@ -369,14 +403,18 @@ if (!empty($date_start) && !empty($date_stop))
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($arrayfields['date']['label'], $_SERVER["PHP_SELF"], "date", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
print '<td>'.$langs->trans("Type").'</td>';
print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], "type", "", $param, '', $sortfield, $sortorder, 'nowrap ');
print_liste_field_titre($arrayfields['date']['label'], $_SERVER["PHP_SELF"], "date", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("Link").'</td>';
print '<td>'.$langs->trans("Document").'</td>';
print '<td>'.$langs->trans("Paid").'</td>';
print '<td align="right">'.$langs->trans("Debit").'</td>';
print '<td align="right">'.$langs->trans("Credit").'</td>';
print '<td align="right">'.$langs->trans("Balance").'</td>';
print '<td align="right">'.$langs->trans("TotalHT").'</td>';
print '<td align="right">'.$langs->trans("TotalTTC").'</td>';
print '<td align="right">'.$langs->trans("TotalVAT").'</td>';
print '<td>'.$langs->trans("ThirdParty").'</td>';
print '<td class="center">'.$langs->trans("Code").'</td>';
print '<td class="center">'.$langs->trans("Country").'</td>';
print '<td class="center">'.$langs->trans("VATIntra").'</td>';
print '</tr>';
if ($result)
{
@@ -390,20 +428,11 @@ if (!empty($date_start) && !empty($date_stop))
{
// Sort array by date ASC to calculate balance
$totalET = 0;
$totalIT = 0;
$totalVAT = 0;
$totalDebit = 0;
$totalCredit = 0;
// Balance calculation
$balance = 0;
foreach($TData as &$data1) {
if ($data1['item']!='Invoice'&& $data1['item']!='Donation' ){
$data1['amount']=-$data1['amount'];
}
if ($data1['amount']>0){
}else{
}
$balance += $data1['amount'];
$data1['balance'] = $balance;
}
// Display array
foreach($TData as $data)
@@ -412,30 +441,79 @@ if (!empty($date_start) && !empty($date_stop))
//if (!empty($data['fk_facture'])) $html_class = 'facid-'.$data['fk_facture'];
//elseif (!empty($data['fk_paiement'])) $html_class = 'payid-'.$data['fk_paiement'];
print '<tr class="oddeven '.$html_class.'">';
print "<td align=\"center\">";
// Type
print '<td>'.$langs->trans($data['item']).'</td>';
// Date
print '<td class="center">';
print dol_print_date($data['date'], 'day');
print "</td>\n";
print '<td aling="left">'.$langs->trans($data['item']).'</td>';
// Ref
print '<td aling="left">'.$data['ref'].'</td>';
// File link
print '<td><a href='.DOL_URL_ROOT.'/'.$data['link'].">".$data['name']."</a></td>\n";
print '<td>';
if ($data['link'])
{
print '<a href='.DOL_URL_ROOT.'/'.$data['link'].' target="_blank">'.($data['name'] ? $data['name'] : $data['ref']).'</a>';
}
print "</td>\n";
// Paid
print '<td aling="left">'.$data['paid'].'</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']);
// Total ET
print '<td align="right">'.price($data['amount_ht'])."</td>\n";
// Total IT
print '<td align="right">'.price($data['amount_ttc'])."</td>\n";
// Total VAT
print '<td align="right">'.price($data['amount_vat'])."</td>\n";
print '<td>'.$data['thirdparty_name']."</td>\n";
print '<td class="center">'.$data['thirdparty_code']."</td>\n";
print '<td class="center">'.$data['country_code']."</td>\n";
print '<td align="right">'.$data['vatnum']."</td>\n";
// Debit
//print '<td align="right">'.(($data['amount_ttc'] > 0) ? price(abs($data['amount_ttc'])) : '')."</td>\n";
// Credit
//print '<td align="right">'.(($data['amount_ttc'] > 0) ? '' : price(abs($data['amount_ttc'])))."</td>\n";
$totalET += $data['amount_ht'];
$totalIT += $data['amount_ttc'];
$totalVAT += $data['amount_vat'];
$totalDebit += ($data['amount_ttc'] > 0) ? abs($data['amount_ttc']) : 0;
$totalCredit += ($data['amount_ttc'] > 0) ? 0 : abs($data['amount_ttc']);
// Balance
print '<td align="right">'.price($data['balance'])."</td>\n";
//print '<td align="right">'.price($data['balance'])."</td>\n";
print "</tr>\n";
}
print '<tr class="liste_total">';
print '<td colspan="5">&nbsp;</td>';
print '<td align="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td align="right">'.price($totalET).'</td>';
print '<td align="right">'.price($totalIT).'</td>';
print '<td align="right">'.price($totalVAT).'</td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
print '<td></td>';
/*print '<td align="right">'.price($totalDebit).'</td>';
print '<td align="right">'.price($totalCredit).'</td>';
print '<td align="right">'.price(price2num($totalDebit - $totalCredit, 'MT')).'</td>';
*/
print "</tr>\n";
}
}

View File

@@ -181,7 +181,8 @@ if (empty($reshook))
// Change status of invoice
else if ($action == 'reopen' && $usercancreate) {
$result = $object->fetch($id);
if ($object->statut == 2 || ($object->statut == 3 && $object->close_code != 'replaced') || ($object->statut == 1 && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
if ($object->statut == Facture::STATUS_CLOSED || ($object->statut == Facture::STATUS_ABANDONED && ($object->close_code != 'replaced' || $object->getIdReplacingInvoice() == 0)) || ($object->statut == Facture::STATUS_VALIDATED && $object->paye == 1)) { // ($object->statut == 1 && $object->paye == 1) should not happened but can be found when data are corrupted
$result = $object->set_unpaid($user);
if ($result > 0) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
@@ -1254,7 +1255,7 @@ if (empty($reshook))
if ($_POST['type'] == Facture::TYPE_DEPOSIT)
{
$typeamount = GETPOST('typedeposit', 'alpha');
$valuedeposit = GETPOST('valuedeposit', 'int');
$valuedeposit = price2num(GETPOST('valuedeposit', 'alpha'), 'MU');
$amountdeposit = array();
if (!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA))
@@ -1319,7 +1320,7 @@ if (empty($reshook))
if (empty($amount)) continue;
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
$descline = $langs->trans('Deposit');
$descline = '(DEPOSIT)';
//$descline.= ' - '.$langs->trans($arraylist[$typeamount]);
if ($typeamount=='amount') {
$descline.= ' ('. price($valuedeposit, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).')';
@@ -1382,8 +1383,9 @@ 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;
// Don't add closed lines when coming from a contract (Set constant to '0,5' to exclude also inactive lines)
if (! isset( $conf->global->CONTRACT_EXCLUDE_SERVICES_STATUS_FOR_INVOICE)) $conf->global->CONTRACT_EXCLUDE_SERVICES_STATUS_FOR_INVOICE = '5';
if ($srcobject->element == 'contrat' && in_array($lines[$i]->statut, explode(',', $conf->global->CONTRACT_EXCLUDE_SERVICES_STATUS_FOR_INVOICE))) continue;
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
@@ -3007,21 +3009,24 @@ if ($action == 'create')
}
else
{
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
$text = '<label>'.$tmp.$langs->trans("InvoiceFirstSituationAsk") . '</label> ';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';
if (! empty($conf->global->INVOICE_USE_SITUATION))
{
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
$text = '<label>'.$tmp.$langs->trans("InvoiceFirstSituationAsk") . '</label> ';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_situation" value="0" disabled> ';
$text = '<label>'.$tmp.$langs->trans("InvoiceSituationAsk") . '</label> ';
$text.= '('.$langs->trans("YouMustCreateInvoiceFromThird").') ';
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceFirstSituationDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';
}
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" name="type" id="radio_replacement" value="0" disabled> ';
@@ -3042,7 +3047,7 @@ if ($action == 'create')
{
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp='<input type="radio" id="radio_creditnote" name="type" value="2"' . (GETPOST('type') == 2 ? ' checked' : '');
if (! $optionsav) $tmp.=' disabled';
if (! $optionsav && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp.=' disabled';
$tmp.= '> ';
// Show credit note options only if we checked credit note
print '<script type="text/javascript" language="javascript">
@@ -4686,11 +4691,11 @@ else if ($id > 0 || ! empty($ref))
&& ($object->statut == 2 || $object->statut == 3 || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) // A paid invoice (partially or completely)
{
if (! $objectidnext && $object->close_code != 'replaced') // Not replaced by another invoice
if ($object->close_code != 'replaced' || (! $objectidnext)) // Not replaced by another invoice or replaced but the replacement invoice has been deleted
{
print '<div class="inline-block divButAction"><a class="butAction'.($conf->use_javascript_ajax?' reposition':'').'" href="' . $_SERVER['PHP_SELF'] . '?facid=' . $object->id . '&amp;action=reopen">' . $langs->trans('ReOpen') . '</a></div>';
} else {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ReOpen') . '</span></div>';
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('ReOpen') . '</span></div>';
}
}

View File

@@ -72,10 +72,10 @@ class Invoices extends DolibarrApi
}
// Get payment details
$this->invoice->totalpaye = $this->invoice->getSommePaiement();
$this->invoice->totalpaid = $this->invoice->getSommePaiement();
$this->invoice->totalcreditnotes = $this->invoice->getSumCreditNotesUsed();
$this->invoice->totaldeposits = $this->invoice->getSumDepositsUsed();
$this->invoice->resteapayer = price2num($this->invoice->total_ttc - $this->invoice->totalpaye - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
$this->invoice->remaintopay = price2num($this->invoice->total_ttc - $this->invoice->totalpaid - $this->invoice->totalcreditnotes - $this->invoice->totaldeposits, 'MT');
if (! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);

View File

@@ -947,7 +947,7 @@ class Facture extends CommonInvoice
}
elseif ($this->type == self::TYPE_SITUATION && !empty($conf->global->INVOICE_USE_SITUATION))
{
$this->fetchObjectLinked('', '', $facture->id, 'facture');
$this->fetchObjectLinked('', '', $this->id, 'facture');
foreach ($this->linkedObjectsIds as $typeObject => $Tfk_object)
{
@@ -3136,7 +3136,13 @@ class Facture extends CommonInvoice
// phpcs:enable
global $mysoc,$user;
include_once DOL_DOCUMENT_ROOT . '/core/lib/price.lib.php';
// Progress should never be changed for discount lines
if (($line->info_bits & 2) == 2)
{
return;
}
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Cap percentages to 100
if ($percent > 100) $percent = 100;
@@ -3152,7 +3158,6 @@ class Facture extends CommonInvoice
$line->multicurrency_total_ttc = $tabprice[18];
$line->update($user);
$this->update_price(1);
$this->db->commit();
}
/**
@@ -3501,7 +3506,7 @@ class Facture extends CommonInvoice
* @param int $offset For pagination
* @param string $sortfield Sort criteria
* @param string $sortorder Sort order
* @return int -1 if KO, array with result if OK
* @return array|int -1 if KO, array with result if OK
*/
function liste_array($shortlist=0, $draft=0, $excluser='', $socid=0, $limit=0, $offset=0, $sortfield='f.datef,f.rowid', $sortorder='DESC')
{
@@ -3572,7 +3577,7 @@ class Facture extends CommonInvoice
* (Status validated or abandonned for a reason 'other') + not payed + no payment at all + not already replaced
*
* @param int $socid Id thirdparty
* @return array Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
* @return array|int Array of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
*/
function list_replacable_invoices($socid=0)
{
@@ -4409,13 +4414,13 @@ class FactureLigne extends CommonInvoiceLine
// From llx_product
/**
* @deprecated
* @see product_ref
* @see $product_ref
*/
public $ref; // Product ref (deprecated)
public $product_ref; // Product ref
/**
* @deprecated
* @see product_label
* @see $product_label
*/
public $libelle; // Product label (deprecated)
public $product_label; // Product label
@@ -4599,6 +4604,7 @@ class FactureLigne extends CommonInvoiceLine
if ($result <= 0)
{
$this->error='ErrorProductIdDoesNotExists';
dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR);
return -1;
}
}
@@ -4629,7 +4635,7 @@ class FactureLigne extends CommonInvoiceLine
$sql.= " '".$this->db->escape($this->localtax1_type)."',";
$sql.= " '".$this->db->escape($this->localtax2_type)."',";
$sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").',';
$sql.= " ".$this->product_type.",";
$sql.= " ".((int) $this->product_type).",";
$sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".price2num($this->subprice).",";
$sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").',';

View File

@@ -1423,8 +1423,8 @@ else
include_once DOL_DOCUMENT_ROOT . '/core/modules/facture/modules_facture.php';
$list = array();
$models = ModelePDFFactures::liste_modeles($db);
foreach ($models as $model) {
$list[] = $model . ':' . $model;
foreach ($models as $k => $model) {
$list[] = str_replace(':', '|', $k) . ':' . $model;
}
$select = 'select;'.implode(',', $list);
print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select);

View File

@@ -261,7 +261,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

@@ -370,9 +370,8 @@ $sql.= " p.rowid as project_id, p.ref as project_ref, p.title as project_label";
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed';
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
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
@@ -1022,7 +1021,7 @@ if ($resql)
// Project
if (! empty($arrayfields['p.ref']['checked']))
{
print '<td class="nowrap">';
print '<td class="nocellnopadd nowrap">';
if ($obj->project_id > 0)
{
$projectstatic->id=$obj->project_id;

View File

@@ -61,42 +61,52 @@ if ($id > 0 || ! empty($ref))
}
}
$hookmanager->initHooks(array('directdebitcard','globalcard'));
/*
* Actions
*/
if ($action == "new")
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if ($object->id > 0)
if ($action == "new")
{
$db->begin();
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
if ($result > 0)
if ($object->id > 0)
{
$db->commit();
$db->begin();
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
$result = $object->demande_prelevement($user, GETPOST('withdraw_request_amount'));
if ($result > 0)
{
$db->commit();
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
}
else
{
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
}
$action='';
}
$action='';
}
if ($action == "delete")
{
if ($object->id > 0)
if ($action == "delete")
{
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
if ($result == 0)
if ($object->id > 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
$result = $object->demande_prelevement_delete($user, GETPOST('did'));
if ($result == 0)
{
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
}
}
}

View File

@@ -531,7 +531,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$sql = 'SELECT f.rowid as facid, f.facnumber, f.total_ttc, f.multicurrency_code, f.multicurrency_total_ttc, f.type,';
$sql.= ' f.datef as df, f.fk_soc as socid, f.date_lim_reglement as dlr';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
$sql.= ' WHERE f.entity IN ('.getEntity('facture', $conf->entity).')';
$sql.= ' WHERE f.entity IN ('.getEntity('facture').')';
$sql.= ' AND (f.fk_soc = '.$facture->socid;
// Can pay invoices of all child of parent company
if(!empty($conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS) && !empty($facture->thirdparty->parent)) {
@@ -593,6 +593,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td align="right">'.$alreadypayedlabel.'</td>';
print '<td align="right">'.$remaindertopay.'</td>';
print '<td align="right">'.$langs->trans('PaymentAmount').'</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $facture, $action); // Note that $action and $object may have been modified by hook
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
@@ -736,6 +740,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print "</td>";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
// Warning
print '<td align="center" width="16">';
//print "xx".$amounts[$invoice->id]."-".$amountsresttopay[$invoice->id]."<br>";
@@ -746,9 +753,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
print "</tr>\n";
$total+=$objp->total;
@@ -840,7 +844,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
*/
if (! GETPOST('action','aZ09'))
{
if ($page == -1) $page = 0 ;
if (empty($page) || $page == -1) $page = 0 ;
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ;
@@ -886,11 +890,11 @@ if (! GETPOST('action','aZ09'))
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
print '</tr>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
$i++;
}
print '</table>';

View File

@@ -71,7 +71,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes
$error++;
$action = 'create';
}
if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0)
if (! empty($conf->banque->enabled) && ! ($_POST["accountid"] > 0))
{
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")), null, 'errors');
$error++;

View File

@@ -63,78 +63,86 @@ $object = new BonPrelevement($db,"");
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
$hookmanager->initHooks(array('directdebitprevcard','globalcard'));
/*
* Actions
*/
if ( $action == 'confirm_delete' )
$parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
$res=$object->delete($user);
if ($res > 0)
{
header("Location: index.php");
exit;
}
}
if ( $action == 'confirm_delete' )
{
$res=$object->delete($user);
if ($res > 0)
{
header("Location: index.php");
exit;
}
}
// Seems to no be used and replaced with $action == 'infocredit
if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
{
$res=$object->set_credite();
if ($res >= 0)
{
header("Location: card.php?id=".$id);
exit;
}
}
// Seems to no be used and replaced with $action == 'infocredit
if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes')
{
$res=$object->set_credite();
if ($res >= 0)
{
header("Location: card.php?id=".$id);
exit;
}
}
if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
/*
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
{
$dir = $conf->prelevement->dir_output.'/receipts';
/*
if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref)
{
$dir = $conf->prelevement->dir_output.'/receipts';
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
{
$object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
}
if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $dir . "/" . dol_unescapefile($_FILES['userfile']['name']),1) > 0)
{
$object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
}
header("Location: card.php?id=".$id);
exit;
}
else
{
dol_syslog("Fichier invalide",LOG_WARNING);
$mesg='BadFile';
}*/
header("Location: card.php?id=".$id);
exit;
}
else
{
dol_syslog("Fichier invalide",LOG_WARNING);
$mesg='BadFile';
}*/
$error = $object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
$error = $object->set_infotrans($user, $dt, GETPOST('methode','alpha'));
if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
}
if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
}
// Set direct debit order to credited, create payment and close invoices
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
{
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
// Set direct debit order to credited, create payment and close invoices
if ($action == 'infocredit' && $user->rights->prelevement->bons->credit)
{
$dt = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$error = $object->set_infocredit($user, $dt);
$error = $object->set_infocredit($user, $dt);
if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
if ($error)
{
header("Location: card.php?id=".$id."&error=$error");
exit;
}
}
}

View File

@@ -1133,15 +1133,25 @@ class BonPrelevement extends CommonObject
/**
* Get object and lines from database
* Get object and lines from database
*
* @param User $user Object user that delete
* @return int >0 if OK, <0 if KO
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int >0 if OK, <0 if KO
*/
function delete($user=null)
function delete($user = null, $notrigger = 0)
{
$this->db->begin();
$error = 0;
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('BON_PRELEVEMENT_DELETE', $user);
if ($result < 0) $error++;
// End call triggers
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX."prelevement_facture WHERE fk_prelevement_lignes IN (SELECT rowid FROM ".MAIN_DB_PREFIX."prelevement_lignes WHERE fk_prelevement_bons = ".$this->id.")";
$resql1=$this->db->query($sql);
if (! $resql1) dol_print_error($this->db);
@@ -1158,7 +1168,7 @@ class BonPrelevement extends CommonObject
$resql4=$this->db->query($sql);
if (! $resql4) dol_print_error($this->db);
if ($resql1 && $resql2 && $resql3)
if ($resql1 && $resql2 && $resql3 && !$error)
{
$this->db->commit();
return 1;
@@ -1349,7 +1359,7 @@ class BonPrelevement extends CommonObject
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, c.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.datec, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum, rib.rum";
$sql.= " FROM";
$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
@@ -1375,7 +1385,7 @@ class BonPrelevement extends CommonObject
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum);
$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->fac, $obj->idfac, $obj->iban, $obj->bic, $this->db->jdate($obj->datec), $obj->drum, $obj->rum);
$this->total = $this->total + $obj->somme;
$i++;
}
@@ -1586,9 +1596,10 @@ class BonPrelevement extends CommonObject
* @param string $row_bic rib.bic AS bic,
* @param string $row_datec rib.datec,
* @param string $row_drum rib.rowid used to generate rum
* @param string $row_rum rib.rum Rum defined on company bank account
* @return string Return string with SEPA part DrctDbtTxInf
*/
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum)
function EnregDestinataireSEPA($row_code_client, $row_nom, $row_address, $row_zip, $row_town, $row_country_code, $row_cb, $row_cg, $row_cc, $row_somme, $row_facnumber, $row_idfac, $row_iban, $row_bic, $row_datec, $row_drum, $row_rum)
{
// phpcs:enable
global $conf;
@@ -1597,7 +1608,7 @@ class BonPrelevement extends CommonObject
// Define value for RUM
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
$Rum = $this->buildRumNumber($row_code_client, $row_datec, $row_drum);
$Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum;
// Define date of RUM signature
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');

View File

@@ -51,43 +51,54 @@ $page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$hookmanager->initHooks(array('directdebitcreatecard','globalcard'));
/*
* Actions
*/
// Change customer bank information to withdraw
if ($action == 'modify')
$parameters = array('mode' => $mode, 'format' => $format, 'limit' => $limit, 'page' => $page, 'offset' => $offset);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
for ($i = 1 ; $i < 9 ; $i++)
{
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"),'chaine',0,'',$conf->entity);
}
}
if ($action == 'create')
{
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
$bprev = new BonPrelevement($db);
// Change customer bank information to withdraw
if ($action == 'modify')
{
for ($i = 1 ; $i < 9 ; $i++)
{
dolibarr_set_const($db, GETPOST("nom$i"), GETPOST("value$i"),'chaine',0,'',$conf->entity);
}
}
if ($action == 'create')
{
// $conf->global->PRELEVEMENT_CODE_BANQUE and $conf->global->PRELEVEMENT_CODE_GUICHET should be empty
$bprev = new BonPrelevement($db);
$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$result = $bprev->create($conf->global->PRELEVEMENT_CODE_BANQUE, $conf->global->PRELEVEMENT_CODE_GUICHET, $mode, $format,$executiondate);
if ($result < 0)
{
setEventMessages($bprev->error, $bprev->errors, 'errors');
}
elseif ($result == 0)
{
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format);
setEventMessages($mesg, null, 'errors');
$mesg.='<br>'."\n";
foreach($bprev->invoice_in_error as $key => $val)
{
$mesg.='<span class="warning">'.$val."</span><br>\n";
}
}
else
{
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
}
if ($result < 0)
{
setEventMessages($bprev->error, $bprev->errors, 'errors');
}
elseif ($result == 0)
{
$mesg=$langs->trans("NoInvoiceCouldBeWithdrawed", $format);
setEventMessages($mesg, null, 'errors');
$mesg.='<br>'."\n";
foreach($bprev->invoice_in_error as $key => $val)
{
$mesg.='<span class="warning">'.$val."</span><br>\n";
}
}
else
{
setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null);
}
}
}

View File

@@ -156,7 +156,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

@@ -121,7 +121,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes')
$result=$object->delete($user);
if ($result > 0)
{
header("Location: index.php");
header("Location: list.php");
exit;
}
else

View File

@@ -319,7 +319,7 @@ 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;

View File

@@ -55,7 +55,7 @@ $result = restrictedArea($user, 'tax', $id, 'chargesociales','charges');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;

View File

@@ -168,7 +168,7 @@ if ($resql)
if ($year)
{
$center=($year?"<a href='index.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='index.php?year=".($year+1)."'>".img_next()."</a>":"");
$center=($year?"<a href='list.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='list.php?year=".($year+1)."'>".img_next()."</a>":"");
print_barre_liste($langs->trans("SocialContributions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy.png', 0, $newcardbutton, '', $limit);
}
else
@@ -258,7 +258,7 @@ if ($resql)
print '<td align="center">';
if ($obj->periode)
{
print '<a href="index.php?year='.strftime("%Y",$db->jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode),'day').'</a>';
print '<a href="list.php?year='.strftime("%Y",$db->jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode),'day').'</a>';
}
else
{

View File

@@ -90,7 +90,7 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
if ($mode != 'sconly')
{
$center=($year?'<a href="index.php?year='.($year-1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="index.php?year='.($year+1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>":"");
$center=($year?'<a href="list.php?year='.($year-1).$param.'">'.img_previous($langs->trans("Previous"), 'class="valignbottom"')."</a> ".$langs->trans("Year").' '.$year.' <a href="list.php?year='.($year+1).$param.'">'.img_next($langs->trans("Next"), 'class="valignbottom"')."</a>":"");
print_barre_liste($title,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,$center,$num,$totalnboflines, 'title_accountancy', 0, '', '', $limit, 1);
}
else
@@ -181,7 +181,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print $socialcontrib->getNomUrl(1,'20');
print '</td>';
// Type
print '<td><a href="../sociales/index.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
print '<td><a href="../sociales/list.php?filtre=cs.fk_type:'.$obj->type.'">'.$obj->lib.'</a></td>';
// Date
$date=$obj->periode;
if (empty($date)) $date=$obj->date_ech;

View File

@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.
// Load translation files required by the page
$langs->loadLangs(array("other","compta","banks","bills","companies","product","trips","admin","accountancy"));
$modecompta = GETPOST('modecompta','alpha');
$modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE);
// Date range
$year=GETPOST("year",'int');

View File

@@ -122,22 +122,24 @@ $year_end = $tmpe['year'];
$nbofyear = ($year_end - $year_start) + 1;
$commonparams=array();
$commonparams['modecompta']=$modecompta;
$commonparams['sortorder'] = $sortorder;
$commonparams['sortfield'] = $sortfield;
if(!empty($modecompta)) $commonparams['modecompta']=$modecompta;
if(!empty($sortorder)) $commonparams['sortorder'] = $sortorder;
if(!empty($sortfield)) $commonparams['sortfield'] = $sortfield;
$headerparams = array();
$headerparams['date_startyear'] = $date_startyear;
$headerparams['date_startmonth'] = $date_startmonth;
$headerparams['date_startday'] = $date_startday;
$headerparams['date_endyear'] = $date_endyear;
$headerparams['date_endmonth'] = $date_endmonth;
$headerparams['date_endday'] = $date_endday;
if(!empty($date_startyear)) $headerparams['date_startyear'] = $date_startyear;
if(!empty($date_startmonth)) $headerparams['date_startmonth'] = $date_startmonth;
if(!empty($date_startday)) $headerparams['date_startday'] = $date_startday;
if(!empty($date_endyear)) $headerparams['date_endyear'] = $date_endyear;
if(!empty($date_endmonth)) $headerparams['date_endmonth'] = $date_endmonth;
if(!empty($date_endday)) $headerparams['date_endday'] = $date_endday;
if(!empty($year)) $headerparams['year'] = $year;
if(!empty($month)) $headerparams['month'] = $month;
$headerparams['q'] = $q;
$tableparams = array();
$tableparams['search_categ'] = $selected_cat;
$tableparams['search_type'] = $selected_type;
if(!empty($selected_cat)) $tableparams['search_categ'] = $selected_cat;
if(!empty($selected_type)) $tableparams['search_type'] = $selected_type;
$tableparams['subcat'] = ($subcat === true)?'yes':'';
// Adding common parameters

View File

@@ -56,9 +56,10 @@ $result = restrictedArea($user, 'tax', $id, 'vat','charges');
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1) {
if (empty($page) || $page == -1) {
$page = 0;
}
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;

View File

@@ -40,6 +40,7 @@ $year=GETPOST("year","int");
if (empty($year))
{
$year_current = strftime("%Y",dol_now());
if($conf->global->SOCIETE_FISCAL_MONTH_START > date('m')) $year_current--;
$year_start = $year_current;
} else {
$year_current = $year;

View File

@@ -80,6 +80,14 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'ro
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('contactcard','globalcard'));
if ($id > 0) $object->fetch($id);
if (! ($object->id > 0) && $action == 'view')
{
$langs->load("errors");
print($langs->trans('ErrorRecordNotFound'));
exit;
}
/*
* Actions
@@ -377,21 +385,24 @@ if (empty($reshook))
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if ($ret < 0) $error++;
$result = $object->update($contactid, $user);
if ($result > 0) {
// Categories association
$categories = GETPOST('contcats', 'array');
$object->setCategories($categories);
$object->old_lastname='';
$object->old_firstname='';
$action = 'view';
}
else
if (! $error)
{
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
$result = $object->update($contactid, $user);
if ($result > 0) {
// Categories association
$categories = GETPOST('contcats', 'array');
$object->setCategories($categories);
$object->old_lastname='';
$object->old_firstname='';
$action = 'view';
}
else
{
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
}
}
}
@@ -500,8 +511,8 @@ else
$linkback='';
print load_fiche_titre($title,$linkback,'title_companies.png');
// Affiche les erreurs
dol_htmloutput_errors(is_numeric($error)?'':$error,$errors);
// Show errors
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
if ($conf->use_javascript_ajax)
{
@@ -775,8 +786,8 @@ else
$objsoc = new Societe($db);
$objsoc->fetch($object->socid);
// Affiche les erreurs
dol_htmloutput_errors($error,$errors);
// Show errors
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
if ($conf->use_javascript_ajax)
{
@@ -1073,11 +1084,10 @@ else
{
$objsoc = new Societe($db);
/*
* Fiche en mode visualisation
*/
// View mode
dol_htmloutput_errors($error,$errors);
// Show errors
dol_htmloutput_errors(is_numeric($error)?'':$error, $errors);
dol_fiche_head($head, 'card', $title, -1, 'contact');

View File

@@ -365,8 +365,8 @@ else
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
@@ -376,18 +376,18 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->plimit($limit+1, $offset);
$result = $db->query($sql);
if (! $result)
$resql = $db->query($sql);
if (! $resql)
{
dol_print_error($db);
exit;
}
$num = $db->num_rows($result);
$num = $db->num_rows($resql);
$arrayofselected=is_array($toselect)?$toselect:array();
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $seearch_cti != ''))
if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && ($sall != '' || $search_cti != ''))
{
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
@@ -715,7 +715,7 @@ $i = 0;
$totalarray=array();
while ($i < min($num,$limit))
{
$obj = $db->fetch_object($result);
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
@@ -914,7 +914,7 @@ while ($i < min($num,$limit))
$i++;
}
$db->free($result);
$db->free($resql);
$parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
$reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.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-2018 Ferran Marcet <fmarcet@2byte.es>
@@ -45,14 +45,14 @@ $confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractlist'; // To manage different context of search
$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'));
@@ -706,9 +706,7 @@ while ($i < min($num,$limit))
$nbofsalesrepresentative=count($listsalesrepresentatives);
if ($nbofsalesrepresentative > 3) // We print only number
{
print '<a href="'.DOL_URL_ROOT.'/societe/commerciaux.php?socid='.$socstatic->id.'">';
print $nbofsalesrepresentative;
print '</a>';
}
else if ($nbofsalesrepresentative > 0)
{

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.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
@@ -47,9 +48,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

@@ -125,8 +125,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$link = new Link($db);
$link->id = $linkid;
$link->fetch();
$link->fetch($linkid);
$res = $link->delete($user);
$langs->load('link');
@@ -160,8 +159,7 @@ elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('l
require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php';
$langs->load('link');
$link = new Link($db);
$link->id = GETPOST('linkid', 'int');
$f = $link->fetch();
$f = $link->fetch(GETPOST('linkid', 'int'));
if ($f)
{
$link->url = GETPOST('link', 'alpha');
@@ -169,7 +167,7 @@ elseif ($action == 'confirm_updateline' && GETPOST('save','alpha') && GETPOST('l
{
$link->url = 'http://' . $link->url;
}
$link->label = GETPOST('label', 'alpha');
$link->label = GETPOST('label', 'alphanohtml');
$res = $link->update($user);
if (!$res)
{
@@ -194,7 +192,7 @@ elseif ($action == 'renamefile' && GETPOST('renamefilesave','alpha'))
// Security:
// Disallow file with some extensions. We rename them.
// Because if we put the documents directory into a directory inside web root (very bad), this allows to execute on demand arbitrary code.
if (preg_match('/\.htm|\.html|\.php|\.pl|\.cgi$/i',$filenameto) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED))
if (isAFileWithExecutableContent($filenameto) && empty($conf->global->MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED))
{
$filenameto.= '.noexe';
}

File diff suppressed because it is too large Load Diff

View File

@@ -43,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, 0);
dol_add_file_process($upload_dir_tmp, 1, 0, 'addedfile', '', null, $trackid, 0);
$action='presend';
}
@@ -478,7 +478,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

@@ -4,6 +4,7 @@
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2020 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
@@ -90,7 +91,7 @@ class box_contacts extends ModeleBoxes
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE sp.entity IN (".getEntity('socpeople').")";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND sp.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($user->societe_id) $sql.= " AND sp.fk_soc = ".$user->societe_id;
$sql.= " ORDER BY sp.tms DESC";
$sql.= $db->plimit($max, 0);

View File

@@ -123,6 +123,13 @@ class CMailFile
{
global $conf, $dolibarr_main_data_root;
// Clean values of $mimefilename_list
if (is_array($mimefilename_list)) {
foreach($mimefilename_list as $key => $val) {
$mimefilename_list[$key] = dol_string_unaccent($mimefilename_list[$key]);
}
}
$this->sendcontext = $sendcontext;
if (empty($replyto)) $replyto=$from;
@@ -522,6 +529,31 @@ class CMailFile
return true;
}
$sendingmode = $this->sendmode;
if ($this->context == 'emailing' && ! empty($conf->global->MAILING_NO_USING_PHPMAIL) && $sendingmode == 'mail')
{
// List of sending methods
$listofmethods=array();
$listofmethods['mail']='PHP mail function';
//$listofmethods['simplemail']='Simplemail class';
$listofmethods['smtps']='SMTP/SMTPS socket library';
// EMailing feature may be a spam problem, so when you host several users/instance, having this option may force each user to use their own SMTP agent.
// You ensure that every user is using its own SMTP server when using the mass emailing module.
$linktoadminemailbefore='';
$linktoadminemailend='';
$this->error = $langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]);
$this->errors[] = $langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]);
$this->error .= '<br>'.$langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']);
$this->errors[] = $langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']);
if (! empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS))
{
$this->error .= '<br>'.$langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS);
$this->errors[] = $langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS);
}
return false;
}
// Check number of recipient is lower or equal than MAIL_MAX_NB_OF_RECIPIENTS_IN_SAME_EMAIL
if (empty($conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL)) $conf->global->MAIL_MAX_NB_OF_RECIPIENTS_TO_IN_SAME_EMAIL=10;
$tmparray1 = explode(',', $this->addr_to);

View File

@@ -195,6 +195,29 @@ abstract class CommonInvoice extends CommonObject
}
}
/**
* Return amount (with tax) of all converted amount for this credit note
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise
*/
function getSumFromThisCreditNotesNotUsed($multicurrency=0)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
$discountstatic=new DiscountAbsolute($this->db);
$result=$discountstatic->getSumFromThisCreditNotesNotUsed($this, $multicurrency);
if ($result >= 0)
{
return $result;
}
else
{
$this->error=$discountstatic->error;
return -1;
}
}
/**
* Renvoie tableau des ids de facture avoir issus de la facture
*

View File

@@ -10,8 +10,8 @@
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2017-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2017 Rui Strecht <rui.strecht@aliartalentos.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
@@ -53,7 +53,7 @@ abstract class CommonObject
/**
* @var string Error string
* @see errors
* @see $errors
*/
public $error;
@@ -509,7 +509,7 @@ abstract class CommonObject
$this->country =$tmparray['label'];
}
if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_cpde)))
if ($withregion && $this->state_id && (empty($this->state_code) || empty($this->state) || empty($this->region) || empty($this->region_code)))
{
require_once DOL_DOCUMENT_ROOT .'/core/lib/company.lib.php';
$tmparray=getState($this->state_id,'all',0,1);
@@ -1816,7 +1816,7 @@ abstract class CommonObject
*/
function setMulticurrencyCode($code)
{
dol_syslog(get_class($this).'::setMulticurrencyCode('.$id.')');
dol_syslog(get_class($this).'::setMulticurrencyCode('.$code.')');
if ($this->statut >= 0 || $this->element == 'societe')
{
$fieldname = 'multicurrency_code';
@@ -1858,7 +1858,7 @@ abstract class CommonObject
*/
function setMulticurrencyRate($rate, $mode=1)
{
dol_syslog(get_class($this).'::setMulticurrencyRate('.$id.')');
dol_syslog(get_class($this).'::setMulticurrencyRate('.$rate.','.$mode.')');
if ($this->statut >= 0 || $this->element == 'societe')
{
$fieldname = 'multicurrency_tx';
@@ -1876,10 +1876,16 @@ abstract class CommonObject
{
foreach ($this->lines as &$line)
{
// Amounts in company currency will be recalculated
if($mode == 1) {
$line->subprice = 0;
}
// Amounts in foreign currency will be recalculated
if($mode == 2) {
$line->multicurrency_subprice = 0;
}
switch ($this->element) {
case 'propal':
$this->updateline(
@@ -2689,7 +2695,7 @@ abstract class CommonObject
$MODULE = "";
if ($this->element == 'propal')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL";
elseif ($this->element == 'order')
elseif ($this->element == 'commande' || $this->element == 'order')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER";
elseif ($this->element == 'facture')
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE";
@@ -3806,10 +3812,11 @@ abstract class CommonObject
// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $reldir)
{
$tpl = dol_buildpath($reldir.'/objectline_create.tpl.php');
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -4059,10 +4066,11 @@ abstract class CommonObject
// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $reldir)
{
$tpl = dol_buildpath($reldir.'/objectline_view.tpl.php');
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -4082,10 +4090,11 @@ abstract class CommonObject
// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $reldir)
{
$tpl = dol_buildpath($reldir.'/objectline_edit.tpl.php');
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -4278,10 +4287,11 @@ abstract class CommonObject
// Output template part (modules that overwrite templates must declare this into descriptor)
// Use global variables + $dateSelector + $seller and $buyer
$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl'));
$dirtpls=array_merge($conf->modules_parts['tpl'], array('/core/tpl'));
foreach($dirtpls as $reldir)
{
$tpl = dol_buildpath($reldir.'/originproductline.tpl.php');
if (empty($conf->file->strict_mode)) {
$res=@include $tpl;
} else {
@@ -5953,6 +5963,12 @@ abstract class CommonObject
$type='link';
$param['options']=array($reg[1].':'.$reg[2]=>$reg[1].':'.$reg[2]);
}
elseif(preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) {
$param['options'] = array($reg[1] . ':' . $reg[2] . ':' . $reg[3] . ':' . $reg[4] => 'N');
$type = 'sellist';
}
$langfile=$val['langfile'];
$list=$val['list'];
$help=$val['help'];
@@ -6285,7 +6301,7 @@ abstract class CommonObject
* @param array $params Optional parameters. Example: array('style'=>'class="oddeven"', 'colspan'=>$colspan)
* @param string $keysuffix Suffix string to add after name and id of field (can be used to avoid duplicate names)
* @param string $keyprefix Prefix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $onetrtd All fields in same tr td
* @param string $onetrtd All fields in same tr td (TODO field not used ?)
* @return string
*/
function showOptionals($extrafields, $mode='view', $params=null, $keysuffix='', $keyprefix='', $onetrtd=0)
@@ -6382,10 +6398,7 @@ abstract class CommonObject
$out .= '<tr id="'.$html_id.'" '.$csstyle.' class="'.$class.$this->element.'_extras_'.$key.'" '.$domData.' >';
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
{
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; }
}
if (! empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0) { $colspan='0'; }
if ($action == 'selectlines') { $colspan++; }
@@ -6442,7 +6455,7 @@ abstract class CommonObject
jQuery(document).ready(function() {
function showOptions(child_list, parent_list)
{
var val = $("select[name=\"options_"+parent_list+"\"]").val();
var val = $("select[name=\""+parent_list+"\"]").val();
var parentVal = parent_list + ":" + val;
if(val > 0) {
$("select[name=\""+child_list+"\"] option[parent]").hide();

View File

@@ -615,6 +615,10 @@ class Conf
$this->expensereport->payment = new stdClass();
$this->expensereport->payment->warning_delay=(isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY)?$this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY:0)*24*60*60;
}
if (isset($this->holiday)) {
$this->holiday->approve = new stdClass();
$this->holiday->approve->warning_delay=(isset($this->global->MAIN_DELAY_HOLIDAYS)?$this->global->MAIN_DELAY_HOLIDAYS:0)*24*60*60;
}
if (! empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT))
{

View File

@@ -133,7 +133,7 @@ class DiscountAbsolute
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as sr";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON sr.fk_facture_source = f.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as fsup ON sr.fk_invoice_supplier_source = fsup.rowid";
$sql.= " WHERE sr.entity = " . $conf->entity;
$sql.= " WHERE sr.entity IN (".getEntity('invoice').")";
if ($rowid) $sql.= " AND sr.rowid=".$rowid;
if ($fk_facture_source) $sql.= " AND sr.fk_facture_source=".$fk_facture_source;
if ($fk_invoice_supplier_source) $sql.= " AND sr.fk_invoice_supplier_source=".$fk_invoice_supplier_source;
@@ -614,6 +614,49 @@ class DiscountAbsolute
return -1;
}
}
/**
* Return amount (with tax) of all converted amount for this credit note
*
* @param CommonInvoice $invoice Object invoice
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return int <0 if KO, Sum of credit notes and deposits amount otherwise
*/
function getSumFromThisCreditNotesNotUsed($invoice, $multicurrency=0)
{
dol_syslog(get_class($this)."::getSumCreditNotesUsed", LOG_DEBUG);
if ($invoice->element == 'facture' || $invoice->element == 'invoice')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc';
$sql.= ' WHERE rc.fk_facture IS NULL AND rc.fk_facture_source = '.$invoice->id;
}
else if ($invoice->element == 'invoice_supplier')
{
$sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc';
$sql.= ' WHERE rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_source = '.$invoice->id;
}
else
{
$this->error=get_class($this)."::getSumCreditNotesUsed was called with a bad object as a first parameter";
dol_print_error($this->error);
return -1;
}
$resql=$this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);
if ($multicurrency) return $obj->multicurrency_amount;
else return $obj->amount;
}
else
{
$this->error = $this->db->lasterror();
return -1;
}
}
/**
* Return clickable ref of object (with picto or not)

View File

@@ -177,7 +177,7 @@ class DolEditor
$out.= $this->content;
$out.= '</textarea>';
if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax))
if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax) && ! empty($conf->fckeditor->enabled))
{
if (! defined('REQUIRE_CKEDITOR')) define('REQUIRE_CKEDITOR','1');

View File

@@ -1224,13 +1224,14 @@ class ExtraFields
if ($value == $obj->rowid)
{
foreach ($fields_label as $field_toshow)
{
$translabel=$langs->trans($obj->$field_toshow);
if ($translabel!=$obj->$field_toshow) {
$labeltoshow=dol_trunc($translabel,18).' ';
}else {
$labeltoshow=dol_trunc($obj->$field_toshow,18).' ';
if (! $notrans) {
foreach ($fields_label as $field_toshow) {
$translabel = $langs->trans($obj->$field_toshow);
if ($translabel != $obj->$field_toshow) {
$labeltoshow = dol_trunc($translabel, 18) . ' ';
} else {
$labeltoshow = dol_trunc($obj->$field_toshow, 18) . ' ';
}
}
}
$out.='<option value="'.$obj->rowid.'" selected>'.$labeltoshow.'</option>';
@@ -1860,7 +1861,7 @@ class ExtraFields
function setOptionalsFromPost($extralabels, &$object, $onlykey='')
{
global $_POST, $langs;
$nofillrequired='';// For error when required field left blank
$nofillrequired=0;// For error when required field left blank
$error_field_required = array();
if (is_array($this->attributes[$object->table_element]['label'])) $extralabels=$this->attributes[$object->table_element]['label'];
@@ -1891,15 +1892,15 @@ class ExtraFields
if ($this->attributes[$object->table_element]['required'][$key]) // Value is required
{
// Check if empty without using GETPOST, value can be alpha, int, array, etc...
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $_POST["options_".$key] != '0')
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] != 'select' && $_POST["options_".$key] != '0')
|| (! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'select')
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
{
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];
$nofillrequired++;
$error_field_required[] = $langs->transnoentitiesnoconv($value);
}
}
if (in_array($key_type,array('date')))
{
// Clean parameters

View File

@@ -152,7 +152,7 @@ class Form
* @param string $value Value to show/edit
* @param object $object Object
* @param boolean $perm Permission to allow button to edit parameter
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select:xxx'...)
* @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols%', 'datepicker' ('day' do not work, don't know why), 'dayhour' or 'datepickerhour', 'ckeditor:dolibarr_zzz:width:height:savemethod:toolbarstartexpanded:rows:cols', 'select;xkey:xval,ykey:yval,...')
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
@@ -172,7 +172,7 @@ class Form
if (empty($typeofdata)) return 'ErrorBadParameter';
// When option to edit inline is activated
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker
if (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && ! preg_match('/^select;|datehourpicker/',$typeofdata)) // TODO add jquery timepicker and support select
{
$ret.=$this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg);
}
@@ -229,7 +229,8 @@ class Form
foreach($arraydata as $val)
{
$tmp=explode(':',$val);
$arraylist[$tmp[0]]=$tmp[1];
$tmpkey=str_replace('|', ':', $tmp[0]);
$arraylist[$tmpkey]=$tmp[1];
}
$ret.=$this->selectarray($htmlname,$arraylist,$value);
}
@@ -298,7 +299,7 @@ class Form
* @param string $value Value to show/edit
* @param string $htmlname DIV ID (field name)
* @param int $condition Condition to edit
* @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:xxx')
* @param string $inputType Type of input ('string', 'numeric', 'datepicker' ('day' do not work, don't know why), 'textarea:rows:cols', 'ckeditor:dolibarr_zzz:width:height:?:1:rows:cols', 'select:loadmethod:savemethod:buttononly')
* @param string $editvalue When in edit mode, use this value as $value instead of value
* @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
@@ -572,15 +573,14 @@ class Form
* Generate select HTML to choose massaction
*
* @param string $selected Value auto selected when at least one record is selected. Not a preselected value. Use '0' by default.
* @param int $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param array $arrayofaction array('code'=>'label', ...). The code is the key stored into the GETPOST('massaction') when submitting action.
* @param int $alwaysvisible 1=select button always visible
* @return string Select list
* @return string|void Select list
*/
function selectMassAction($selected, $arrayofaction, $alwaysvisible=0)
{
global $conf,$langs,$hookmanager;
if (count($arrayofaction) == 0) return;
$disabled=0;
$ret='<div class="centpercent center">';
@@ -589,6 +589,8 @@ class Form
// Complete list with data from external modules. THe module can use $_SERVER['PHP_SELF'] to know on which page we are, or use the $parameters['currentcontext'] completed by executeHooks.
$parameters=array();
$reshook=$hookmanager->executeHooks('addMoreMassActions',$parameters); // Note that $action and $object may have been modified by hook
// check if there is a mass action
if (count($arrayofaction) == 0 && empty($hookmanager->resPrint)) return;
if (empty($reshook))
{
$ret.='<option value="0"'.($disabled?' disabled="disabled"':'').'>-- '.$langs->trans("SelectAction").' --</option>';
@@ -1861,10 +1863,10 @@ class Form
* @param int $forcecombo Force to use combo box
* @param string $morecss Add more css on select
* @param int $hidepriceinlabel 1=Hide prices in label
* @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used
* 'warehouseopen' = count products from open warehouses,
* 'warehouseclosed' = count products from closed warehouses,
* 'warehouseinternal' = count products from warehouses for internal correct/transfer only
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
* @return void
*/
@@ -1876,7 +1878,16 @@ class Form
// check parameters
$price_level = (! empty($price_level) ? $price_level : 0);
if (is_null($ajaxoptions)) $ajaxoptions=array();
if(strval($filtertype) === '' && (!empty($conf->product->enabled) || !empty($conf->service->enabled))){
if(!empty($conf->product->enabled) && empty($conf->service->enabled)){
$filtertype = '0';
}
elseif(empty($conf->product->enabled) && !empty($conf->service->enabled)){
$filtertype = '1';
}
}
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT))
{
$placeholder='';
@@ -2006,10 +2017,10 @@ class Form
* @param int $forcecombo Force to use combo box
* @param string $morecss Add more css on select
* @param int $hidepriceinlabel 1=Hide prices in label
* @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used
* 'warehouseopen' = select products from open warehouses,
* 'warehouseclosed' = select products from closed warehouses,
* 'warehouseinternal' = select products from warehouses for internal correct/transfer only
* @param string $warehouseStatus Warehouse status filter to group/count stock. Following comma separated filter options can be used.
* 'warehouseopen' = count products from open warehouses,
* 'warehouseclosed' = count products from closed warehouses,
* 'warehouseinternal' = count products from warehouses for internal correct/transfer only
* @return array Array of keys for json
*/
function select_produits_list($selected='',$htmlname='productid',$filtertype='',$limit=20,$price_level=0,$filterkey='',$status=1,$finished=2,$outputmode=0,$socid=0,$showempty='1',$forcecombo=0,$morecss='',$hidepriceinlabel=0, $warehouseStatus='')
@@ -2039,7 +2050,14 @@ class Form
}
$selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
(count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock";
if (count($warehouseStatusArray))
{
$selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock
}
else
{
$selectFieldsGrouped = ", p.stock";
}
$sql = "SELECT ";
$sql.= $selectFields . $selectFieldsGrouped;
@@ -2074,7 +2092,8 @@ class Form
if (count($warehouseStatusArray))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
$sql.= ' AND e.statut IN ('.$this->db->escape(implode(',',$warehouseStatusArray)).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0.
}
// include search in supplier ref
@@ -2098,10 +2117,6 @@ class Form
}
$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
if (count($warehouseStatusArray))
{
$sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.$this->db->escape(implode(',',$warehouseStatusArray)).'))';
}
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
$sql .= " AND pac.rowid IS NULL";
@@ -2272,7 +2287,7 @@ class Form
/**
* constructProductListOption
*
* @param resultset $objp Resultset of fetch
* @param resource $objp Resultset of fetch
* @param string $opt Option (var used for returned value in string option format)
* @param string $optJson Option (var used for returned value in json format)
* @param int $price_level Price level
@@ -5558,7 +5573,8 @@ class Form
if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company';
$confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT
$fieldstoshow='t.ref';
if (((float) DOL_VERSION) < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber';
else $fieldstoshow='t.ref';
if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...)
{
$tmpfieldstoshow='';

View File

@@ -767,7 +767,7 @@ class FormFile
$out.= '<a class="documentdownload paddingright" href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).($param?'&'.$param:'').'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= ' target="_blank">';
$out.= '>';
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]);
$out.= dol_trunc($file["name"], 150);
$out.= '</a>'."\n";
@@ -1758,7 +1758,7 @@ class FormFile
print $langs->trans('Link') . ': <input type="text" name="link" value="' . $link->url . '">';
print '</td>';
print '<td>';
print $langs->trans('Label') . ': <input type="text" name="label" value="' . $link->label . '">';
print $langs->trans('Label') . ': <input type="text" name="label" value="' . dol_escape_htmltag($link->label) . '">';
print '</td>';
print '<td align="center">' . dol_print_date(dol_now(), "dayhour", "tzuser") . '</td>';
print '<td align="right"></td>';
@@ -1772,7 +1772,7 @@ class FormFile
print '<td>';
print img_picto('', 'object_globe').' ';
print '<a data-ajax="false" href="' . $link->url . '" target="_blank">';
print $link->label;
print dol_escape_htmltag($link->label);
print '</a>';
print '</td>'."\n";
print '<td align="right"></td>';

View File

@@ -394,6 +394,7 @@ class FormMail extends Form
if ($this->param['models'] != 'none')
{
$result = $this->fetchAllEMailTemplate($this->param["models"], $user, $outputlangs);
if ($result < 0)
{
setEventMessages($this->error, $this->errors, 'errors');
@@ -627,7 +628,7 @@ class FormMail extends Form
$out.= ' &lt;'.$this->tomail.'&gt;';
if ($this->withtofree)
{
$out.= '<br>'.$langs->trans("and").' <input class="minwidth200" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />';
$out.= '<br>'.$langs->trans("and").' <input class="minwidth200" id="sendto" name="sendto" value="'.((! is_array($this->withto) && ! is_numeric($this->withto)) ? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) : "").'" />';
}
}
else
@@ -640,7 +641,7 @@ class FormMail extends Form
{
if (! empty($this->withtofree))
{
$out.= '<input class="minwidth200" id="sendto" name="sendto" value="'.(! is_array($this->withto) && ! is_numeric($this->withto)? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) :"").'" />';
$out.= '<input class="minwidth200" id="sendto" name="sendto" value="'.((! is_array($this->withto) && ! is_numeric($this->withto)) ? (isset($_REQUEST["sendto"])?$_REQUEST["sendto"]:$this->withto) : "").'" />';
}
if (! empty($this->withto) && is_array($this->withto))
{
@@ -1029,7 +1030,6 @@ class FormMail extends Form
$defaultmessage=preg_replace("/^(<br>)+/","",$defaultmessage);
$defaultmessage=preg_replace("/^\n+/","",$defaultmessage);
}
$out.= '<tr>';
$out.= '<td valign="top">';
$out.=$form->textwithpicto($langs->trans('MailText'), $helpforsubstitution, 1, 'help', '', 0, 2, 'substittooltipfrombody');

View File

@@ -96,7 +96,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
}
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;

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