Compare commits

...

215 Commits
12.0.4 ... 11.0

Author SHA1 Message Date
Laurent Destailleur
a186e16568 Backport fix for mysql 8 export 2024-10-29 15:32:54 +01:00
Laurent Destailleur
a621032643 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2024-09-29 19:28:05 +02:00
Laurent Destailleur
32646cb7f4 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2024-09-29 19:25:49 +02:00
Florian Mortgat
74b67eb6c6 FIX - use price() to display qty on a product's stats tab to avoid showing too many decimals when rounding errors are possible (#31165) 2024-09-29 15:57:05 +02:00
Laurent Destailleur
667890247c Merge remote-tracking branch 'origin/10.0' into 11.0 2024-09-26 18:46:30 +02:00
Florian Mortgat
c727bbb530 FIX: when qty is not an integer, apply price() (#31138)
* FIX: when qty is not an integer, apply price() to avoid displaying precision errors if php.ini's precision settings are too high

* Apply eldy's suggestion to use price's parameters rather than a test
2024-09-26 18:41:41 +02:00
Laurent Destailleur
973a2ede97 Fix syntax error 2023-08-10 11:35:19 +02:00
Laurent Destailleur
e8fd551043 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2023-08-10 10:43:44 +02:00
Laurent Destailleur
34b3113bb7 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2023-08-10 10:41:20 +02:00
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
03a9daa3e6 Merge pull request #25139 from atm-greg/Fix_11.0_bankentries_list_missing_hook
add missing hook printFieldListValue
2023-06-19 16:48:13 +02:00
atm-greg
e5193f16cc add printFieldListJoin 2023-06-19 16:09:34 +02:00
atm-greg
9abde6c057 add missing hook printFieldListValue 2023-06-19 14:26:49 +02:00
Laurent Destailleur
6aa8ba8935 Removed unexpected files 2023-03-16 09:29:10 +01:00
Laurent Destailleur
f782ac6654 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-11-22 22:03:47 +01:00
Laurent Destailleur
1e54e695b2 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-11-22 22:00:59 +01:00
Laurent Destailleur
f2eb3c1a55 Merge pull request #22919 from atm-maxime/11.0
Fix API right check
2022-11-22 21:40:12 +01:00
Laurent Destailleur
41a970c90f Merge pull request #22922 from ATM-Nicolas/fix_sql_request_parenthesis
FIX sql request parenthesis
2022-11-22 21:39:11 +01:00
ATM-Nicolas
3d9b2a1676 FIX : SQL request parenthesis 2022-11-22 15:32:37 +01:00
Maxime Kohlhaas
7be0e0da1c Fix API right check 2022-11-22 13:46:42 +01:00
Laurent Destailleur
cc1a3080d0 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-05-03 11:53:23 +02:00
Laurent Destailleur
b5f887b3e4 Fix DEBUGBAR_USE_LOG_FILE 2022-05-03 11:52:32 +02:00
Laurent Destailleur
a1534955a1 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-03-10 15:52:50 +01:00
Laurent Destailleur
79371f66b0 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2022-03-10 15:52:28 +01: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
7dfb369a98 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2022-01-07 15:48:23 +01:00
Laurent Destailleur
265aeb76e6 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts:
	htdocs/core/class/utils.class.php
	htdocs/expensereport/class/expensereport.class.php
2022-01-07 15:48:13 +01:00
Laurent Destailleur
5ee74d7c07 Merge branch '9.0' of git@github.com:Dolibarr/dolibarr.git into 10.0 2022-01-07 15:45:51 +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
5de6c193ff Merge pull request #19745 from daraelmin/patch-1
Fix #19723 - Belgium provinces incorrect mapping
2022-01-06 10:41:19 +01:00
daraelmin
1f6e9a1a9e Fix install - Belgium provinces incorrect mapping 2022-01-04 18:46:29 +01:00
Laurent Destailleur
0a72aed3d7 Fix missing space before union 2021-12-23 13:35:38 +01:00
Laurent Destailleur
ce8312c744 Merge pull request #19464 from atm-quentin/FIX_11_TAB_INVOICE
FIX : Urgent onglet contact inaccessible depuis une facture
2021-11-30 11:45:56 +01:00
Quentin VIAL-GOUTEYRON
632147ad88 object->id is always empty 2021-11-24 12:04:18 +01:00
Laurent Destailleur
9aa5c94612 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-11-11 15:59:48 +01:00
Laurent Destailleur
ba724204a4 FIX Bad use of dol_concatdesc() 2021-11-11 15:50:32 +01:00
Laurent Destailleur
ff696e0dad Merge pull request #19236 from marc-dll/11.0_FIX_invoice_creation_blocked
FIX: URGENT: impossible to create an invoice
2021-10-31 14:03:11 +01:00
Laurent Destailleur
3dcd1aa05d Update info.php 2021-10-31 14:02:34 +01:00
Laurent Destailleur
8dfe4fe05f Update note.php 2021-10-31 14:02:14 +01:00
Laurent Destailleur
65d59405da Update document.php 2021-10-31 14:01:56 +01:00
Laurent Destailleur
0e2e8fe27f Update contact.php 2021-10-31 14:01:40 +01:00
Marc de Lima Lucio
eb8d7f92c3 FIX: invoice: inpossible to create an invoice because of very bad check + warnings when trying to print tabs for invoice with no ID 2021-10-28 15:26:40 +02:00
Laurent Destailleur
e1af439a6d Merge pull request #18931 from atm-florianm/FIX_11.0_consistent_UX_for_invoices_when_no_id_or_ref
FIX: consistent UX when calling a tab from the invoice card with empty ref/id
2021-10-17 13:52:30 +02:00
atm-florian
57052e2fba FIX PR#18931 Remove useless explicit call to dol_shutdown 2021-10-11 11:10:14 +02:00
atm-florian
2da16ade6c FIX: consistent UX when calling a tab from the invoice card with empty ref / id 2021-10-08 17:24:52 +02:00
Laurent Destailleur
cd09099409 Merge pull request #18563 from atm-maxime/patch-3
Fix supplier invoice pdf generation canelle
2021-09-01 13:37:50 +02:00
Maxime Kohlhaas
d09d036f06 Fix supplier invoice pdf generation canelle
Thirdparty wrongly fetched was causing errors on mass generation
2021-08-31 16:10:55 +02:00
Laurent Destailleur
ab8f78f29a Merge pull request #18366 from atm-quentin/FIX_11_postgre_select_filter_extrafield
FIX compatibility postgre sql
2021-08-11 15:45:04 +02:00
Laurent Destailleur
8da328b183 Update extrafields_list_search_sql.tpl.php 2021-08-11 15:44:48 +02:00
Quentin VIAL-GOUTEYRON
108a5ff7cb FIX postgre filter select search extrafield 2021-08-09 15:14:25 +02:00
Laurent Destailleur
026f38fe06 Merge pull request #18094 from marc-dll/11.0_FIX_holiday_pgsql
FIX: holiday: balances not updated correctly with pgsql because of case sensitivity
2021-07-06 14:47:08 +02:00
Marc de Lima Lucio
eea90cef56 FIX: holiday: balances not updated correctly with pgsql because of case sensitivity 2021-07-05 16:31:33 +02:00
Laurent Destailleur
246f7b054e Merge pull request #18060 from atm-arnaud/FIX_deposit_can_create_credit_note_in_payment_conf
FIX deposit can create credit note in payment conf
2021-06-30 14:48:29 +02:00
atm-arnaud
8772c53723 FIX deposit can create credit note in payment conf 2021-06-30 12:37:21 +02:00
Laurent Destailleur
0472ab4690 Merge pull request #18040 from OPEN-DSI/v11-fix-contact-update-perso-birthday-alert
FIX update contact birthday alert
2021-06-29 15:37:38 +02:00
lvessiller
fa28a02d74 FIX update contact birthday alert 2021-06-28 11:03:22 +02:00
Juanjo Menent
eeef78760a fix: Bad position of the printFieldListWhere hook 2021-06-17 10:29:43 +02:00
Laurent Destailleur
1d9310055e Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-06-14 15:19:11 +02:00
Laurent Destailleur
e81023c35a Update doc 2021-06-14 15:12:08 +02:00
Laurent Destailleur
dcca3011ee Clean code 2021-06-14 14:41:50 +02:00
Laurent Destailleur
e41a3a2f42 Merge pull request #17867 from OPEN-DSI/v11-fix-clone-invoice-with-acount-line
FIX clone invoice with acount line
2021-06-14 14:41:05 +02:00
Laurent Destailleur
41d9324600 Merge pull request #17888 from marc-dll/11.0_FIX_activity_task_assignment
FIX: project time spent by day/week: quote mismatch in SQL query to assign to check task assigment
2021-06-11 18:12:57 +02:00
Laurent Destailleur
a8f11fec31 Update perweek.php 2021-06-11 18:12:39 +02:00
Laurent Destailleur
057d91698f Update perday.php 2021-06-11 18:11:55 +02:00
Marc de Lima Lucio
96656ff148 FIX: project time spent by day/week: quote mismatch is SQL query to assign to check task assigment 2021-06-10 23:26:33 +02:00
Laurent Destailleur
5d6735f364 Merge pull request #17826 from ptibogxiv/patch-428
Fix date_start of last subscription
2021-06-10 13:01:07 +02:00
Laurent Destailleur
92b20d3595 Merge pull request #17831 from atm-john/11.0_fix_doc_childtablesoncascade
FIX : childtablesoncascade doc
2021-06-10 12:59:19 +02:00
Laurent Destailleur
b7ba9df6b4 Update societe.class.php 2021-06-10 12:59:04 +02:00
Laurent Destailleur
8a46fd376f Update commonobject.class.php 2021-06-10 12:58:42 +02:00
Laurent Destailleur
9ed7a3a5c5 Merge pull request #17863 from marc-dll/11.0_FIX_holiday_massaction_delete_right
FIX: holiday list: bad right for mass deletion
2021-06-10 12:13:10 +02:00
Laurent Destailleur
729c12a8e4 Merge pull request #17864 from DorianVabre/FIX_11.0_CSMSFile_count
Fix: using strlen() instead of count() to measure a message length on CSMSFile
2021-06-10 12:12:43 +02:00
lvessiller
c37c371392 FIX clone invoice with acount line 2021-06-09 17:18:01 +02:00
Dorian Vabre
0a23cf029d using strlen instead of count 2021-06-09 14:13:50 +02:00
Marc de Lima Lucio
5d9aa40065 FIX: holiday list: bad right for mass deletion 2021-06-09 12:40:34 +02:00
ATM john
1aca7efce3 Fix childtablesoncascade doc 2021-06-06 13:15:03 +02:00
ptibogxiv
36accba5c9 Fix date_start of last subscription 2021-06-05 14:43:40 +02:00
Laurent Destailleur
1753e980b8 Merge pull request #17728 from atm-maxime/fix_compta_export_dateech
Fix Quadra accountancy export for due date
2021-05-26 17:25:56 +02:00
Maxime Kohlhaas
1d5b8cbb19 Fix Quadra accountancy export for due date 2021-05-26 14:59:28 +02:00
Laurent Destailleur
93558d5bbb Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-05-20 14:58:57 +02:00
Laurent Destailleur
865ecf7a94 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts:
	htdocs/admin/translation.php
2021-05-20 14:58:50 +02:00
Laurent Destailleur
e8d9e9e697 Merge pull request #17659 from gmilad/gmilad-fix-17608-b10
Fix issue #17608 for branch 10
2021-05-20 14:34:12 +02:00
Laurent Destailleur
90443e26ac Merge pull request #17660 from gmilad/gmilad-fix-17608-b11
Fix issue #17608 for branch 11
2021-05-20 14:30:30 +02:00
Laurent Destailleur
5fd4da66cb Merge pull request #17673 from OPEN-DSI/v11-fix-supplier-order-special-code
FIX keep special code on supplier order lines for external modules
2021-05-20 14:13:07 +02:00
lvessiller
e2e6d4ba14 FIX keep special code on supplier order lines for external modules 2021-05-19 14:29:46 +02:00
gmilad
4bb18db905 Fix issue #17608 for branch 11
Fix issue #17608 for branch 11
2021-05-18 19:53:35 +02:00
gmilad
57732d4265 Fix issue #17608 for branch 10
Fix issue #17608 for branch 10
2021-05-18 19:45:15 +02:00
Laurent Destailleur
6170b28c3b FIx #17651 2021-05-18 11:58:49 +02:00
Laurent Destailleur
a865f49d72 Fix phpcs 2021-05-17 19:19:26 +02:00
Laurent Destailleur
c54e010126 Fix perms on API user 2021-05-17 16:16:45 +02:00
Laurent Destailleur
cb9db6e3a8 Merge pull request #17630 from DorianVabre/Fix_11.0_api_user_right
Fix: user rest api rights
2021-05-17 15:58:11 +02:00
stickler-ci
a3aba28c95 Fixing style errors. 2021-05-17 10:06:41 +00:00
Dorian Vabre
547f1dd370 Fix: user rest api rights 2021-05-17 11:54:53 +02:00
Laurent Destailleur
5305a983c7 Merge pull request #17629 from fmarcet/11.0
Fix: Before there was no mistake
2021-05-17 10:30:46 +02:00
Ferran Marcet
f923c70f38 Fix: Before there was no mistake 2021-05-17 10:17:54 +02:00
Laurent Destailleur
2637f9af63 Merge pull request #17586 from atm-quentin/FIX_missing_town_and_zip_filter
FIX missing town and zip filter in contract list sql request
2021-05-17 10:08:44 +02:00
Laurent Destailleur
fd6147578a Merge pull request #17611 from atm-maxime/fix/supplier_discount_replenish
Fix use supplier relative discount in replenish order creation
2021-05-17 09:44:39 +02:00
Laurent Destailleur
592cfb5e93 Merge pull request #17602 from fmarcet/11.0
FIX: Impossible to add multiple localtax2
2021-05-17 09:13:58 +02:00
Laurent Destailleur
6a2afabcac Merge pull request #17617 from piernov/11.0-fix-LDAPposixGroupId
Fix: properly set gid for Group LDAP synchro
2021-05-17 07:14:25 +02:00
Laurent Destailleur
fc22565532 Merge pull request #17613 from atm-maxime/fix/date_propal
Fix use of DatePropal instead of Date
2021-05-17 07:09:35 +02:00
piernov
1cbe0e3f2d Fix: properly set gid for Group LDAP synchro
Even if the gidNumber field was set in the configuration, a gid different from the Dolibarr's one was generated and stored into LDAP.
Now the gidNumber is properly set to Dolibarr's gid if gidNumber field is set in the LDAP module configuration.
2021-05-15 18:01:34 +02:00
Maxime Kohlhaas
db32f882e8 Fix use of DatePropal instead of Date 2021-05-15 07:45:04 +02:00
Maxime Kohlhaas
acadef72c1 Fix use supplier relative discount in replenish order creation 2021-05-14 18:01:22 +02:00
Ferran Marcet
c577d1c51e FIX: Impossible to add multiple localtax2 2021-05-13 13:35:28 +02:00
Quentin VIAL-GOUTEYRON
56d78cf12a FIX missing town and zip filter in contract list sql request 2021-05-12 11:02:27 +02:00
Laurent Destailleur
b5c88d5817 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-05-11 20:15:32 +02:00
Laurent Destailleur
c2fa19a0b4 fix phpcs 2021-05-11 20:15:20 +02:00
Laurent Destailleur
82400ca2a5 Merge pull request #17542 from atm-john/patch-2
FIX : var case
2021-05-11 18:43:57 +02:00
John BOTELLA
2fda3b1b46 FIX ; var case
On this page $datePrint is not used but $dateprint yes
2021-05-08 13:53:20 +02:00
Laurent Destailleur
824a601014 Merge pull request #17507 from atm-john/11.0_fix_search_accent_in_description
FIX : search accented words in product description (consumption page)
2021-05-06 16:45:21 +02:00
Laurent Destailleur
9ce23ac6b2 Merge pull request #17494 from atm-john/fix_not_enabled_email_template
FIX saving template email
2021-05-06 16:22:19 +02:00
Laurent Destailleur
a4d93424dc Merge pull request #17498 from marc-dll/FIX_11.0_pgsql_where_boolean
FIX: pgsql: prevent 'WHERE 1'
2021-05-06 15:58:41 +02:00
ATM john
63292255cc Fix search accented words in product description 2021-05-05 18:45:23 +02:00
Marc de Lima Lucio
139ae3db00 FIX: pgsql: prevent 'WHERE 1' 2021-05-05 11:49:11 +02:00
ATM john
6574e54a41 Fix saving template email 2021-05-04 18:09:13 +02:00
Laurent Destailleur
e6b4f1eab6 Merge pull request #17442 from atm-john/11.0_fix_showInputField_checkbox_selection
FIX : Show input field checkbox selection
2021-05-03 16:16:56 +02:00
Laurent Destailleur
33a20ae9a1 Update extrafields.class.php 2021-05-03 16:16:44 +02:00
ATM john
6e4962bb39 Merge branch '11.0' of github.com:Dolibarr/dolibarr into 11.0_fix_showInputField_checkbox_selection 2021-04-30 12:22:31 +02:00
ATM john
6c1e0919c8 Fix checkbox multiselect pre-selected value from get/post 2021-04-30 12:20:43 +02:00
Laurent Destailleur
27e2c69e4e Merge pull request #17439 from atm-lena/11.0_FIX_ShowContactSearch_SQLError
FIX SQL Error show_contacts : socialnetworks
2021-04-30 12:03:40 +02:00
Laurent Destailleur
0d4eaca3e8 Merge pull request #17426 from daraelmin/daraelmin-patch-v11
Fix wrong alias in natural_search v11-v14
2021-04-30 11:58:53 +02:00
Laurent Destailleur
08c85a88c8 Merge pull request #17437 from daraelmin/daraelmin-patch-v11-2
Fix logical test always false V11 to v14
2021-04-30 11:57:58 +02:00
stickler-ci
81b964db45 Fixing style errors. 2021-04-30 08:12:24 +00:00
atm-lena
5e98d99321 FIX SQL Error show_contacts : socialnetworks 2021-04-30 10:04:21 +02:00
daraelmin
749aeeb233 Fix $objp->subscription =="yes" 2021-04-29 23:16:21 +02:00
daraelmin
4174ebd9c0 Fix subscription =="yes" 2021-04-29 23:11:51 +02:00
daraelmin
965eb2d639 Fix logical test always false
subscription is an integer and is set to 0 or 1. So subscription is never equal to "yes"
2021-04-29 22:57:39 +02:00
daraelmin
68415322ec Fix v11 wrong alias in natural_search 2021-04-29 10:00:54 +02:00
Laurent Destailleur
2e9cf8d00b Fix phpcs 2021-04-27 02:15:58 +02:00
Laurent Destailleur
c7f38c4cf0 Fix bad var 2021-04-27 02:10:52 +02:00
Laurent Destailleur
7a6edfd61f Merge pull request #17295 from atm-gauthier/fix_adv_target_emailing_extrafields_link
FIX : type link extrafield case for advanced target emailing
2021-04-27 01:45:26 +02:00
Laurent Destailleur
e9b8e81773 Update advtargetemailing.class.php 2021-04-27 01:45:10 +02:00
Laurent Destailleur
5a6d3b7c88 Merge pull request #17372 from marc-dll/FIX_11.0_invoice__generation_after_paiement
FIX: invoice PDF generation after payment
2021-04-26 22:49:56 +02:00
Marc de Lima Lucio
ce022ab36c FIX: payment validation: invoices PDF were no re-generated, make it with correct display options 2021-04-22 15:57:06 +02:00
Marc de Lima Lucio
ee96fb6470 FIX: payment creation: re-generate invoice PDF with correct display options 2021-04-22 15:56:12 +02:00
stickler-ci
318a783237 Fixing style errors. 2021-04-19 07:19:45 +00:00
Gauthier PC portable 024
8c428081ab FIX : test on link type 2021-04-19 09:17:33 +02:00
Gauthier PC portable 024
ff8aae1209 Merge branch 'fix_adv_target_emailing_extrafields_link' of github.com:atm-gauthier/dolibarr into fix_adv_target_emailing_extrafields_link 2021-04-19 09:16:06 +02:00
Gauthier PC portable 024
5b6439ca5e FIX : cast int 2021-04-19 09:15:47 +02:00
stickler-ci
37f44f4a07 Fixing style errors. 2021-04-16 14:58:57 +00:00
Gauthier PC portable 024
f8fcf7c16b FIX : type link extrafield case for advanced target emailing 2021-04-16 16:55:19 +02:00
Laurent Destailleur
521dec7792 Merge pull request #17018 from fmarcet/11.0
FIX: Show Ref.Supplier in LinkToObjectBlock
2021-03-31 13:44:53 +02:00
Ferran Marcet
b6faa6b605 FIX: Show Ref.Supplier in LinkToObjectBlock 2021-03-31 09:40:12 +02:00
Ferran Marcet
b4f638602a FIX: Show Ref.Supplier in LinkToObjectBlock 2021-03-30 11:10:07 +02:00
Laurent Destailleur
eabe5ae616 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-03-29 21:35:54 +02:00
Laurent Destailleur
8c08b3945b Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-03-29 21:35:46 +02:00
Laurent Destailleur
b9a91f92ea Merge pull request #16984 from aspangaro/10p38
FIX Search on date in accountancy
2021-03-29 16:12:31 +02:00
Alexandre SPANGARO
56ae51375d FIX Search on date in accountancy 2021-03-27 07:11:28 +01:00
Laurent Destailleur
30543bda71 Merge pull request #16947 from atm-john/11.0_fix_something_that_not_exist
FIX : shhhhhh ! There is nothing here...
2021-03-25 01:09:20 +01:00
ATM john
4f693b86c2 shhhhhh ! There is nothing here... 2021-03-23 19:27:40 +01:00
Laurent Destailleur
66bbc7f54f Merge pull request #16734 from AlexisLaurier/11.0
correct nb_expedition count
2021-03-16 15:12:18 +01:00
Alexis LAURIER
971b97d78f correct nb_expedition count 2021-03-16 15:00:46 +01:00
Laurent Destailleur
672a07fdac Merge pull request #16535 from atm-greg/Fix_attach_files_when_models_are_available
Fix : if mailmodels exist in database attached files are always cleared
2021-03-04 16:45:00 +01:00
atm-greg
c41b59b14c Fix : when we have got models in database attached files are cleared even if we did not have selected a model 2021-03-04 14:23:08 +01:00
Laurent Destailleur
ef789376e7 Merge pull request #16501 from atm-gauthier/FIX/HeightForTotWhenTooMuchPayment_SI
FIX : handling $heightforinfotot when he's superior to a page height …
2021-03-02 12:49:58 +01:00
stickler-ci
d20ba5a665 Fixing style errors. 2021-03-01 15:38:15 +00:00
Gauthier PC portable 024
861b583668 FIX : handling $heightforinfotot when he's superior to a page height on Supplier Invoice 2021-03-01 16:34:42 +01:00
Laurent Destailleur
549136efeb Removed useless log 2021-02-26 10:25:30 +01:00
Laurent Destailleur
99a17cadb7 Fix sql syntax 2021-02-26 10:25:08 +01:00
Laurent Destailleur
8e8efce7d1 Fix sql syntax 2021-02-26 10:23:53 +01:00
Laurent Destailleur
9db211b1a7 Merge pull request #16433 from ATM-Consulting/fix/11.0_contact_updateRoles_sql_injection_of_socid
FIX 11.0 - $this->socid injected in query without checking for empty string
2021-02-26 10:22:50 +01:00
Florian Mortgat
d59ee06438 FIX 11.0 - $this->socid injected in query without checking for empty value 2021-02-25 14:51:57 +01:00
Laurent Destailleur
a779ce36f3 Merge pull request #16257 from ivanmestre/fix-bank-account-filter-reset-payment-various
FIX #16241 Bank Account filter resets on payment various
2021-02-11 18:36:59 +01:00
Iván Mestre
cb4cfbd27d Fixed Bank Account filter resets on payment various
Changed GET search bank account GET parameter from search_amount to search_account
2021-02-10 14:43:19 -03:00
Laurent Destailleur
1282494211 Merge pull request #16243 from ptibogxiv/patch-414
FIX update order by api
2021-02-10 01:17:33 +01:00
ptibogxiv
e5f6a64846 FIX update order by api
fix update shipping method and shipping date by API (no change with code or functionality juste fix this pb with updating)
2021-02-09 19:24:36 +01:00
Laurent Destailleur
ff9070ff9c Merge pull request #16206 from atm-maxime/fix_supp_inv_backtolistlink
Fix links to go back on supplier invoice list
2021-02-08 15:04:23 +01:00
Maxime Kohlhaas
414a2366fb Fix links to go back on supplier invoice list 2021-02-07 19:28:00 +01:00
Laurent Destailleur
87c8d917e9 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts:
	htdocs/compta/prelevement/card.php
2021-02-06 01:03:31 +01:00
Laurent Destailleur
c888ce08c1 Merge pull request #16174 from atm-florianm/fix/10.0_check_withdrawal_already_credited_before_crediting_it
FIX 10.0 - before crediting a withdrawal receipt, check whether it has been credited already
2021-02-06 01:00:56 +01:00
Laurent Destailleur
7d14cde45e Merge pull request #16173 from fappels/11_backport_price_patch
FIX: Add critical price patch from 12 to 11.
2021-02-06 00:59:52 +01:00
Florian Mortgat
3f862bf43e FIX 10.0 - before crediting a withdrawal receipt, check whether it has been credited already 2021-02-05 11:34:39 +01:00
Francis Appels
1b55935577 Add critical price patch from 12 to 11. 2021-02-05 10:39:46 +01:00
Laurent Destailleur
2576973dc3 Merge pull request #16140 from OPEN-DSI/v11-fix-model-mail-selected
FIX select default mail template
2021-02-03 20:26:40 +01:00
Laurent Destailleur
6ab723e85c Fix bad path of include 2021-02-03 17:09:26 +01:00
lvessiller
3b050c3452 FIX select default mail template 2021-02-02 10:34:33 +01:00
Laurent Destailleur
188ed6984f Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2021-01-31 18:54:32 +01:00
Laurent Destailleur
08aa3eac00 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
2021-01-31 18:54:19 +01:00
Laurent Destailleur
9ef5f26624 Merge pull request #14022 from OPEN-DSI/fix_supplier_order_dispatching
FIX: Fix detect dispatched product and set to received completely when the supplier order have services
2021-01-31 18:51:57 +01:00
Laurent Destailleur
758d91b4a3 Merge pull request #16087 from ATM-Consulting/fix/11.0_required_extrafields_of_type_sellist_not_properly_checked
FIX 11.0 - mandatory extrafields of type sellist
2021-01-31 18:18:05 +01:00
Laurent Destailleur
099fcd7e4e Fix test email
Conflicts:
	htdocs/admin/mails.php
2021-01-28 19:51:54 +01:00
Laurent Destailleur
c63a124d1c More complete fix 2021-01-28 14:13:29 +01:00
Juanjo Menent
2f98d8035c Fix: Bad supplier price updater 2021-01-28 13:37:43 +01:00
Florian Mortgat
8dfe39258b FIX 11.0 - when a mandatory extrafield of type sellist contains '0' it should be considered empty and trigger an error message upon insertion 2021-01-27 23:46:09 +01:00
Laurent Destailleur
e431b5aacb Merge pull request #16074 from ATM-Consulting/11.0_FIX_wrong_extrafield_insertion_when_creating_intervention
FIX 11.0: when a new intervention is created from an object, a new $e…
2021-01-27 19:35:05 +01:00
Florian Mortgat
35448e3307 FIX 11.0: when a new intervention is created from an object, a new $extrafields object is instantiated but not initialized
Because of this, missing mandatory extrafields are not checked and no extrafields are inserted
2021-01-26 12:42:04 +01:00
Laurent Destailleur
a0fe2a8abc Merge pull request #16022 from frederic34/patch-1
Update .gitignore
2021-01-19 16:19:26 +01:00
Frédéric FRANCE
b2d790b46a Update .gitignore 2021-01-19 14:27:31 +01:00
Laurent Destailleur
0dc182553e Merge pull request #15896 from atm-lena/FIX/issue_14197
FIX balance starting and ending fiscal month #14197
2021-01-06 21:32:02 +01:00
Laurent Destailleur
9e50a06f2b Merge pull request #15894 from atm-john/11.0_fix_issue_14833
Fix #14833 A security mecanism generates data loss
2021-01-06 20:26:19 +01:00
Laurent Destailleur
a955df21bf Merge pull request #15905 from atm-quentin/FIX/issue_14501
FIX useless tracking number displayed on pdf if empty issue #14501
2021-01-06 20:22:43 +01:00
Laurent Destailleur
d3bc6aadec Merge pull request #15902 from atm-john/11.0_fix_box_issue_15465
FIX #15465 External user sees last 5 shipments to other customers in the dashboard
2021-01-06 19:56:57 +01:00
Laurent Destailleur
7372a18283 Update box_shipments.php 2021-01-06 19:56:49 +01:00
stickler-ci
ca557cfacd Fixing style errors. 2021-01-06 13:22:35 +00:00
quentin
e44b14364a FIX useless tracking number displayed on pdf if empty 2021-01-06 14:17:06 +01:00
ATM john
50b5226d10 FIX #15465 External user sees last 5 shipments to other customers in the dashboard 2021-01-06 12:40:38 +01:00
atm-lena
4b9bb824d0 FIX balance starting and ending fiscal month #14197 2021-01-06 11:16:51 +01:00
ATM john
92a4314779 Fix security mecanism generating data loss 2021-01-06 10:45:54 +01:00
Laurent Destailleur
5709216427 Merge pull request #15881 from OPEN-DSI/v11-fix-product-list-vat-rate-show-right
FIX right to show VAT rate in product list
2021-01-05 18:57:06 +01:00
lvessiller
ca6899c138 FIX right to show VAT rate in product list 2021-01-05 16:11:46 +01:00
Laurent Destailleur
f79dec80e6 Fix phpcs 2020-12-17 16:45:56 +01:00
Laurent Destailleur
f0d787debb Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2020-12-17 14:07:24 +01:00
Laurent Destailleur
6bbc25e8c3 Merge pull request #15775 from Haldarys/10.0-fix-prelevement
Fix PRELEVEMENT_ADDDAYS check
2020-12-17 13:53:44 +01:00
Laurent Destailleur
27542ed8ed Update prelevement.php 2020-12-17 13:53:09 +01:00
Laurent Destailleur
36d6b472ce Update prelevement.php 2020-12-17 13:52:03 +01:00
Haldarys
10ac74162e Fix PRELEVEMENT_ADDDAYS check
If we used a positive value in PRELEVEMENT_ADDDAYS it couldn't submit the changes to database
2020-12-17 10:19:21 +01:00
Laurent Destailleur
7886a6e838 Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0 2020-12-13 15:06:54 +01:00
Laurent Destailleur
04c233c229 Merge pull request #15747 from aspangaro/10_p57
FIX: Export FEC - Force Carriage Return Line Feed
2020-12-13 15:06:19 +01:00
Alexandre SPANGARO
35b3d4f40a FIX: Export FEC - Force Carriage Return Line Feed 2020-12-13 14:11:04 +01:00
kamel
5bae9db0a8 FIX: Fix detect distached product and set to received completely when the supplier order have services (support STOCK_SUPPORTS_SERVICES) 2020-06-02 17:29:55 +02:00
97 changed files with 404 additions and 273 deletions

1
.gitignore vendored
View File

@@ -16,6 +16,7 @@ default.properties
.DS_Store
.idea
*.iml
*.orig
Thumbs.db
/dolibarr_genesis.mp4
# Log files

View File

@@ -43,7 +43,7 @@ jobs:
include:
- if: type = push
php: '5.5'
env: DB=postgresql
env: DB=mysql
- if: type = pull_request OR type = push
php: '7.4'
env: DB=mysql

View File

@@ -542,7 +542,7 @@ $cfg['ThemePerServer'] = FALSE; // allow diferent theme for each co
* %f will be replaced by a list of field names.
* (%t and %f only applies to DefaultQueryTable)
*/
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1 = 1';
$cfg['DefaultQueryDatabase'] = '';
/**

View File

@@ -17,8 +17,6 @@ on Internet on web following sites:<br>
<br>
* <a href="https://demo.dolibarr.org">Dolibarr demo (online)</a><br>
<br>
* <a href="https://www.nltechno.com/pages/dolibarrwinbin.php">DoliWamp, the Dolibarr for Windows</a><br>
<br>
* <a href="https://www.dolistore.com">DoliStore (official addons/plugins market place)</a><br>
</body>

View File

@@ -19,7 +19,7 @@ Download
Install
--------------------------------
* For a Quick guide, take a look at README file into root directory.
* For a Quick guide, take a look at README.md file into root directory.
* More complete documentations are also available on line on the Dolibarr Wiki:
https://wiki.dolibarr.org

View File

@@ -22,7 +22,7 @@ Download / Herunterladen
Installation
--------------------------------
* Für eine kurze Einleitung, schau auf die README Datei im Hauptverzeichnis.
* Für eine kurze Einleitung, schau auf die README.md Datei im Hauptverzeichnis.
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
https://wiki.dolibarr.org/index.php/Hauptseite

View File

@@ -19,9 +19,7 @@ https://www.dolistore.org
Documentation utilisateur
--------------------------------
* Pour une prise en main et installation rapide, consultez le fichier
README-FR à la racine.
* Pour une prise en main et installation rapide, consultez le fichier README-FR.md à la racine.
* Une documentation utilisateur francophone plus consistante est disponible en
ligne sur le wiki de Dolibarr à l'adresse:
https://wiki.dolibarr.org
* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse:
https://wiki.dolibarr.org

View File

@@ -4,4 +4,5 @@ User guide
--------------------------------
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
https://www.dolibarr.org

View File

@@ -3,9 +3,6 @@ README (french)
Documentation utilisateur
--------------------------------
* Pour une prise en main et installation rapide, consultez le fichier
README-FR à la racine.
La documentation utilisateur francophone est disponible en ligne sur le site Web de Dolibarr à l'adresse:
* Une documentation utilisateur francophone plus consistante est disponible en
ligne sur le site Web de Dolibarr à l'adresse:
https://www.dolibarr.fr

View File

@@ -87,6 +87,7 @@ if (empty($search_date_start) && !GETPOSTISSET('formfilteraction'))
} else {
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)

View File

@@ -44,14 +44,14 @@ $search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type", 'alpha');
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
$search_date_modification_end = dol_mktime(0, 0, 0, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
$search_date_export_end = dol_mktime(0, 0, 0, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
//var_dump($search_date_start);exit;
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {

View File

@@ -39,7 +39,7 @@ $langs->loadLangs(array("accountancy"));
$action = GETPOST('action', 'alpha');
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_accountancy_code = GETPOST("search_accountancy_code");

View File

@@ -498,9 +498,8 @@ class AccountancyExport
$Tab['contrepartie'] = str_repeat(' ', 8);
// elarifr: date format must be fixed format : 6 char ddmmyy = %d%m%yand not defined by user / dolibarr setting
if (!empty($data->date_echeance))
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // elarifr: format must be ddmmyy
if (!empty($data->date_lim_reglement))
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // elarifr: format must be ddmmyy
else
$Tab['date_echeance'] = '000000';
@@ -685,7 +684,7 @@ class AccountancyExport
public function exportFEC($objectLines)
{
$separator = "\t";
$end_line = "\n";
$end_line = "\r\n";
print "JournalCode".$separator;
print "JournalLib".$separator;

View File

@@ -1402,7 +1402,7 @@ class Adherent extends CommonObject
$this->first_subscription_amount = $obj->subscription;
}
$this->last_subscription_date = $this->db->jdate($obj->datec);
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
$this->last_subscription_amount = $obj->subscription;

View File

@@ -857,7 +857,7 @@ while ($i < min($num, $limit))
else
{
print '<td class="nowrap left">';
if ($obj->subscription == 'yes')
if (!empty($obj->subscription))
{
print $langs->trans("SubscriptionNotReceived");
if ($obj->statut > 0) print " ".img_warning();

View File

@@ -511,7 +511,7 @@ if ($rowid > 0)
$sql .= " AND t.rowid = ".$object->id;
if ($sall)
{
$sql .= natural_search(array("f.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
$sql .= natural_search(array("d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
}
if ($status != '')
{
@@ -710,7 +710,7 @@ if ($rowid > 0)
else
{
print '<td class="nowrap left">';
if ($objp->subscription == 'yes')
if (!empty($objp->subscription))
{
print $langs->trans("SubscriptionNotReceived");
if ($objp->statut > 0) print " ".img_warning();

View File

@@ -777,7 +777,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) {
$sql .= (int) GETPOST($keycode, 'int');
}
else {
else {
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
}

View File

@@ -719,7 +719,7 @@ else
{
if (function_exists('fsockopen') && $port && $server)
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect&date='.dol_now().'#formmailbeforetitle">'.$langs->trans("DoTestServerAvailability").'</a>';
}
}
else
@@ -789,6 +789,7 @@ else
// Run the test to connect
if ($action == 'testconnect')
{
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
@@ -804,6 +805,7 @@ else
}
setEventMessages($errormsg, null, 'errors');
print $errormsg;
}
print '<br>';
}

View File

@@ -257,7 +257,7 @@ if (empty($reshook))
$sql = "INSERT INTO ".$tabname[$id]." (";
// List of fields
$sql .= $tabfieldinsert[$id];
$sql .= ",active)";
$sql .= ",active,enabled)";
$sql .= " VALUES(";
// List of values
@@ -289,7 +289,7 @@ if (empty($reshook))
$i++;
}
$sql .= ", 1)";
$sql .= ", 1, 1)";
dol_syslog("actionadd", LOG_DEBUG);
$result = $db->query($sql);

View File

@@ -74,35 +74,31 @@ if ($action == "set")
else $error++;
$res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
if (GETPOST("PRELEVEMENT_USER") > 0)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
if (! ($res > 0)) $error++;
}
if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="")
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! $res > 0) $error++;
} elseif (! $error)
{
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
if (! ($res > 0)) $error++;
if (! $error) {
$db->commit();
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
}
else
{
} else {
$db->rollback();
setEventMessages($langs->trans("Error"), null, 'errors');
}
@@ -251,9 +247,10 @@ print '</td></tr>';
//ADDDAYS
print '<tr class="pair"><td>'.$langs->trans("ADDDAYS").'</td>';
print '<td class="left">';
if (! $conf->global->PRELEVEMENT_ADDDAYS) $conf->global->PRELEVEMENT_ADDDAYS=0;
if (empty($conf->global->PRELEVEMENT_ADDDAYS)) $conf->global->PRELEVEMENT_ADDDAYS=0;
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="15" ></td>';
print '</td></tr>';
print '</table>';
print '<br>';

View File

@@ -197,7 +197,7 @@ if ($action == 'delete')
$form = new Form($db);
$formadmin = new FormAdmin($db);
$wikihelp = 'EN:Setup|FR:Paramétrage|ES:Configuración';
$wikihelp = 'EN:Setup_Translation|FR:Paramétrage_Traduction|ES:Configuración_Traducción';
llxHeader('', $langs->trans("Setup"), $wikihelp);
$param = '&mode='.$mode;

View File

@@ -640,6 +640,10 @@ class AdvanceTargetingMailing extends CommonObject
if ($arrayquery['options_'.$key]!=''){
$sqlwhere[]= " (te.".$key." = ".$arrayquery['options_'.$key].")";
}
} elseif ($extrafields->attributes[$elementtype]['type'][$key] == 'link') {
if ($arrayquery['options_'.$key] > 0) {
$sqlwhere[]= " (te.".$key." = ".((int) $arrayquery['options_'.$key]).")";
}
} else {
if (is_array($arrayquery['options_'.$key])) {
$sqlwhere[]= " (te.".$key." IN ('".implode("','", $arrayquery['options_'.$key])."'))";
@@ -666,7 +670,6 @@ class AdvanceTargetingMailing extends CommonObject
while ($i < $num)
{
$obj = $this->db->fetch_object($resql);
$this->thirdparty_lines[$i] = $obj->rowid;
$i++;

View File

@@ -325,7 +325,7 @@ if (empty($reshook))
$duration = GETPOST('duree_validite', 'int');
if (empty($datep)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors');
$action = 'create';
$error++;
}
@@ -1614,7 +1614,7 @@ if ($action == 'create')
}
// Date
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
print '<tr><td class="fieldrequired">'.$langs->trans('DatePropal').'</td><td>';
print $form->selectDate('', '', '', '', '', "addprop", 1, 1);
print '</td></tr>';
@@ -2044,7 +2044,7 @@ if ($action == 'create')
print '<tr>';
print '<td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans('Date');
print $langs->trans('DatePropal');
print '</td>';
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate)
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&amp;id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';

View File

@@ -157,7 +157,7 @@ $arrayfields = array(
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
'p.date'=>array('label'=>"Date", 'checked'=>1),
'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),

View File

@@ -2254,6 +2254,7 @@ class Commande extends CommonOrder
$sql .= ' FROM '.MAIN_DB_PREFIX.'expedition as e';
$sql .= ', '.MAIN_DB_PREFIX.'element_element as el';
$sql .= ' WHERE el.fk_source = '.$this->id;
$sql .= " AND el.sourcetype = 'commande'";
$sql .= " AND el.fk_target = e.rowid";
$sql .= " AND el.targettype = 'shipping'";
@@ -3289,6 +3290,7 @@ class Commande extends CommonOrder
if (isset($this->note_public)) $this->note_public = trim($this->note_public);
if (isset($this->modelpdf)) $this->modelpdf = trim($this->modelpdf);
if (isset($this->import_key)) $this->import_key = trim($this->import_key);
$delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date;
// Check parameters
// Put here code to add control on parameters values
@@ -3313,6 +3315,8 @@ class Commande extends CommonOrder
$sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").",";
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
$sql .= " date_livraison=".(strval($this->delivery_date) != '' ? "'".$this->db->idate($this->delivery_date)."'" : 'null').",";
$sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? $this->shipping_method_id : "null").",";
$sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").",";
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";

View File

@@ -495,6 +495,12 @@ $sql .= " ".MAIN_DB_PREFIX."bank as b";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (b.rowid = ef.fk_object)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu ON bu.fk_bank = b.rowid AND type = 'company'";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu.url_id = s.rowid";
// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListJoin', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " WHERE b.fk_account = ba.rowid";
$sql .= " AND ba.entity IN (".getEntity('bank_account').")";
if ($search_account > 0) $sql .= " AND b.fk_account = ".$search_account;
@@ -1507,6 +1513,11 @@ if ($resql)
if (!$i) $totalarray['nbfield']++;
}
// Fields from hook
$parameters=array('arrayfields'=>$arrayfields, 'obj'=>$objp, 'i'=>$i, 'totalarray'=>&$totalarray);
$reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objecttmp); // Note that $action and $objecttmpect may have been modified by hook
print $hookmanager->resPrint;
// Action edit/delete
print '<td class="nowraponall" align="center">';
// Transaction reconciliated or edit link

View File

@@ -148,7 +148,7 @@ if ($result)
if ($typeid > 0) $param.='&typeid='.urlencode($typeid);
if ($search_amount_deb) $param.='&search_amount_deb='.urlencode($search_amount_deb);
if ($search_amount_cred) $param.='&search_amount_cred='.urlencode($search_amount_cred);
if ($search_account > 0) $param.='&search_amount='.urlencode($search_account);
if ($search_account > 0) $param.='&search_account='.urlencode($search_account);
//if ($search_date) $param.='&search_date='.$search_date;
if ($search_accountancy_code > 0) $param.='&search_accountancy_code='.urlencode($search_accountancy_code);

View File

@@ -2756,6 +2756,7 @@ if (empty($reshook))
* View
*/
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
@@ -3669,6 +3670,15 @@ if ($action == 'create')
}
elseif ($id > 0 || !empty($ref))
{
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound");
echo ' <a href="javascript:history.go(-1)">'.$langs->trans('GoBack').'</div>';
llxFooter();
exit;
}
/*
* Show object in view mode
*/
@@ -5260,7 +5270,7 @@ elseif ($id > 0 || !empty($ref))
}
// Create a credit note
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
if (($object->type == Facture::TYPE_STANDARD || ($object->type == Facture::TYPE_DEPOSIT && empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS) ) || $object->type == Facture::TYPE_PROFORMA) && $object->statut > 0 && $usercancreate)
{
if (!$objectidnext)
{

View File

@@ -85,6 +85,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php';
* View
*/
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Documents');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);

View File

@@ -43,6 +43,14 @@ $ref = GETPOST("ref", 'alpha');
* View
*/
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$form = new Form($db);
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Info');

View File

@@ -64,6 +64,14 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include,
* View
*/
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('Notes');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);

View File

@@ -109,28 +109,70 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture->
$object->fetch($id);
if ($object->valide($user) > 0)
{
$db->commit();
// Loop on each invoice linked to this payment to rebuild PDF
$factures = array();
foreach ($factures as $id)
{
$fac = new Facture($db);
$fac->fetch($id);
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
if (!empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
$outputlangs = $langs;
if (!empty($_REQUEST['lang_id']))
{
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$fac->generateDocument($fac->modelpdf, $outputlangs);
}
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
$sql = 'SELECT f.rowid as facid';
$sql .= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
$sql .= ' WHERE pf.fk_facture = f.rowid';
$sql .= ' AND f.fk_soc = s.rowid';
$sql .= ' AND f.entity IN ('.getEntity('invoice').')';
$sql .= ' AND pf.fk_paiement = '.$object->id;
$resql = $db->query($sql);
if ($resql)
{
$i = 0;
$num = $db->num_rows($resql);
if ($num > 0)
{
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$invoice = new Facture($db);
if ($invoice->fetch($objp->facid) <= 0) {
$errors++;
setEventMessage($invoice->error, $invoice->errors, 'errors');
break;
}
if ($invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref) < 0) {
$errors++;
setEventMessage($invoice->error, $invoice->errors, 'errors');
break;
}
$i++;
}
}
$db->free($resql);
}
else
{
$errors++;
setEventMessage($db->error, $db->errors, 'errors');
}
}
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
exit;
if (! $errors) {
$db->commit();
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
exit;
}
}
else
{

View File

@@ -440,8 +440,13 @@ class Paiement extends CommonObject
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
$hidedetails = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0;
$hidedesc = ! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0;
$hideref = !empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0;
$ret = $invoice->fetch($facid); // Reload to get new records
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs);
$result = $invoice->generateDocument($invoice->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
setEventMessages($invoice->error, $invoice->errors, 'errors');
$error++;

View File

@@ -85,16 +85,21 @@ if (empty($reshook))
}
}
// 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')
{
if ($object->statut == 2) {
$res = -1;
setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors');
} else {
$res=$object->set_credite();
}
if ($res >= 0)
{
header("Location: card.php?id=".$id);
exit;
}
}
if ($action == 'infotrans' && $user->rights->prelevement->bons->send)
{
@@ -135,14 +140,19 @@ if (empty($reshook))
{
$dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
$error = $object->set_infocredit($user, $dt);
if ($object->statut == 2) {
$error = 1;
setEventMessages('WithdrawalCantBeCreditedTwice', array(), 'errors');
} else {
$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

@@ -418,7 +418,7 @@ if ($modecompta == 'CREANCES-DETTES')
// Quantity
print '<td class="right">';
print $qty[$key];
print price($qty[$key], 1, $langs, 0, 0);
print '</td>';
// Percent;

View File

@@ -740,38 +740,32 @@ class Contact extends CommonObject
$this->error = $this->db->lasterror();
}
// Mis a jour alerte birthday
if ($this->birthday_alert)
{
//check existing
$sql_check = "SELECT rowid FROM ".MAIN_DB_PREFIX."user_alert WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
$result_check = $this->db->query($sql_check);
if (!$result_check || ($this->db->num_rows($result_check) < 1))
{
//insert
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user_alert(type,fk_contact,fk_user) ";
$sql .= "VALUES (1,".$this->db->escape($id).",".$user->id.")";
$result = $this->db->query($sql);
if (!$result)
{
$error++;
$this->error = $this->db->lasterror();
if ($user) {
// Mis a jour alerte birthday
if ($this->birthday_alert) {
//check existing
$sql_check = "SELECT rowid FROM " . MAIN_DB_PREFIX . "user_alert WHERE type=1 AND fk_contact=" . $this->db->escape($id) . " AND fk_user=" . $user->id;
$result_check = $this->db->query($sql_check);
if (!$result_check || ($this->db->num_rows($result_check) < 1)) {
//insert
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "user_alert(type,fk_contact,fk_user) ";
$sql .= "VALUES (1," . $this->db->escape($id) . "," . $user->id . ")";
$result = $this->db->query($sql);
if (!$result) {
$error++;
$this->error = $this->db->lasterror();
}
} else {
$result = true;
}
} else {
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "user_alert ";
$sql .= "WHERE type=1 AND fk_contact=" . $this->db->escape($id) . " AND fk_user=" . $user->id;
$result = $this->db->query($sql);
if (!$result) {
$error++;
$this->error = $this->db->lasterror();
}
}
else
{
$result = true;
}
}
else
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert ";
$sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id;
$result = $this->db->query($sql);
if (!$result)
{
$error++;
$this->error = $this->db->lasterror();
}
}
@@ -1686,7 +1680,7 @@ class Contact extends CommonObject
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_soc=".$this->socid." AND fk_socpeople=".$this->id; ;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_contacts WHERE fk_soc=".((int) $this->socid)." AND fk_socpeople=".$this->id;
dol_syslog(__METHOD__, LOG_DEBUG);
$result = $this->db->query($sql);
@@ -1704,11 +1698,10 @@ class Contact extends CommonObject
$sql .= "fk_socpeople) ";
$sql .= " VALUES (".$conf->entity.",";
$sql .= "'".$this->db->idate(dol_now())."',";
$sql .= $this->socid.", ";
$sql .= ((int) $this->socid).", ";
$sql .= $valRoles." , ";
$sql .= $this->id;
$sql .= ")";
dol_syslog(__METHOD__, LOG_DEBUG);
$result = $this->db->query($sql);
if (!$result)

View File

@@ -250,6 +250,8 @@ if ($search_email) $sql .= natural_search('s.email', $search_email);
if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
if ($search_zip) $sql .= natural_search(array('s.zip'), $search_zip);
if ($search_town) $sql .= natural_search(array('s.town'), $search_town);
if ($search_sale > 0)
{
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;

View File

@@ -103,10 +103,11 @@ class box_shipments extends ModeleBoxes
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande as c ON el.fk_source = c.rowid AND el.sourcetype IN ('commande') AND el.targettype = 'shipping'";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON e.fk_soc = sc.fk_soc";
$sql .= " WHERE e.entity IN (".getEntity('expedition').")";
if (!empty($conf->global->ORDER_BOX_LAST_SHIPMENTS_VALIDATED_ONLY)) $sql .= " AND e.fk_statut = 1";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= " AND sc.fk_user = ".$user->id;
if ($user->socid > 0) $sql.= " AND s.rowid = ".$user->socid;
if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND sc.fk_user = ".$user->id;
else $sql .= " ORDER BY e.date_delivery, e.ref DESC ";
$sql .= $this->db->plimit($max, 0);

View File

@@ -75,7 +75,7 @@ class CSMSFile
return -1;
}
dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".$conf->global->MAIN_SMS_SENDMODE." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".count($msg), LOG_DEBUG);
dol_syslog("CSMSFile::CSMSFile: MAIN_SMS_SENDMODE=".$conf->global->MAIN_SMS_SENDMODE." charset=".$conf->file->character_set_client." from=".$from.", to=".$to.", msg length=".strlen($msg), LOG_DEBUG);
dol_syslog("CSMSFile::CSMSFile: deferred=".$deferred." priority=".$priority." class=".$class, LOG_DEBUG);
// Action according to choosed sending method

View File

@@ -440,7 +440,7 @@ abstract class CommonObject
/**
* @var array List of child tables. To know object to delete on cascade.
* if name like with @ClassNAme:FilePathClass;ParentFkFieldName' it will
* if name like with @ClassName:FilePathClass:ParentFkFieldName' it will
* call method deleteByParentField(parentId,ParentFkFieldName) to fetch and delete child object
*/
protected $childtablesoncascade = array();
@@ -5238,6 +5238,7 @@ abstract class CommonObject
$mandatorypb = false;
if ($attributeType == 'link' && $this->array_options[$key] == '-1') $mandatorypb = true;
if ($this->array_options[$key] === '') $mandatorypb = true;
if ($attributeType == 'sellist' && $this->array_options[$key] == '0') $mandatorypb = true;
if ($mandatorypb)
{
dol_syslog("Mandatory extra field ".$key." is empty");

View File

@@ -1339,7 +1339,10 @@ class ExtraFields
}
elseif ($type == 'checkbox')
{
$value_arr = explode(',', $value);
$value_arr = $value;
if (!is_array($value)) {
$value_arr = explode(',', $value);
}
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
}
elseif ($type == 'radio')
@@ -2060,9 +2063,12 @@ 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...
// check if functionally empty without using GETPOST (depending on the type of extrafield, a
// technically non-empty value may be treated as empty functionally).
// value can be alpha, int, array, etc...
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]) && isset($_POST["options_".$key]) && $this->attributes[$object->table_element]['type'][$key] == 'sellist' && $_POST['options_' . $key] == '0')
|| (is_array($_POST["options_".$key]) && empty($_POST["options_".$key])))
{
//print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key];

View File

@@ -16,7 +16,7 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Christophe Battarel <christophe@altairis.fr>
@@ -7020,7 +7020,7 @@ class Form
print '<input type="radio" name="idtolinkto" value='.$objp->rowid.'>';
print '</td>';
print '<td class="center">'.$objp->ref.'</td>';
print '<td>'.$objp->ref_client.'</td>';
print '<td>'.(!empty($objp->ref_client)?$objp->ref_client:$objp->ref_supplier).'</td>';
print '<td class="right">'.price($objp->total_ht).'</td>';
print '<td>'.$objp->name.'</td>';
print '</tr>';

View File

@@ -332,7 +332,7 @@ class FormMail extends Form
$langs->loadLangs(array('other', 'mails'));
// Clear temp files. Must be done at beginning, before call of triggers
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1'))
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1'))
{
$this->clear_attached_files();
}
@@ -455,9 +455,11 @@ class FormMail extends Form
// Zone to select email template
if (count($modelmail_array) > 0)
{
$model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : $arraydefaultmessage->id;
// If list of template is filled
$out .= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
$out .= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
$out .= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, $model_mail_selected_id, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
if ($user->admin) $out .= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')), 1);
$out .= ' &nbsp; ';
$out .= '<input class="button" type="submit" value="'.$langs->trans('Apply').'" name="modelselected" id="modelselected">';

View File

@@ -469,7 +469,7 @@ class Translate
if (! $found && ! empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
{
// Overwrite translation with database read
$sql ="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where lang='".$db->escape($this->defaultlang)."' OR lang IS NULL";
$sql ="SELECT transkey, transvalue FROM ".MAIN_DB_PREFIX."overwrite_trans where (lang='".$db->escape($this->defaultlang)."' OR lang IS NULL)";
$sql.=" AND entity IN (0, ".getEntity('overwrite_trans').")";
$sql.=$db->order("lang", "DESC");
$resql=$db->query($sql);

View File

@@ -346,17 +346,19 @@ class Utils
{
$handlein = popen($fullcommandclear, 'r');
$i = 0;
while (!feof($handlein))
{
$i++; // output line number
$read = fgets($handlein);
// Exclude warning line we don't want
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
fwrite($handle, $read);
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok = 1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok = 1;
if ($handlein) {
while (!feof($handlein))
{
$i++; // output line number
$read = fgets($handlein);
// Exclude warning line we don't want
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
fwrite($handle, $read);
if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok = 1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok = 1;
}
pclose($handlein);
}
pclose($handlein);
}
@@ -388,7 +390,7 @@ class Utils
if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle);
if ($compression == 'bz') bzclose($handle);
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error
$errormsg = '';
}
else

View File

@@ -902,11 +902,11 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
't.email',
);
//Social media
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
$searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
}
}
// foreach ($socialnetworks as $key => $value) {
// if ($value['active']) {
// $searchAddressPhoneDBFields['t.'.$key] = "t.socialnetworks->'$.".$key."'";
// }
// }
if (!$sortorder) $sortorder = "ASC";
if (!$sortfield) $sortfield = "t.lastname";

View File

@@ -602,6 +602,7 @@ function GETPOST($paramname, $check = 'none', $method = 0, $filter = null, $opti
$out = trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
$out = str_replace('"', "''", trim($out));
if (preg_match('/"/', $out)) $out = '';
elseif (preg_match('/\.\.\//', $out)) $out = '';
$out = dol_string_nohtmltag($out);
@@ -8122,7 +8123,7 @@ function getDictvalue($tablename, $field, $id, $checkentity = false, $rowidfield
if (!isset($dictvalues[$tablename]))
{
$dictvalues[$tablename] = array();
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; // Here select * is allowed as it is generic code and we don't have list of fields
$sql = 'SELECT * FROM '.$tablename.' WHERE 1 = 1'; // Here select * is allowed as it is generic code and we don't have list of fields
if ($checkentity) $sql .= ' AND entity IN (0,'.getEntity($tablename).')';
$resql = $db->query($sql);

View File

@@ -367,7 +367,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_propale['nb'];
print '</td><td class="right">';
print $product->stats_propale['qty'];
print price($product->stats_propale['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}
@@ -385,7 +385,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_proposal_supplier['nb'];
print '</td><td class="right">';
print $product->stats_proposal_supplier['qty'];
print price($product->stats_proposal_supplier['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}
@@ -403,7 +403,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_commande['nb'];
print '</td><td class="right">';
print $product->stats_commande['qty'];
print price($product->stats_commande['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}
@@ -421,7 +421,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_commande_fournisseur['nb'];
print '</td><td class="right">';
print $product->stats_commande_fournisseur['qty'];
print price($product->stats_commande_fournisseur['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}
@@ -439,7 +439,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_facture['nb'];
print '</td><td class="right">';
print $product->stats_facture['qty'];
print price($product->stats_facture['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}
@@ -457,7 +457,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_facture_fournisseur['nb'];
print '</td><td class="right">';
print $product->stats_facture_fournisseur['qty'];
print price($product->stats_facture_fournisseur['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}
@@ -476,7 +476,7 @@ function show_stats_for_company($product, $socid)
print '</td><td class="right">';
print $product->stats_contrat['nb'];
print '</td><td class="right">';
print $product->stats_contrat['qty'];
print price($product->stats_contrat['qty'], 1, $langs, 0, 0);
print '</td>';
print '</tr>';
}

View File

@@ -1266,12 +1266,10 @@ class pdf_einstein extends ModelePDFCommandes
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
} else {
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))

View File

@@ -373,14 +373,15 @@ class pdf_rouget extends ModelePdfExpedition
$tab_top_alt = $tab_top;
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
$tab_top_alt = $pdf->GetY();
//$tab_top_alt += 1;
// Tracking number
if (!empty($object->tracking_number))
{
$pdf->writeHTMLCell(60, 4, $this->posxdesc - 1, $tab_top - 1, $outputlangs->transnoentities("TrackingNumber")." : ".$object->tracking_number, 0, 1, false, true, 'L');
$tab_top_alt = $pdf->GetY();
$object->getUrlTrackingStatus($object->tracking_number);
if (!empty($object->tracking_url))
{

View File

@@ -1631,12 +1631,10 @@ class pdf_crabe extends ModelePDFFactures
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
} else {
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))

View File

@@ -1478,12 +1478,10 @@ class pdf_azur extends ModelePDFPropales
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
} else {
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))
@@ -1533,7 +1531,7 @@ class pdf_azur extends ModelePDFPropales
$posy += 4;
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
$pdf->MultiCell(100, 3, $outputlangs->transnoentities("DatePropal")." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
$posy += 4;
$pdf->SetXY($posx, $posy);

View File

@@ -1514,12 +1514,10 @@ class pdf_cyan extends ModelePDFPropales
if ($this->emetteur->logo)
{
$logodir = $conf->mycompany->dir_output;
if (! empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
{
if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
$logo = $logodir.'/logos/thumbs/'.$this->emetteur->logo_small;
}
else {
} else {
$logo = $logodir.'/logos/'.$this->emetteur->logo;
}
if (is_readable($logo))

View File

@@ -208,7 +208,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
global $user, $langs, $conf, $mysoc, $hookmanager, $nblines;
// Get source company
if (!is_object($object->thirdparty)) $object->fetch_thirdparty();
$object->fetch_thirdparty();
if (!is_object($object->thirdparty)) $object->thirdparty = $mysoc; // If fetch_thirdparty fails, object has no socid (specimen)
$this->emetteur = $object->thirdparty;
if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined
@@ -224,8 +224,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
if ($conf->fournisseur->facture->dir_output)
{
$object->fetch_thirdparty();
$deja_regle = $object->getSommePaiement(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$amount_credit_notes_included = $object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
$amount_deposits_included = $object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0);
@@ -277,6 +275,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$pdf->SetAutoPageBreak(1, 0);
$heightforinfotot = 50+(4*$nbpayments); // Height reserved to output the info and total part and payment part
if($heightforinfotot > 220) $heightforinfotot = 220;
$heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
if ($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS >0) $heightforfooter+= 6;

View File

@@ -41,7 +41,7 @@ if (! empty($extrafieldsobjectkey) && ! empty($search_array_options) && is_array
if (in_array($typ, array('chkbxlst', 'checkbox'))) $mode_search=4; // Search on a multiselect field with sql type = text
if (is_array($crit)) $crit = implode(' ', $crit); // natural_search() expects a string
elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {
$sql .= ' AND (' . $extrafieldsobjectprefix.$tmpkey . ' = "' . $db->escape($crit) . '")';
$sql .= " AND (" . $extrafieldsobjectprefix.$tmpkey . " = '" . $db->escape($crit) . "')";
continue;
}
$sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search);

View File

@@ -289,9 +289,9 @@ if (! empty($_SESSION['dol_loginmesg']))
if (!empty($conf->global->MAIN_EASTER_EGG_COMMITSTRIP)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
if (substr($langs->defaultlang, 0, 2)=='fr') {
$resgetcommitstrip = getURLContent("http://www.commitstrip.com/fr/feed/");
$resgetcommitstrip = getURLContent("https://www.commitstrip.com/fr/feed/");
} else {
$resgetcommitstrip = getURLContent("http://www.commitstrip.com/en/feed/");
$resgetcommitstrip = getURLContent("https://www.commitstrip.com/en/feed/");
}
if ($resgetcommitstrip && $resgetcommitstrip['http_code'] == '200')
{

View File

@@ -282,8 +282,8 @@ class InterfaceLdapsynchro extends DolibarrTriggers
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
// Get a gid number for objectclass PosixGroup
if (in_array('posixGroup', $info['objectclass'])) {
// Get a gid number for objectclass PosixGroup if none was provided
if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
}

View File

@@ -84,11 +84,7 @@ class InterfaceContactRoles extends DolibarrTriggers
if (is_array($TContact) && ! empty($TContact)) {
$TContactAlreadyLinked = array();
if ($object->id > 0) {
$cloneFrom = dol_clone($object, 1);
if (! empty($cloneFrom->id)) {
$TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(- 1, 'external'), $cloneFrom->liste_contact(- 1, 'internal'));
}
$TContactAlreadyLinked = array_merge($object->liste_contact(-1, 'external'), $object->liste_contact(-1, 'internal'));
}
foreach ($TContact as $i => $infos) {

View File

@@ -268,11 +268,11 @@ class DataPolicy
{
if ($sendtocc)
{
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg .= dol_concatdesc($actionmsg, $message);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}
// Send mail
@@ -342,11 +342,11 @@ class DataPolicy
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg .= dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg .= dol_concatdesc($actionmsg, $message);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subject);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $message);
}

View File

@@ -72,7 +72,7 @@ class DolLogsCollector extends MessagesCollector
{
global $conf;
$uselogfile=$conf->global->DEBUGBAR_USE_LOGFILE;
$uselogfile=$conf->global->DEBUGBAR_USE_LOG_FILE;
if ($uselogfile)
{

View File

@@ -2236,7 +2236,7 @@ class ExpenseReport extends CommonObject
$sql = "SELECT DISTINCT ur.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."user_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql .= " WHERE ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';
$sql .= "UNION";
$sql .= " UNION";
$sql .= " SELECT DISTINCT ugu.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."usergroup_user as ugu, ".MAIN_DB_PREFIX."usergroup_rights as ur, ".MAIN_DB_PREFIX."rights_def as rd";
$sql .= " WHERE ugu.fk_usergroup = ur.fk_usergroup AND ur.fk_id = rd.id and rd.module = 'expensereport' AND rd.perms = 'approve'"; // Permission 'Approve';

View File

@@ -258,7 +258,13 @@ if (empty($reshook))
}
// Extrafields
$extrafields = new ExtraFields($db);
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
if ($ret < 0) {
$error++;
$action = 'create';
}
$array_options = $extrafields->getOptionalsFromPost($object->table_element);
$object->array_options = $array_options;

View File

@@ -3173,6 +3173,7 @@ class CommandeFournisseur extends CommonOrder
{
if (is_array($supplierorderdispatch->lines) && count($supplierorderdispatch->lines) > 0)
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$date_liv = dol_now();
// Build array with quantity deliverd by product
@@ -3180,7 +3181,11 @@ class CommandeFournisseur extends CommonOrder
$qtydelivered[$line->fk_product] += $line->qty;
}
foreach ($this->lines as $line) {
$qtywished[$line->fk_product] += $line->qty;
if ($line->product_type == Product::TYPE_PRODUCT ||
($line->product_type == Product::TYPE_SERVICE && !empty($conf->global->STOCK_SUPPORTS_SERVICES))
) {
$qtywished[$line->fk_product] += $line->qty;
}
}
//Compare array
$diff_array = array_diff_assoc($qtydelivered, $qtywished); // Warning: $diff_array is done only on common keys.

View File

@@ -1239,6 +1239,8 @@ if (empty($reshook))
$tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id);
}
$object->special_code = $lines[$i]->special_code;
$result = $object->addline(
$desc,
$lines[$i]->subprice,

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2010-2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2021 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2016 Florian Henry <florian.henry@atm-consulting.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
@@ -227,6 +227,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
foreach ($_POST as $key => $value)
{
// without batch module enabled
$reg = array();
if (preg_match('/^product_([0-9]+)_([0-9]+)$/i', $key, $reg))
{
$pos++;
@@ -268,15 +269,19 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) {
if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) {
$dto = GETPOST("dto_".$reg[1].'_'.$reg[2]);
if (empty($dto)) {
$dto = 0;
}
//update supplier price
if (isset($_POST[$saveprice])) {
// TODO Use class
$sql = "UPDATE ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql .= " SET unitprice='".GETPOST($pu)."'";
$sql .= ", price=".GETPOST($pu)."*quantity";
$sql .= " SET unitprice='".price2num(GETPOST($pu), 'MU')."'";
$sql .= ", price=".price2num(GETPOST($pu), 'MU')."*quantity";
$sql .= ", remise_percent='".$dto."'";
$sql .= " WHERE fk_soc=".$object->socid;
$sql .= " AND fk_product=".GETPOST($prod, 'int');
$sql .= " WHERE fk_soc=".((int) $object->socid);
$sql .= " AND fk_product=".((int) GETPOST($prod, 'int'));
$resql = $db->query($sql);
}

View File

@@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref))
dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'bill');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref supplier

View File

@@ -67,7 +67,7 @@ $head = facturefourn_prepare_head($object);
$titre = $langs->trans('SupplierInvoice');
dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), -1, 'bill');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
// Ref supplier

View File

@@ -2112,7 +2112,7 @@ class Holiday extends CommonObject
{
global $mysoc;
$sql = "SELECT rowid, code, label, affect, delay, newByMonth";
$sql = "SELECT rowid, code, label, affect, delay, newbymonth";
$sql .= " FROM ".MAIN_DB_PREFIX."c_holiday_types";
$sql .= " WHERE (fk_country IS NULL OR fk_country = ".$mysoc->country_id.')';
if ($active >= 0) $sql .= " AND active = ".((int) $active);
@@ -2126,7 +2126,7 @@ class Holiday extends CommonObject
{
while ($obj = $this->db->fetch_object($result))
{
$types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newByMonth);
$types[$obj->rowid] = array('rowid'=> $obj->rowid, 'code'=> $obj->code, 'label'=>$obj->label, 'affect'=>$obj->affect, 'delay'=>$obj->delay, 'newByMonth'=>$obj->newbymonth);
}
return $types;

View File

@@ -381,7 +381,7 @@ if ($resql)
//'builddoc'=>$langs->trans("PDFMerge"),
//'presend'=>$langs->trans("SendByMail"),
);
if ($user->rights->holiday->supprimer) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if ($user->rights->holiday->delete) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -158,10 +158,10 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'05','',1,'FLANDRE-OCCIDENTALE','Flandre-Occidentale');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'06','',1,'FLANDRE-ORIENTALE','Flandre-Orientale');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'07','',2,'HAINAUT','Hainaut');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'08','',2,'LIEGE','Liège');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'08','',2,'LIEGE','Liège');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'09','',1,'LIMBOURG','Limbourg');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'10','',2,'LUXEMBOURG','Luxembourg');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'11','',2,'NAMUR','Namur');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (202,'11','',2,'NAMUR','Namur');
-- Provinces Italy (id=3)
insert into llx_c_departements (code_departement,fk_region,cheflieu,tncc,ncc,nom) values ('AG',315,NULL,NULL,NULL,'AGRIGENTO');

View File

@@ -27,6 +27,7 @@ MakeWithdrawRequest=Make a direct debit payment request
WithdrawRequestsDone=%s direct debit payment requests recorded
ThirdPartyBankCode=Third-party bank code
NoInvoiceCouldBeWithdrawed=No invoice debited successfully. Check that invoices are on companies with a valid IBAN and that IBAN has a UMR (Unique Mandate Reference) with mode <strong>%s</strong>.
WithdrawalCantBeCreditedTwice=This withdrawal receipt is already marked as credited; this can't be done twice, as this would potentially create duplicate payments and bank entries.
ClassCredited=Classify credited
ClassCreditedConfirm=Are you sure you want to classify this withdrawal receipt as credited on your bank account?
TransData=Transmission date

View File

@@ -27,6 +27,7 @@ MakeWithdrawRequest=Faire une demande de prélèvement
WithdrawRequestsDone=%s demandes de prélèvements enregistrées
ThirdPartyBankCode=Code banque du tiers
NoInvoiceCouldBeWithdrawed=Aucune facture traitée avec succès. Vérifiez que les factures sont sur les sociétés avec un BAN par défaut valide et que le BAN a un RUM avec le mode <strong> %s </strong>.
WithdrawalCantBeCreditedTwice=Ce bon de prélèvement est déjà classé crédité; cette opération ne peut pas être réalisée deux fois, car cela pourrait engendrer des doublons dans les paiements et les écritures bancaires.
ClassCredited=Classer crédité
ClassCreditedConfirm=Êtes-vous sûr de vouloir classer ce bon de prélèvement comme crédité sur votre compte bancaire ?
TransData=Date de transmission

View File

@@ -180,7 +180,7 @@ $arrayfields = array(
'p.sellprice'=>array('label'=>$langs->trans("SellingPrice"), 'checked'=>1, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
'p.minbuyprice'=>array('label'=>$langs->trans("BuyingPriceMinShort"), 'checked'=>1, 'enabled'=>(!empty($user->rights->fournisseur->lire))),
'p.numbuyprice'=>array('label'=>$langs->trans("BuyingPriceNumShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))),
'p.tva_tx'=>array('label'=>$langs->trans("VATRate"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))),
'p.tva_tx'=>array('label'=>$langs->trans("VATRate"), 'checked'=>0, 'enabled'=>empty($conf->global->PRODUIT_MULTIPRICES)),
'p.pmp'=>array('label'=>$langs->trans("PMPValueShort"), 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire))),
'p.seuil_stock_alerte'=>array('label'=>$langs->trans("StockLimit"), 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
'p.desiredstock'=>array('label'=>$langs->trans("DesiredStock"), 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service')),
@@ -332,7 +332,7 @@ if ($search_label) $sql .= natural_search('p.label', $search_label);
if ($search_barcode) $sql .= natural_search('p.barcode', $search_barcode);
if (isset($search_tosell) && dol_strlen($search_tosell) > 0 && $search_tosell != -1) $sql .= " AND p.tosell = ".$db->escape($search_tosell);
if (isset($search_tobuy) && dol_strlen($search_tobuy) > 0 && $search_tobuy != -1) $sql .= " AND p.tobuy = ".$db->escape($search_tobuy);
if ($search_vatrate) $sql .= natural_search('p.tva_tx', $search_vatrate);
if ($search_vatrate) $sql .= natural_search('p.tva_tx', $search_vatrate, 1);
if (dol_strlen($canvas) > 0) $sql .= " AND p.canvas = '".$db->escape($canvas)."'";
if ($catid > 0) $sql .= " AND cp.fk_categorie = ".$catid;
if ($catid == -2) $sql .= " AND cp.fk_categorie IS NULL";
@@ -774,7 +774,7 @@ if ($resql)
print_liste_field_titre($arrayfields['p.numbuyprice']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($arrayfields['p.tva_tx']['checked'])) {
print_liste_field_titre($arrayfields['p.tva_tx']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre($arrayfields['p.tva_tx']['label'], $_SERVER["PHP_SELF"], 'p.tva_tx', "", $param, '', $sortfield, $sortorder, 'right ');
}
if (!empty($arrayfields['p.pmp']['checked'])) {
print_liste_field_titre($arrayfields['p.pmp']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');

View File

@@ -1442,11 +1442,11 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
// Il doit au moins y avoir la ligne de prix initial.
// On l'ajoute donc pour remettre a niveau (pb vieilles versions)
//$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
$object->updatePrice($object->multiprices[1], $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), $object->multiprices_min[1], 1);
} else {
$object->updatePrice($object->price, $object->price_base_type, $user, $object->tva_tx, $object->price_min);
}
if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
$object->updatePrice(($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_ttc[1] : $object->multiprices[1]), $object->multiprices_base_type[1], $user, (empty($object->multiprices_tva_tx[1]) ? 0 : $object->multiprices_tva_tx[1]), ($object->multiprices_base_type[1] == 'TTC' ? $object->multiprices_min_ttc[1] : $object->multiprices_min[1]), 1);
} else {
$object->updatePrice(($object->price_base_type == 'TTC' ? $object->price_ttc : $object->price), $object->price_base_type, $user, $object->tva_tx, ($object->price_base_type == 'TTC' ? $object->price_min_ttc : $object->price_min));
}
$result = $db->query($sql);
$num = $db->num_rows($result);

View File

@@ -48,7 +48,7 @@ $hookmanager->initHooks(array('stockreplenishlist'));
//checks if a product has been ordered
$action = GETPOST('action', 'alpha');
$action = GETPOST('action', 'aZ09');
$sref = GETPOST('sref', 'alpha');
$snom = GETPOST('snom', 'alpha');
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
@@ -211,7 +211,9 @@ if ($action == 'order' && isset($_POST['valid']))
if ($resql && $db->num_rows($resql) > 0) {
$obj = $db->fetch_object($resql);
$order->fetch($obj->rowid);
$order->fetch_thirdparty();
foreach ($supplier['lines'] as $line) {
if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent;
$result = $order->addline(
$line->desc,
$line->subprice,
@@ -248,6 +250,7 @@ if ($action == 'order' && isset($_POST['valid']))
//trick to know which orders have been generated this way
$order->source = 42;
foreach ($supplier['lines'] as $line) {
if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent;
$order->lines[] = $line;
}
$order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id;
@@ -305,7 +308,7 @@ if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entre
$sql = 'SELECT p.rowid, p.ref, p.label, p.description, p.price,';
$sql .= ' p.price_ttc, p.price_base_type,p.fk_product_type,';
$sql .= ' p.price_ttc, p.price_base_type, p.fk_product_type,';
$sql .= ' p.tms as datem, p.duration, p.tobuy,';
$sql .= ' p.desiredstock, p.seuil_stock_alerte,';
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
@@ -323,11 +326,8 @@ $sql .= $hookmanager->resPrint;
$sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as s ON p.rowid = s.fk_product';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot AS ent ON s.fk_entrepot = ent.rowid AND ent.entity IN('.getEntity('stock').')';
if ($fk_supplier > 0) {
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.'product_fournisseur_price pfp ON (pfp.fk_product = p.rowid AND pfp.fk_soc = '.$fk_supplier.')';
}
if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.$fk_entrepot.')';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_warehouse_properties AS pse ON (p.rowid = pse.fk_product AND pse.fk_entrepot = '.((int) $fk_entrepot).')';
}
// Add fields from hooks
@@ -349,6 +349,15 @@ if ($sref) $sql .= natural_search('p.ref', $sref);
if ($snom) $sql .= natural_search('p.label', $snom);
$sql .= ' AND p.tobuy = 1';
if (!empty($canvas)) $sql .= ' AND p.canvas = "'.$db->escape($canvas).'"';
if ($fk_supplier > 0) {
$sql .= ' AND EXISTS (SELECT pfp.rowid FROM '.MAIN_DB_PREFIX.'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid AND pfp.fk_soc = '.((int) $fk_supplier).' AND pfp.entity IN ('.getEntity('product_fournisseur_price').'))';
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= ' GROUP BY p.rowid, p.ref, p.label, p.description, p.price';
$sql .= ', p.price_ttc, p.price_base_type,p.fk_product_type, p.tms';
$sql .= ', p.duration, p.tobuy';
@@ -456,11 +465,6 @@ if ($usevirtualstock)
}
}
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder);
$sql .= $db->plimit($limit + 1, $offset);
@@ -759,7 +763,9 @@ while ($i < ($limit ? min($num, $limit) : $num))
print '<td class="right">'.$alertstock.'</td>';
// Current stock (all warehouses)
print '<td class="right">'.$warning.$stock.'</td>';
print '<td class="right">'.$warning.$stock;
print '<!-- stock returned by main sql is '.$objp->stock_physique.' -->';
print '</td>';
// Already ordered
print '<td class="right"><a href="replenishorders.php?sproduct='.$prod->id.'">'.$ordered.'</a> '.$picto.'</td>';

View File

@@ -210,7 +210,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
{
// Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project)
$sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
$sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
$sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'";
$resql = $db->query($sql);
if ($resql)
{

View File

@@ -224,7 +224,7 @@ if ($action == 'addtime' && $user->rights->projet->lire && GETPOST('assigntask')
{
// Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project)
$sql = 'SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
$sql .= ' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
$sql .= ' AND ec.fk_socpeople = '.((int) $idfortaskuser)." AND ec.element_id = ".((int) $object->fk_project)." AND tc.element = 'project' AND source = 'internal'";
$resql = $db->query($sql);
if ($resql)
{

View File

@@ -1048,7 +1048,7 @@ class Thirdparties extends DolibarrApi
{
global $db, $conf;
if (!DolibarrApiAccess::$user->rights->facture->lire) {
if (!DolibarrApiAccess::$user->rights->societe->lire) {
throw new RestException(401);
}
if (empty($id)) {

View File

@@ -84,7 +84,7 @@ class Societe extends CommonObject
/**
* @var array List of child tables. To know object to delete on cascade.
* if name like with @ClassNAme:FilePathClass;ParentFkFieldName' it will call method deleteByParentField (with parentId as parameters) and FieldName to fetch and delete child object
* if name like with @ClassName:FilePathClass:ParentFkFieldName' it will call method deleteByParentField (with parentId as parameters) and FieldName to fetch and delete child object
*/
protected $childtablesoncascade = array(
"societe_prices",

View File

@@ -218,7 +218,7 @@ if ($type_element == 'propal')
$where = " WHERE c.fk_soc = s.rowid AND s.rowid = ".$socid;
$where.= " AND d.fk_propal = c.rowid";
$where.= " AND c.entity = ".$conf->entity;
$datePrint = 'c.datep';
$dateprint = 'c.datep';
$doc_number='c.ref';
$thirdTypeSelect='customer';
}
@@ -309,7 +309,7 @@ if (!empty($sql_select))
if ($sref) $sql.= " AND ".$doc_number." LIKE '%".$db->escape($sref)."%'";
if ($sprod_fulldescr)
{
$sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%'";
$sql.= " AND (d.description LIKE '%".$db->escape($sprod_fulldescr)."%' OR d.description LIKE '%".$db->escape(dol_htmlentities($sprod_fulldescr))."%'";
if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.ref LIKE '%".$db->escape($sprod_fulldescr)."%'";
if (GETPOST('type_element') != 'fichinter') $sql.= " OR p.label LIKE '%".$db->escape($sprod_fulldescr)."%'";
$sql.=")";

View File

@@ -331,7 +331,7 @@ if ($id > 0 || ! empty($ref))
else
{
print '<td class="left nowrap">';
if ($objp->subscription == 'yes')
if (!empty($objp->subscription))
{
print $langs->trans("SubscriptionNotReceived");
if ($objp->statut > 0) print " ".img_warning();

View File

@@ -71,7 +71,7 @@ class Users extends DolibarrApi
$obj_ret = array();
if (!DolibarrApiAccess::$user->rights->user->user->lire) {
if (!DolibarrApiAccess::$user->rights->user->user->lire && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401, "You are not allowed to read list of users");
}
@@ -142,9 +142,9 @@ class Users extends DolibarrApi
*/
public function get($id, $includepermissions = 0)
{
//if (!DolibarrApiAccess::$user->rights->user->user->lire) {
//throw new RestException(401);
//}
if (!DolibarrApiAccess::$user->rights->user->user->lire && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401);
}
$result = $this->useraccount->fetch($id);
if (!$result)
@@ -177,7 +177,11 @@ class Users extends DolibarrApi
*/
public function getInfo()
{
$apiUser = DolibarrApiAccess::$user;
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401, 'Not allowed');
}
$apiUser = DolibarrApiAccess::$user;
$result = $this->useraccount->fetch($apiUser->id);
if (!$result) {
@@ -208,9 +212,9 @@ class Users extends DolibarrApi
public function post($request_data = null)
{
// check user authorization
//if(! DolibarrApiAccess::$user->rights->user->creer) {
// throw new RestException(401, "User creation not allowed");
//}
if (empty(DolibarrApiAccess::$user->rights->user->creer) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401, "User creation not allowed");
}
// check mandatory fields
/*if (!isset($request_data["login"]))
throw new RestException(400, "login field missing");
@@ -242,9 +246,9 @@ class Users extends DolibarrApi
*/
public function put($id, $request_data = null)
{
//if (!DolibarrApiAccess::$user->rights->user->user->creer) {
//throw new RestException(401);
//}
if (empty(DolibarrApiAccess::$user->rights->user->user->creer) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401);
}
$result = $this->useraccount->fetch($id);
if (!$result)
@@ -299,7 +303,7 @@ class Users extends DolibarrApi
{
$obj_ret = array();
if (!DolibarrApiAccess::$user->rights->user->user->lire) {
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401);
}
@@ -334,9 +338,9 @@ class Users extends DolibarrApi
global $conf;
//if (!DolibarrApiAccess::$user->rights->user->user->supprimer) {
//throw new RestException(401);
//}
if (empty(DolibarrApiAccess::$user->rights->user->user->creer) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401);
}
$result = $this->useraccount->fetch($id);
if (!$result)
{
@@ -389,9 +393,10 @@ class Users extends DolibarrApi
$obj_ret = array();
if (!DolibarrApiAccess::$user->rights->user->group_advance->read) {
throw new RestException(401, "You are not allowed to read list of groups");
}
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) ||
!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401, "You are not allowed to read groups");
}
// case of external user, $societe param is ignored and replaced by user's socid
//$socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : $societe;
@@ -463,7 +468,8 @@ class Users extends DolibarrApi
{
global $db, $conf;
if (!DolibarrApiAccess::$user->rights->user->group_advance->read) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) ||
!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty(DolibarrApiAccess::$user->rights->user->group_advance->read) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401, "You are not allowed to read groups");
}
@@ -486,9 +492,9 @@ class Users extends DolibarrApi
*/
public function delete($id)
{
//if (!DolibarrApiAccess::$user->rights->user->user->supprimer) {
//throw new RestException(401);
//}
if (empty(DolibarrApiAccess::$user->rights->user->user->supprimer) && empty(DolibarrApiAccess::$user->admin)) {
throw new RestException(401);
}
$result = $this->useraccount->fetch($id);
if (!$result)
{

View File

@@ -3320,7 +3320,7 @@ class User extends CommonObject
}
else
{
$sql .= " WHERE 1";
$sql .= " WHERE 1 = 1";
}
// Manage filter

View File

@@ -983,7 +983,7 @@ class UserGroup extends CommonObject
}
$info[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] = (!empty($valueofldapfield)?$valueofldapfield:'');
}
if(!empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID])){
if(!empty($conf->global->LDAP_GROUP_FIELD_GROUPID)){
$info[$conf->global->LDAP_GROUP_FIELD_GROUPID]=$this->id;
}
return $info;

View File

@@ -69,8 +69,8 @@ if ($action == 'dolibarr2ldap')
{
$info=$object->_load_ldap_info();
// Get a gid number for objectclass PosixGroup
if (in_array('posixGroup', $info['objectclass'])) {
// Get a gid number for objectclass PosixGroup if none was provided
if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
}