Compare commits

...

953 Commits

Author SHA1 Message Date
Laurent Destailleur
3dbab22060 Prepare 14.0.4 2021-11-19 18:08:49 +01:00
Laurent Destailleur
35b1868693 FIX Missing trans 2021-11-19 14:01:31 +01:00
Laurent Destailleur
bb6440af9d FIX Better label for reception status 2021-11-19 13:46:30 +01:00
Laurent Destailleur
cdc160b9a9 FIX column alignement on valid confirm page of shipment 2021-11-19 11:12:53 +01:00
Laurent Destailleur
ec2067df7d Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-11-19 10:06:46 +01:00
Laurent Destailleur
271f42e761 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/expedition/class/expedition.class.php
	htdocs/fourn/class/fournisseur.facture.class.php
	htdocs/societe/list.php
2021-11-19 10:06:35 +01:00
Laurent Destailleur
e7a4f04da4 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/expedition/class/expedition.class.php
	htdocs/fourn/class/fournisseur.commande.class.php
	htdocs/fourn/class/fournisseur.facture.class.php
2021-11-18 21:41:12 +01:00
Laurent Destailleur
efb9d184e4 Merge pull request #19382 from OPEN-DSI/fix-societe-list-region-filter
FIX filter on region in company list
2021-11-18 20:29:36 +01:00
Laurent Destailleur
242eaa9394 Merge pull request #19387 from FHenry/14.0_fix_list_contact
FIX : contact not in list (contact/list) if module mailing not active and contact has no email
2021-11-18 20:28:43 +01:00
Laurent Destailleur
4caeddf7f8 Merge pull request #19388 from FHenry/14.0_fix_preselecttask_on_event_creation
FIX: preselect task on create event from task
2021-11-18 20:25:03 +01:00
Laurent Destailleur
44d4ab6f9c Merge pull request #19384 from fmarcet/12.0
Fix: Bad date conversion
2021-11-18 20:10:50 +01:00
Laurent Destailleur
8f96383186 Update expedition.class.php 2021-11-18 20:10:04 +01:00
Ferran Marcet
db975bbcc2 Fix: The error not correctly collected on insertation line failure 2021-11-18 17:17:00 +01:00
Laurent Destailleur
e609622f2b Fix test on verifCond for value 0 2021-11-18 13:17:48 +01:00
Laurent Destailleur
0c9fb16a36 Fix trans 2021-11-18 09:55:36 +01:00
Laurent Destailleur
0294f3dc34 Missing trans 2021-11-18 09:54:48 +01:00
Laurent Destailleur
0e57f62d02 Prepare 14.0.3 2021-11-17 19:03:25 +01:00
Florian HENRY
bc64aba3a6 FIX: preselect task on create event from task 2021-11-16 13:43:08 +01:00
Florian HENRY
0692e01fea Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14.0_fix_list_contact 2021-11-16 13:31:58 +01:00
Florian HENRY
47da6793c5 FIX: contact not listed if module mainling not active and contact has no email 2021-11-16 13:31:51 +01:00
Laurent Destailleur
e2000473a5 Sync transifex 2021-11-16 10:44:56 +01:00
Laurent Destailleur
9eb66548a5 Sync transifex 2021-11-15 19:02:26 +01:00
Laurent Destailleur
878ee35e5d Sync transifex 2021-11-15 18:07:05 +01:00
Ferran Marcet
7af883abc1 Fix: Bad date conversion 2021-11-15 16:43:54 +01:00
lvessiller
e365a14b5a FIX filter on region in company list 2021-11-15 14:41:16 +01:00
Laurent Destailleur
9cbba5941f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-11-15 13:56:32 +01:00
Laurent Destailleur
c995794e2d Fix kk_KZ language 2021-11-15 13:56:17 +01:00
Laurent Destailleur
12f0a36095 Merge pull request #19284 from henrynopo/patch-1
Supplier Invoice Payment - Re-order the "Payment amount, original currency" to be together with the columns of original currency
2021-11-15 11:46:00 +01:00
Laurent Destailleur
fc489380a1 Merge pull request #19345 from hregis/fix_lost_superadmin_grade_after_edit_user
FIX lost superadmin grade after edit user card
2021-11-15 11:06:52 +01:00
Laurent Destailleur
0743c656ac Merge pull request #19359 from daraelmin/daraelmin-patch-3
Fix date_select go away when sorting subscription
2021-11-15 11:00:48 +01:00
Laurent Destailleur
4d962f165d Merge pull request #19375 from daraelmin/daraelmin-patch-5
Fix #19306 - Tracking url is clickable in reception card
2021-11-15 10:42:29 +01:00
Laurent Destailleur
641803ce7c Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-11-15 10:41:20 +01:00
Laurent Destailleur
9c493127d5 Fix sync 2021-11-15 10:41:05 +01:00
Laurent Destailleur
1f58c60b6e Merge pull request #19377 from aspangaro/14p23
FIX Ticket - Card - Wrong font awesome library
2021-11-15 10:39:30 +01:00
Alexandre SPANGARO
2be7da1031 Double line 2021-11-14 04:18:13 +01:00
Alexandre SPANGARO
d6cb95b0f7 FIX Ticket - Card - Wrong font awesome library 2021-11-14 04:18:03 +01:00
daraelmin
f2407a3f94 Fix 19306 - Tracking url is clickable in reception card 2021-11-13 20:04:03 +01:00
Laurent Destailleur
ec78f21c26 Sync transifex 2021-11-13 15:17:06 +01:00
daraelmin
53b565ec1d Fix date_select go away when sorting subscription 2021-11-11 20:06:21 +01:00
Laurent Destailleur
21c2dba922 Fix phpcs 2021-11-11 19:06:55 +01:00
Laurent Destailleur
f5a7275077 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/takepos/index.php
2021-11-11 18:34:04 +01:00
Laurent Destailleur
a725ffefdd Fix sql error 2021-11-11 18:30:17 +01:00
Regis Houssin
5eff0e7a0c FIX only a superadmin can modify entity 2021-11-11 17:48:23 +01:00
Regis Houssin
564badc61b Merge remote-tracking branch 'origin/14.0' into fix_lost_superadmin_grade_after_edit_user 2021-11-11 17:23:55 +01:00
Laurent Destailleur
ddad00c8e4 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/takepos/index.php
2021-11-11 16:14:48 +01:00
Laurent Destailleur
f24c38db73 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/datapolicy/class/datapolicy.class.php
	htdocs/takepos/index.php
2021-11-11 16:06:21 +01:00
Laurent Destailleur
e188855dca Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts:
	htdocs/datapolicy/class/datapolicy.class.php
2021-11-11 16:01:37 +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
88d8f73614 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-11-11 15:36:00 +01:00
Laurent Destailleur
fa4b5d99c0 FIX Bad use of dol_concatdesc() 2021-11-11 15:35:34 +01:00
Laurent Destailleur
8518c772fb Merge pull request #19343 from OPEN-DSI/fix-takepos-report-terminal
FIX close cash with some terminals in TakePOS
2021-11-11 14:42:12 +01:00
Laurent Destailleur
a4344a7ec5 Merge pull request #19337 from marc-dll/13.0_FIX_project_task_list_extrafields
FIX: project task list: extrafields could not be displayed
2021-11-11 14:41:56 +01:00
Laurent Destailleur
aae83d248c Merge pull request #19346 from daraelmin/14.0
Fix wrong sign in test
2021-11-11 14:29:56 +01:00
Laurent Destailleur
28aa17e4fd FIX calculation of balance in conciliation page on desc sorting. 2021-11-11 14:27:17 +01:00
Laurent Destailleur
fd3fd9d945 Fix getpost 2021-11-11 13:46:58 +01:00
daraelmin
cea3d93b91 Fix wrong sign in test 2021-11-09 20:51:27 +01:00
Regis Houssin
5649e865c3 FIX wrong check 2021-11-09 18:38:29 +01:00
Regis Houssin
1e20e082fe FIX lost superadmin grade after edit user card ! 2021-11-09 18:36:04 +01:00
lvessiller
33e40c12c8 FIX close cash with some terminals in TakePOS 2021-11-09 14:12:28 +01:00
Laurent Destailleur
9f8e21bc2c Fix filter on dates 2021-11-08 20:39:52 +01:00
Laurent Destailleur
d28edae460 Fix idate must be jdate 2021-11-08 20:11:32 +01:00
Laurent Destailleur
6787998c56 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-11-08 20:08:35 +01:00
Laurent Destailleur
ebdcff3b49 FIX filter for export of accounting documents 2021-11-08 20:07:03 +01:00
Marc de Lima Lucio
c1a2e7b12e FIX: project task list: extrafields could not be displayed 2021-11-08 17:51:19 +01:00
Laurent Destailleur
a724cadd1f Merge pull request #19290 from PyroShape/142
FIX : Change date format of the inventorycode to be equal as mass stock transfert
2021-11-08 03:33:53 +01:00
Laurent Destailleur
621f0812a1 Merge pull request #19304 from daraelmin/daraelmin-patch-3
Fix default enddate subscription must be in futur
2021-11-08 03:28:35 +01:00
Laurent Destailleur
a94b2b4f7e Clean code 2021-11-08 03:22:49 +01:00
Laurent Destailleur
cd4f59bb2a FIX bad sign of amount stored for multicurrency columns on credit notes 2021-11-08 03:01:18 +01:00
Laurent Destailleur
e8b3875e2e FIX bad sign of amount stored for multicurrency columns on credit notes 2021-11-08 02:57:21 +01:00
Laurent Destailleur
d591a83085 css 2021-11-08 00:57:00 +01:00
Laurent Destailleur
2fc05a4c1c Add test virus file 2021-11-08 00:37:42 +01:00
Laurent Destailleur
3b7c385c6c Fix syntax error 2021-11-07 13:53:30 +01:00
Laurent Destailleur
ccc1d4d1fa Fix warning 2021-11-07 12:24:25 +01:00
Laurent Destailleur
7e68f9e013 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/db/DoliDB.class.php
	htdocs/resource/list.php
2021-11-06 21:04:17 +01:00
Laurent Destailleur
ddb68a3ae8 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-11-06 20:40:34 +01:00
Laurent Destailleur
edbcf78495 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-11-06 20:39:05 +01:00
Laurent Destailleur
0bc5ec8c78 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-11-06 20:38:29 +01:00
Laurent Destailleur
65105a3e05 Better log 2021-11-06 19:27:50 +01:00
daraelmin
9d7f7e2090 Better condition 2021-11-05 14:03:56 +01:00
Laurent Destailleur
c0c894d6f4 Merge pull request #19288 from OPEN-DSI/fix_00018
FIX second approval back in stable feature as is the setting for minimum amount (last part from PR#14286)
2021-11-05 14:00:41 +01:00
Laurent Destailleur
f8cc75ecf2 Merge pull request #19296 from daraelmin/daraelmin-stats-1
Add link year subscription list in subscription by year stats page
2021-11-05 13:19:05 +01:00
Laurent Destailleur
15bc4a7d6b Update index.php 2021-11-05 13:18:37 +01:00
Laurent Destailleur
a0fffbae04 Merge pull request #19298 from daraelmin/daraelmin-stats-2
Fix Bad count of subscription by year
2021-11-05 13:06:17 +01:00
Laurent Destailleur
19b9412c13 FIX #19305 2021-11-05 12:49:33 +01:00
Laurent Destailleur
23749b57ec Merge pull request #19311 from atm-john/12.0_fix_missing_return_status_for_getrow
FIX : missing return status
2021-11-05 12:42:54 +01:00
Laurent Destailleur
3959d12a39 Update DoliDB.class.php 2021-11-05 12:42:42 +01:00
ATM john
dd8d4e9e98 Fix missing return status 2021-11-04 12:10:19 +01:00
stickler-ci
586005ff2e Fixing style errors. 2021-11-03 21:43:30 +00:00
daraelmin
f9db196512 Update subscription.php 2021-11-03 22:31:45 +01:00
daraelmin
0e91b32e99 Update subscription.php 2021-11-03 20:40:09 +01:00
daraelmin
973f408b6e Fix default enddate subscription must be in futur 2021-11-03 20:35:57 +01:00
daraelmin
d334fe1292 Fix Bad count of subscription by year
If
2021-11-03 13:12:33 +01:00
daraelmin
b02c89bd8b Add link year subscription list in subscription by year stats page 2021-11-02 23:07:46 +01:00
Benjamin Chantalat
49d955b794 Uniformization of the table code as the line above 2021-11-02 15:53:57 +01:00
Benjamin Chantalat
0c1d4c9d51 No need of escape htmltag thanks to GETPOST before 2021-11-02 15:48:12 +01:00
Benjamin Chantalat
126fbf9f63 Change date format to be equal to mass stock transfert 2021-11-02 15:46:04 +01:00
kamel
82b7f0e9e4 FIX second approval back in stable feature as is the setting for minimum amount (last part from PR#14286) 2021-11-02 15:21:14 +01:00
stickler-ci
899f0bee9a Fixing style errors. 2021-11-02 12:59:38 +00:00
Henry
b56eaf91e8 Update paiement.php 2021-11-02 20:53:00 +08:00
Laurent Destailleur
b4895c4dd2 Merge pull request #18975 from aspangaro/14p23
FIX Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction
2021-10-31 18:13:54 +01:00
Laurent Destailleur
fdf5d457a8 Merge pull request #19196 from atm-gauthier/FIX_default_price_base_type_with_variants
FIX : We need a default price base type in variant creation case with…
2021-10-31 17:42:58 +01:00
Laurent Destailleur
cee573cf96 Update ProductCombination.class.php 2021-10-31 17:42:43 +01:00
Laurent Destailleur
eecd82a0fd Merge pull request #19202 from frederic34/patch-11
backport fix
2021-10-31 17:34:38 +01:00
Laurent Destailleur
dbf330b49c Comment on test 2021-10-31 17:17:21 +01:00
Laurent Destailleur
05cdbcc092 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-31 17:12:13 +01:00
Laurent Destailleur
b966286895 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-31 17:12:04 +01:00
Laurent Destailleur
0e4c113e7f Fix phpcs 2021-10-31 17:11:23 +01:00
Laurent Destailleur
ffc1d8fb97 Merge pull request #19211 from FHenry/14_fix_modulebuilder
fix: setup template on module builder (error SQL when not tag exists)
2021-10-31 17:09:15 +01:00
Laurent Destailleur
42b043feef Merge pull request #19213 from atm-greg/FIX_restrictedArea_for_payment_delete
FIX restrictedArea for payment delete
2021-10-31 17:06:47 +01:00
Laurent Destailleur
682ad98918 Update security.lib.php 2021-10-31 17:06:37 +01:00
Laurent Destailleur
fb6a1d1f51 FIX #19210 2021-10-31 16:59:48 +01:00
Laurent Destailleur
51b0758263 Merge pull request #19219 from FHenry/14_fix_warning
fix: warning dol_print_date setTimeStamp when time empty
2021-10-31 16:49:13 +01:00
Laurent Destailleur
c73c962459 Merge pull request #19220 from frederic34/patch-4
remove duplicate code
2021-10-31 16:47:33 +01:00
Laurent Destailleur
82898b1aca Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-31 16:25:46 +01:00
Laurent Destailleur
9989180c5f Fix target is lost 2021-10-31 16:25:29 +01:00
Laurent Destailleur
9247bbcc1d Merge pull request #19223 from noec764/12.0_FIX_resource_list_extrafields_filter
FIX: resource list : Use standard code to handle list filters
2021-10-31 16:15:08 +01:00
Laurent Destailleur
15406f16d2 Merge pull request #19215 from FHenry/14_fix_catagorie_method
fix: getFilterSelectQuery get correct table
2021-10-31 16:13:36 +01:00
Laurent Destailleur
707dd85f43 Merge pull request #19242 from aspangaro/14p25
FIX Accountancy - Product admin - Log error when we affect accounting account with product_perentity activated
2021-10-31 15:22:01 +01:00
Laurent Destailleur
e6e440e573 Fix #19257 error in the page Overview of a project 2021-10-31 15:14:15 +01:00
Laurent Destailleur
8064ecce73 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-31 14:38:07 +01:00
Laurent Destailleur
da4fe03be7 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/class/html.formticket.class.php
	htdocs/ticket/card.php
2021-10-31 14:37:33 +01:00
Laurent Destailleur
ca8dab36a3 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/compta/facture/card.php
	htdocs/core/class/html.formticket.class.php
	htdocs/core/modules/modAdherent.class.php
	htdocs/core/modules/modProjet.class.php
2021-10-31 14:33:44 +01:00
Laurent Destailleur
01c6de1085 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-10-31 14:24:53 +01:00
Laurent Destailleur
6d918ad1c7 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-10-31 14:24:19 +01:00
Laurent Destailleur
3bbb30ccf6 Merge pull request #19257 from aspangaro/14p26
FIX #19241 Project - Fix display salary in overview
2021-10-31 14:23:43 +01:00
Laurent Destailleur
ffcc6b6d69 Merge pull request #19235 from noec764/14.0_FIX_Error_in_stock_module
FIX: Replenish: SQL error when no warehouse has been created
2021-10-31 14:22:31 +01:00
Laurent Destailleur
13d3ff8ef7 Update replenish.php 2021-10-31 14:22:14 +01:00
Laurent Destailleur
480ad63c5d Update stocks.lang 2021-10-31 14:21:01 +01:00
Laurent Destailleur
7773f8f017 Update replenish.php 2021-10-31 14:20:30 +01:00
Laurent Destailleur
dfc8698422 Update replenish.php 2021-10-31 14:16:18 +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
Laurent Destailleur
0d1f67145e Merge pull request #19237 from ksar-ksar/patch-10
FIX #19214 : PostgreSQL error on admin/limits.php
2021-10-31 14:00:13 +01:00
Laurent Destailleur
c1a046601c Merge pull request #19238 from FHenry/14_fix_deltesuppierorder
fix: warning on delete supplier order
2021-10-31 13:58:52 +01:00
Laurent Destailleur
6054e23b4d Merge pull request #19252 from hregis/fix_totalarray_is_overwritten
FIX $totalarray is overwritten, totals were lost
2021-10-31 13:56:37 +01:00
Laurent Destailleur
92f9f3179e Update list.php 2021-10-31 13:56:19 +01:00
Laurent Destailleur
7232e38dbe Merge pull request #19248 from fmarcet/12.0
Fix: Import don't work if extrafield is separator
2021-10-31 13:54:31 +01:00
Laurent Destailleur
f2c282305e Merge pull request #19260 from aspangaro/12p21
FIX Ticket - Duplicate field project when we create ticket from project
2021-10-31 13:53:58 +01:00
Laurent Destailleur
dcc98b6026 Fix filter on product on statistic page 2021-10-31 12:54:08 +01:00
Alexandre SPANGARO
54b81312b5 FIX Ticket - Duplicate field project when we create ticket from project 2021-10-30 22:49:32 +02:00
Alexandre SPANGARO
9142599ea5 copyright 2021-10-30 21:18:52 +02:00
Alexandre SPANGARO
b1c799ee08 FIX #19241 Project - Fix display salary in overview 2021-10-30 21:17:15 +02:00
Regis Houssin
09621af54e FIX $totalarray is overwritten, totals were lost 2021-10-29 22:49:29 +02:00
Ferran Marcet
1336d3e791 Fix: Import don't work if extrafield is separator 2021-10-29 12:25:50 +02:00
Alexandre SPANGARO
da52742421 FIX Accountancy - Product admin - SQL error when we affect accounting account with product_perentity activated 2021-10-29 05:47:29 +02:00
Florian HENRY
9d15a7a18c fix: warning on delete wupplier order 2021-10-28 17:37:30 +02:00
ksar
2b13c05d13 FIX #19214 2021-10-28 15:54:38 +02: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
Administrator
2a9cd21b71 FIX: Travis Sanitize SQL 2021-10-28 14:14:25 +02:00
Administrator
44eedb8c6e FIX: Replenish: SQL error when no warehouse has been created + Warning when there are no warehouses 2021-10-28 12:58:14 +02:00
Laurent Destailleur
82a35f82b4 CSS 2021-10-28 11:33:22 +02:00
Laurent Destailleur
f033e91cb0 phpcs 2021-10-28 11:03:27 +02:00
Laurent Destailleur
41bba0e879 Fix import of members 2021-10-28 00:12:41 +02:00
Laurent Destailleur
5df25fece7 Trans and log 2021-10-27 11:15:26 +02:00
Administrator
c998abe54e FIX: resource list : Use standard code to handle list filters 2021-10-27 11:09:00 +02:00
Frédéric FRANCE
dc15d09f12 remove duplicate code 2021-10-27 09:37:22 +02:00
Alexandre SPANGARO
9bfd5c4f41 Merge branch '14.0' into 14p23 2021-10-27 09:36:22 +02:00
Florian HENRY
46119c99a2 fix: warning dol_print_date setTimeStamp when time empty 2021-10-27 09:23:54 +02:00
Laurent Destailleur
f12c709ec1 Fix checkbox 2021-10-27 03:09:12 +02:00
Laurent Destailleur
e85548d470 Fix look and feel v14 2021-10-27 03:06:50 +02:00
Laurent Destailleur
637e8f44e6 Fix phpcs 2021-10-27 00:05:40 +02:00
Laurent Destailleur
19734c89d6 Fix css 2021-10-26 22:09:07 +02:00
Laurent Destailleur
4e844b4687 Fix phpcs 2021-10-26 20:45:00 +02:00
Florian HENRY
96f08082a2 fix: getFilterSelectQuery get correct table 2021-10-26 18:25:49 +02:00
stickler-ci
6fd08bc5ef Fixing style errors. 2021-10-26 14:56:56 +00:00
atm-greg
406089ef0c FIX restrictedArea for payment delete 2021-10-26 16:47:16 +02:00
Laurent Destailleur
7cd09eb649 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/modules/mailings/modules_mailings.php
2021-10-26 16:34:25 +02:00
Laurent Destailleur
7393abea8f Fix phpcs 2021-10-26 14:42:26 +02:00
Laurent Destailleur
2436f0967b Fix translation of Nature of member in import. 2021-10-26 14:37:15 +02:00
Laurent Destailleur
fcdfd370ba Fix css 2021-10-26 14:31:55 +02:00
Florian HENRY
89ba133c61 fix: categorie display if none 2021-10-26 14:11:51 +02:00
Laurent Destailleur
da2ce063b3 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/contact/card.php
	htdocs/contact/list.php
	htdocs/core/modules/mailings/modules_mailings.php
	htdocs/product/card.php
	htdocs/public/emailing/mailing-unsubscribe.php
2021-10-26 13:42:30 +02:00
Laurent Destailleur
fde44f2792 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/contact/list.php
	htdocs/core/modules/mailings/modules_mailings.php
2021-10-26 13:29:47 +02:00
Laurent Destailleur
181991ee47 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-10-26 13:10:23 +02:00
Laurent Destailleur
d82cbf6636 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-26 13:09:15 +02:00
Laurent Destailleur
e87e354bd5 Fix: can't reset country of origin 2021-10-26 13:08:22 +02:00
Alexandre SPANGARO
a129e91198 Merge branch '14.0' into 14p23 2021-10-26 06:23:31 +02:00
Laurent Destailleur
cffee1df4b Fix phpcs 2021-10-25 22:09:21 +02:00
Laurent Destailleur
02f8ac4cbc Fix error phpunit 2021-10-25 21:49:25 +02:00
Frédéric FRANCE
1683f46d9b backport fix 2021-10-25 21:21:48 +02:00
Gauthier PC portable 024
1e45b9b1cd FIX : We need a default price base type in variant creation case with multiprices when parent has been created with only one level price 2021-10-25 15:25:58 +02:00
Laurent Destailleur
678e23b13a Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-25 13:05:22 +02:00
Laurent Destailleur
1106198c05 css 2021-10-25 12:34:12 +02:00
Laurent Destailleur
4ab759b067 Fix check/uncheck of ping 2021-10-24 14:23:35 +02:00
Laurent Destailleur
ad3297b0ef Use of MAIN_FIRST_PING_OK_ID = 'disabled' works when forcing reinstall. 2021-10-24 14:01:38 +02:00
Laurent Destailleur
d3f630e4b5 Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14.0 2021-10-24 13:06:41 +02:00
Laurent Destailleur
dc32350ee7 Code comment 2021-10-24 13:02:45 +02:00
Laurent Destailleur
58b2365f8a Merge pull request #19176 from atm-maxime/fix_ecm_autotree
Fix #8716 : tasks were not shown in ecm auto tree
2021-10-24 12:35:43 +02:00
Maxime Kohlhaas
6abd4cc120 Fix #8716 : tasks were not shown in ecm auto tree 2021-10-24 11:38:45 +02:00
Laurent Destailleur
664eafd810 Merge pull request #19168 from atm-maxime/fix_massmovments
Fix #18916 : mass stock movements not displayed if error while adding line
2021-10-24 00:44:39 +02:00
Laurent Destailleur
66a732c005 Merge pull request #19167 from atm-maxime/fix_currency_sync
Fix #18922 : multicurrency sync in http with good currencylayer url
2021-10-24 00:44:19 +02:00
Laurent Destailleur
c8bcd01a10 Merge pull request #19162 from atm-maxime/fix_no_mail_in_now_unsubscribe
Fix #18961 : no_email field has been replaced by mailing_unsubscribe table
2021-10-24 00:42:48 +02:00
Maxime Kohlhaas
0a2c950401 Fix #18916 : mass stock movements not displayed if error while adding line 2021-10-24 00:31:57 +02:00
Maxime Kohlhaas
983e28691b Use a subselect instead of a join 2021-10-24 00:02:55 +02:00
Laurent Destailleur
4ab59eebf3 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-23 23:58:27 +02:00
Laurent Destailleur
fc29aa7d3b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-23 23:58:00 +02:00
Laurent Destailleur
1750e385a9 Merge pull request #19164 from tiaris/14.0_bug18934
FIX #18934 on-registration in the extrafieldsline database for deliveries
2021-10-23 23:57:23 +02:00
Maxime Kohlhaas
77c716565e Fix #18922 : multicurrency sync in http with good currencylayer url 2021-10-23 23:42:06 +02:00
stickler-ci
53e9da4748 Fixing style errors. 2021-10-23 20:37:07 +00:00
Maxime Kohlhaas
29950a6afa Replace != by <> in SQL requests 2021-10-23 22:27:29 +02:00
Maxime Kohlhaas
00b617d17f Fix #18961 : no_email field has been replaced by mailing_unsubscribe table 2021-10-23 22:22:45 +02:00
Jean
b027db49b5 FIX #18934
Non-registration in the extrafieldsline database for deliveries
2021-10-23 22:21:50 +02:00
Laurent Destailleur
c75db78cea Merge pull request #19125 from atm-maxime/fix_recuitment_list_sql_error
Fix #19083 : wrong field list in sql request
2021-10-23 11:38:51 +02:00
Laurent Destailleur
b70f52a615 Merge pull request #19126 from atm-maxime/fix_product_api_subproducts
Fix #19070 : Api subproducts was returning false
2021-10-23 11:35:29 +02:00
Laurent Destailleur
b4d241a12b Merge pull request #19135 from hregis/fix_wrong_position_of_error_message
FIX wrong position of error message
2021-10-23 11:22:39 +02:00
Regis Houssin
452a8cfe18 FIX wrong position of error message 2021-10-23 10:27:24 +02:00
Maxime Kohlhaas
604052d1a1 Fix #19070 : Api subproducts was returning false 2021-10-23 02:28:53 +02:00
Maxime Kohlhaas
5275d3cd48 Fix #19083 : wrong field list in sql request 2021-10-23 02:20:06 +02:00
Laurent Destailleur
67f5ef913e Merge pull request #19037 from aspangaro/14p24
FIX Accountancy simplified - Salaries are not present in report
2021-10-22 22:54:23 +02:00
Laurent Destailleur
fc0c4295bd Merge pull request #19118 from atm-florianm/FIX_12.0_tcpdf_issue_315_roman_numeral_bomb_vulnerability
FIX tcpdf roman numeral rendering bomb, cf. tecnickom/TCPDF PR 315
2021-10-22 19:10:13 +02:00
Laurent Destailleur
a90afd3180 Merge pull request #19106 from atm-lena/14.0_FIX_Issue_18711_HolidayValidateFiles
Validate Holiday : keep files
2021-10-22 19:03:15 +02:00
atm-florian
17773f8414 FIX tcpdf vulnerability to roman numeral bomb, cf. tecnickom/TCPDF issue #315 2021-10-22 18:26:23 +02:00
Laurent Destailleur
bede1116a8 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-22 15:42:32 +02:00
Laurent Destailleur
b5929fb7c4 Fix phpcs 2021-10-22 15:42:18 +02:00
stickler-ci
87b4805bc0 Fixing style errors. 2021-10-22 13:35:30 +00:00
atm-lena
fa21b27ced Validate Holiday : keep files 2021-10-22 15:27:16 +02:00
Laurent Destailleur
6c9cddaa9c Merge pull request #19092 from rfranks-securenet/14.0
Fixed ref_ext missing from supplier invoice in REST API
2021-10-22 14:24:36 +02:00
rfranks-securenet
7ba8cad2aa Merge branch 'Dolibarr:14.0' into 14.0 2021-10-22 10:42:00 +01:00
Laurent Destailleur
e4a757ff9e Merge pull request #19086 from FHenry/14_fix_various_warning
fix: fix various php warning
2021-10-22 11:39:48 +02:00
Richard Franks
98eb07d6f2 FIX #18695 Added ref_ext to supplier invoice
Added ref_ext to the fields for create, fetch and update functions
on fournisseur.facture class. This enables the REST API to use
this field for additional information.
2021-10-22 10:39:14 +01:00
Laurent Destailleur
8289eec510 Merge pull request #19087 from FHenry/14_fix_moduilebuilder
fix: bad comma SQL request in modulebuilder template list
2021-10-22 11:33:09 +02:00
Florian HENRY
6c71cc1e14 better correction from modulebuilder source of #19081 2021-10-22 11:03:35 +02:00
Florian HENRY
0c770b8810 fix various warning 2021-10-22 10:54:33 +02:00
Florian HENRY
9a9ed8989e fix various warning 2021-10-22 10:50:54 +02:00
Florian HENRY
444f7703a6 fix various warning 2021-10-22 10:50:24 +02:00
stickler-ci
ba8ef15916 Fixing style errors. 2021-10-22 08:50:15 +00:00
Florian HENRY
64bb2e6ece fix various warning 2021-10-22 10:49:47 +02:00
Laurent Destailleur
f0394c42d5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-22 10:49:29 +02:00
Laurent Destailleur
962aa9f977 Fix #yogosha7494 2021-10-22 10:49:01 +02:00
Alexandre SPANGARO
0c8291b60f Fix INNER JOIN & Add urlencode() 2021-10-22 04:35:23 +02:00
Laurent Destailleur
8bb8e92ff2 Merge pull request #19034 from prietojc/patch-17
FIX card.php
2021-10-22 00:02:35 +02:00
Laurent Destailleur
80aebef63f Merge pull request #19024 from daraelmin/daraelmin-patch-5
Fix adhtype amount as default on new subscription
2021-10-21 23:48:58 +02:00
Laurent Destailleur
2741e12376 Merge pull request #19033 from hregis/fix_wrong_sql_index
FIX compatibility with Multicompany
2021-10-21 23:47:44 +02:00
Laurent Destailleur
f1565bb283 Merge pull request #18982 from atm-lena/13.0_FIX_updateExtrafield_EmptyValue
Function updateExtrafield : replace empty value to null
2021-10-21 23:41:30 +02:00
Laurent Destailleur
9f6cfc5a07 Merge pull request #19036 from hregis/fix_missing_sql_filter_by_entity
FIX missing sql filter by entity
2021-10-21 23:35:29 +02:00
Laurent Destailleur
99c309b517 Merge pull request #19066 from atm-florianm/FIX_issue_19014_modulebuilder_obj_prop_update
FIX #19014 - the properties of some fields are not updated on form submission
2021-10-21 22:42:53 +02:00
Laurent Destailleur
313e0f86dc Merge pull request #19067 from atm-lena/14.0_FIX_19008_LineBoolean
FIX #19008
2021-10-21 22:09:56 +02:00
atm-lena
bdc8854baa Clean 2021-10-21 18:54:07 +02:00
atm-lena
03765528e1 Contract line : update boolean 2021-10-21 18:42:06 +02:00
atm-florian
2468c0e120 FIX #19014 - the properties of some fields are not updated when you submit the form
+ reformatting (one line per array item)
2021-10-21 18:24:03 +02:00
atm-lena
806c53d4c4 FIX Ret PR 2021-10-21 09:49:14 +02:00
Regis Houssin
71b9ac384f FIX only ones value is return for dictionaries 2021-10-21 08:43:20 +02:00
Alexandre SPANGARO
d2b96fe0f6 Correct link to salary list with user search 2021-10-21 06:08:48 +02:00
Alexandre SPANGARO
a1c0e1ad1f Better fix with backward compatibility with old salary module 2021-10-21 05:45:37 +02:00
Alexandre SPANGARO
be7c1c8a23 Typo & translation 2021-10-21 05:18:56 +02:00
Alexandre SPANGARO
02bb39d438 FIX Accountancy simplified - Salaries are not present in report 2021-10-21 05:06:50 +02:00
Regis Houssin
4b2b2328c3 FIX missing sql filter by entity 2021-10-20 21:33:18 +02:00
JC Prieto
0756a01002 Fix card.php
Error adding localtax
2021-10-20 19:33:28 +02:00
Regis Houssin
3029804db7 FIX compatibility with Multicompany 2021-10-20 19:21:18 +02:00
daraelmin
eed689e1c1 quote instead double quote 2021-10-20 16:33:38 +02:00
daraelmin
a2adc6fc58 Getpostisset 2021-10-20 15:59:42 +02:00
Laurent Destailleur
34c61edcbd Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-20 15:01:01 +02:00
Laurent Destailleur
85fe1d6d1e fix sql injection reported by Mehdi Oudad 2021-10-20 15:00:49 +02:00
Laurent Destailleur
66437c472a Merge pull request #19031 from hregis/fix_wrong_array_key_value
FIX wrong array key value
2021-10-20 13:46:07 +02:00
Regis Houssin
f38fca8174 FIX wrong array key value 2021-10-20 13:35:30 +02:00
Laurent Destailleur
766463a0b2 Merge pull request #18966 from aspangaro/14p22
Accountancy - Show message for admin if accountancy hidden options are activated to help to resolve some problems
2021-10-20 12:51:29 +02:00
Laurent Destailleur
2852e6ff9e Merge pull request #19028 from aspangaro/14p24
PHP8
2021-10-20 12:45:13 +02:00
Laurent Destailleur
54c9a60fa3 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-20 12:38:32 +02:00
Laurent Destailleur
53244c5f45 FIX missing permission check reported by me@lainwir3d.net on product api 2021-10-20 12:38:19 +02:00
Alexandre SPANGARO
632751cebc Use getDolGlobalInt() 2021-10-20 12:37:49 +02:00
Laurent Destailleur
136807645d Merge pull request #19030 from atm-florianm/FIX_14.0_civility_field_with_in_private_thirdparty_creation_form
FIX 14.0 - civility field of private third party creation form has inadequate width
2021-10-20 11:30:55 +02:00
Laurent Destailleur
ae1da43225 Update card.php 2021-10-20 11:30:38 +02:00
Laurent Destailleur
f59f605bcc Update card.php 2021-10-20 11:29:34 +02:00
Laurent Destailleur
562df7a27a Merge pull request #19025 from daraelmin/daraelmin-patch-3
Fix wrong const in select MEMBER_ALLOW_CHANGE_OF_TYPE
2021-10-20 11:25:35 +02:00
atm-florian
417daa4289 FIX 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none) 2021-10-20 11:15:02 +02:00
Laurent Destailleur
289f90fb1e Fix qty must not use html type "number" but "text" (need decimal values) 2021-10-20 11:05:40 +02:00
Laurent Destailleur
0371183ed9 Merge pull request #19029 from aspangaro/14p12
FIX Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode
2021-10-20 11:02:05 +02:00
Alexandre SPANGARO
63fafdf120 FIX Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode 2021-10-20 07:54:09 +02:00
Alexandre SPANGARO
2dc997528b Merge branch '14.0' into 14p23 2021-10-20 07:42:01 +02:00
Alexandre SPANGARO
bee6abd6fc Merge branch '14.0' into 14p24 2021-10-20 07:38:54 +02:00
Laurent Destailleur
b9540c3eb6 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	ChangeLog
	htdocs/adherents/card.php
	htdocs/filefunc.inc.php
	htdocs/install/repair.php
2021-10-20 03:38:10 +02:00
daraelmin
dc465d6bac Fix adhtype amount as default on new subscription 2021-10-20 00:29:46 +02:00
daraelmin
f4743c7f1f Fix wrong const in select MEMBER_ALLOW_CHANGE_OF_TYPE 2021-10-19 23:00:36 +02:00
Laurent Destailleur
b1de75758f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-19 20:04:14 +02:00
Laurent Destailleur
265f3d0ab0 Fix css 2021-10-19 20:03:59 +02:00
Laurent Destailleur
b1e4e2699b Merge pull request #18993 from atm-florianm/FIX_13.0_ticket_message_editing_requires_end_date
FIX 13.0: end date required to edit a ticket message
2021-10-19 19:05:36 +02:00
Laurent Destailleur
eefa65f49b Merge pull request #19006 from OPEN-DSI/v14-fix-propal-validate-with-pdf-options
FIX generate documents with PDF options
2021-10-18 19:29:58 +02:00
Laurent Destailleur
039e0ba89e Merge pull request #19005 from atm-florianm/FIX_13.0_typo_in_firstname
FIX 13.0: sometimes firstname was mistyped as fistname
2021-10-18 19:28:16 +02:00
Laurent Destailleur
34abd39c0c Merge pull request #19000 from aspangaro/14p12
FIX #18912 Accountancy - SQL error when custom group is added without country defined
2021-10-18 19:27:44 +02:00
Laurent Destailleur
8bc826bdda Merge pull request #19004 from atm-florianm/FIX_14.0_typo_in_mode_parameter_for_adherent_list
FIX 14.0 - due to a typo in the 'mode' parameter, the "first name" co…
2021-10-18 19:23:52 +02:00
Laurent Destailleur
6733085071 Merge pull request #19007 from OPEN-DSI/v14-fix-event-print-dates-hours-diff
FIX show end hours in events linked to objects
2021-10-18 19:23:30 +02:00
lvessiller
98a613edec FIX show end hours in events linked to objects 2021-10-18 14:31:37 +02:00
atm-florian
c016a20aac FIX 13.0 - due to a typo in the 'mode' parameter, the "first name" column of the list of members displays the full name 2021-10-18 12:12:38 +02:00
lvessiller
a52ceaf1d2 FIX generate documents with PDF options 2021-10-18 12:12:00 +02:00
atm-florian
d0d5955fb1 FIX 13.0: sometimes firstname was mistyped as fistname 2021-10-18 12:09:33 +02:00
Alexandre SPANGARO
053740792f Update accounting.lib.php 2021-10-18 10:19:50 +02:00
Alexandre SPANGARO
9685695577 FIX Accountancy - PHP8 2021-10-18 10:19:46 +02:00
atm-florian
aff8d9c24a FIX 13.0 PR #18993: add comment on modified part 2021-10-18 09:46:20 +02:00
atm-florian
2ff75dfab4 FIX 13.0 feedback of PR #18993: make ticket messages punctual events with attr percentage = -1 2021-10-18 09:43:05 +02:00
Alexandre SPANGARO
dce1e56a78 FIX #18912 Accountancy - SQL error when custom group is added without country defined 2021-10-18 05:44:22 +02:00
Laurent Destailleur
5221c9e38f Fix editline 2021-10-17 19:41:17 +02:00
Laurent Destailleur
7bcc76c1aa Fix margin rates and mark rates are 2 different columns 2021-10-17 19:41:02 +02:00
Laurent Destailleur
78523e852d css 2021-10-17 14:04:49 +02:00
Laurent Destailleur
30d25bcb52 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-17 14:03:07 +02:00
Laurent Destailleur
30ba753b34 css 2021-10-17 14:02:37 +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
Laurent Destailleur
bd73545d08 Merge pull request #18985 from henrynopo/patch-5
Fix the rounding issue in case of multi-currency
2021-10-17 13:50:35 +02:00
Laurent Destailleur
7bfad108a8 Merge pull request #18995 from aspangaro/14p11
FIX User salary card - translation problem
2021-10-17 13:49:44 +02:00
Laurent Destailleur
ccf78a1af4 FIX Use of accent into filename of GED 2021-10-17 12:30:08 +02:00
Laurent Destailleur
b30d7371a4 Fix allow ' - ' into file name 2021-10-17 12:21:22 +02:00
Alexandre SPANGARO
fb30136202 Translation 2021-10-17 08:12:28 +02:00
Alexandre SPANGARO
e9ecb2e1ee Translation 2021-10-17 08:11:34 +02:00
Alexandre SPANGARO
102c8a5772 FIX User salary card - translation problem 2021-10-17 08:02:28 +02:00
Laurent Destailleur
8bdece7101 CSS 2021-10-16 21:43:48 +02:00
Laurent Destailleur
ee6780c46e FIX #18968 2021-10-16 21:37:12 +02:00
Laurent Destailleur
759502829c Merge pull request #18973 from atm-maxime/fix_member_from_third
Fix member creation from thirdparty extrafields
2021-10-16 21:23:47 +02:00
Laurent Destailleur
68bb625ec7 Merge pull request #18976 from PyroShape/142
FIX : #18634 : Problem of virtual stock with reception module enabled
2021-10-16 21:23:08 +02:00
Laurent Destailleur
1c07385aba Update product.class.php 2021-10-16 21:22:53 +02:00
Laurent Destailleur
830e067eff Fix for tzuser 2021-10-16 21:03:47 +02:00
Laurent Destailleur
5a4383c9ac Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-16 20:07:19 +02:00
Laurent Destailleur
f2757a63a1 Clean code 2021-10-16 20:06:58 +02:00
Laurent Destailleur
308d408cd0 Merge pull request #18980 from OPEN-DSI/v14-fix-print-date-user-timezone
FIX user date timezone offset
2021-10-16 20:03:42 +02:00
Laurent Destailleur
2b5bc202fc Merge pull request #18984 from henrynopo/patch-2
Supplier Invoice Payment List
2021-10-16 19:19:34 +02:00
Laurent Destailleur
bd52613331 Fix phpcs 2021-10-16 17:06:10 +02:00
Laurent Destailleur
946bca3b62 Prepare 13.0.5 2021-10-16 13:26:39 +02:00
Laurent Destailleur
a0c81d6230 Prepare 13.0.5 2021-10-16 13:23:59 +02:00
Laurent Destailleur
46eed3767f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-16 12:54:05 +02:00
Laurent Destailleur
52890c64c1 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/compta/facture/stats/index.php
	htdocs/compta/prelevement/create.php
2021-10-16 12:53:57 +02:00
Laurent Destailleur
faf80b94e9 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/compta/facture/stats/index.php
2021-10-16 12:49:18 +02:00
Laurent Destailleur
a2733344e7 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-16 12:33:32 +02:00
Laurent Destailleur
07052196e2 Fix popup message on sepa creation 2021-10-16 12:33:19 +02:00
atm-florian
bd7e3e57ca FIX 13.0: end date required to edit a ticket message 2021-10-15 16:56:38 +02:00
stickler-ci
fb79aaeb0c Fixing style errors. 2021-10-15 07:19:49 +00:00
Henry
0cb1972674 Update card.php 2021-10-15 15:07:48 +08:00
Henry
316bc16634 Update card.php 2021-10-15 15:05:13 +08:00
Henry
3d62ee22d3 Supplier Invoice Payment List
fix the missing multicurrency payments and remainders
2021-10-15 11:13:40 +08:00
atm-lena
ff7727466a Function updateExtrafield : replace empty value to null 2021-10-14 17:13:44 +02:00
lvessiller
5d22eeeff2 FIX user date timezone offset 2021-10-14 16:06:22 +02:00
Laurent Destailleur
3875d26a2f Fix filter for supplierinvoice stats 2021-10-14 15:55:12 +02:00
Laurent Destailleur
db3d16f080 Fix filter tag for supplier invoice statistics 2021-10-14 15:43:35 +02:00
Laurent Destailleur
bc230dbfc2 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-10-14 12:00:33 +02:00
Laurent Destailleur
371c75e76a FIX list of categories in stats of supplier invoices 2021-10-14 11:58:21 +02:00
Benjamin Chantalat
3438a4a9f6 Add the module reception to the calcul of virtual stock 2021-10-14 09:33:26 +02:00
Alexandre SPANGARO
9e3a00521d FIX also on customer index for automatic binding 2021-10-13 21:36:04 +02:00
Alexandre SPANGARO
5d7587259d FIX Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction 2021-10-13 21:21:16 +02:00
Maxime Kohlhaas
3c33770f00 Fix member creation from thirdparty extrafields 2021-10-13 15:30:49 +02:00
Alexandre SPANGARO
04091169da Accountancy - Show message for admin if accountancy hidden options are activated to help to resolve some problems 2021-10-13 02:48:42 +02:00
Laurent Destailleur
fe3e11a104 Merge pull request #18957 from OPEN-DSI/v14-fix-takepos-payment-style
FIX payment style and html5 tags
2021-10-12 16:45:56 +02:00
lvessiller
ab4da186c5 FIX 2 columns for total labels 2021-10-12 15:52:59 +02:00
lvessiller
1788508963 FIX payment style and html5 tags 2021-10-12 14:11:19 +02:00
Laurent Destailleur
d75138b362 Merge pull request #18946 from atm-lena/13.0_FIX_HookCreateDictionaryFieldList_HTMLTRTag
Hook createDictionaryFieldList :  tr html tag to right place
2021-10-12 12:46:04 +02:00
Laurent Destailleur
3a7681c186 Merge pull request #18945 from PyroShape/14b
FIX : Remove not complete order from the virtual stock
2021-10-12 12:44:22 +02:00
Laurent Destailleur
2e32254574 Fix rul to shipment files 2021-10-11 20:36:10 +02:00
Laurent Destailleur
c4ca9e92a6 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-11 20:18:46 +02:00
Laurent Destailleur
6b69e64fb6 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-11 20:18:08 +02:00
Laurent Destailleur
4e9c7c9efb FIX Attachment of pdf into shipment when sending email 2021-10-11 20:04:45 +02:00
Laurent Destailleur
3a32787f15 Fix for backward compatibility 2021-10-11 16:14:34 +02:00
Laurent Destailleur
5fc0802eb1 Fix for backward compatibility 2021-10-11 16:13:55 +02:00
atm-lena
7c8bde885b hook createDictioaryFieldList : tr html tag to right place 2021-10-11 16:03:56 +02:00
Benjamin Chantalat
91164951de Remove not complete order from virtual stock 2021-10-11 15:24:56 +02:00
Laurent Destailleur
4fba60d2bb Merge pull request #18925 from OPEN-DSI/v14-fix-cron-reload-user-langs
FIX reload user lang
2021-10-11 11:21:28 +02:00
atm-florian
57052e2fba FIX PR#18931 Remove useless explicit call to dol_shutdown 2021-10-11 11:10:14 +02:00
Laurent Destailleur
9c749a37b1 Merge pull request #18930 from OPEN-DSI/v14-fix-optionals-create-card
FIX optional visibility on create card
2021-10-11 11:07:56 +02:00
Laurent Destailleur
c9972b9eea Merge pull request #18937 from PyroShape/142
Fix date format into supplier order info tab
2021-10-11 11:04:39 +02:00
Laurent Destailleur
b43dcb24f0 Update fournisseur.commande.class.php 2021-10-11 11:04:21 +02:00
Laurent Destailleur
8ba05cc242 Merge pull request #18936 from PyroShape/14
FIX #18875 in v14
2021-10-11 10:26:55 +02:00
Laurent Destailleur
ff5f371428 Fix add protection to avoid deletion of page when deleting a file 2021-10-10 20:46:06 +02:00
Benjamin Chantalat
6e60e1f453 Fix date format into supplier order info tab 2021-10-09 20:38:46 +02:00
Benjamin Chantalat
de17b367c8 FIX #18875 in v14 2021-10-09 20:14:16 +02:00
Laurent Destailleur
cdf1d37a1d Fix changelog 2021-10-08 18:52:01 +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
lvessiller
90be175c50 FIX load tranlate array after setting lang 2021-10-08 16:20:51 +02:00
lvessiller
be4a00213c FIX optional visibility on create card 2021-10-08 15:58:08 +02:00
Laurent Destailleur
2f61c4e93b Add onbeforecopy and onbeforecut into the WAF 2021-10-08 12:14:42 +02:00
lvessiller
1efc2eda69 FIX reload user lang 2021-10-08 11:54:38 +02:00
Laurent Destailleur
816e4cdde6 Comment 2021-10-08 10:59:11 +02:00
Laurent Destailleur
b905b1b4bc FIX missing filter status=1 on rss feeds 2021-10-07 16:09:32 +02:00
Laurent Destailleur
d245abe908 Fix rounding 2021-10-07 11:34:21 +02:00
Laurent Destailleur
68ac62d09c Fix phpcs 2021-10-07 11:05:06 +02:00
Laurent Destailleur
9b5909300e Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/compta/paiement/card.php
	htdocs/fourn/facture/card.php
2021-10-07 11:00:00 +02:00
Laurent Destailleur
efd44b0ec0 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-10-07 10:57:03 +02:00
Laurent Destailleur
5910d10021 Add hidden option to allow to fix corrupted situations 2021-10-07 10:43:50 +02:00
Laurent Destailleur
ed6fefc493 Trans 2021-10-07 04:10:39 +02:00
Laurent Destailleur
ec545f8967 Fix data 2021-10-07 02:58:51 +02:00
Laurent Destailleur
5463a02887 Debug v14 2021-10-06 21:59:10 +02:00
Laurent Destailleur
6cb690e678 Debug v14 2021-10-06 21:56:48 +02:00
Laurent Destailleur
8fe37b20c0 Debug v14 2021-10-06 21:54:04 +02:00
Laurent Destailleur
cc0b709ad5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-06 21:47:59 +02:00
Laurent Destailleur
2a5e654544 Debug v14 2021-10-06 21:47:46 +02:00
Laurent Destailleur
b34279da89 Debug v14 2021-10-06 21:46:01 +02:00
Laurent Destailleur
f95b0c3033 Debug 2021-10-06 21:43:30 +02:00
Laurent Destailleur
88a482c615 Fix phpcs 2021-10-06 18:40:32 +02:00
Laurent Destailleur
144de734ce Fix phpcs 2021-10-06 18:39:16 +02:00
Laurent Destailleur
1c53035e38 Doc 2021-10-06 16:19:36 +02:00
Laurent Destailleur
e3032ef1c4 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/fourn/facture/card.php
2021-10-06 16:06:25 +02:00
Laurent Destailleur
eba377cdf0 Merge pull request #18860 from FHenry/12_fix_selectline_from_supplier_order_to_supplier_invoice
fix: Supplier order => Supplier Invoice : line selector (checkbox) wasn't working
2021-10-06 15:31:14 +02:00
Laurent Destailleur
10f0434116 Update card.php 2021-10-06 15:30:19 +02:00
Laurent Destailleur
3c885c1fce Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-06 14:27:47 +02:00
Laurent Destailleur
92ae3c9d52 Fix label in graph 2021-10-06 14:26:48 +02:00
Laurent Destailleur
7a9eb0baa7 Merge pull request #18911 from ksar-ksar/patch-10
FIX #18910 : MRP List SQL query syntax error with more than one extrafileds.
2021-10-06 14:10:37 +02:00
Laurent Destailleur
4be2d1414e Fix regression 2021-10-06 14:03:10 +02:00
Francis Appels
dceb2b5341 Fix fatal error 2021-10-06 13:36:11 +02:00
Rüdiger Hahn
d963aa8832 Allow removal of tabs
For being able to remove or replace tabs, it is also necessary to call
this function with 'remove' mode.
2021-10-06 13:35:34 +02:00
Laurent Destailleur
b630b15991 Add missing line to remove a tab in modulebuilder 2021-10-06 13:33:13 +02:00
Laurent Destailleur
ea3e3b133d Debug eventorganization modules 2021-10-06 12:55:07 +02:00
Laurent Destailleur
ff29ac93ad Debug eventorganization modules 2021-10-06 12:43:40 +02:00
Laurent Destailleur
3709c6ff47 Fix phpcs 2021-10-06 11:53:27 +02:00
Laurent Destailleur
93b4853f8e Fix var_dump 2021-10-06 11:52:12 +02:00
ksar
6a20fcc5c0 FIX #18910 2021-10-06 11:24:42 +02:00
Laurent Destailleur
123c047e29 Fix look and feel v14 2021-10-05 13:34:25 +02:00
Laurent Destailleur
b11dbf069e FIX Bad use of a forced contact of another company on PDF/ODT documents 2021-10-05 13:11:54 +02:00
Laurent Destailleur
b559dc9053 css 2021-10-05 08:55:57 +02:00
Laurent Destailleur
e14676be49 Fix phpunit 2021-10-04 19:09:38 +02:00
Laurent Destailleur
91ee704dc3 Move trans from admin to main 2021-10-04 12:16:50 +02:00
Laurent Destailleur
1c56f65c27 Fix missing migration instruction 2021-10-04 11:49:49 +02:00
Laurent Destailleur
e46d064d5e Clean text 2021-10-03 20:36:03 +02:00
Laurent Destailleur
2c32c6c5c9 Fix contextpage for list of tickets 2021-10-03 19:17:23 +02:00
Laurent Destailleur
e558adbcfc Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-10-03 18:20:34 +02:00
Laurent Destailleur
d6e1a6be93 Look and feel v14 2021-10-03 18:20:01 +02:00
Laurent Destailleur
4c6f2fc4b5 Merge pull request #18874 from OPEN-DSI/v14-fix-product-per-entity-portability-sql
FIX Product accountancy affectation with product_perentity activated …
2021-10-02 21:04:11 +02:00
Laurent Destailleur
c149af82fe Merge pull request #18873 from JR-Polyline/patch-1
Fix dynamic prices not updating
2021-10-02 20:45:16 +02:00
Laurent Destailleur
d99b3d601a FIX #18854 2021-10-02 20:07:09 +02:00
lvessiller
fd7d1374c2 FIX Product accountancy affectation with product_perentity activated (PR #18620) 2021-10-01 16:37:54 +02:00
JR-Polyline
2be2423dee Fix dynamic prices not updating
When Dynamic price module active and an a math expression is used to compute buy price on supplier product card, the calculated price does not update on the card when saved.
Changing line 849 appears to solve this without any ill effect.
2021-10-01 21:30:25 +08:00
Laurent Destailleur
d68719226b Fix can install module with name module_abc-x.y.z (w).zip 2021-10-01 14:10:50 +02:00
Laurent Destailleur
157112758b Fix phpcs 2021-09-30 20:14:59 +02:00
Laurent Destailleur
166d3b08d6 Add LIBXML_NONET to simplexml_load_string 2021-09-30 20:12:01 +02:00
Florian HENRY
6d00097c89 fix 2021-09-30 16:37:52 +02:00
Laurent Destailleur
0bf1db2fd4 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-30 16:29:10 +02:00
Laurent Destailleur
ed264182c6 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/admin/dict.php
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/product/card.php
	htdocs/takepos/receipt.php
2021-09-30 16:28:42 +02:00
Laurent Destailleur
44bb5ebf34 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
2021-09-30 16:23:34 +02:00
Laurent Destailleur
bb6399e12a Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/admin/dict.php
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/product/card.php
2021-09-30 16:21:36 +02:00
Laurent Destailleur
fc4a16b356 Fix avoid error when trigger run on downgraded version. 2021-09-30 16:18:07 +02:00
Florian HENRY
d0508d557b fix: checkbox for line selection between supplier order and supplier invoice was infective 2021-09-30 14:56:02 +02:00
Laurent Destailleur
422191def1 Merge pull request #18858 from FHenry/12_fix_dict_tva
fix: search code on tva dict
2021-09-30 14:05:07 +02:00
Laurent Destailleur
620d7109b5 Update dict.php 2021-09-30 14:04:56 +02:00
Florian HENRY
332fa77d90 fix: search code on tva dict 2021-09-30 13:49:02 +02:00
Laurent Destailleur
ee79df9bc7 Merge pull request #18839 from indelog/fix_list_of_autoecmfiles
Fix FormFile::list_of_autoecmfiles object_instance classname after hook
2021-09-30 13:39:16 +02:00
Laurent Destailleur
ae9643bbef Update html.formfile.class.php 2021-09-30 13:38:38 +02:00
Laurent Destailleur
3deb424b4f Merge pull request #18845 from indelog/fix_doc_prev_ecm
Fix show for external module in ecm index auto page
2021-09-30 13:36:49 +02:00
Norbert Penel
4e86f872ca it was impossible to update a task
after some investigation i saw those errors but they are maybe some more around here
2021-09-30 13:35:23 +02:00
Laurent Destailleur
98d8bad955 Merge pull request #18843 from indelog/fix_ecm_deletion
Fix append module suffix on src_object_type when create ecm file
2021-09-30 13:32:42 +02:00
Laurent Destailleur
4fe9a4fd30 Merge pull request #18846 from hregis/fix_avoid_warning_if_not_an_array
FIX avoid warning if $categories is an id
2021-09-30 13:30:37 +02:00
Laurent Destailleur
04fa5ff70b css 2021-09-30 01:50:11 +02:00
Laurent Destailleur
fca39d9179 css 2021-09-30 01:15:36 +02:00
Laurent Destailleur
3d239e7528 Trans 2021-09-29 17:28:06 +02:00
Laurent Destailleur
11c48a53a5 Fix name of file 2021-09-29 17:20:59 +02:00
Laurent Destailleur
a495d5e982 Fix translation 2021-09-29 17:14:37 +02:00
Laurent Destailleur
2dd55301de Fix duplicate field and look and feel 2021-09-29 17:06:51 +02:00
Laurent Destailleur
52fb627a64 Look and feel v14 2021-09-29 16:45:48 +02:00
Laurent Destailleur
1d35d8fd2d CSS popup company 2021-09-29 16:42:52 +02:00
Laurent Destailleur
34dacca77c Css 2021-09-29 16:31:40 +02:00
Laurent Destailleur
a395ff5ee3 Css 2021-09-29 16:19:47 +02:00
Laurent Destailleur
10ea7ddeef Fix link param 2021-09-29 12:31:25 +02:00
Regis Houssin
6e08ecde04 FIX indentation 2021-09-29 08:47:22 +02:00
Laurent Destailleur
baadf2dc6c Fix reposition 2021-09-29 01:51:34 +02:00
Laurent Destailleur
1e840fe7ed Code comment 2021-09-28 18:07:04 +02:00
Regis Houssin
43a47999d7 FIX avoid warning if $categories is an id 2021-09-28 16:35:01 +02:00
Indelog
fae0337b3e Fix show for external module in ecm index auto page
This set the correct `modulepart` parameter for link generated to
`document.php` of ecm auto index page if `src_object_type` for
ecm document has a module suffix (`@modulename`).
2021-09-28 16:22:28 +02:00
Indelog
5b8b55cfba Fix append module suffix on src_object_type when create ecm file
Files added to `llx_ecm_files` for externals modules never be removed on
object deletion.

When `CommonObject::deleteEcmFiles()` is called with `mode=1`, it  use
this sql filter to find the file related to the object which is removed
:

```
$sql .= " WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX."ecm_files WHERE src_object_type = '".$this->db->escape($this->table_element.(empty($this->module) ? '' : '@'.$this->module))."' AND src_object_id = ".((int) $this->id).")";
```

We see it append `'@'.$this->module` to `$this->table_element` but when
file is add to the `llx_ecm_files` by
`CommonObject::commonGenerateDocument()` , it added whiteout the
`'@'.$this->module` suffix. So the file is never remove from
`llx_ecm_files` when object is deleted.

This fix it by appending module suffix on `src_object_type` if object
has `module` property when add document to the `llx_ecm_files`.
2021-09-28 15:26:08 +02:00
Laurent Destailleur
abc7137c81 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-28 13:45:05 +02:00
Laurent Destailleur
fc56b88a1f FIX select list of orders not complete when field type of company is on 2021-09-28 13:44:42 +02:00
Laurent Destailleur
d7986fafbc Merge pull request #18810 from aspangaro/14p16
FIX Accountancy - Missing specific filename for export on format FEC2
2021-09-28 13:20:33 +02:00
Alexandre SPANGARO
9426af8f6a NEW #18820 Accountancy - Add product account in import/export of thirdparty (level 3) 2021-09-28 13:16:44 +02:00
Laurent Destailleur
21fa60a730 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-28 13:08:03 +02:00
Laurent Destailleur
e6290b3b62 Merge pull request #18836 from aspangaro/14p22
FIX Propal list - Problem of pagination on date
2021-09-28 12:17:22 +02:00
Laurent Destailleur
c3d539abff Merge pull request #18833 from marc-dll/12.0_FIX_product_extrafields_update
FIX: products/services card: hidden extrafields were overridden
2021-09-28 12:13:08 +02:00
Laurent Destailleur
a70f5dd90e Doc 2021-09-28 12:12:11 +02:00
Indelog
2472dff67b Fix FormFile::list_of_autoecmfiles object_instance classname after hook
FormFile::list_of_autoecmfiles() can instantiate object with parameters
resulting of hook `addSectionECMAuto` but for do this,
it use `${$hookmanager->resArray['classname']}` which return a
`null`. Instead we should do this
`$hookmanager->resArray['classname']`.
2021-09-28 12:08:45 +02:00
Laurent Destailleur
0e3ec3ea2d Trans 2021-09-28 11:56:43 +02:00
Laurent Destailleur
e6e224f33c Better translation 2021-09-28 11:53:00 +02:00
Laurent Destailleur
0750d4bb6e Look and feel v14 2021-09-28 00:21:54 +02:00
Alexandre SPANGARO
43ed88f056 FIX Propal list - Problem of pagination on date 2021-09-27 23:02:19 +02:00
Laurent Destailleur
ec3154075a Comment 2021-09-27 22:16:08 +02:00
Laurent Destailleur
0e1cc2b096 Fix cost price is 0. 2021-09-27 18:46:27 +02:00
Marc de Lima Lucio
6abe6462e6 FIX: products/services card: hidden extrafields were overridden 2021-09-27 14:33:57 +02:00
Laurent Destailleur
b77cadf39a Fix filter 2021-09-27 11:38:34 +02:00
Laurent Destailleur
9b825df158 Clean code 2021-09-27 11:36:40 +02:00
Laurent Destailleur
c9ae46db50 FIX Filter on categories 2021-09-27 11:34:26 +02:00
Laurent Destailleur
6d92591358 Fix look and feel v15 2021-09-27 11:28:34 +02:00
Laurent Destailleur
d5d4b8d8e0 Fix escape the undescore on search in website module 2021-09-26 14:21:23 +02:00
Laurent Destailleur
cb964a3ab3 Fix cancel button 2021-09-26 13:55:19 +02:00
Laurent Destailleur
c02b5b08ea Fix trans 2021-09-26 12:58:34 +02:00
Laurent Destailleur
a47cd22450 Fix sql 2021-09-25 21:15:53 +02:00
Laurent Destailleur
567334318a Fix sql eventorganization 2021-09-25 21:13:55 +02:00
Alexandre SPANGARO
4e212054a4 Merge branch '14.0' into 14p16 2021-09-25 07:13:03 +02:00
Alexandre SPANGARO
8f5f657e4d FIX Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it 2021-09-25 07:12:33 +02:00
Laurent Destailleur
14728e385e Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-24 13:36:40 +02:00
Laurent Destailleur
a3c8f2ed56 Merge pull request #18771 from laudeco/hotfix/receipt_html
Allow to edit the header of receipt by using HTML
2021-09-24 13:33:08 +02:00
Laurent Destailleur
128bba1d9b Fix GETPOST 2021-09-24 13:29:03 +02:00
Laurent Destailleur
fd817ed015 Merge pull request #18800 from hregis/fix_wrong_request_sql
FIX check if greater 0
2021-09-24 13:10:24 +02:00
Laurent Destailleur
42a71e9303 Merge pull request #18812 from Hystepik/develop_v14#1
Fix #18809 : error on client tooltip
2021-09-24 13:10:00 +02:00
Laurent Destailleur
f85f81c2ee Merge pull request #18811 from aspangaro/14p20
FIX Accountancy - Option of export popup are inverted
2021-09-24 13:09:04 +02:00
Laurent Destailleur
dbf7a9a0d0 FIX payment using wrong type in takepos when too many payment mode 2021-09-24 11:48:43 +02:00
lmarcouiller
f88d12f55d Fix #18809 : error on client tooltip 2021-09-24 11:16:34 +02:00
Alexandre SPANGARO
3e485dcb41 FIX Accountancy - Option of export popup are inverted 2021-09-24 06:38:43 +02:00
Alexandre SPANGARO
15313b8d37 FIX Accountancy - Missing specific filename for export on format FEC2 2021-09-24 06:03:01 +02:00
Laurent Destailleur
cd46ccdb66 Code comment 2021-09-24 02:31:15 +02:00
Laurent Destailleur
b09c4166b3 Fix set position of lines in tasks of a project 2021-09-24 02:24:04 +02:00
Laurent Destailleur
3d22cbe4da Fix look and feel 2021-09-24 02:16:40 +02:00
Laurent Destailleur
4c80e0425b Fix date for tasks created during project creation 2021-09-24 02:10:42 +02:00
Laurent Destailleur
8fb5286260 FIX #18797 2021-09-24 02:02:12 +02:00
DevIntact
36a902167f Translation of event title for incoming email
Event title for incoming email is not translated while collected by cronjob. 
i.e : ActionAC_EMAIL_IN
2021-09-24 01:49:16 +02:00
Laurent Destailleur
a2a4a74964 Fix trans 2021-09-23 16:18:21 +02:00
Laurent Destailleur
3467faab6b Fix property 2021-09-23 03:20:15 +02:00
Laurent Destailleur
31d9eb192f Clean code 2021-09-23 02:51:36 +02:00
Laurent Destailleur
128f6d9a5c Fix combo box for thirdparties in invoice stats used bad component 2021-09-23 02:38:53 +02:00
Laurent Destailleur
51b6318f88 FIX Test when date of invoie is in future (pb with TZ and offset) 2021-09-23 02:14:01 +02:00
Laurent De Coninck
70e66627fe restrict the html 2021-09-22 20:14:47 +02:00
stickler-ci
2bd0fdd364 Fixing style errors. 2021-09-22 14:09:29 +00:00
Laurent Destailleur
87da490b58 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-22 15:26:35 +02:00
Laurent Destailleur
a20ae60e70 Merge pull request #18793 from hregis/fix_wrong_table_element_line
FIX init hookmanager after loading $conf values
2021-09-22 15:25:17 +02:00
Laurent Destailleur
6f9fc205ef Merge pull request #18796 from altairis-noe/warehouse_project_elements
FIX: add warehouse in projects' overview count
2021-09-22 15:24:05 +02:00
Noé Cendrier
066013c31f typo stickler 2021-09-22 15:15:39 +02:00
Laurent Destailleur
2824c8b8ab FIX support of localtax on expense report 2021-09-22 15:11:18 +02:00
Regis Houssin
144147c5d1 FIX check if greater 0 2021-09-22 14:58:03 +02:00
Regis Houssin
d91d14d10c FIX init hookmanager after loading $conf values 2021-09-22 12:48:05 +02:00
Laurent Destailleur
6c7c6c9efd FIX legal issue on expense report pdf (must also show price without tax) 2021-09-22 12:47:06 +02:00
kamel
9266b4e8fd FIX Button text on proposal card for create a invoice 2021-09-21 19:44:49 +02:00
Laurent Destailleur
b5d7a752f7 Merge pull request #18766 from ksar-ksar/patch-10
FIX #18735
2021-09-21 19:28:09 +02:00
Laurent Destailleur
f96ea0cba0 Merge pull request #18776 from OPEN-DSI/fix-invoice-supplier-selected-lines
FIX selected lines on supplier invoice create
2021-09-21 19:09:13 +02:00
Laurent Destailleur
b049b663b6 Merge pull request #18775 from bb2a/patch-1
# Fix # Users search erreur
2021-09-21 19:04:55 +02:00
Laurent Destailleur
e4c47e65c1 Merge pull request #18777 from ksar-ksar/patch-11
FIX #18767 : Adherent delete
2021-09-21 19:04:03 +02:00
Laurent Destailleur
04fb93370f Merge pull request #18780 from ksar-ksar/patch-12
Missing translations for Inventories
2021-09-21 17:53:53 +02:00
Noé Cendrier
c89468428e add warehouse in projects elements count 2021-09-21 17:22:55 +02:00
Laurent Destailleur
9ba7f019ea Fix css 2021-09-21 16:53:29 +02:00
Laurent Destailleur
76ee014b52 Fix add a hidden solution to fix a corrupted value for AWP. 2021-09-21 16:32:32 +02:00
Laurent Destailleur
a7ccbb4d9a css 2021-09-21 15:40:42 +02:00
Laurent Destailleur
841c4da0f8 Fix css 2021-09-21 15:39:05 +02:00
Laurent Destailleur
09fff2150e Fix: avoid to add line for event registration twice into invoice 2021-09-21 15:30:34 +02:00
Laurent Destailleur
e2c389a4a9 Fix delete invoice 2021-09-21 14:23:21 +02:00
Laurent Destailleur
b7105d572a Fix delete of invoice not complete (some fk_invoice still filled) 2021-09-21 14:20:01 +02:00
ksar
7a6a515386 Missing translations for Inventories 2021-09-21 12:18:37 +02:00
Laurent Destailleur
06f97f4f80 Look and feel v14 2021-09-21 12:04:28 +02:00
ksar
f2b39b3eeb FIX #18767 : Adherent delete
Adherent Delete was not working due to the fact that 
$features = 'adherent';
$feature2 = 'cotisation';
And $user->rights->$feature->$subfeature->supprimer does not exist

Also I used the double declaration of salaries.
2021-09-21 11:27:41 +02:00
lvessiller
991a7ffd43 FIX selected lines on supplier invoice create 2021-09-21 11:04:59 +02:00
Anthony Berton
35707d1f4f Update list.php 2021-09-21 09:13:01 +02:00
Laurent De Coninck
5e2d8eac2b Allow to edit the header of receipt by using HTML
In the current version the WYSIWYG oesn't allow any HTML by thus fix you
can use any button from the wysiwyg and it displays on the receipe.

[see: X]
2021-09-20 22:51:43 +02:00
Laurent Destailleur
9b828532cc Fix membership css 2021-09-20 16:41:22 +02:00
Laurent Destailleur
c75fbb7642 FIX fetch of product with modulebuilder load too much data 2021-09-20 16:00:11 +02:00
Laurent Destailleur
1e735c48aa Code comment 2021-09-20 15:31:57 +02:00
Laurent Destailleur
f1b8941e27 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-20 15:30:06 +02:00
Laurent Destailleur
45c5abea69 FIX calculateCosts of BOM must not be included into fetch 2021-09-20 15:29:55 +02:00
Laurent Destailleur
261c0fc908 Merge pull request #18761 from javieralapps4up/14.0
Fix: #18760 bad rights admin if advanced perms
2021-09-20 14:06:58 +02:00
Laurent Destailleur
b97ad33911 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-20 13:21:13 +02:00
Laurent Destailleur
0eff2fa15b FIX default language defined for IN country 2021-09-20 13:20:54 +02:00
Laurent Destailleur
be2a95ca51 Add language as_IN 2021-09-20 13:01:53 +02:00
javieralapps4up
0453a27bda Update main.inc.php 2021-09-20 12:24:44 +02:00
ksar
131677a5ea FIX #18735
File preview is not working
2021-09-20 11:50:10 +02:00
Laurent Destailleur
e433dabc64 Merge pull request #18762 from aspangaro/14p16
FIX #18698 Supplier invoice list - "alert" checkbox not working
2021-09-20 11:04:52 +02:00
Alexandre SPANGARO
ce56f52a30 FIX #18698 Supplier invoice list - "alert" checkbox not working 2021-09-20 03:28:30 +02:00
stickler-ci
1ea2182bf7 Fixing style errors. 2021-09-19 20:32:07 +00:00
javieralapps4up
77e493755f Fix: #18760 bad rights admin if advanced perms
Insufficient rights to view a group's card for admin users if advanced permissions are used
2021-09-19 22:26:49 +02:00
Laurent Destailleur
b5a27b4c15 css 2021-09-19 21:27:01 +02:00
Laurent Destailleur
25971e373d Fix css 2021-09-19 21:20:12 +02:00
Laurent Destailleur
6af9f3b142 Fix css 2021-09-19 21:18:30 +02:00
Laurent Destailleur
3dc3214047 CSS 2021-09-19 21:13:27 +02:00
Laurent Destailleur
ee362a42bd css 2021-09-19 21:06:09 +02:00
Laurent Destailleur
1f76165e46 Fix do not show link on objects for object with existing hard link field 2021-09-19 01:35:42 +02:00
Laurent Destailleur
2acb84b432 FIX unprivileged user can see task associated with a not allowed project 2021-09-19 01:30:39 +02:00
Laurent Destailleur
4faaa81277 Rename tool 2021-09-19 01:11:28 +02:00
Laurent Destailleur
facd6abec3 FIX user without permission can set ticket subject 2021-09-19 00:56:10 +02:00
Laurent Destailleur
052511d081 Fix sql error 2021-09-18 15:05:31 +02:00
Laurent Destailleur
0bf213acac Code comment 2021-09-18 13:25:12 +02:00
Laurent Destailleur
2810315dc5 Fix payment of registration of event 2021-09-18 13:19:29 +02:00
Laurent Destailleur
5fa62f25fa Fix registration of attendee 2021-09-18 12:39:26 +02:00
Laurent Destailleur
ceb368abd4 Fix message 2021-09-18 12:29:35 +02:00
Laurent Destailleur
0168a9860b Fix tooltip on website syntax disappear
Fix backard compatibility of getLabelStatus
2021-09-18 12:09:08 +02:00
Laurent Destailleur
dafc7d2617 Fix bad position of picto 2021-09-18 11:34:15 +02:00
Laurent Destailleur
ddcb4c149a css 2021-09-18 11:32:58 +02:00
Laurent Destailleur
0859438118 Show public and private note of attendee 2021-09-18 11:25:29 +02:00
Laurent Destailleur
0c67185dcf Add note on registration 2021-09-18 11:03:15 +02:00
Laurent Destailleur
675a30d500 Fix phpcs 2021-09-17 19:42:41 +02:00
Laurent Destailleur
3d9be1437a Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
	htdocs/compta/paiement/list.php
	htdocs/fourn/paiement/list.php
	htdocs/projet/tasks/time.php
2021-09-17 12:29:58 +02:00
Laurent Destailleur
b546f21ef4 Merge branch '12.0' of https://github.com/dolibarr/dolibarr into 13.0
Conflicts:
	htdocs/comm/action/class/actioncomm.class.php
2021-09-17 12:21:25 +02:00
Laurent Destailleur
505517d142 Merge pull request #18629 from Gjuju/12.0
Fix : GET extrafields on API "get events list" requests
2021-09-17 12:16:32 +02:00
Laurent Destailleur
58fd4ad92f Merge pull request #18641 from Gecka-Apps/14.0-fix-takepos-payment-methods
14.0 fix takepos payment methods
2021-09-17 12:15:35 +02:00
Laurent Destailleur
dff038fddd Merge pull request #18705 from aspangaro/14p19
FIX Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
2021-09-17 11:56:38 +02:00
Laurent Destailleur
b248d2f1cf Merge pull request #18709 from javieralapps4up/14.0
Fix #18707 date, account and payment type are lost when sorting by any field
2021-09-17 11:50:57 +02:00
Laurent Destailleur
c04604ea1c Merge pull request #18721 from fmarcet/13.0
Fix: On payment list, not filter by company when it is an external user
2021-09-17 11:48:54 +02:00
Laurent Destailleur
1c43a83a8b Merge pull request #18737 from marc-dll/12.0_FIX_projet_task_time_user_filter
FIX: task time: can't filter by user with pgsql + show error message
2021-09-17 11:31:45 +02:00
Lucas Marcouiller
20e8dd4c54 Fix error on html.for.class on ismultientitymanaged test
Conflicts:
	htdocs/core/class/html.form.class.php
2021-09-17 11:30:45 +02:00
stickler-ci
46e8f1bebf Fixing style errors. 2021-09-17 10:59:42 +02:00
antonin_tdj
5f19291285 Avoir Error 19 Constraint Violation (in case of password unchanged) 2021-09-17 10:59:35 +02:00
antonin_tdj
8f3ff32c82 fix ldap passw bug with activedirectory
Fix to avoid LDAP Error: 53 (Unwilling to perform) on Samba4 AD
2021-09-17 10:59:09 +02:00
Laurent Destailleur
20b50993bb Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-17 10:57:15 +02:00
Laurent Destailleur
d5d97e2d24 Merge pull request #18725 from aspangaro/14p16
FIX Accountancy - Some correction on export name
2021-09-17 10:52:48 +02:00
Marc de Lima Lucio
571d130c3c FIX: task time: keep on using natural_search 2021-09-17 10:51:37 +02:00
Laurent Destailleur
3a8a813c4e Merge pull request #18730 from esion-net/patch-2
NEW Expose bank account holder, label and number
2021-09-17 10:50:11 +02:00
Laurent Destailleur
bed697c98d Merge pull request #18732 from esion-net/patch-2
NEW Expose bank account holder, label and number
2021-09-17 10:49:51 +02:00
Laurent Destailleur
02bed7ce01 Fix sanitize 2021-09-17 10:45:59 +02:00
Laurent Destailleur
c052a50d75 Fix phpcs 2021-09-17 10:32:19 +02:00
Laurent Destailleur
8a67100a31 Fix phpcs 2021-09-17 10:31:28 +02:00
Laurent Destailleur
c559e5cc3e Fix missing label 2021-09-16 21:23:02 +02:00
Laurent Destailleur
bf173fdbf1 Debug module event organization 2021-09-16 21:19:16 +02:00
Laurent Destailleur
ae028baea1 Debug module event organization 2021-09-16 21:12:29 +02:00
Laurent Destailleur
0c0ef7b683 Debug module event organization 2021-09-16 20:56:14 +02:00
Laurent Destailleur
16331ce87b Better detection of company 2021-09-16 18:53:00 +02:00
Laurent Destailleur
bfe305dc47 Debug event organization module 2021-09-16 18:16:25 +02:00
Marc de Lima Lucio
88cd8fface FIX: task time: can't filter by user with pgsql + show error message 2021-09-16 17:53:47 +02:00
Laurent Destailleur
424ddcb218 Fix page of payment 2021-09-16 16:37:20 +02:00
Florian
3091448d1a Expose bank account holder, label and number
Useful for automated texts on invoices to have those values available as well.
2021-09-16 15:40:25 +02:00
Laurent Destailleur
5b07be0179 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/expedition/class/expedition.class.php
	htdocs/holiday/list.php
2021-09-16 13:33:49 +02:00
Laurent Destailleur
c68687bdf6 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/product/fournisseurs.php
2021-09-16 13:29:25 +02:00
Laurent Destailleur
87bb971d75 FIX autocalculation of the supplier price in main currency.
Conflicts:
	htdocs/product/fournisseurs.php
2021-09-16 13:22:22 +02:00
Laurent Destailleur
f26601e836 FIX autocalculation of the supplier price in main currency. 2021-09-16 13:17:00 +02:00
Laurent Destailleur
9918873719 Better log 2021-09-16 13:07:02 +02:00
Laurent Destailleur
3a04fc557b Fix email templates 2021-09-16 12:30:46 +02:00
Laurent Destailleur
0fc51b6564 Fix email content 2021-09-16 12:10:40 +02:00
Laurent Destailleur
b18e0e3d1e Add missing translation key 2021-09-16 12:04:46 +02:00
Alexandre SPANGARO
ed37f9fb7a FIX Accountancy - Some correction on export name 2021-09-16 06:40:43 +02:00
Laurent Destailleur
b18e25db87 Code comment 2021-09-16 03:13:44 +02:00
Laurent Destailleur
aab8d4a628 css 2021-09-16 02:24:25 +02:00
Laurent Destailleur
c907c6ed08 Fix trans 2021-09-16 02:19:08 +02:00
Laurent Destailleur
51d7622434 Fix trans 2021-09-16 02:18:00 +02:00
Laurent Destailleur
2b340579a1 Fix look 2021-09-15 21:12:16 +02:00
Laurent Destailleur
0ab399aa37 Fix try to find the thirdparty from contacts too. 2021-09-15 20:46:48 +02:00
Laurent Destailleur
f859967c24 Fix look and feel v14 2021-09-15 20:28:47 +02:00
Laurent Destailleur
db57aea163 Fix class does not exist 2021-09-15 20:05:37 +02:00
Laurent Destailleur
b1cb32c743 Fix some sql 2021-09-15 20:03:38 +02:00
Laurent Destailleur
5aaf8ff8f3 Fix sql 2021-09-15 19:58:55 +02:00
Laurent Destailleur
801bf83334 Css v14 2021-09-15 19:48:43 +02:00
Laurent Destailleur
eab4014f20 Rename url 2021-09-15 19:42:07 +02:00
Laurent Destailleur
29d9771b80 Code comment 2021-09-15 19:39:22 +02:00
Laurent Destailleur
4a2d3a55d4 FIX Selection of type "people" for membership must hide the company 2021-09-15 19:33:30 +02:00
Laurent Destailleur
3f7a75b0a3 FIX translation into email for member at membership validation. 2021-09-15 19:02:17 +02:00
Laurent Destailleur
599621cc1b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-09-15 13:29:55 +02:00
Laurent Destailleur
724badb522 Fix deletion of shipment when there is batch record 2021-09-15 13:29:19 +02:00
Ferran Marcet
7a637104b2 Fix: Not filter by company when it is an external user 2021-09-15 11:29:12 +02:00
Laurent Destailleur
3f2f6c3ed3 Fix online registration 2021-09-14 21:12:11 +02:00
Laurent Destailleur
81863e45f4 Fix link 2021-09-14 18:09:50 +02:00
Laurent Destailleur
6dbf316e66 Fix links 2021-09-14 17:56:06 +02:00
Laurent Destailleur
5f612dfd7c Trans 2021-09-14 17:38:17 +02:00
Laurent Destailleur
2d64c3e560 Fix filter 2021-09-14 17:35:54 +02:00
Laurent Destailleur
21462d0b82 Fix can reset filter in setup 2021-09-14 17:24:53 +02:00
Laurent Destailleur
aeead15a62 css 2021-09-14 17:07:29 +02:00
Laurent Destailleur
c7721563c5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-14 17:00:01 +02:00
Laurent Destailleur
f3fcb7a48a Fix insertion of email templates 2021-09-14 16:59:49 +02:00
javieralapps4up
e1203d115a Update list.php 2021-09-14 02:22:30 +02:00
javieralapps4up
0763846805 Bug: #18670 date, account and payment type are lost when sorting by any field
Filtereds $date, $search_account and $search_paymenttype are not saved when sorting by any field
2021-09-14 02:15:22 +02:00
Alexandre SPANGARO
eae4269745 Merge branch '14p19' of https://github.com/aspangaro/dolibarr into 14p19 2021-09-13 21:32:55 +02:00
Alexandre SPANGARO
42543ba005 Add alpha key 2021-09-13 21:29:31 +02:00
stickler-ci
6368ba9a6e Fixing style errors. 2021-09-13 19:21:53 +00:00
Alexandre SPANGARO
44f4f9e288 Merge branch '14.0' into 14p19 2021-09-13 21:13:26 +02:00
Alexandre SPANGARO
fe241cc71f FIX Accountancy - Format Quadra export - Missing line type C (act account) 2021-09-13 21:12:39 +02:00
Laurent Destailleur
7420e6ab9a Merge pull request #18693 from FHenry/14_fix_ldap_limit
fix: User class fetch method if LDAP Search LIMIT must be after ORDER BY
2021-09-13 17:04:43 +02:00
Julien Gainza
65c4a21898 FIX move fetch_optionnal into $ac_static->fetch() 2021-09-13 16:35:13 +02:00
Laurent Destailleur
1ec9d08557 Merge pull request #18701 from aspangaro/14p18
FIX Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
2021-09-13 16:33:43 +02:00
Laurent Destailleur
41f627b80d Prepare 14.0.3 2021-09-13 16:33:16 +02:00
Alexandre SPANGARO
d7236fad99 Merge branch '14.0' into 14p18 2021-09-13 14:51:17 +02:00
Alexandre SPANGARO
3ee258fefc FIX Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50) 2021-09-13 14:08:41 +02:00
Florian HENRY
d464922d71 fix: LDAP Search LIMIT must be after ORDER BY 2021-09-13 09:44:54 +02:00
Laurent Destailleur
ce9a10bd90 Fix description of some options 2021-09-13 03:43:25 +02:00
Laurent Destailleur
3ea617ef68 Fix missing trans 2021-09-13 03:07:57 +02:00
Laurent Destailleur
5869975ed1 Fix phpcs 2021-09-13 02:59:09 +02:00
Laurent Destailleur
900af89827 Fix filename 2021-09-13 02:47:27 +02:00
Laurent Destailleur
63767b1e31 Fix compression if buildzip is provided must be in zip format. 2021-09-13 02:42:55 +02:00
Laurent Destailleur
5756f0cfdf Fix code syntax 2021-09-13 01:36:18 +02:00
Laurent Destailleur
201e46f34b Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-13 01:18:37 +02:00
Laurent Destailleur
7efd810d57 Clean code 2021-09-13 01:18:24 +02:00
Laurent Destailleur
669213a6db Merge pull request #18685 from frederic34/patch-1
doxygen
2021-09-13 01:03:13 +02:00
Laurent Destailleur
6353987b15 css 2021-09-12 02:04:02 +02:00
Laurent Destailleur
ce33f39bb0 Clean code. Menu must be greyed in get_menudiv 2021-09-11 15:43:26 +02:00
Frédéric FRANCE
5658c7daea doxygen 2021-09-11 09:49:01 +02:00
Laurent Destailleur
c005a20cc0 Fix ldap with ssl 2021-09-11 03:27:59 +02:00
Laurent Destailleur
fd696f8c28 Prepare 14.0.2 2021-09-10 20:59:07 +02:00
Laurent Destailleur
9dcf3e49d0 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/class/extrafields.class.php
2021-09-10 20:50:34 +02:00
Laurent Destailleur
2f4463c983 FIX Collapsing of extrafields has disappeared. 2021-09-10 20:49:22 +02:00
Laurent Destailleur
5d512243b8 Merge pull request #18683 from FHenry/14_fix_search_evt_tab
fix: on Event tabs, if no evt type use in filter, filter on label and state not apply
2021-09-10 19:57:12 +02:00
Laurent Destailleur
3980e4a32b Merge pull request #18681 from FHenry/14_fix_extrafield_separator_type
fix: show display/hide icon on extrafield type separator
2021-09-10 19:49:26 +02:00
Laurent Destailleur
d50c518b70 Merge pull request #18676 from FHenry/14_fix_ajax_company_ambious_column
fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken
2021-09-10 19:49:12 +02:00
Laurent Destailleur
78ec200c73 Merge pull request #18679 from FHenry/14_fix_cat_icon_perms
fix: do not display icon to edit/delete tags if user not authorize
2021-09-10 19:45:23 +02:00
Laurent Destailleur
fe92c2605d Fix look and feel v14 2021-09-10 17:45:27 +02:00
Laurent Destailleur
75cd63a29b Fix css and missing test 2021-09-10 17:39:58 +02:00
Florian HENRY
257686c2fe fix: on Event tabs, if no evt type use in filter, filter on label and state not apply 2021-09-10 15:45:03 +02:00
Florian HENRY
f3a555ec69 fix: show display/hide icon on extrafield type separator 2021-09-10 15:17:09 +02:00
Florian HENRY
962bda810c Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_fix_cat_icon_perms 2021-09-10 15:00:54 +02:00
Christian Foellmann
29820f446d fix import of product desc without wrong linebreaks 2021-09-10 13:37:42 +02:00
Florian HENRY
ef888d5fca Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_fix_ajax_company_ambious_column 2021-09-10 13:26:05 +02:00
Florian HENRY
c66181a00e fix: when COMPANY_SHOW_ADDRESS_SELECTLIST is 1 ajax call to company.php is broken 2021-09-10 13:25:40 +02:00
Juanjo Menent
1eb4975a76 fix: Bad date creation for project clone 2021-09-10 11:44:58 +02:00
Laurent Destailleur
4939cc9911 Fix trans 2021-09-10 11:04:59 +02:00
Laurent Destailleur
7526cb3b8b Fix VAT rate label and add Mali default vat rate 2021-09-10 09:44:06 +02:00
Laurent Destailleur
77247ec43a Add date valid/approval 2021-09-09 20:35:57 +02:00
Laurent Destailleur
f4786c8a0a Include ref into label of log history
Conflicts:
	htdocs/holiday/card.php
2021-09-09 19:50:39 +02:00
Laurent Destailleur
6465e8aa36 Include ref into label of log history 2021-09-09 19:47:51 +02:00
Laurent Destailleur
b8b5b97d78 Code comment 2021-09-09 19:47:15 +02:00
Laurent Destailleur
520ce4c3ac Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 19:21:45 +02:00
Laurent Destailleur
ffd7f60830 FIX #18589 #18617 2021-09-09 19:21:32 +02:00
Laurent Destailleur
647fa49202 Merge pull request #18667 from lainwir3d/fix_order_shipment_list_duplicates
FIX #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
2021-09-09 18:59:28 +02:00
lainwir3d
63abe2f1ff FIX #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary. 2021-09-09 19:56:28 +04:00
Florian HENRY
45ad23206a fix: do not display icon to edit/delete tags if not perms 2021-09-09 17:41:40 +02:00
Laurent Destailleur
a80950b96d Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 16:06:28 +02:00
Laurent Destailleur
5406e3d34e Fix phpcs 2021-09-09 16:06:16 +02:00
Laurent Destailleur
de005f5cd2 Merge pull request #18661 from Hystepik/develop_v14#4
Fix #18660 : fix rights of supplier order with API
2021-09-09 15:18:17 +02:00
Laurent Destailleur
5d5b7c3af4 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/comm/action/peruser.php
	htdocs/main.inc.php
2021-09-09 15:15:26 +02:00
Laurent Destailleur
30894b989c Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-09-09 15:12:16 +02:00
Laurent Destailleur
70f22f2648 # WARNING: head commit changed in the meantime
Merge
2021-09-09 15:12:02 +02:00
Laurent Destailleur
654bf4d672 Fix name of index #18623 2021-09-09 15:07:55 +02:00
Laurent Destailleur
4d5621ea6f Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 14:59:12 +02:00
Laurent Destailleur
f1758b6f0c Merge pull request #18623 from atm-gauthier/14.0_fix_salary_extrafields
14.0 fix salary extrafields are no more available
2021-09-09 14:58:54 +02:00
Laurent Destailleur
1a8364adcc Merge pull request #18637 from hregis/fix_multicompany
FIX multicompany transverse mode compatibility
2021-09-09 14:50:22 +02:00
lmarcouiller
4928d03c4f update to have modify ! to empty() 2021-09-09 14:44:17 +02:00
fr69400
ad0c4c518f Update row.php
right write doesn't exist for supplier_proposal

->line order dont works
2021-09-09 14:42:43 +02:00
lmarcouiller
8af6b8679e update with fournisseur && supplier_order 2021-09-09 14:40:39 +02:00
Laurent Destailleur
70eed40146 Merge pull request #18659 from Hystepik/develop_v14#3
Fix : reception list sql error
2021-09-09 14:17:10 +02:00
lmarcouiller
022f3e640d Fix #18660 : fix rights of supplier order with API 2021-09-09 13:28:30 +02:00
lmarcouiller
d451703bbf Fix : reception list sql error 2021-09-09 11:21:34 +02:00
Regis Houssin
303b0e7f31 FIX better sql request 2021-09-09 09:21:30 +02:00
Laurent Destailleur
e5b71a1a89 Merge pull request #18598 from henrynopo/patch-2
Increase the width of column for General Set-ups - Update dolibarr.php
2021-09-09 05:12:06 +02:00
Laurent Destailleur
de97b248f2 Update dolibarr.php 2021-09-09 05:11:56 +02:00
Laurent Destailleur
ea9a07fb3d Update dolibarr.php 2021-09-09 05:11:31 +02:00
Laurent Destailleur
a4d897f609 Merge pull request #18625 from jyhere/patch-1
Fix : unable to create a direct debit if ics_transfer is empty
2021-09-09 05:04:06 +02:00
Laurent Destailleur
adf4c94f45 Merge pull request #18631 from hregis/fix_maxlength_of_input
FIX increase maxlength of password input
2021-09-09 05:00:03 +02:00
Laurent Destailleur
9fe9d0e9bf Merge pull request #18630 from hregis/fix_wrong_table_element_line
FIX wrong table_element_line
2021-09-09 04:59:27 +02:00
Laurent Destailleur
3c215730db Merge pull request #18639 from Hystepik/develop_v14#1
Fix #18633 : fix error message
2021-09-09 04:56:54 +02:00
Laurent Destailleur
77b8d91895 Update 13.0.0-14.0.0.sql 2021-09-09 04:56:25 +02:00
Laurent Destailleur
ac8dfb2dd5 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-09 04:41:55 +02:00
Laurent Destailleur
d42492c67b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/class/dolreceiptprinter.class.php
2021-09-09 04:41:39 +02:00
Laurent Destailleur
e20e80fae3 Merge pull request #18646 from ksar-ksar/patch-8
FIX #18591 : Remove double quotes of SQL Queries
2021-09-09 04:36:48 +02:00
Laurent Destailleur
6d7cb01951 Merge pull request #18645 from atm-adrien/FIX_add_token
FIX : Add token to remove error when removing widget
2021-09-09 04:31:03 +02:00
Laurent Destailleur
e4a7903700 Merge pull request #18657 from moreauftheobald/14.0_fiix_knowledgemanagement_menu
Fix: Enable Knowledge Management Menu
2021-09-09 03:23:26 +02:00
Laurent Destailleur
61d5152209 Update eldy.lib.php 2021-09-09 03:23:04 +02:00
Laurent Destailleur
0146153792 Merge pull request #18650 from aspangaro/14p18
css
2021-09-09 03:02:54 +02:00
Laurent Destailleur
348fe00ffb Merge pull request #18653 from Hystepik/develop_v14#2
Fix permission for salaries module
2021-09-09 03:02:34 +02:00
Laurent Destailleur
b87ac639fd Update card.php 2021-09-09 03:02:18 +02:00
Laurent Destailleur
89ed156d7e Complete getOutstandingBills() 2021-09-09 02:18:50 +02:00
Laurent Destailleur
39dd1e2dd1 Code comment 2021-09-09 02:00:07 +02:00
Laurent Destailleur
30856d5b18 FIX Relative discount with high nb of decimals 2021-09-08 22:09:02 +02:00
Laurent Destailleur
4705d41ed2 FIX Relative discount with high nb of decimals 2021-09-08 22:00:16 +02:00
Laurent Destailleur
8326ecee78 Fix phpcs 2021-09-08 21:19:40 +02:00
Laurent Destailleur
e0fa4e4b5c Fix phpcs 2021-09-08 21:19:01 +02:00
MOREAU FRANCK
04026dd0b0 fix Stickler CI review 2021-09-08 19:51:34 +02:00
Laurent Destailleur
57a2ea3a53 Fix sql error 2021-09-08 19:49:24 +02:00
MOREAU FRANCK
e9505c1109 Update V14 2021-09-08 18:23:44 +02:00
lmarcouiller
a5e670291e Fix permission for salaries module 2021-09-08 15:36:51 +02:00
Regis Houssin
8c95ada9fd FIX wrong users count in multicompany transverse mode 2021-09-08 10:25:27 +02:00
Alexandre SPANGARO
6c118b4dfb css 2021-09-08 04:31:38 +02:00
Laurent Destailleur
0b68da4e9e Debug organizedeventregistration module 2021-09-08 02:27:52 +02:00
Laurent Destailleur
f5903c9b02 Debug organizedeventregistration module 2021-09-08 02:17:00 +02:00
Laurent Destailleur
880ac07661 Debug organizedeventregistration module 2021-09-08 01:41:59 +02:00
Laurent Destailleur
b92784c04b Fix autoselect of thirdparty 2021-09-07 23:38:33 +02:00
Laurent Destailleur
3cc888f4df Debug event module 2021-09-07 23:19:36 +02:00
Laurent Destailleur
07d48e627e Debug event organization module 2021-09-07 23:19:16 +02:00
Laurent Destailleur
83ec43a2ee css 2021-09-07 17:44:57 +02:00
Laurent Destailleur
0edf2f344b Fix sql 2021-09-07 17:38:46 +02:00
ksar
e26e6288c2 FIX #18591 : Remove double quotes of SQL Queries
FIX #18591 : Remove double quotes of SQL Queries for postgresql compatibility
2021-09-07 15:22:02 +02:00
Adrien Raze
5f58eefc79 Merge branch '14.0' of https://github.com/Dolibarr/dolibarr into FIX_add_token 2021-09-07 14:48:23 +02:00
Adrien Raze
948d2bc4e9 FIX : Add token when remove the last widget on home page 2021-09-07 14:43:37 +02:00
Laurent Dinclaux
c8af143468 Fix coding standards 2021-09-07 23:27:31 +11:00
lmarcouiller
f3babd2819 Fix #18633 : fix error message 2021-09-07 13:59:36 +02:00
Laurent Dinclaux
807b4bf93e Fix cash payment in some cases. Make pay requests language independant and rely on payment method code. 2021-09-07 22:42:17 +11:00
Laurent Dinclaux
a39f469a50 Only check takepos configuration if a terminal is choosen, to prevent error message 2021-09-07 22:31:09 +11:00
Regis Houssin
52419f28c5 FIX add DISTINCT 2021-09-07 12:38:15 +02:00
Regis Houssin
4aaaa8e21a FIX multicompany transverse mode compatibility 2021-09-07 12:10:35 +02:00
Laurent Destailleur
02f21d478a Fix trans 2021-09-06 19:06:46 +02:00
Laurent Destailleur
51a751f088 Fix option MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT 2021-09-06 19:00:01 +02:00
Laurent Destailleur
f5f0b9debc Fix label for selection 2021-09-06 18:41:04 +02:00
Laurent Destailleur
e77d7d22a8 Trans 2021-09-06 18:34:18 +02:00
Laurent Destailleur
70d52aca1d Trans 2021-09-06 17:42:17 +02:00
Regis Houssin
7d8023fea7 FIX wrong table_element_line 2021-09-06 16:21:30 +02:00
Julien Gainza
9d89e48d15 Fix : Add extrafields on API "get events list" 2021-09-06 15:55:33 +02:00
stickler-ci
3537f68c7e Fixing style errors. 2021-09-06 13:24:22 +00:00
jyhere
18da6e6d6f Update create.php
Fix : unable to create a direct debit if ics and ics_transfer are empty even though ics_transfer is only used for bank transfer.
2021-09-06 15:20:47 +02:00
stickler-ci
1043bc964d Fixing style errors. 2021-09-06 12:58:06 +00:00
Gauthier PC portable 024
383c92f6c6 FIX : migration script 2021-09-06 14:52:11 +02:00
Laurent Destailleur
a57e8a14b8 Fix look and feel v14 2021-09-06 12:56:33 +02:00
Laurent Destailleur
38bd5e0902 Fix trans 2021-09-06 12:51:40 +02:00
Gauthier PC portable 024
be1c08ddfe FIX : salary extrafields don't work and table is not well named 2021-09-06 12:30:39 +02:00
Laurent Destailleur
b782e5986a Fix css 2021-09-06 03:29:46 +02:00
Laurent Destailleur
e4767e91ea Fix css 2021-09-06 03:26:43 +02:00
Laurent Destailleur
5850b68f79 Fix css 2021-09-06 03:22:06 +02:00
Regis Houssin
1c97393a69 FIX increase maxlength of password input 2021-09-05 15:35:06 +02:00
Laurent Destailleur
b58684af98 Fix trans 2021-09-05 14:31:33 +02:00
Laurent Destailleur
68bc85124b Merge pull request #18601 from frederic34/patch-8
fix #17634
2021-09-05 01:07:46 +02:00
Laurent Destailleur
5b9a583005 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-09-04 13:53:46 +02:00
Laurent Destailleur
4e7549ab7d css 2021-09-04 13:53:31 +02:00
Frédéric FRANCE
456f25d57e fix #17634 2021-09-04 11:30:03 +02:00
Henry
b13fc30a0a Update dolibarr.php 2021-09-04 12:25:40 +08:00
Laurent Destailleur
87b33c09e0 Merge pull request #18595 from FHenry/14_eventorg
NEW : Can register an attendees on project global (and also on conférence)
2021-09-03 20:50:21 +02:00
Laurent Destailleur
2e3b6b2fc8 Backport sql injection fix from develop 2021-09-03 18:00:28 +02:00
Florian HENRY
628c715878 ok for prod 2021-09-03 16:39:10 +02:00
Florian HENRY
96f9f8ae98 work on event 2021-09-03 15:40:33 +02:00
Laurent Destailleur
531037ddb6 Prepare 14.0.2 2021-09-03 11:04:49 +02:00
Laurent Destailleur
35e5480f2f Fix var init 2021-09-03 10:58:43 +02:00
henrynopo
4c1d857991 Update remx.php 2021-09-02 19:36:48 +02:00
henrynopo
6e5258f482 Update stocks.lang 2021-09-02 19:26:32 +02:00
Laurent Destailleur
9ec5470adf Merge pull request #18583 from ksar-ksar/patch-7
FIX #18565
2021-09-02 17:36:07 +02:00
ksar
260049c917 FIX #18565 2021-09-02 17:15:57 +02:00
Laurent Destailleur
7758c0b8a7 Fix phpcs 2021-09-02 16:06:19 +02:00
Laurent Destailleur
e22bd5c048 Fix better format address for jp in romaji 2021-09-02 10:39:56 +02:00
Laurent Destailleur
8193e792b5 Fix responsive 2021-09-01 22:39:01 +02:00
Laurent Destailleur
076bfd82a3 FIX option "Default value for field 'Refuse bulk emailings'" 2021-09-01 22:38:47 +02:00
Laurent Destailleur
03cfea2504 Fix const setup 2021-09-01 19:06:58 +02:00
Laurent Destailleur
7c7e89cc3b Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
2021-09-01 18:41:44 +02:00
Laurent Destailleur
831a66465f Fix trans 2021-09-01 18:28:21 +02:00
Christian Foellmann
f391b11da7 fix product nature on create 2021-09-01 18:23:38 +02:00
Laurent Destailleur
82d99bfa01 Merge pull request #18546 from lainwir3d/fix_restapi_order_mail_substitutes
FIX #18544 Shipment rest api: load thirdparty object when validating
2021-09-01 18:19:11 +02:00
Laurent Destailleur
f0a68d728a Merge pull request #18548 from henrynopo/patch-17
Fix error of SUPPLIER_INVOICE_ALLOW_REUSE_OF_CREDIT_WHEN_PARTIALLY_REFUNDED
2021-09-01 18:17:37 +02:00
Laurent Destailleur
7e8ce82e0a Merge pull request #18543 from lainwir3d/fix_restapi_global_user_variable
FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user
2021-09-01 18:05:40 +02:00
Laurent Destailleur
0f325bdd65 Update api_access.class.php 2021-09-01 18:05:24 +02:00
Laurent Destailleur
82d878dd7a Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php
2021-09-01 17:59:07 +02:00
Laurent Destailleur
74f3b98ea9 Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0
Conflicts:
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
2021-09-01 17:54:21 +02:00
Laurent Destailleur
3e4d7dfaba Fix $_SERVER["PHP_SEFL"] into $_SERVER["PHP_SELF"] 2021-09-01 17:44:54 +02:00
Laurent Destailleur
443827ff42 FIX #18531 2021-09-01 17:10:26 +02:00
Laurent Destailleur
b66bd781a4 Clean code 2021-09-01 16:26:59 +02:00
Vincent Dieltiens
2bad48bdcc FournisseurCommandDispatch extends CommonObjectLine instead of CommonObject 2021-09-01 16:25:29 +02:00
Laurent Destailleur
1027f1059e Merge pull request #18574 from FHenry/14_eventorg
fix: disabled module Event Org when project disabled
2021-09-01 16:17:55 +02:00
Laurent Destailleur
14ca7db5d7 Typo in log 2021-09-01 16:17:31 +02:00
Vincent Dieltiens
59e917cd5f regroup BILL_SUPPLIER_VALIDATE actions
Conflicts:
	htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php
2021-09-01 16:14:44 +02:00
Vincent Dieltiens
65ccbb6249 Regroup BILL_SUPPLIER_VALIDATE triggers under the same condition 2021-09-01 16:06:36 +02:00
Florian HENRY
bb6dda087c Merge branch '14.0' of github.com:Dolibarr/dolibarr into 14_eventorg 2021-09-01 15:23:04 +02:00
Florian HENRY
bae73b9a52 disabled module on inactive 2021-09-01 15:16:11 +02:00
Laurent Destailleur
375557e092 FIX Menu List of project was not visible. 2021-09-01 15:10:02 +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
Laurent Destailleur
fb0bd41178 Fix trans 2021-09-01 13:02:36 +02:00
Laurent Destailleur
bcd835ddbd Fix tooltips 2021-09-01 12:34:59 +02:00
Laurent Destailleur
a48473ba7a Missing trans exclude 2021-09-01 12:22:44 +02:00
Laurent Destailleur
da8dcaa0c9 Fix look and feel v14 2021-09-01 12:15:23 +02:00
Laurent Destailleur
dad4c34ec5 Debug module conference or booth 2021-08-31 23:51:45 +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
c7444865a1 Fix css 2021-08-31 13:16:37 +02:00
Laurent Destailleur
bbf219fd7b FIX Export of website generates a package that contains a sql error 2021-08-31 13:09:52 +02:00
Laurent Destailleur
b29fc5552d Fix id in link 2021-08-30 22:10:26 +02:00
Laurent Destailleur
60832c6e87 css 2021-08-30 21:48:46 +02:00
Laurent Destailleur
426894f6a6 Fix not null column 2021-08-30 21:44:09 +02:00
Laurent Destailleur
8639956b79 Fix position of information on lines of documents 2021-08-30 21:22:00 +02:00
Laurent Destailleur
3e443e9146 Fix partnership module 2021-08-30 19:47:44 +02:00
Laurent Destailleur
5549186e3a Fix link 2021-08-30 19:28:49 +02:00
Laurent Destailleur
7c9909ee12 Fix label of list of members 2021-08-30 19:21:52 +02:00
Laurent Destailleur
d9bfd72c29 Fix missing login in tooltip 2021-08-30 19:13:02 +02:00
Laurent Destailleur
d1ef4bdbd1 Fix missing login in tooltip 2021-08-30 19:10:43 +02:00
Laurent Destailleur
18e7a5efa9 Trans 2021-08-30 19:00:15 +02:00
Laurent Destailleur
3c029d0ccf Fix sort on company on member list. 2021-08-30 18:57:41 +02:00
Laurent Destailleur
b78771f8c4 Fix select empty value for thirdparties select combo 2021-08-30 18:56:52 +02:00
Laurent Destailleur
9db5f85d4e Fix responsive 2021-08-30 18:42:41 +02:00
Laurent Destailleur
9c3ba22b02 Fix label of company of a thirdparty 2021-08-30 18:38:31 +02:00
henrynopo
3240a3652d Update card.php 2021-08-30 15:34:59 +08:00
henrynopo
7bf6daaca7 Update card.php 2021-08-30 15:33:26 +08:00
stickler-ci
01a44760a8 Fixing style errors. 2021-08-29 20:14:19 +00:00
lainwir3d
4381f67a64 FIX #18544 Shipment REST API: load thirdparty object into the shipment before validating. 2021-08-30 00:08:43 +04:00
lainwir3d
359dae6af8 FIX #18542 REST API: set global $user variable to DolibarrApiAccess::user. 2021-08-29 23:13:41 +04:00
Laurent Destailleur
74ad0586a9 Fix disabled 2021-08-29 20:42:14 +02:00
Laurent Destailleur
47b96e07b7 Fix init 2021-08-29 20:36:54 +02:00
Laurent Destailleur
daf32e9f14 Fix modules disabled in demo must remains disabled 2021-08-29 20:36:08 +02:00
Laurent Destailleur
81a8efd856 Restore error message 2021-08-28 20:14:23 +02:00
Laurent Destailleur
8870662200 Merge pull request #18475 from OPEN-DSI/v14-fix-invoice-fetch-not-found-syslog-level
FIX invoice fetch not found syslog debug level instead of error
2021-08-28 20:12:45 +02:00
Laurent Destailleur
feb2e71f0c Fix regression 2021-08-28 18:59:12 +02:00
Laurent Destailleur
8ab9c96b7e Fix 0 insert instead of null 2021-08-28 18:56:48 +02:00
Laurent Destailleur
e71ff148ba Fix phpcs 2021-08-28 18:42:26 +02:00
Laurent Destailleur
6afe9c88f6 Merge pull request #18491 from daraelmin/patch-3
Fix : conditiion always wrong when on following link
2021-08-28 18:21:37 +02:00
Laurent Destailleur
1c1caaccde Update member.php 2021-08-28 18:21:23 +02:00
Laurent Destailleur
3ce5674b76 Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-28 18:01:06 +02:00
Laurent Destailleur
978511e127 Update fournisseur.facture.class.php
Conflicts:
	htdocs/fourn/class/fournisseur.facture.class.php
2021-08-28 17:59:45 +02:00
LVSInformatique
4f45228e7b Update list.php 2021-08-28 17:44:26 +02:00
Laurent Destailleur
881d176996 css 2021-08-28 17:30:53 +02:00
Laurent Destailleur
bb94ea7334 Fix debug car reception: Fill/reset link, colspan, translation 2021-08-28 17:24:05 +02:00
Laurent Destailleur
4c39816ce6 Merge pull request #18510 from henrynopo/patch-9
Fix - edit shipment Qty both predefined product while batch and stock are not enabled
2021-08-28 16:36:05 +02:00
stickler-ci
e60cf96c8e Fixing style errors. 2021-08-28 14:35:01 +00:00
Laurent Destailleur
31ca781236 Update card.php 2021-08-28 16:34:38 +02:00
stickler-ci
2ddebc123a Fixing style errors. 2021-08-28 14:32:44 +00:00
Laurent Destailleur
faf1d52d91 Update card.php 2021-08-28 16:32:22 +02:00
lmarcouiller
c509e3bc43 FIx error 500 on restler api PHP 8.0 2021-08-28 14:53:59 +02:00
Laurent Destailleur
12ce4bf7af Merge pull request #18522 from Hystepik/develop_v13#1
Fix #18519 : Modulebuilder api permission
2021-08-28 14:39:13 +02:00
Laurent Destailleur
45515fa8b2 fix css 2021-08-28 14:28:50 +02:00
Laurent Destailleur
20d0b0c564 Fix link in some tooltips 2021-08-28 13:56:59 +02:00
Laurent Destailleur
1fec53e7f2 Fix generate the phpunit file from modulebuilder 2021-08-28 13:37:35 +02:00
Laurent Destailleur
7001388159 Fix warning event late on tab Resources 2021-08-28 05:40:14 +02:00
Laurent Destailleur
64c4e25c02 Fix warning 2021-08-28 05:40:07 +02:00
Laurent Destailleur
acf0386a9b Fix css 2021-08-28 03:14:48 +02:00
lmarcouiller
ce7a301896 Fix #18519 : Modulebuilder api permission 2021-08-27 11:48:56 +02:00
Laurent Destailleur
c6c87cd813 Fix duplicated code and missing declaration 2021-08-26 21:37:00 +02:00
Laurent Destailleur
ac55a052b2 Fix warning abuot external users shown only if appropriate 2021-08-26 12:41:37 +02:00
Laurent Destailleur
931f712c5f Fix import gender man/woman, not 0/1 + import of thirdparty for members 2021-08-26 11:55:22 +02:00
henrynopo
a0c9cf2d8d Update card.php 2021-08-26 12:31:20 +08:00
Laurent Destailleur
65629711d0 FIX #18484 2021-08-25 14:53:14 +02:00
Laurent Destailleur
d022b3b0a1 FIx #18481 2021-08-25 12:24:13 +02:00
daraelmin
701b43d917 Add MEMBER_ALLOW_CHANGE_OF_TYPE in admin panel 2021-08-25 09:01:30 +02:00
daraelmin
29f98041e6 conditiion always wrong when on following link 2021-08-25 08:48:42 +02:00
Laurent Destailleur
5b7fb9a4bb Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-24 16:36:39 +02:00
Laurent Destailleur
ba594b20e0 Fix phpcs 2021-08-24 16:36:27 +02:00
lvessiller
a4a44faa7f FIX change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done) 2021-08-24 16:21:55 +02:00
Laurent Destailleur
1c665c34cd Merge pull request #18485 from fappels/14_fix_supplier_order_card
Fix warning on supplier order card when reception enabled.
2021-08-24 15:31:05 +02:00
Laurent Destailleur
8aa262f302 Merge pull request #18453 from aspangaro/14p15
FIX #18353 Invoice list translation issue
2021-08-24 15:29:32 +02:00
Laurent Destailleur
a9b0c4ebc5 Merge pull request #18455 from aspangaro/14p10
FIX #18375 SQL Error on tasks statistics
2021-08-24 15:16:06 +02:00
Laurent Destailleur
2d870d0f81 Merge branch '14.0' into 14p10 2021-08-24 15:15:38 +02:00
henrynopo
73c0471ead Fix error of supplier invoice (variable amount)
This update fixed the coding error for addline of deposit invoice for variable amount.

In addition, there is no invoice template for supplier invoice, so I also corrected the respective description.
2021-08-24 15:12:15 +02:00
Laurent Destailleur
15da97f1da Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/accountancy/journal/expensereportsjournal.php
	htdocs/accountancy/journal/purchasesjournal.php
	htdocs/accountancy/journal/sellsjournal.php
	htdocs/compta/facture/card.php
	htdocs/product/price.php
2021-08-24 15:05:14 +02:00
Laurent Destailleur
591059847e Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 13.0
Conflicts:
	htdocs/product/price.php
2021-08-24 15:00:35 +02:00
Laurent Destailleur
67baa48c16 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/fourn/facture/list.php
2021-08-24 14:56:13 +02:00
Laurent Destailleur
6fa5930e8d Fix label must not be translated 2021-08-24 14:54:46 +02:00
Laurent Destailleur
b10f75932f Merge pull request #18466 from aspangaro/14p16
FIX Supplier invoice list - Wrong language key used
2021-08-24 14:51:46 +02:00
Laurent Destailleur
8b2c82dd23 Fix position of fields 2021-08-24 14:27:18 +02:00
Alexandre SPANGARO
efb78d7431 FIX Invoice list - Wrong name for column total_tva 2021-08-24 14:22:36 +02:00
Alexandre SPANGARO
7b829bc899 FIX Field already present in SQL request 2021-08-24 14:22:21 +02:00
Laurent Destailleur
b28180d759 Merge pull request #18471 from aspangaro/12p19
FIX Accountancy - Some problems of length with general & subledger ac…
2021-08-24 14:19:16 +02:00
Laurent Destailleur
9816dff00a Merge pull request #18480 from henrynopo/patch-11
Fix - Supplier deposit invoice - auto convert to discount (error)
2021-08-24 14:09:39 +02:00
Laurent Destailleur
c6774505d8 FIX #18465 2021-08-24 14:05:02 +02:00
henrynopo
3c1bdd163f Update paiementfourn.class.php 2021-08-24 18:34:34 +08:00
Francis Appels
edeaa6009f Fix warning on supplier order card when reception enabled. 2021-08-24 10:48:26 +02:00
lvessiller
4efe2a0e09 FIX invoice fetch not found syslog debug level instead of error 2021-08-24 08:20:40 +02:00
Laurent Destailleur
a6ddc90d5b Fix responsive 2021-08-23 23:53:58 +02:00
Laurent Destailleur
7af023665f Clean var not defined 2021-08-23 19:37:11 +02:00
Laurent Destailleur
8485fee5f9 Cast numeric into on sql request 2021-08-23 19:33:24 +02:00
Laurent Destailleur
23829ae637 Cast numeric into on sql request 2021-08-23 18:56:46 +02:00
Laurent Destailleur
6d5329bbf8 Fix phpunit 2021-08-23 17:45:16 +02:00
Laurent Destailleur
d4b5ee6c85 Fix cast into variable into sql request. 2021-08-23 17:41:11 +02:00
Laurent Destailleur
edb239837c FIX #yogosha6944 Protection against traversal path. 2021-08-23 16:03:34 +02:00
Laurent Destailleur
cd141373fb Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-23 16:00:10 +02:00
Laurent Destailleur
d46dfd017a FIX #yogosha6944 Protection against traversal path. 2021-08-23 16:00:03 +02:00
Laurent Destailleur
fc6a0dfcaa FIX #yogosha6944 Protection against traversal path. 2021-08-23 15:47:18 +02:00
Laurent Destailleur
21852bd16b Show link to invoices on member record 2021-08-23 15:25:41 +02:00
Alexandre SPANGARO
a0378549b8 FIX Accountancy - Some problems of length with general & subledger account 2021-08-23 15:19:27 +02:00
Laurent Destailleur
5f16de8150 Code comment 2021-08-23 15:08:29 +02:00
Laurent Destailleur
a25346e302 FIX Date of payment of subscription must not be set to 1970-01-01.
Fix look and feel v14
2021-08-23 15:00:29 +02:00
Laurent Destailleur
983d7e5177 FIX Add option $noescapecommand in executeCLI for better compatibility 2021-08-23 12:26:16 +02:00
Laurent Destailleur
041784876d Fix option $nolog 2021-08-23 12:25:59 +02:00
Laurent Destailleur
227f01b000 Fix can add a redirection into the executeCLI method. 2021-08-23 12:25:48 +02:00
Laurent Destailleur
fdffc0c13a NEW Add param $nolog to avoid logging into dol_delete_recursive_dir() 2021-08-23 12:25:29 +02:00
Laurent Destailleur
0325b68bfb Fix missing autoselect 2021-08-23 10:17:36 +02:00
Alexandre SPANGARO
b5a4c58106 FIX Supplier invoice list - Wrong language key used 2021-08-22 22:42:40 +02:00
Laurent Destailleur
d3de81fecb Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
Conflicts:
	htdocs/holiday/card.php
	htdocs/holiday/class/holiday.class.php
2021-08-22 19:34:13 +02:00
Laurent Destailleur
53a6e0cfaf Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into 13.0 2021-08-22 19:23:56 +02:00
Laurent Destailleur
fe17c13a5f FIX an approved holiday can be canceled by an admin. 2021-08-22 19:22:47 +02:00
Laurent Destailleur
ff3f85b214 Fix case sensitive 2021-08-22 01:44:52 +02:00
Laurent Destailleur
e6fa070c84 Fix phpcs 2021-08-22 01:21:31 +02:00
Laurent Destailleur
b3043ab3d6 Fix phpunit 2021-08-22 01:20:25 +02:00
Laurent Destailleur
4cd5a53b63 FIX Recommended session.cookie_samesite must be 'Lax' not 'Strict'. 2021-08-22 00:44:51 +02:00
Laurent Destailleur
49f6a634d0 Fix output of error message. br is no more encoded 2021-08-21 15:00:47 +02:00
Laurent Destailleur
ac5b16fd01 Fix lang 2021-08-21 13:41:04 +02:00
Laurent Destailleur
04a922b5f4 Implement the noescapetags into dol_escape_htmltag 2021-08-21 13:27:33 +02:00
Laurent Destailleur
17213ae65d More error messages on paypal payment. 2021-08-21 12:37:28 +02:00
Laurent Destailleur
68d24661db Try to fix the ' that show &apos; on PDF 2021-08-21 12:19:50 +02:00
Laurent Destailleur
bdf8c3ddc6 Fix test 2021-08-20 23:26:56 +02:00
Alexandre SPANGARO
af843ed82c Merge branch '14.0' into 14p10 2021-08-20 22:11:42 +02:00
Alexandre SPANGARO
53af4b0076 FIX #18375 SQL Error on tasks statistics 2021-08-20 22:11:26 +02:00
Alexandre SPANGARO
8bdf58b942 FIX #18353 Invoice list translation issue 2021-08-20 21:42:43 +02:00
Laurent Destailleur
35e48f3a27 Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0 2021-08-20 21:12:22 +02:00
Laurent Destailleur
9d285ea232 Fix: Can delete a price when date is in future to fix corrupted data 2021-08-20 21:11:20 +02:00
Laurent Destailleur
b52ad0500b Removed useless files 2021-08-20 16:25:51 +02:00
Laurent Destailleur
10ddd621ca Fix escape error message 2021-08-20 12:40:49 +02:00
Laurent Destailleur
03d2d24244 Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0 2021-08-19 16:12:26 +02:00
Laurent Destailleur
e1dc5b5188 css 2021-08-19 16:12:13 +02:00
Laurent Destailleur
91792e3c0e Merge pull request #18441 from KlaasOl/patch-4
Update main.lang
2021-08-19 13:48:12 +02:00
Laurent Destailleur
c20d61029c Merge pull request #18442 from FHenry/fix_14_tokenCRSCF
fix: missing token CRCSF
2021-08-19 13:46:31 +02:00
Florian HENRY
223637317b fix: missing tocken CRCSF 2021-08-19 09:51:09 +02:00
Klaas Oldenburger
0d4badb50b Update main.lang
Change date format to Dutch standards
2021-08-19 08:26:37 +02:00
Laurent Destailleur
8f1b4df5f4 Fix deletion of old file 2021-08-19 02:54:58 +02:00
Laurent Destailleur
6d4aa1ad08 Fix deletion of old signature file 2021-08-19 02:51:24 +02:00
Laurent Destailleur
9b5a6f4298 Fix signature file must be zip if possible 2021-08-19 02:48:45 +02:00
Laurent Destailleur
35ebaf7b79 Merge pull request #18282 from aspangaro/12p18
FIX: Manage credit note on situation invoice for calculate margin
2021-08-17 19:26:16 +02:00
Laurent Destailleur
a19f8cd87d Merge pull request #18337 from atm-maxime/fix_holidays_users
Fix : we only want employee users for holidays
2021-08-17 18:37:38 +02:00
Laurent Destailleur
16c290f735 Merge pull request #18383 from marc-dll/12.0_FIX_invoice_tiny_negative_vat
FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts
2021-08-17 18:24:33 +02:00
Laurent Destailleur
ceaaff0186 Sellby always before Eatby #18361 2021-08-17 18:05:34 +02:00
Alexandre SPANGARO
f88abb9a6f Add parenthesis 2021-08-15 07:32:46 +02:00
Alexandre SPANGARO
0d467972cd Merge branch '12.0' into 12p18 2021-08-15 07:19:33 +02:00
Marc de Lima Lucio
08f21e3fc4 FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts 2021-08-10 10:23:56 +02:00
Maxime Kohlhaas
803722e323 Fix : we only want employee users for holidays 2021-08-04 14:48:10 +02:00
Alexandre SPANGARO
ca6dd8850a FIX: Manage credit note on situation invoice for calculate margin 2021-07-29 15:24:08 +02:00
4330 changed files with 122883 additions and 38296 deletions

234
ChangeLog
View File

@@ -2,6 +2,209 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 14.0.4 compared to 14.0.3 *****
FIX: $totalarray is overwritten, totals were lost
FIX: 13.0 - due to a typo in the 'mode' parameter, the "first name" column of the list of members displays the full name
FIX: 13.0: end date required to edit a ticket message
FIX: 13.0 feedback of PR #18993: make ticket messages punctual events with attr percentage = -1
FIX: 13.0 PR #18993: add comment on modified part
FIX: 13.0: sometimes firstname was mistyped as fistname
FIX: 14.0 - civility field of private third party creation form has inadequate width
FIX: 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none)
FIX: 14.0 - due to a typo in the 'mode' parameter, the "first name" co…
FIX: #18634 : Problem of virtual stock with reception module enabled
FIX: #18695 Added ref_ext to supplier invoice
FIX: #18698 Supplier invoice list - "alert" checkbox not working
FIX: #18735
FIX: #18767 : Adherent delete
FIX: #18797
FIX: #18854
FIX: #18875 in v14
FIX: #18910
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
FIX: #18912 Accountancy - SQL error when custom group is added without country defined
FIX: #18934 on-registration in the extrafieldsline database for deliveries
FIX: #18968
FIX: #19008
FIX: #19014 - the properties of some fields are not updated when you submit the form
FIX: #19210
FIX: #19214 : PostgreSQL error on admin/limits.php
FIX: #19241 Project - Fix display salary in overview
FIX: #19305
FIX: 2 columns for total labels
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
FIX: Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
FIX: Accountancy - Option of export popup are inverted
FIX: Accountancy - PHP8
FIX: Accountancy - Product admin - SQL error when we affect accounting account with product_perentity activated
FIX: Accountancy simplified - Salaries are not present in report
FIX: Accountancy - Some correction on export name
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
FIX: add warehouse in projects' overview count
FIX: also on customer index for automatic binding
FIX: Attachment of pdf into shipment when sending email
FIX: autocalculation of the supplier price in main currency.
FIX: avoid warning if $categories is an id
FIX: bad sign of amount stored for multicurrency columns on credit notes
FIX: Bad use of a forced contact of another company on PDF/ODT documents
FIX: Bad use of dol_concatdesc()
FIX: Button text on proposal card for create a invoice
FIX: calculateCosts of BOM must not be included into fetch
FIX: calculation of balance in conciliation page on desc sorting.
FIX: card.php
FIX: Change date format of the inventorycode to be equal as mass stock transfert
FIX: check if greater 0
FIX: close cash with some terminals in TakePOS
FIX: compatibility with Multicompany
FIX: consistent UX when calling a tab from the invoice card with empty ref/id
FIX: default language defined for IN country
FIX: Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode
FIX: fetch of product with modulebuilder load too much data
FIX: filter for export of accounting documents
FIX: Filter on categories
FIX: generate documents with PDF options
FIX: indentation
FIX: init hookmanager after loading $conf values
FIX: invoice: inpossible to create an invoice because of very bad check + warnings when trying to print tabs for invoice with no ID
FIX: legal issue on expense report pdf (must also show price without tax)
FIX: list of categories in stats of supplier invoices
FIX: load tranlate array after setting lang
FIX: lost superadmin grade after edit user card
FIX: missing filter status=1 on rss feeds
FIX: missing permission check reported by me@lainwir3d.net on product api
FIX: missing return status
FIX: missing sql filter by entity
FIX: move fetch_optionnal into $ac_static->fetch()
FIX: only a superadmin can modify entity
FIX: only ones value is return for dictionaries
FIX: optional visibility on create card
FIX: payment style and html5 tags
FIX: payment using wrong type in takepos when too many payment mode
FIX: PR#18931 Remove useless explicit call to dol_shutdown
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
FIX: products/services card: hidden extrafields were overridden
FIX: project task list: extrafields could not be displayed
FIX: Propal list - Problem of pagination on date
FIX: reload user lang
FIX: Remove not complete order from the virtual stock
FIX: Replenish: SQL error when no warehouse has been created + Warning when there are no warehouses
FIX: resource list : Use standard code to handle list filters
FIX: restrictedArea for payment delete
FIX: Ret PR
FIX: second approval back in stable feature as is the setting for minimum amount (last part from PR#14286)
FIX: selected lines on supplier invoice create
FIX: Selection of type "people" for membership must hide the company
FIX: select list of orders not complete when field type of company is on
FIX: show end hours in events linked to objects
FIX: support of localtax on expense report
FIX: task time: can't filter by user with pgsql + show error message
FIX: task time: keep on using natural_search
FIX: tcpdf vulnerability to roman numeral bomb, cf. tecnickom/TCPDF issue #315
FIX: Test when date of invoie is in future (pb with TZ and offset)
FIX: Ticket - Card - Wrong font awesome library
FIX: Ticket - Duplicate field project when we create ticket from project
FIX: translation into email for member at membership validation.
FIX: Travis Sanitize SQL
FIX: unprivileged user can see task associated with a not allowed project
FIX: URGENT: impossible to create an invoice
FIX: Use of accent into filename of GED
FIX: user date timezone offset
FIX: User salary card - translation problem
FIX: user without permission can set ticket subject
FIX: We need a default price base type in variant creation case with multiprices when parent has been created with only one level price
FIX: wrong array key value
FIX: wrong check
FIX: wrong position of error message
Sync transifex.
***** ChangeLog for 14.0.3 compared to 14.0.2 *****
FIX: #18698 Supplier invoice list - "alert" checkbox not working
FIX: #18735
FIX: #18767 : Member delete
FIX: #18854
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
FIX: Accountancy - Option of export popup are inverted
FIX: Accountancy - Some correction on export name
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
FIX: add warehouse in projects' overview count
FIX: autocalculation of the supplier price in main currency.
FIX: avoid warning if $categories is an id
FIX: Bad use of a forced contact of another company on PDF/ODT documents
FIX: Button text on proposal card to create a invoice
FIX: calculateCosts of BOM must not be included into fetch
FIX: check if greater 0
FIX: default language defined for IN country
FIX: fetch of product with modulebuilder load too much data
FIX: Filter on categories
FIX: indentation
FIX: init hookmanager after loading $conf values
FIX: legal issue on expense report pdf (must also show price without tax)
FIX: missing filter status=1 on rss feeds
FIX: move fetch_optionnal into $ac_static->fetch()
FIX: payment using wrong type in takepos when too many payment mode
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
FIX: products/services card: hidden extrafields were overridden
FIX: Propal list - Problem of pagination on date
FIX: selected lines on supplier invoice create
FIX: Selection of type "people" for membership must hide the company
FIX: select list of orders not complete when field type of company is on
FIX: support of localtax on expense report
FIX: task time: can't filter by user with pgsql + show error message
FIX: task time: keep on using natural_search
FIX: Test when date of invoie is in future (pb with TZ and offset)
FIX: translation into email for member at membership validation.
FIX: unprivileged user can see task associated with a not allowed project
FIX: user without permission can set ticket subject
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
FIX: #18353 Invoice list translation issue
FIX: #18375 SQL Error on tasks statistics
FIX: #18465
FIX: #18484
FIX: #18531
FIX: #18542 REST API: set global $user variable to DolibarrApiAccess::user.
FIX: #18544 Shipment REST API: load thirdparty object into the shipment before validating.
FIX: #18544 Shipment rest api: load thirdparty object when validating
FIX: #18565
FIX: #18589 #18617
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
FIX: #18666 Order / Shipment list: Don't SQL JOIN category table when not necessary.
FIX: Accountancy - Some problems of length with general & subledger account
FIX: add DISTINCT
FIX: Add option $noescapecommand in executeCLI for better compatibility
FIX: Add token to remove error when removing widget
FIX: Add token when remove the last widget on home page
FIX: an approved holiday can be canceled by an admin.
FIX: better sql request
FIX: change LOG_DEBUG with LOG_WARNING in syslog and remove sql error in syslog (already done)
FIX: Collapsing of extrafields has disappeared.
FIX: Date of payment of subscription must not be set to 1970-01-01.
FIX: Export of website generates a package that contains a sql error
FIX: Field already present in SQL request
FIX: increase maxlength of password input
FIX: invoice fetch not found syslog debug level instead of error
FIX: Invoice list - Wrong name for column total_tva
FIX: invoice validation: when checking if any vat rate has a negative amount, prevent false positives with -1E-14 amounts
FIX: Manage credit note on situation invoice for calculate margin
FIX: Menu List of project was not visible.
FIX: migration script
FIX: multicompany transverse mode compatibility
FIX: option "Default value for field 'Refuse bulk emailings'"
FIX: Recommended session.cookie_samesite must be 'Lax' not 'Strict'.
FIX: Relative discount with high nb of decimals
FIX: salary extrafields don't work and table is not well named
FIX: Supplier invoice list - Wrong language key used
FIX: wrong table_element_line
FIX: wrong users count in multicompany transverse mode
FIX: #yogosha6944 Protection against traversal path.
***** ChangeLog for 14.0.1 compared to 14.0.0 *****
FIX: $conf->task used but it does not exist, use $conf->projet instead
@@ -272,6 +475,37 @@ Following changes may create regressions for some external modules, but were nec
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
***** ChangeLog for 13.0.5 compared to 13.0.4 *****
FIX: 13.0: class CommandeFournisseurDispatch provides trigger for UPDATE but not for CREATE / DELETE
FIX: #18389 Accountancy - Bug on LDcompta10 export for supplier invoice
FIX: #18591 : Remove double quotes of SQL Queries for postgresql compatibility
FIX: Accountancy - Debug Export Sage50 / CIEL Compta / CIEL Compta Evo (Format XIMPORT)
FIX: Accountancy - Some problems of length with general & subledger account
FIX: add DISTINCT
FIX: an approved holiday can be canceled by an admin.
FIX: autocalculation of the supplier price in main currency.
FIX: better sql request
FIX: cannot add time spend when column ref is not displayed
FIX: compatibility postgre sql
FIX: holiday card: hooks uninitialized
FIX: Invoice - Missing button to reopen an abandoned situation invoice
FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts
FIX: list of categories in stats of supplier invoices
FIX: Manage credit note on situation invoice for calculate margin
FIX: method_exists needs object at first param
FIX: move fetch_optionnal into $ac_static->fetch()
FIX: multicompany transverse mode compatibility
FIX: on supplier order, JOIN with product fourn price table must be done with fk_soc too to avoid display several times a same line (because of same supplier product ref)
FIX: postgre filter select search extrafield
FIX: products/services card: hidden extrafields were overridden
FIX: shipping validation workflow: 'ORDER_NEW' trigger called from wrong object
FIX: task time: can't filter by user with pgsql + show error message
FIX: task time: keep on using natural_search
FIX: wrong users count in multicompany transverse mode
***** ChangeLog for 13.0.4 compared to 13.0.3 *****
FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).

View File

@@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other application/modules
- Electronic Document Management (EDM)
- Electronic Document Management (EDM)
- Bookmarks management
- Reporting
- Data export/import
- Barcodes
- Barcodes
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- Mass emailing
- RSS integration
- Skype integration
- Social platforms linking
- Social platforms linking
- Payment platforms integration (PayPal, Stripe, Paybox...)
- Email-Collector
@@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-Users and groups with finely grained rights
- Multi-Currency
- Multi-Company (by adding of an external module)
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
@@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Compatible with European GDPR rules
- ...
- Flexible PDF & ODT generation for invoices, proposals, orders...
-
- ...
### System Environment / Requirements

View File

@@ -48,17 +48,16 @@ $includecustom=0;
$includeconstants=array();
if (empty($argv[1])) {
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Usage: ".$script_file." release=autostable|auto[-mybuild]|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value] [buildzip=1]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1;
}
parse_str($argv[1]);
$i=0;
while ($i < $argc) {
if (! empty($argv[$i])) {
parse_str($argv[$i]);
parse_str($argv[$i]); // set all params $release, $includecustom, $includeconstant, $buildzip ...
}
if (preg_match('/includeconstant=/', $argv[$i])) {
$tmp=explode(':', $includeconstant, 3); // $includeconstant has been set with previous parse_str()
@@ -125,8 +124,8 @@ print "\n";
//$outputfile=dirname(__FILE__).'/../htdocs/install/filelist-'.$release.'.xml';
$outputdir=dirname(dirname(__FILE__)).'/htdocs/install';
print 'Delete current files '.$outputdir.'/filelist*.xml'."\n";
dol_delete_file($outputdir.'/filelist*.xml', 0, 1, 1);
print 'Delete current files '.$outputdir.'/filelist*.xml*'."\n";
dol_delete_file($outputdir.'/filelist*.xml*', 0, 1, 1);
$checksumconcat=array();
@@ -237,6 +236,22 @@ fputs($fp, '</dolibarr_script_dir_checksum>'."\n");
fputs($fp, '</checksum_list>'."\n");
fclose($fp);
print "File ".$outputfile." generated\n";
if (empty($buildzip)) {
print "File ".$outputfile." generated\n";
} else {
if ($buildzip == '1' || $buildzip == 'zip') {
$result = dol_compress_file($outputfile, $outputfile.'.zip', 'zip');
if ($result > 0) {
dol_delete_file($outputfile);
print "File ".$outputfile.".zip generated\n";
}
} elseif ($buildzip == '2' || $buildzip == 'gz') {
$result = dol_compress_file($outputfile, $outputfile.'.gz', 'gz');
if ($result > 0) {
dol_delete_file($outputfile);
print "File ".$outputfile.".gz generated\n";
}
}
}
exit(0);

View File

@@ -168,6 +168,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
- protected $default_monospaced_font = 'courier';
+ protected $default_monospaced_font = 'freemono';
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
of the function, replace:
$roman = '';
with:
$roman = '';
if ($number >= 4000) {
// do not represent numbers above 4000 in Roman numerals
return strval($number);
}

View File

@@ -3,11 +3,26 @@
#
# Use this sample to search into a ldap
#
# ldapsearch -h hostname -x
# ldapsearch -h hostname -x -b "ou=people,dc=teclib,dc=infra"
# ldapsearch -h hostname -x -z 0 -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
# ldapsearch -h hostname -x -b "o=somecompany.com" -D "cn=manager,o=somecompany.com" -w password "(objectclass=*)"
# Anonymous access
# ldapsearch -h hostname -p 389
#
# Login access (using a Bind DN)
# ldapsearch -h hostname -p 389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -d1 -H ldap://hostname:389 -x -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
# ldapsearch -H ldap://hostname:389 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password
#
# Login access in SSL (using a Bind DN)
# ldapsearch -H ldaps://hostnamme:636 -z 0 -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local
# If it fails, you may try to use "hostname" that is real name of certificate.
# You must also check that /etc/ldap/ldap.conf contains the line TLS_CACERT /etc/ssl/certs/ca-certificates.crt
# What to search
# ldapsearch -h hostname -p 389 -x -D "uid=root,cn=users,dc=ldap,dc=test,dc=local" -w password -b "cn=users,dc=ldap,dc=test,dc=local"
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "ou=people,dc=teclib,dc=infra"
# ldapsearch -h hostname -p 389 -x -D "cn=manager,o=somecompany.com" -w password -b "o=somecompany.com" "(objectclass=*)"
#
# Example to test a ldap search:
# ldapsearch -h hostname -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password
# ldapsearch -h hostname -p 389 -x -z 5 -b 'OU=Collaborateurs,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -D 'CN=UserAdmin,OU=Informatique,OU=Utilisateurs,OU=MyCompany,DC=bocal,DC=lan' -w password

View File

@@ -1,234 +0,0 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-dbf.php
* \brief Script example to create a table from a large DBF file (openoffice)
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Recupere root dolibarr
$path = dirname($_SERVER["PHP_SELF"]);
require $path . "./../htdocs/master.inc.php";
require $path . "/includes/dbase.class.php";
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$filepath = $argv[1];
$filepatherr = $filepath . '.err';
$startchar = empty($argv[2]) ? 0 : (int) $argv[2];
$deleteTable = empty($argv[3]) ? 1 : 0;
$startlinenb = empty($argv[3]) ? 1 : (int) $argv[3];
$endlinenb = empty($argv[4]) ? 0 : (int) $argv[4];
if (empty($filepath)) {
print "Usage: php $script_file myfilepath.dbf [removeChatColumnName] [startlinenb] [endlinenb]\n";
print "Example: php $script_file myfilepath.dbf 0 2 1002\n";
print "\n";
exit(-1);
}
if (!file_exists($filepath)) {
print "Error: File " . $filepath . " not found.\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$user->getrights();
// Ask confirmation
if (!$confirmed) {
print "Hit Enter to continue or CTRL+C to stop...\n";
$input = trim(fgets(STDIN));
}
// Open input and output files
$fhandle = dbase_open($filepath, 0);
if (!$fhandle) {
print 'Error: Failed to open file ' . $filepath . "\n";
exit(1);
}
$fhandleerr = fopen($filepatherr, 'w');
if (!$fhandleerr) {
print 'Error: Failed to open file ' . $filepatherr . "\n";
exit(1);
}
$langs->setDefaultLang($defaultlang);
$record_numbers = dbase_numrecords($fhandle);
$table_name = substr(basename($filepath), 0, strpos(basename($filepath), '.'));
print 'Info: ' . $record_numbers . " lines in file \n";
$header = dbase_get_header_info($fhandle);
if ($deleteTable) {
$db->query("DROP TABLE IF EXISTS `$table_name`");
}
$sqlCreate = "CREATE TABLE IF NOT EXISTS `$table_name` ( `id` INT(11) NOT NULL AUTO_INCREMENT ";
$fieldArray = array("`id`");
foreach ($header as $value) {
$fieldName = substr(str_replace('_', '', $value['name']), $startchar);
$fieldArray[] = "`$fieldName`";
$sqlCreate .= ", `" . $fieldName . "` VARCHAR({$value['length']}) NULL DEFAULT NULL ";
}
$sqlCreate .= ", PRIMARY KEY (`id`)) ENGINE = InnoDB";
$resql = $db->query($sqlCreate);
if ($resql !== false) {
print "Table $table_name created\n";
} else {
var_dump($db->errno());
print "Impossible : " . $sqlCreate . "\n";
die();
}
$i = 0;
$nboflines++;
$fields = implode(',', $fieldArray);
//var_dump($fieldArray);die();
$maxLength = 0;
for ($i = 1; $i <= $record_numbers; $i++) {
if ($startlinenb && $i < $startlinenb) {
continue;
}
if ($endlinenb && $i > $endlinenb) {
continue;
}
$row = dbase_get_record_with_names($fhandle, $i);
if ($row === false || (isset($row["deleted"]) && $row["deleted"] == '1')) {
continue;
}
$sqlInsert = "INSERT INTO `$table_name`($fields) VALUES (null,";
array_shift($row); // remove delete column
foreach ($row as $value) {
$sqlInsert .= "'" . $db->escape(utf8_encode($value)) . "', ";
}
replaceable_echo(implode("\t", $row));
$sqlInsert = rtrim($sqlInsert, ', ');
$sqlInsert .= ")";
$resql = $db->query($sqlInsert);
if ($resql === false) {
print "Impossible : " . $sqlInsert . "\n";
var_dump($row, $db->errno());
die();
}
// $fields = (object) $row;
// var_dump($fields);
continue;
}
die();
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
if ($mode != 'confirmforced' && ($error || $mode != 'confirm')) {
print "Rollback any changes.\n";
$db->rollback();
} else {
print "Commit all changes.\n";
$db->commit();
}
$db->close();
fclose($fhandle);
fclose($fhandleerr);
exit($error);
/**
* replaceable_echo
*
* @param string $message Message
* @param int $force_clear_lines Force clear messages
* @return void
*/
function replaceable_echo($message, $force_clear_lines = null)
{
static $last_lines = 0;
if (!is_null($force_clear_lines)) {
$last_lines = $force_clear_lines;
}
$toss = array();
$status = 0;
$term_width = exec('tput cols', $toss, $status);
if ($status) {
$term_width = 64; // Arbitrary fall-back term width.
}
$line_count = 0;
foreach (explode("\n", $message) as $line) {
$line_count += count(str_split($line, $term_width));
}
// Erasure MAGIC: Clear as many lines as the last output had.
for ($i = 0; $i < $last_lines; $i++) {
// Return to the beginning of the line
echo "\r";
// Erase to the end of the line
echo "\033[K";
// Move cursor Up a line
echo "\033[1A";
// Return to the beginning of the line
echo "\r";
// Erase to the end of the line
echo "\033[K";
// Return to the beginning of the line
echo "\r";
// Can be consolodated into
// echo "\r\033[K\033[1A\r\033[K\r";
}
$last_lines = $line_count;
echo $message . "\n";
}

View File

@@ -1,248 +0,0 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Recupere root dolibarr
$path = preg_replace('/importdb-products.php/i', '', $_SERVER["PHP_SELF"]);
require $path . "../../htdocs/master.inc.php";
require $path . "includes/dbase.class.php";
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
//$delimiter = ',';
//$enclosure = '"';
//$linelength = 10000;
//$escape = '/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$tvas = [
'1' => "20.00",
'2' => "5.50",
'3' => "0.00",
'4' => "20.60",
'5' => "19.60",
];
$tvasD = [
'1' => "20",
'2' => "5.5",
'3' => "0",
'4' => "20",
'5' => "20",
];
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$table = $argv[1];
if (empty($argv[1])) {
print "Error: Which table ?\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$sql = "SELECT * FROM `$table` WHERE 1";
$resql = $db->query($sql);
if ($resql) {
while ($fields = $db->fetch_array($resql)) {
$errorrecord = 0;
if ($fields === false) {
continue;
}
$nboflines++;
$produit = new Product($db);
$produit->type = 0;
$produit->status = 1;
$produit->ref = trim($fields['REF']);
if ($produit->ref == '') {
continue;
}
print "Process line nb " . $j . ", ref " . $produit->ref;
$produit->label = trim($fields['LIBELLE']);
if ($produit->label == '') {
$produit->label = $produit->ref;
}
if (empty($produit->label)) {
continue;
}
//$produit->description = trim($fields[4] . "\n" . ($fields[5] ? $fields[5] . ' x ' . $fields[6] . ' x ' . $fields[7] : ''));
// $produit->volume = price2num($fields[8]);
// $produit->volume_unit = 0;
$produit->weight = price2num($fields['MASSE']);
$produit->weight_units = 0; // -3 = g
//$produit->customcode = $fields[10];
$produit->barcode = str_pad($fields['CODE'], 12, "0", STR_PAD_LEFT);
$produit->barcode_type = '2';
$produit->import_key = $fields['CODE'];
$produit->status = 1;
$produit->status_buy = 1;
$produit->finished = 1;
// $produit->multiprices[0] = price2num($fields['TARIF0']);
// $produit->multiprices[1] = price2num($fields['TARIF1']);
// $produit->multiprices[2] = price2num($fields['TARIF2']);
// $produit->multiprices[3] = price2num($fields['TARIF3']);
// $produit->multiprices[4] = price2num($fields['TARIF4']);
// $produit->multiprices[5] = price2num($fields['TARIF5']);
// $produit->multiprices[6] = price2num($fields['TARIF6']);
// $produit->multiprices[7] = price2num($fields['TARIF7']);
// $produit->multiprices[8] = price2num($fields['TARIF8']);
// $produit->multiprices[9] = price2num($fields['TARIF9']);
// $produit->price_min = null;
// $produit->price_min_ttc = null;
// $produit->price = price2num($fields[11]);
// $produit->price_ttc = price2num($fields[12]);
// $produit->price_base_type = 'TTC';
// $produit->tva_tx = price2num($fields[13]);
$produit->tva_tx = (int) ($tvas[$fields['CODTVA']]);
$produit->tva_npr = 0;
// $produit->cost_price = price2num($fields[16]);
//compta
$produit->accountancy_code_buy = trim($fields['COMACH']);
$produit->accountancy_code_sell = trim($fields['COMVEN']);
// $produit->accountancy_code_sell_intra=trim($fields['COMVEN']);
// $produit->accountancy_code_sell_export=trim($fields['COMVEN']);
// Extrafields
// $produit->array_options['options_ecotaxdeee'] = price2num($fields[17]);
$produit->seuil_stock_alerte = $fields['STALERTE'];
$ret = $produit->create($user, 0);
if ($ret < 0) {
print " - Error in create result code = " . $ret . " - " . $produit->errorsToString();
$errorrecord++;
} else {
print " - Creation OK with ref " . $produit->ref . " - id = " . $ret;
}
dol_syslog("Add prices");
// If we use price level, insert price for each level
if (!$errorrecord && 1) {
//$ret1 = $produit->updatePrice($produit->price_ttc, $produit->price_base_type, $user, $produit->tva_tx, $produit->price_min, 1, $produit->tva_npr, 0, 0, array());
$ret1 = false;
for ($i = 0; $i < 10; $i++) {
if ($fields['TARIF' . ($i)] == 0) {
continue;
}
$ret1 = $ret1 || $produit->updatePrice(price2num($fields['TARIF' . ($i)]), 'HT', $user, $produit->tva_tx, $produit->price_min, $i + 1, $produit->tva_npr, 0, 0, array()) < 0;
}
if ($ret1) {
print " - Error in updatePrice result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - updatePrice OK";
}
}
// dol_syslog("Add multilangs");
// Add alternative languages
// if (!$errorrecord && 1) {
// $produit->multilangs['fr_FR'] = array('label' => $produit->label, 'description' => $produit->description, 'note' => $produit->note_private);
// $produit->multilangs['en_US'] = array('label' => $fields[3], 'description' => $produit->description, 'note' => $produit->note_private);
//
// $ret = $produit->setMultiLangs($user);
// if ($ret < 0) {
// print " - Error in setMultiLangs result code = " . $ret . " - " . $produit->errorsToString();
// $errorrecord++;
// } else {
// print " - setMultiLangs OK";
// }
// }
dol_syslog("Add stocks");
// stocks
if (!$errorrecord && $fields['STOCK'] != 0) {
$rets = $produit->correct_stock($user, 1, $fields['STOCK'], 0, 'Stock importé');
if ($rets < 0) {
print " - Error in correct_stock result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - correct_stock OK";
}
}
//update date créa
if (!$errorrecord) {
$date = substr($fields['DATCREA'], 0, 4) . '-' . substr($fields['DATCREA'], 4, 2) . '-' . substr($fields['DATCREA'], 6, 2);
$retd = $db->query("UPDATE `llx_product` SET `datec` = '$date 00:00:00' WHERE `llx_product`.`rowid` = $produit->id");
if ($retd < 1) {
print " - Error in update date créa result " . $produit->errorsToString();
$errorrecord++;
} else {
print " - update date créa OK";
}
}
print "\n";
if ($errorrecord) {
print( 'Error on record nb ' . $i . " - " . $produit->errorsToString() . "\n");
var_dump($db);
die();
$error++; // $errorrecord will be reset
}
$j++;
}
} else {
die("error : $sql");
}
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
$db->close();
exit($error);

View File

@@ -1,365 +0,0 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* WARNING, THIS WILL LOAD MASS DATA ON YOUR INSTANCE
*/
/**
* \file dev/initdata/import-product.php
* \brief Script example to insert products from a csv file.
* To purge data, you can have a look at purge-data.php
*/
// Test si mode batch
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path = dirname(__FILE__) . '/';
if (substr($sapi_type, 0, 3) == 'cgi') {
echo "Error: You are using PHP for CGI. To execute ".$script_file." from command line, you must use PHP for CLI mode.\n";
exit;
}
// Recupere root dolibarr
$path = preg_replace('/importdb-thirdparties.php/i', '', $_SERVER["PHP_SELF"]);
require $path . "../../htdocs/master.inc.php";
require $path . "includes/dbase.class.php";
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
//$delimiter = ',';
//$enclosure = '"';
//$linelength = 10000;
//$escape = '/';
// Global variables
$version = DOL_VERSION;
$confirmed = 1;
$error = 0;
$civilPrivate = array("MLLE",
"MM",
"MM/MADAME",
"MME",
"MME.",
"MME²",
"MMONSIEUR",
"MMR",
"MOBNSIEUR",
"MOMSIEUR",
"MON SIEUR",
"MONDIAL",
"MONIEUR",
"MONJSIEUR",
"MONNSIEUR",
"MONRIEUR",
"MONS",
"MONSIEÕR",
"MONSIER",
"MONSIERU",
"MONSIEU",
"monsieue",
"MONSIEUR",
"Monsieur     \"",
"MONSIEUR    \"",
"MONSIEUR   E",
"MONSIEUR  DENIS",
"MONSIEUR ET MME",
"MONSIEUR!",
"MONSIEUR.",
"MONSIEUR.MADAME",
"MONSIEUR3",
"MONSIEURN",
"MONSIEURT",
"MONSIEUR£",
"MONSIEYR",
"Monsigur",
"MONSIIEUR",
"MONSIUER",
"MONSIZEUR",
"MOPNSIEUR",
"MOSIEUR",
"MR",
"Mr  Mme",
"Mr - MME",
"MR BLANC",
"MR ET MME",
"mr mm",
"MR OU MME",
"Mr.",
"MR/MME",
"MRME",
"MRR",
"Mrs",
"Mademoiselle",
"MADAOME",
"madamme",
"MADAME",
"M0NSIEUR",
"M.et Madame",
"M. ET MR",
"M.",
"M%",
"M MME",
"M ET MME",
"M",
"M CROCE",
"M DIEVART",
);
/*
* Main
*/
@set_time_limit(0);
print "***** " . $script_file . " (" . $version . ") pid=" . dol_getmypid() . " *****\n";
dol_syslog($script_file . " launched with arg " . implode(',', $argv));
$table = $argv[1];
if (empty($argv[1])) {
print "Error: Quelle table ?\n";
print "\n";
exit(-1);
}
$ret = $user->fetch('', 'admin');
if (!$ret > 0) {
print 'A user with login "admin" and all permissions must be created to use this script.' . "\n";
exit;
}
$sql = "SELECT * FROM `$table` WHERE 1 "; //ORDER BY REMISE DESC,`LCIVIL` DESC";
$resql = $db->query($sql);
//$db->begin();
if ($resql) {
while ($fields = $db->fetch_array($resql)) {
$i++;
$errorrecord = 0;
if ($startlinenb && $i < $startlinenb) {
continue;
}
if ($endlinenb && $i > $endlinenb) {
continue;
}
$nboflines++;
$object = new Societe($db);
$object->import_key = $fields['CODE'];
$object->state = 1;
$object->client = 3;
$object->fournisseur = 0;
$object->name = $fields['FCIVIL'] . ' ' . $fields['FNOM'];
//$object->name_alias = $fields[0] != $fields[13] ? trim($fields[0]) : '';
$date = $fields['DATCREA'] ? $fields['DATCREA'] : ($fields['DATMOD'] ? $fields['DATMOD'] : '20200101');
$object->code_client = 'CU' . substr($date, 2, 2) . substr($date, 4, 2) . '-' . str_pad(substr($fields['CODE'], 0, 5), 5, "0", STR_PAD_LEFT);
$object->address = trim($fields['FADR1']);
if ($fields['FADR2']) {
$object->address .= "\n" . trim($fields['FADR2']);
}
if ($fields['FADR3']) {
$object->address .= "\n" . trim($fields['FADR3']);
}
$object->zip = trim($fields['FPOSTE']);
$object->town = trim($fields['FVILLE']);
if ($fields['FPAYS']) {
$object->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['FPAYS']))), 'c_country', 'label', 'rowid');
} else {
$object->country_id = 1;
}
$object->phone = trim($fields['FTEL']) ? trim($fields['FTEL']) : trim($fields['FCONTACT']);
$object->phone = substr($object->phone, 0, 20);
$object->fax = trim($fields['FFAX']) ? trim($fields['FFAX']) : trim($fields['FCONTACT']);
$object->fax = substr($object->fax, 0, 20);
$object->email = trim($fields['FMAIL']);
// $object->idprof2 = trim($fields[29]);
$object->tva_intra = str_replace(['.', ' '], '', $fields['TVAINTRA']);
$object->tva_intra = substr($object->tva_intra, 0, 20);
$object->default_lang = 'fr_FR';
$object->cond_reglement_id = dol_getIdFromCode($db, 'PT_ORDER', 'c_payment_term', 'code', 'rowid', 1);
$object->multicurrency_code = 'EUR';
if ($fields['REMISE'] != '0.00') {
$object->remise_percent = abs($fields['REMISE']);
}
// $object->code_client = $fields[9];
// $object->code_fournisseur = $fields[10];
if ($fields['FCIVIL']) {
$labeltype = in_array($fields['FCIVIL'], $civilPrivate) ? 'TE_PRIVATE' : 'TE_SMALL';
$object->typent_id = dol_getIdFromCode($db, $labeltype, 'c_typent', 'code');
}
// Set price level
$object->price_level = $fields['TARIF'] + 1;
// if ($labeltype == 'Revendeur')
// $object->price_level = 2;
print "Process line nb " . $i . ", code " . $fields['CODE'] . ", name " . $object->name;
// Extrafields
$object->array_options['options_banque'] = $fields['BANQUE'];
$object->array_options['options_banque2'] = $fields['BANQUE2'];
$object->array_options['options_banquevalid'] = $fields['VALID'];
if (!$errorrecord) {
$ret = $object->create($user);
if ($ret < 0) {
print " - Error in create result code = " . $ret . " - " . $object->errorsToString();
$errorrecord++;
var_dump($object->code_client, $db);
die();
} else {
print " - Creation OK with name " . $object->name . " - id = " . $ret;
}
}
if (!$errorrecord) {
dol_syslog("Set price level");
$object->set_price_level($object->price_level, $user);
}
if (!$errorrecord && @$object->remise_percent) {
dol_syslog("Set remise client");
$object->set_remise_client($object->remise_percent, 'Importé', $user);
}
dol_syslog("Add contact");
// Insert an invoice contact if there is an invoice email != standard email
if (!$errorrecord && ($fields['LCIVIL'] || $fields['LNOM'])) {
$madame = array("MADAME",
"MADEMOISELLE",
"MELLE",
"MLLE",
"MM",
"Mme",
"MNE",
);
$monsieur = array("M",
"M ET MME",
"M MME",
"M.",
"M. MME",
"M. OU Mme",
"M.ou Madame",
"MONSEUR",
"MONSIER",
"MONSIEU",
"MONSIEUR",
"monsieur:mme",
"MONSIEUR¨",
"MONSIEZUR",
"MONSIUER",
"MONSKIEUR",
"MR",
);
$ret1 = $ret2 = 0;
$contact = new Contact($db);
if (in_array($fields['LCIVIL'], $madame)) {
// une dame
$contact->civility_id = 'MME';
$contact->lastname = $fields['LNOM'];
} elseif (in_array($fields['LCIVIL'], $monsieur)) {
// un monsieur
$contact->civility_id = 'MR';
$contact->lastname = $fields['LNOM'];
} elseif (in_array($fields['LCIVIL'], ['DOCTEUR'])) {
// un monsieur
$contact->civility_id = 'DR';
$contact->lastname = $fields['LNOM'];
} else {
// un a rattraper
$contact->lastname = $fields['LCIVIL'] . " " . $fields['LNOM'];
}
$contact->address = trim($fields['LADR1']);
if ($fields['LADR2']) {
$contact->address .= "\n" . trim($fields['LADR2']);
}
if ($fields['LADR3']) {
$contact->address .= "\n" . trim($fields['LADR3']);
}
$contact->zip = trim($fields['LPOSTE']);
$contact->town = trim($fields['LVILLE']);
if ($fields['FPAYS']) {
$contact->country_id = dol_getIdFromCode($db, trim(ucwords(strtolower($fields['LPAYS']))), 'c_country', 'label', 'rowid');
} else {
$contact->country_id = 1;
}
$contact->email = $fields['LMAIL'];
$contact->phone = trim($fields['LTEL']) ? trim($fields['LTEL']) : trim($fields['LCONTACT']);
$contact->fax = trim($fields['LFAX']) ? trim($fields['LFAX']) : trim($fields['LCONTACT']);
$contact->socid = $object->id;
$ret1 = $contact->create($user);
if ($ret1 > 0) {
//$ret2=$contact->add_contact($object->id, 'BILLING');
}
if ($ret1 < 0 || $ret2 < 0) {
print " - Error in create contact result code = " . $ret1 . " " . $ret2 . " - " . $contact->errorsToString();
$errorrecord++;
} else {
print " - create contact OK";
}
}
//update date créa
if (!$errorrecord) {
$datec = substr($date, 0, 4) . '-' . substr($date, 4, 2) . '-' . substr($date, 6, 2);
$retd = $db->query("UPDATE `llx_societe` SET `datec` = '$datec 00:00:00' WHERE `rowid` = $object->id");
if ($retd < 1) {
print " - Error in update date créa result " . $object->errorsToString();
$errorrecord++;
} else {
print " - update date créa OK";
}
}
print "\n";
if ($errorrecord) {
print( 'Error on record nb ' . $i . " - " . $object->errorsToString() . "\n");
var_dump($db, $object, $contact);
// $db->rollback();
die();
$error++; // $errorrecord will be reset
}
$j++;
}
} else {
die("error : $sql");
}
$db->commit();
// commit or rollback
print "Nb of lines qualified: " . $nboflines . "\n";
print "Nb of errors: " . $error . "\n";
$db->close();
exit($error);

View File

@@ -1,599 +0,0 @@
<?php
/**
* \file dev/initdata/dbf/includes/dbase.class.php
* \ingroup dev
* \brief Class to manage DBF databases
*/
// source : https://github.com/donfbecker/php-dbase
define('DBASE_RDONLY', 0);
define('DBASE_WRONLY', 1);
define('DBASE_RDWR', 2);
define('DBASE_TYPE_DBASE', 0);
define('DBASE_TYPE_FOXPRO', 1);
/**
* Class for DBase
*/
class DBase
{
private $fd;
private $headerLength = 0;
private $fields = array();
private $fieldCount = 0;
private $recordLength = 0;
private $recordCount = 0;
/**
* resource dbase_open
* @param string $filename filename
* @param int $mode mode
* @return DBase
*/
public static function open($filename, $mode)
{
if (!file_exists($filename)) {
return false;
}
$modes = array('r', 'w', 'r+');
$mode = $modes[$mode];
$fd = fopen($filename, $mode);
if (!$fd) {
return false;
}
return new DBase($fd);
}
/**
* resource dbase_create
* @param string $filename filename
* @param array $fields fields
* @param int $type DBASE_TYPE_DBASE
* @return DBase
*/
public static function create($filename, $fields, $type = DBASE_TYPE_DBASE)
{
if (file_exists($filename)) {
return false;
}
$fd = fopen($filename, 'c+');
if (!$fd) {
return false;
}
// Byte 0 (1 byte): Valid dBASE for DOS file; bits 0-2 indicate version number, bit 3
// indicates the presence of a dBASE for DOS memo file, bits 4-6 indicate the
// presence of a SQL table, bit 7 indicates the presence of any memo file
// (either dBASE m PLUS or dBASE for DOS)
self::putChar8($fd, 5);
// Byte 1-3 (3 bytes): Date of last update; formatted as YYMMDD
self::putChar8($fd, date('Y') - 1900);
self::putChar8($fd, date('m'));
self::putChar8($fd, date('d'));
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
self::putInt32($fd, 0);
// Byte 8-9 (16-bit number): Number of bytes in the header.
self::putInt16($fd, 32 + (32 * count($fields)) + 1);
// Byte 10-11 (16-bit number): Number of bytes in record.
// Make sure the include the byte for deleted flag
$len = 1;
foreach ($fields as &$field) {
$len += self::length($field);
}
self::putInt16($fd, $len);
// Byte 12-13 (2 bytes): Reserved, 0 filled.
self::putInt16($fd, 0);
// Byte 14 (1 byte): Flag indicating incomplete transaction
// The ISMARKEDO function checks this flag. BEGIN TRANSACTION sets it to 1, END TRANSACTION and ROLLBACK reset it to 0.
self::putChar8($fd, 0);
// Byte 15 (1 byte): Encryption flag. If this flag is set to 1, the message Database encrypted appears. Changing this flag to 0 removes the message, but does not decrypt the file.
self::putChar8($fd, 0);
// Byte 16-27 (12 bytes): Reserved for dBASE for DOS in a multi-user environment
self::putInt32($fd, 0);
self::putInt32($fd, 0);
self::putInt32($fd, 0);
// Byte 28 (1 byte): Production .mdx file flag; 0x01 if there is a production .mdx file, 0x00 if not
self::putChar8($fd, 0);
// Byte 29 (1 byte): Language driver ID
// (no clue what this is)
self::putChar8($fd, 0);
// Byte 30-31 (2 bytes): Reserved, 0 filled.
self::putInt16($fd, 0);
// Byte 32 - n (32 bytes each): Field descriptor array
foreach ($fields as &$field) {
self::putString($fd, $field[0], 11); // Byte 0 - 10 (11 bytes): Field name in ASCII (zero-filled)
self::putString($fd, $field[1], 1); // Byte 11 (1 byte): Field type in ASCII (C, D, F, L, M, or N)
self::putInt32($fd, 0); // Byte 12 - 15 (4 bytes): Reserved
self::putChar8($fd, self::length($field)); // Byte 16 (1 byte): Field length in binary. The maximum length of a field is 254 (0xFE).
self::putChar8($fd, $field[3]); // Byte 17 (1 byte): Field decimal count in binary
self::putInt16($fd, 0); // Byte 18 - 19 (2 bytes): Work area ID
self::putChar8($fd, 0); // Byte 20 (1 byte): Example (??)
self::putInt32($fd, 0); // Byte 21 - 30 (10 bytes): Reserved
self::putInt32($fd, 0);
self::putInt16($fd, 0);
self::putChar8($fd, 0); // Byte 31 (1 byte): Production MDX field flag; 1 if field has an index tag in the production MDX file, 0 if not
}
// Byte n + 1 (1 byte): 0x0D as the field descriptor array terminator
self::putChar8($fd, 0x0D);
return new DBase($fd);
}
/**
* Create DBase instance
* @param mixed $fd file descriptor
* @return void
*/
private function __construct($fd)
{
$this->fd = $fd;
// Byte 4-7 (32-bit number): Number of records in the database file. Currently 0
fseek($this->fd, 4, SEEK_SET);
$this->recordCount = self::getInt32($fd);
// Byte 8-9 (16-bit number): Number of bytes in the header.
fseek($this->fd, 8, SEEK_SET);
$this->headerLength = self::getInt16($fd);
// Number of fields is (headerLength - 33) / 32)
$this->fieldCount = ($this->headerLength - 33) / 32;
// Byte 10-11 (16-bit number): Number of bytes in record.
fseek($this->fd, 10, SEEK_SET);
$this->recordLength = self::getInt16($fd);
// Byte 32 - n (32 bytes each): Field descriptor array
fseek($fd, 32, SEEK_SET);
for ($i = 0; $i < $this->fieldCount; $i++) {
$data = fread($this->fd, 32);
$field = array_map('trim', unpack('a11name/a1type/c4/c1length/c1precision/s1workid/c1example/c10/c1production', $data));
$this->fields[] = $field;
}
}
/**
* dbase_close
* @return void
*/
public function close()
{
fclose($this->fd);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_get_header_info
* @return array
*/
public function get_header_info()
{
// phpcs:disable
return $this->fields;
}
/**
* dbase_numfields
* @return int
*/
public function numfields()
{
return $this->fieldCount;
}
/**
* dbase_numrecords
* @return int
*/
public function numrecords()
{
return $this->recordCount;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_add_record
* @param array $record record
* @return bool
*/
public function add_record($record)
{
// phpcs:enable
if (count($record) != $this->fieldCount) {
return false;
}
// Seek to end of file, minus the end of file marker
fseek($this->fd, 0, SEEK_END);
// Put the deleted flag
self::putChar8($this->fd, 0x20);
// Put the record
if (!$this->putRecord($record)) {
return false;
}
// Update the record count
fseek($this->fd, 4);
self::putInt32($this->fd, ++$this->recordCount);
return true;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_replace_record
* @param array $record record
* @param int $record_number record number
* @return bool
*/
public function replace_record($record, $record_number)
{
// phpcs:enable
if (count($record) != $this->fieldCount) {
return false;
}
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
// Skip to the record location, plus the 1 byte for the deleted flag
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)) + 1);
return $this->putRecord($record);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_delete_record
* @param int $record_number record number
* @return bool
*/
public function delete_record($record_number)
{
// phpcs:enable
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
self::putChar8($this->fd, 0x2A);
return true;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_get_record
* @param int $record_number record number
* @return array
*/
public function get_record($record_number)
{
// phpcs:enable
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
fseek($this->fd, $this->headerLength + ($this->recordLength * ($record_number - 1)));
$record = array(
'deleted' => self::getChar8($this->fd) == 0x2A ? 1 : 0
);
foreach ($this->fields as $i => &$field) {
$value = trim(fread($this->fd, $field['length']));
if ($field['type'] == 'L') {
$value = strtolower($value);
if ($value == 't' || $value == 'y') {
$value = true;
} elseif ($value == 'f' || $value == 'n') {
$value = false;
} else {
$value = null;
}
}
$record[$i] = $value;
}
return $record;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* dbase_get_record_with_names
* @param int $record_number record number
* @return array
*/
public function get_record_with_names($record_number)
{
// phpcs:enable
if ($record_number < 1 || $record_number > $this->recordCount) {
return false;
}
$record = $this->get_record($record_number);
foreach ($this->fields as $i => &$field) {
$record[$field['name']] = $record[$i];
unset($record[$i]);
}
return $record;
}
/**
* dbase_pack
* @return void
*/
public function pack()
{
$in_offset = $out_offset = $this->headerLength;
$new_count = 0;
$rec_count = $this->recordCount;
while ($rec_count > 0) {
fseek($this->fd, $in_offset, SEEK_SET);
$record = fread($this->fd, $this->recordLength);
$deleted = substr($record, 0, 1);
if ($deleted != '*') {
fseek($this->fd, $out_offset, SEEK_SET);
fwrite($this->fd, $record);
$out_offset += $this->recordLength;
$new_count++;
}
$in_offset += $this->recordLength;
$rec_count--;
}
ftruncate($this->fd, $out_offset);
// Update the record count
fseek($this->fd, 4);
self::putInt32($this->fd, $new_count);
}
/*
* A few utilitiy functions
*/
/**
* @param string $field field
* @return int
*/
private static function length($field)
{
switch ($field[1]) {
case 'D': // Date: Numbers and a character to separate month, day, and year (stored internally as 8 digits in YYYYMMDD format)
return 8;
case 'T': // DateTime (YYYYMMDDhhmmss.uuu) (FoxPro)
return 18;
case 'M': // Memo (ignored): All ASCII characters (stored internally as 10 digits representing a .dbt block number, right justified, padded with whitespaces)
case 'N': // Number: -.0123456789 (right justified, padded with whitespaces)
case 'F': // Float: -.0123456789 (right justified, padded with whitespaces)
case 'C': // String: All ASCII characters (padded with whitespaces up to the field's length)
return $field[2];
case 'L': // Boolean: YyNnTtFf? (? when not initialized)
return 1;
}
return 0;
}
/*
* Functions for reading and writing bytes
*/
/**
* getChar8
* @param mixed $fd file descriptor
* @return int
*/
private static function getChar8($fd)
{
return ord(fread($fd, 1));
}
/**
* putChar8
* @param mixed $fd file descriptor
* @param mixed $value value
* @return bool
*/
private static function putChar8($fd, $value)
{
return fwrite($fd, chr($value));
}
/**
* getInt16
* @param mixed $fd file descriptor
* @param int $n n
* @return bool
*/
private static function getInt16($fd, $n = 1)
{
$data = fread($fd, 2 * $n);
$i = unpack("S$n", $data);
if ($n == 1) {
return (int) $i[1];
} else {
return array_merge($i);
}
}
/**
* putInt16
* @param mixed $fd file descriptor
* @param mixed $value value
* @return bool
*/
private static function putInt16($fd, $value)
{
return fwrite($fd, pack('S', $value));
}
/**
* getInt32
* @param mixed $fd file descriptor
* @param int $n n
* @return bool
*/
private static function getInt32($fd, $n = 1)
{
$data = fread($fd, 4 * $n);
$i = unpack("L$n", $data);
if ($n == 1) {
return (int) $i[1];
} else {
return array_merge($i);
}
}
/**
* putint32
* @param mixed $fd file descriptor
* @param mixed $value value
* @return bool
*/
private static function putInt32($fd, $value)
{
return fwrite($fd, pack('L', $value));
}
/**
* putString
* @param mixed $fd file descriptor
* @param mixed $value value
* @param int $length length
* @return bool
*/
private static function putString($fd, $value, $length = 254)
{
$ret = fwrite($fd, pack('A' . $length, $value));
}
/**
* putRecord
* @param mixed $record record
* @return bool
*/
private function putRecord($record)
{
foreach ($this->fields as $i => &$field) {
$value = $record[$i];
// Number types are right aligned with spaces
if ($field['type'] == 'N' || $field['type'] == 'F' && strlen($value) < $field['length']) {
$value = str_repeat(' ', $field['length'] - strlen($value)) . $value;
}
self::putString($this->fd, $value, $field['length']);
}
return true;
}
}
if (!function_exists('dbase_open')) {
/**
* dbase_open
* @param string $filename filename
* @param int $mode mode
* @return DBase
*/
function dbase_open($filename, $mode)
{
return DBase::open($filename, $mode);
}
/**
* dbase_create
* @param string $filename filename
* @param array $fields fields
* @param int $type type
* @return DBase
*/
function dbase_create($filename, $fields, $type = DBASE_TYPE_DBASE)
{
return DBase::create($filename, $fields, $type);
}
/**
* dbase_close
* @param Resource $dbase_identifier dbase identifier
* @return bool
*/
function dbase_close($dbase_identifier)
{
return $dbase_identifier->close();
}
/**
* dbase_get_header_info
* @param Resource $dbase_identifier dbase identifier
* @return string
*/
function dbase_get_header_info($dbase_identifier)
{
return $dbase_identifier->get_header_info();
}
/**
* dbase_numfields
* @param Resource $dbase_identifier dbase identifier
* @return int
*/
function dbase_numfields($dbase_identifier)
{
$dbase_identifier->numfields();
}
/**
* dbase_numrecords
* @param Resource $dbase_identifier dbase identifier
* @return int
*/
function dbase_numrecords($dbase_identifier)
{
return $dbase_identifier->numrecords();
}
/**
* dbase_add_record
* @param Resource $dbase_identifier dbase identifier
* @param array $record record
* @return bool
*/
function dbase_add_record($dbase_identifier, $record)
{
return $dbase_identifier->add_record($record);
}
/**
* dbase_delete_record
* @param Resource $dbase_identifier dbase identifier
* @param int $record_number record number
* @return bool
*/
function dbase_delete_record($dbase_identifier, $record_number)
{
return $dbase_identifier->delete_record($record_number);
}
/**
* dbase_replace_record
* @param Resource $dbase_identifier dbase identifier
* @param array $record record
* @param int $record_number record number
* @return bool
*/
function dbase_replace_record($dbase_identifier, $record, $record_number)
{
return $dbase_identifier->replace_record($record, $record_number);
}
/**
* dbase_get_record
* @param Resource $dbase_identifier dbase identifier
* @param int $record_number record number
* @return bool
*/
function dbase_get_record($dbase_identifier, $record_number)
{
return $dbase_identifier->get_record($record_number);
}
/**
* dbase_get_record_with_names
* @param Resource $dbase_identifier dbase identifier
* @param int $record_number record number
* @return bool
*/
function dbase_get_record_with_names($dbase_identifier, $record_number)
{
return $dbase_identifier->get_record_with_names($record_number);
}
/**
* dbase_pack
* @param Resource $dbase_identifier dbase identifier
* @return bool
*/
function dbase_pack($dbase_identifier)
{
return $dbase_identifier->pack();
}
}

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -91,19 +91,19 @@ $tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account
$tabsqlsort = array();
$tabsqlsort[32] = "position ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
// Name of the fields in the result of select to display the dictionary
$tabfield = array();
$tabfield[32] = "code,label,range_account,category_type,formula,position,country";
// Nom des champs d'edition pour modification d'un enregistrement
// Name of editing fields for record modification
$tabfieldvalue = array();
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
// Nom des champs dans la table pour insertion d'un enregistrement
// Name of the fields in the table for inserting a record
$tabfieldinsert = array();
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
// Nom du rowid si le champ n'est pas de type autoincrement
// Name of the rowid if the field is not of type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on
// "nameoffield" if id field is not "rowid" or has not autoincrement on
$tabrowid = array();
@@ -151,7 +151,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
if ($value == 'range_account' && empty($_POST['range_account'])) {
continue;
}
if ($value == 'country' || $value == 'country_id') {
if (($value == 'country' || $value == 'country_id') && (!empty($_POST['country_id']))) {
continue;
}
if (!GETPOSTISSET($value) || GETPOST($value) == '') {
@@ -176,6 +176,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
if ($fieldnamekey == 'category_type') {
$fieldnamekey = 'Calculated';
}
if ($fieldnamekey == 'country') {
$fieldnamekey = 'Country';
}
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
}
@@ -263,7 +266,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
}
}
// Si verif ok et action modify, on modifie la ligne
// If check ok and action modify, we modify the line
if ($ok && GETPOST('actionmodify', 'alpha')) {
if ($tabrowid[$id]) {
$rowidcol = $tabrowid[$id];
@@ -430,12 +433,12 @@ print load_fiche_titre($titre, $linkback, $titlepicto);
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
// Confirmation de la suppression de la ligne
// Confirmation of the deletion of the line
if ($action == 'delete') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
}
// Complete requete recherche valeurs avec critere de tri
// Complete search query with sorting criteria
$sql = $tabsql[$id];
if ($search_country_id > 0) {
@@ -634,14 +637,14 @@ if ($resql) {
// Title of lines
print '<tr class="liste_titre">';
foreach ($fieldlist as $field => $value) {
// Determine le nom du champ par rapport aux noms possibles
// dans les dictionnaires de donnees
$showfield = 1; // By defaut
// Determines the name of the field in relation to the possible names
// in data dictionaries
$showfield = 1; // By default
$class = "left";
$sortable = 1;
$valuetoshow = '';
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
$valuetoshow = ucfirst($fieldlist[$field]); // By default
$valuetoshow = $langs->trans($valuetoshow); // try to translate
if ($fieldlist[$field] == 'source') {
$valuetoshow = $langs->trans("Contact");

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
@@ -260,6 +260,22 @@ $linkback = '';
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
print load_fiche_titre($title, $linkback, 'accountancy');
// Show message if accountancy hidden options are activated to help to resolve some problems
if (!$user->admin) {
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
}
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
}
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
}
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
}
}
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';

View File

@@ -186,18 +186,35 @@ if ($action == 'update') {
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$sql.'</pre></span></div>';
$ko++;
} else {
$db->begin();
$sql = '';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
$sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
$sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
$resql_exists = $db->query($sql_exists);
if (!$resql_exists) {
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
$ko++;
} else {
$nb_exists = $db->num_rows($resql_exists);
if ($nb_exists <= 0) {
// insert
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->escape($accountancy_field_name) . ")";
$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
} else {
$obj_exists = $db->fetch_object($resql_exists);
// update
$sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
}
}
} else {
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
$sql .= " WHERE rowid = ".((int) $productid);
}
$db->begin();
dol_syslog("/accountancy/admin/productaccount.php sql=".$sql, LOG_DEBUG);
if ($db->query($sql)) {
$ok++;

View File

@@ -429,7 +429,7 @@ if ($action != 'export_csv') {
print '<tr class="oddeven">';
print '<td>'.$accounting_account.'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($opening_balance, 'MT')).'</td>';
}
$urlzoom = '';
@@ -443,9 +443,9 @@ if ($action != 'export_csv') {
}
}
// Debit
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->debit, 'MT')).'</a></td>';
// Credit
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->credit, 'MT')).'</a></td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
@@ -466,10 +466,10 @@ if ($action != 'export_csv') {
if (!empty($show_subgroup)) {
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
}
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
} else {
@@ -481,10 +481,10 @@ if ($action != 'export_csv') {
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
}
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
} else {

View File

@@ -591,7 +591,7 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
if (!empty($accountancyexport->errors)) {
setEventMessages('', $accountancyexport->errors, 'errors');
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
} elseif (!empty($notifiedexportdate) || !empty($notifiedvalidationdate)) {
// Specify as export : update field date_export or date_validated
$error = 0;
$db->begin();
@@ -602,17 +602,17 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
$sql .= " SET";
if (!$notifiedexportdate && !$notifiedvalidationdate) {
if (!empty($notifiedexportdate) && !empty($notifiedvalidationdate)) {
$sql .= " date_export = '".$db->idate($now)."'";
$sql .= ", date_validated = '".$db->idate($now)."'";
} elseif (!$notifiedexportdate) {
} elseif (!empty($notifiedexportdate)) {
$sql .= " date_export = '".$db->idate($now)."'";
} elseif (!$notifiedvalidationdate) {
} elseif (!empty($notifiedvalidationdate)) {
$sql .= " date_validated = '".$db->idate($now)."'";
}
$sql .= " WHERE rowid = ".((int) $movement->id);
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
dol_syslog("/accountancy/bookkeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
$result = $db->query($sql);
if (!$result) {
$error++;

View File

@@ -119,8 +119,8 @@ class AccountancyExport
self::$EXPORT_TYPE_CHARLEMAGNE => $langs->trans('Modelcsv_charlemagne'),
self::$EXPORT_TYPE_LDCOMPTA => $langs->trans('Modelcsv_LDCompta'),
self::$EXPORT_TYPE_LDCOMPTA10 => $langs->trans('Modelcsv_LDCompta10'),
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinum_v3'),
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
self::$EXPORT_TYPE_GESTIMUMV3 => $langs->trans('Modelcsv_Gestinumv3'),
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinumv5'),
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
);
@@ -468,7 +468,7 @@ class AccountancyExport
/**
* Export format : CIEL (Format XIMPORT)
* Format since 2003 compatible CIEL version > 2002 / Sage50
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
* Last review for this format : 2021-09-13 Alexandre Spangaro (aspangaro@open-dsi.fr)
*
* Help : https://sage50c.online-help.sage.fr/aide-technique/
* In sage software | Use menu : "Exchange" > "Importing entries..."
@@ -496,7 +496,7 @@ class AccountancyExport
$Tab = array();
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
$Tab['code_journal'] = str_pad($data->code_journal, 2);
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
@@ -504,9 +504,9 @@ class AccountancyExport
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
$Tab['type_montant'] = str_pad($data->sens, 1);
$Tab['vide'] = str_repeat(' ', 18);
$Tab['vide'] = str_repeat(' ', 18); // Analytical accounting - Not managed in Dolibarr
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
$Tab['end'] = 'O2003';
$Tab['end'] = 'O2003'; // 0 = EUR | 2003 = Format Ciel
$Tab['end_line'] = $end_line;
@@ -516,14 +516,19 @@ class AccountancyExport
}
/**
* Export format : Quadratus
* Export format : Quadratus (Format ASCII)
* Format since 2015 compatible QuadraCOMPTA
* Last review for this format : 2021/09/13 Alexandre Spangaro (aspangaro@open-dsi.fr)
*
* Help : https://docplayer.fr/20769649-Fichier-d-entree-ascii-dans-quadracompta.html
* In QuadraCompta | Use menu : "Outils" > "Suivi des dossiers" > "Import ASCII(Compta)"
*
* @param array $TData data
* @return void
*/
public function exportQuadratus(&$TData)
{
global $conf;
global $conf, $db;
$end_line = "\r\n";
@@ -536,6 +541,44 @@ class AccountancyExport
$code_compta = $data->subledger_account;
}
$Tab = array();
if (!empty($data->subledger_account)) {
$Tab['type_ligne'] = 'C';
$Tab['num_compte'] = str_pad(self::trunc($data->subledger_account, 8), 8);
$Tab['lib_compte'] = str_pad(self::trunc($data->subledger_label, 30), 30);
if ($data->doc_type == 'customer_invoice') {
$Tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc($data->subledger_label, 6), 6));
$Tab['filler'] = str_repeat(' ', 52);
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8);
} elseif ($data->doc_type == 'supplier_invoice') {
$Tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc($data->subledger_label, 6), 6));
$Tab['filler'] = str_repeat(' ', 52);
$Tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8);
} else {
$Tab['filler'] = str_repeat(' ', 59);
$Tab['coll_compte'] = str_pad(' ', 8);
}
$Tab['filler2'] = str_repeat(' ', 110);
$Tab['Maj'] = 2; // Partial update (alpha key, label, address, collectif, RIB)
if ($data->doc_type == 'customer_invoice') {
$Tab['type_compte'] = 'C';
} elseif ($data->doc_type == 'supplier_invoice') {
$Tab['coll_compte'] = 'F';
} else {
$Tab['coll_compte'] = 'G';
}
$Tab['filler3'] = str_repeat(' ', 235);
$Tab['end_line'] = $end_line;
print implode($Tab);
}
$Tab = array();
$Tab['type_ligne'] = 'M';
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 8), 8);

View File

@@ -297,7 +297,7 @@ class BookKeeping extends CommonObject
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
$sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines
$sql .= " AND fk_docdet = ".((int) $this->fk_docdet); // This field can be 0 if record is for several lines
}
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
@@ -937,7 +937,6 @@ class BookKeeping extends CommonObject
$line->piece_num = $obj->piece_num;
$line->date_creation = $this->db->jdate($obj->date_creation);
$line->date_export = $this->db->jdate($obj->date_export);
$line->date_validation = $this->db->jdate($obj->date_validated);
$line->date_validation = $this->db->jdate($obj->date_validation);
$this->lines[] = $line;
@@ -1090,7 +1089,6 @@ class BookKeeping extends CommonObject
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
$line->date_modification = $this->db->jdate($obj->date_modification);
$line->date_export = $this->db->jdate($obj->date_export);
$line->date_validation = $this->db->jdate($obj->date_validated);
$line->date_validation = $this->db->jdate($obj->date_validation);
$this->lines[] = $line;
@@ -1751,7 +1749,6 @@ class BookKeeping extends CommonObject
$line->date_creation = $obj->date_creation;
$line->date_modification = $obj->date_modification;
$line->date_export = $obj->date_export;
$line->date_validation = $obj->date_validated;
$line->date_validation = $obj->date_validation;
$this->linesmvt[] = $line;
@@ -1816,7 +1813,6 @@ class BookKeeping extends CommonObject
$line->sens = $obj->sens;
$line->code_journal = $obj->code_journal;
$line->piece_num = $obj->piece_num;
$line->date_validation = $obj->date_validated;
$line->date_validation = $obj->date_validation;
$this->linesexport[] = $line;

View File

@@ -170,6 +170,8 @@ if ($action == 'validatehistory') {
} else {
$num_lines = $db->num_rows($result);
$facture_static = new Facture($db);
$isSellerInEEC = isInEEC($mysoc);
$i = 0;
@@ -213,6 +215,18 @@ if ($action == 'validatehistory') {
}
}
// Manage Deposit
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
$accountdeposittoventilated = new AccountingAccount($db);
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
$objp->code_sell_l = $accountdeposittoventilated->ref;
$objp->code_sell_p = '';
$objp->code_sell_t = '';
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
}
}
if ($objp->aarowid_suggest > 0) {
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
$sqlupdate .= " SET fk_code_ventilation = ".((int) $objp->aarowid_suggest);
@@ -265,8 +279,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -314,7 +328,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -349,8 +363,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -436,7 +450,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("TotalVente").'</td>';
print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -497,7 +511,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print "<br>\n";
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400">'.$langs->trans("TotalMarge").'</td>';
print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {

View File

@@ -369,9 +369,9 @@ if ($result) {
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneCustomer").'</span><br>';
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
$moreforfilter = '';

View File

@@ -637,11 +637,15 @@ if ($result) {
}
// Manage Deposit
if ($objp->description == "(DEPOSIT)") {
$accountdeposittoventilated = new AccountingAccount($db);
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
$objp->code_sell_l = $accountdeposittoventilated->ref;
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
$accountdeposittoventilated = new AccountingAccount($db);
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
$objp->code_sell_l = $accountdeposittoventilated->ref;
$objp->code_sell_p = '';
$objp->code_sell_t = '';
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
}
}
if (!empty($objp->code_sell_p)) {

View File

@@ -154,8 +154,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -197,7 +197,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -233,8 +233,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -276,7 +276,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
@@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') {
$userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name'];
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
print "</tr>";
}
@@ -627,7 +627,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
} else {

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2007-2010 Jean Heimburger <jean@tiaris.info>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
@@ -648,7 +648,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$val["refsologest"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$conf->global->ACCOUNTING_ACCOUNT_SUPPLIER.'"'.$sep;
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("Thirdparty").'"'.$sep;
@@ -717,9 +717,9 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$date.'"'.$sep;
print '"'.$val["refsologest"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.length_accountg(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$val["refsuppliersologest"].' - '.$langs->trans("VAT").' NPR"'.$sep;
print '"'.($mt < 0 ? price(-$mt) : '').'"'.$sep;
@@ -894,7 +894,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForSuppliersNotDefined").'</span>';
} else {

View File

@@ -609,7 +609,7 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
print '"'.$val["ref"].'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 32)).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$conf->global->ACCOUNTING_ACCOUNT_CUSTOMER.'"'.$sep;
print '"'.length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER).'"'.$sep;
print '"'.length_accounta(html_entity_decode($k)).'"'.$sep;
print '"'.$langs->trans("Thirdparty").'"'.$sep;
print '"'.utf8_decode(dol_trunc($companystatic->name, 16)).' - '.$invoicestatic->ref.' - '.$langs->trans("Thirdparty").'"'.$sep;
@@ -834,7 +834,7 @@ if (empty($action) || $action == 'view') {
print "<td>".$invoicestatic->getNomUrl(1)."</td>";
// Account
print "<td>";
$accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
$accountoshow = length_accountg($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER);
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
print '<span class="error">'.$langs->trans("MainAccountForCustomersNotDefined").'</span>';
} else {

View File

@@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -309,7 +309,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
print length_accountg($row[0]);
}
@@ -344,8 +344,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="200">'.$langs->trans("Account").'</td>';
print '<td width="200" class="left">'.$langs->trans("Label").'</td>';
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
print '<td class="left">'.$langs->trans("Label").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td width="400" class="left">'.$langs->trans("Total").'</td>';
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {

View File

@@ -369,9 +369,9 @@ if ($result) {
print_barre_liste($langs->trans("InvoiceLinesDone"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num_lines, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
print '<span class="opacitymedium">'.$langs->trans("DescVentilDoneSupplier").'</span><br>';
print '<br><div class="inline-block divButAction">'.$langs->trans("ChangeAccount").'<br>';
print '<br><div class="inline-block divButAction paddingbottom">'.$langs->trans("ChangeAccount").' ';
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
print '<input type="submit" class="button small valignmiddle" value="'.$langs->trans("ChangeBinding").'"/></div>';
$moreforfilter = '';

View File

@@ -620,10 +620,12 @@ if ($result) {
}
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (!empty($objp->company_code_buy)) {
$objp->code_buy_t = $objp->company_code_buy;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
if (!empty($objp->company_code_buy)) {
$objp->code_buy_t = $objp->company_code_buy;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
}
}
if (!empty($objp->code_buy_p)) {
@@ -724,11 +726,13 @@ if ($result) {
$s .= $langs->trans("NotDefined");
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '<br>';
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
$shelp = '';
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
print '<br>';
$s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
$shelp = '';
$s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : '<span style="'.$code_buy_t_notset.'">'.$langs->trans("NotDefined").'</span>');
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
print '</td>';
// Suggested accounting account

View File

@@ -38,10 +38,12 @@ header('Content-Type: text/csv');
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
$accountancyexport = new AccountancyExport($db);
if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_FEC && $type_export == "general_ledger") { // Specific filename for FEC model export into the general ledger
// Specific filename for FEC model export into the general ledger
if (($accountancyexport->getFormatCode($formatexportset) == 'fec' || $accountancyexport->getFormatCode($formatexportset) == 'fec2')
&& $type_export == "general_ledger") {
// FEC format is defined here: https://www.legifrance.gouv.fr/affichCodeArticle.do?idArticle=LEGIARTI000027804775&cidTexte=LEGITEXT000006069583&dateTexte=20130802&oldAction=rechCodeArticle
if (empty($search_date_end)) {
// TODO Get the max date into bookeeping table
// TODO Get the max date into bookkeeping table
$search_date_end = dol_now();
}
$datetouseforfilename = $search_date_end;
@@ -58,7 +60,7 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
} elseif ($accountancyexport->getFormatCode($formatexportset) == 'ciel' && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
$completefilename = "XIMPORT.TXT";
} else {
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;

View File

@@ -25,7 +25,7 @@
*/
/**
* \file htdocs/adherents/admin/adherent.php
* \file htdocs/adherents/admin/member.php
* \ingroup member
* \brief Page to setup the module Foundation
*/
@@ -205,16 +205,16 @@ print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print "</tr>\n";
// Login/Pass required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
print "</td></tr>\n";
// Mail required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
print "</td></tr>\n";
// Login/Pass required for members
print '<tr class="oddeven"><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
print "</td></tr>\n";
// Send mail information is on by default
print '<tr class="oddeven"><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
@@ -225,6 +225,13 @@ print '<tr class="oddeven"><td>'.$langs->trans("MemberCreateAnExternalUserForSub
print $form->selectyesno('ADHERENT_CREATE_EXTERNAL_USER_LOGIN', (!empty($conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN) ? $conf->global->ADHERENT_CREATE_EXTERNAL_USER_LOGIN : 0), 1);
print "</td></tr>\n";
// Allow members to change type on renewal forms
/* To test during next beta
print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
print "</td></tr>\n";
*/
// Insert subscription into bank account
print '<tr class="oddeven"><td>'.$langs->trans("MoreActionsOnSubscription").'</td>';
$arraychoices = array('0'=>$langs->trans("None"));

View File

@@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') {
if ($action == 'update') {
$public = GETPOST('MEMBER_ENABLE_PUBLIC');
$amount = GETPOST('MEMBER_NEWFORM_AMOUNT');
$amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
@@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<tr class="oddeven" id="tramount"><td>';
print $langs->trans("DefaultAmount");
print '</td><td class="right">';
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
print '<input type="text" class="right width75" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
print "</td></tr>\n";
// Can edit

View File

@@ -645,7 +645,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@@ -716,7 +716,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
@@ -787,7 +787,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
@@ -913,7 +913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->state_id = GETPOST('state_id', 'int');
// We set country_id, country_code and country for the selected country
$object->country_id = GETPOST('country_id', 'int') ?GETPOST('country_id', 'int') : $mysoc->country_id;
$object->country_id = GETPOST('country_id', 'int') ? GETPOST('country_id', 'int') : $mysoc->country_id;
if ($object->country_id) {
$tmparray = getCountry($object->country_id, 'all');
$object->country_code = $tmparray['code'];
@@ -921,12 +921,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
if (!empty($socid)) {
$object = new Societe($db);
$soc = new Societe($db);
if ($socid > 0) {
$object->fetch($socid);
$soc->fetch($socid);
}
if (!($object->id > 0)) {
if (!($soc->id > 0)) {
$langs->load("errors");
print($langs->trans('ErrorRecordNotFound'));
exit;
@@ -1009,7 +1009,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "</td>\n";
// Company
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $object->company).'"></td></tr>';
print '<tr><td id="tdcompany">'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth300" maxlength="128" value="'.(GETPOSTISSET('societe') ? GETPOST('societe', 'alphanohtml') : $soc->name).'"></td></tr>';
// Civility
print '<tr><td>'.$langs->trans("UserTitle").'</td><td>';
@@ -1033,7 +1033,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// EMail
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $object->email).'"></td></tr>';
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET('member_email') ? GETPOST('member_email', 'alpha') : $soc->email).'"></td></tr>';
// Website
print '<tr><td>'.$form->editfieldkey('Web', 'member_url', '', $object, 0).'</td>';
@@ -1041,21 +1041,25 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Address
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET('address') ?GETPOST('address', 'alphanohtml') : $object->address).'</textarea>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOSTISSET('address') ?GETPOST('address', 'alphanohtml') : $soc->address).'</textarea>';
print '</td></tr>';
// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
print $formcompany->select_ziptown((GETPOSTISSET('zipcode') ? GETPOST('zipcode', 'alphanohtml') : $soc->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
print ' ';
print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print $formcompany->select_ziptown((GETPOSTISSET('town') ? GETPOST('town', 'alphanohtml') : $soc->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
print '</td></tr>';
// Country
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
if (empty($soc->country_id)) {
$soc->country_id = $mysoc->country_id;
$soc->country_code = $mysoc->country_code;
$soc->state_id = $mysoc->state_id;
}
print '<tr><td>'.$langs->trans('Country').'</td><td>';
print img_picto('', 'country', 'class="pictofixedwidth"');
print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id');
print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $soc->country_id, 'country_id');
if ($user->admin) {
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
}
@@ -1064,9 +1068,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// State
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
print '<tr><td>'.$langs->trans('State').'</td><td>';
if ($object->country_id) {
if ($soc->country_id) {
print img_picto('', 'state', 'class="pictofixedwidth"');
print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code);
} else {
print $countrynotdefined;
}
@@ -1075,7 +1079,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Pro phone
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" size="20" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $object->phone).'"></td></tr>';
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" size="20" value="'.(GETPOSTISSET('phone') ? GETPOST('phone', 'alpha') : $soc->phone).'"></td></tr>';
// Personal phone
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
@@ -1506,7 +1510,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
$outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@@ -1821,14 +1825,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$company = new Societe($db);
$result = $company->fetch($object->socid);
print $company->getNomUrl(1);
// Show link to invoices
$tmparray = $company->getOutstandingBills('customer');
if (!empty($tmparray['refs'])) {
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
// TODO Add alert if warning on at least one invoice late
print '</a>';
}
} else {
print $langs->trans("NoThirdPartyAssociatedToMember");
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
}
}
print '</td></tr>';
}
// Login Dolibarr
// Login Dolibarr - Link to user
print '<tr><td>';
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
@@ -1846,7 +1858,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
print '</td></tr>';
//VCard
// VCard
print '<tr><td>';
print $langs->trans("VCard").'</td><td colspan="3">';
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
@@ -1941,7 +1953,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->societe->enabled) && !$object->socid) {
if ($user->rights->societe->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";;
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";;
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrThirdParty").'</a>'."\n";
}
@@ -1954,7 +1966,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!$user->socid && !$object->user_id) {
if ($user->rights->user->user->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&amp;action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
} else {
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("ValidateBefore")).'">'.$langs->trans("CreateDolibarrLogin").'</a>'."\n";
}
@@ -2002,8 +2014,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Generated documents
$filename = dol_sanitizeFileName($object->ref);
//$filename = 'tmp_cards.php';
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'member');
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire;
$delallowed = $user->rights->adherent->creer;

View File

@@ -1900,8 +1900,8 @@ class Adherent extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql .= " statut = ".self::STATUS_VALIDATED;
$sql .= ", datevalid = '".$this->db->idate($now)."'";
$sql .= ", fk_user_valid=".$user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= ", fk_user_valid=".((int) $user->id);
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
$result = $this->db->query($sql);
@@ -2185,6 +2185,9 @@ class Adherent extends CommonObject
if (!empty($this->ref)) {
$label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
}
if (!empty($this->login)) {
$label .= '<br><b>'.$langs->trans('Login').':</b> '.$this->login;
}
if (!empty($this->firstname) || !empty($this->lastname)) {
$label .= '<br><b>'.$langs->trans('Name').':</b> '.$this->getFullName($langs);
}

View File

@@ -70,7 +70,7 @@ class AdherentStats extends Stats
$this->where .= " m.statut != -1";
$this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
//if (!$user->rights->societe->client->voir && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
if ($this->memberid) {
$this->where .= " AND m.rowid = ".((int) $this->memberid);
}

View File

@@ -317,6 +317,7 @@ $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.p
$sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
$sql .= " d.note_private, d.note_public,";
$sql .= " s.nom,";
$sql .= " ".$db->ifsql("d.societe IS NULL", "s.nom", "d.societe")." as companyname,";
$sql .= " t.libelle as type, t.subscription,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
// Add fields from extrafields
@@ -491,7 +492,7 @@ if (GETPOSTISSET("search_status")) {
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
$titre = $langs->trans("MembersListNotUpToDate");
}
if ($search_status == Adherent::STATUS_RESILIATED) {
if ((string) $search_status == (string) Adherent::STATUS_RESILIATED) { // The cast to string is required to have test false when search_status is ''
$titre = $langs->trans("MembersListResiliated");
}
if ($search_status == Adherent::STATUS_EXCLUDED) {
@@ -832,7 +833,7 @@ if (!empty($arrayfields['d.gender']['checked'])) {
print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder);
}
if (!empty($arrayfields['d.company']['checked'])) {
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'companyname', '', $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['d.login']['checked'])) {
print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder);
@@ -905,6 +906,7 @@ while ($i < min($num, $limit)) {
$memberstatic->id = $obj->rowid;
$memberstatic->ref = $obj->ref;
$memberstatic->civility_id = $obj->civility;
$memberstatic->login = $obj->login;
$memberstatic->lastname = $obj->lastname;
$memberstatic->firstname = $obj->firstname;
$memberstatic->gender = $obj->gender;
@@ -919,9 +921,13 @@ while ($i < min($num, $limit)) {
if (!empty($obj->fk_soc)) {
$memberstatic->fetch_thirdparty();
$companyname = $memberstatic->thirdparty->name;
if ($memberstatic->thirdparty->id > 0) {
$companyname = $memberstatic->thirdparty->name;
$companynametoshow = $memberstatic->thirdparty->getNomUrl(1);
}
} else {
$companyname = $obj->company;
$companynametoshow = $obj->company;
}
$memberstatic->company = $companyname;
@@ -955,7 +961,8 @@ while ($i < min($num, $limit)) {
// Firstname
if (!empty($arrayfields['d.firstname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
print $obj->firstname;
print $memberstatic->getNomUrl(0, 0, 'card', 'firstname');
//print $obj->firstname;
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@@ -964,7 +971,8 @@ while ($i < min($num, $limit)) {
// Lastname
if (!empty($arrayfields['d.lastname']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">';
print $obj->lastname;
print $memberstatic->getNomUrl(0, 0, 'card', 'lastname');
//print $obj->lastname;
print "</td>\n";
if (!$i) {
$totalarray['nbfield']++;
@@ -984,7 +992,7 @@ while ($i < min($num, $limit)) {
// Company
if (!empty($arrayfields['d.company']['checked'])) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($companyname).'">';
print $companyname;
print $companynametoshow;
print "</td>\n";
}
// Login
@@ -1094,7 +1102,9 @@ while ($i < min($num, $limit)) {
}
// EMail
if (!empty($arrayfields['d.email']['checked'])) {
print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n";
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->email).'">';
print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1);
print "</td>\n";
}
// End of subscription date
$datefin = $db->jdate($obj->datefin);

View File

@@ -195,9 +195,7 @@ foreach ($data as $val) {
}
print '<tr class="oddeven" height="24">';
print '<td class="center">';
//print '<a href="month.php?year='.$year.'">';
print $year;
//print '</a>';
print '<a href="'.DOL_URL_ROOT.'/adherents/subscription/list.php?date_select='.((int) $year).'">'.$year.'</a>';
print '</td>';
print '<td class="right">'.$val['nb'].'</td>';
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';

View File

@@ -209,7 +209,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
// Subscription informations
$datesubscription = 0;
$datesubend = 0;
$paymentdate = 0;
$paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01
if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) {
$datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int"));
}
@@ -260,7 +260,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
}
// Check if a payment is mandatory or not
if (!$error && $adht->subscription) { // Member type need subscriptions
if ($adht->subscription) { // Member type need subscriptions
if (!is_numeric($amount)) {
// If field is '' or not a numeric value
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
@@ -268,28 +268,35 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$error++;
$action = 'addsubscription';
} else {
// If an amount has been provided, we check also fields that becomes mandatory when amount is not null.
if (!empty($conf->banque->enabled) && GETPOST("paymentsave") != 'none') {
if (GETPOST("subscription")) {
if (!GETPOST("label")) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
if (GETPOST("paymentsave") != 'invoiceonly' && !GETPOST("operation")) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) {
$errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
} else {
if (GETPOST("accountid")) {
if (GETPOST("accountid", 'int')) {
$errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
}
if ($errmsg) {
$error++;
setEventMessages($errmsg, null, 'errors');
$error++;
$action = 'addsubscription';
}
}
}
}
@@ -601,14 +608,22 @@ if ($rowid > 0) {
$company = new Societe($db);
$result = $company->fetch($object->fk_soc);
print $company->getNomUrl(1);
// Show link to invoices
$tmparray = $company->getOutstandingBills('customer');
if (!empty($tmparray['refs'])) {
print ' - '.img_picto($langs->trans("Invoices"), 'bill', 'class="paddingright"').'<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->socid.'">'.$langs->trans("Invoices").' ('.count($tmparray['refs']).')';
// TODO Add alert if warning on at least one invoice late
print '</a>';
}
} else {
print $langs->trans("NoThirdPartyAssociatedToMember");
print '<span class="opacitymedium">'.$langs->trans("NoThirdPartyAssociatedToMember").'</span>';
}
}
print '</td></tr>';
}
// Login Dolibarr
// Login Dolibarr - Link to user
print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
@@ -626,9 +641,11 @@ if ($rowid > 0) {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
} else {
if ($object->user_id) {
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
$linkeduser = new User($db);
$linkeduser->fetch($object->user_id);
print $linkeduser->getNomUrl(-1);
} else {
print $langs->trans("NoDolibarrAccess");
print '<span class="opacitymedium">'.$langs->trans("NoDolibarrAccess").'</span>';
}
}
print '</td></tr>';
@@ -926,8 +943,10 @@ if ($rowid > 0) {
}
if (!$datefrom) {
$datefrom = $object->datevalid;
if ($object->datefin > 0) {
if ($object->datefin > 0 && dol_time_plus_duree($object->datefin, $defaultdelay, $defaultdelayunit) > dol_now()) {
$datefrom = dol_time_plus_duree($object->datefin, 1, 'd');
} else {
$datefrom = dol_get_first_day(dol_print_date(time(), "%Y"));
}
}
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
@@ -946,7 +965,7 @@ if ($rowid > 0) {
if ($adht->subscription) {
// Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.GETPOST('subscription').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'. price(GETPOSTISSET('subscription') ? GETPOST('subscription') : $adht->amount).'"> '.$langs->trans("Currency".$conf->currency) .'</td></tr>';
// Label
print '<tr><td>'.$langs->trans("Label").'</td>';
@@ -970,17 +989,18 @@ if ($rowid > 0) {
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('MoreActions');
print '</td>';
print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'> '.$langs->trans("None").'<br>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(empty($bankdirect) && empty($invoiceonly) && empty($bankviainvoice) ? ' checked' : '').'>';
print '<label for="none"> '.$langs->trans("None").'</label><br>';
// Add entry into bank accoun
if (!empty($conf->banque->enabled)) {
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.(!empty($bankdirect) ? ' checked' : '');
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
print '><label for="bankdirect"> '.$langs->trans("MoreActionBankDirect").'</label><br>';
}
// Add invoice with no payments
if (!empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.(!empty($invoiceonly) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionInvoiceOnly");
print '><label for="invoiceonly"> '.$langs->trans("MoreActionInvoiceOnly");
if ($object->fk_soc) {
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
} else {
@@ -1004,13 +1024,13 @@ if ($rowid > 0) {
}
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
print '</label><br>';
}
// Add invoice with payments
if (!empty($conf->banque->enabled) && !empty($conf->societe->enabled) && !empty($conf->facture->enabled)) {
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.(!empty($bankviainvoice) ? ' checked' : '');
//if (empty($object->fk_soc)) print ' disabled';
print '> '.$langs->trans("MoreActionBankViaInvoice");
print '><label for="bankviainvoice"> '.$langs->trans("MoreActionBankViaInvoice");
if ($object->fk_soc) {
print ' ('.$langs->trans("ThirdParty").': '.$company->getNomUrl(1).')';
} else {
@@ -1034,7 +1054,7 @@ if ($rowid > 0) {
}
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
}
print '<br>';
print '</label><br>';
}
print '</td></tr>';

View File

@@ -311,6 +311,7 @@ print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="date_select" value="'.$date_select.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $subscription->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@@ -318,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
print "</tr>";
$i++;
}
// If no record found
if ($num == 0) {
/*$colspan = 1;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
$colspan++;
}
}*/
$colspan = 8;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
print "</table>";
print '</div>';

View File

@@ -115,7 +115,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
// Name
print '<tr class="oddeven"><td><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';

View File

@@ -165,24 +165,27 @@ $urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
$message .= '<div class="urllink">';
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '<input type="text" id="onlinepaymenturl1" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl1');
$message .= '<br>';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
$message .= '<div class="urllink">';
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '<input type="text" id="onlinepaymenturl2" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl2');
$message .= '<br>';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
$message .= '<div class="urllink">';
$message .= '<input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '<input type="text" id="onlinepaymenturl3" class="quatrevingtpercent" value="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'">';
$message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl3');
$message .= '<br>';
print $message;

View File

@@ -696,7 +696,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') {
$tooltiphelp = '<i>'.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."</i>";
}
print "<label for=\"use_vat\">".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
print '<label for="use_vat">'.$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)."</label>";
print "</td></tr>\n";
@@ -706,7 +706,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') {
$tooltiphelp = "<i>".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."</i>\n";
}
print "<label for=\"no_vat\">".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
print '<label for="no_vat">'.$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)."</label>";
print "</td></tr>\n";
print "</table>";
@@ -721,12 +721,12 @@ print "</tr>\n";
if ($mysoc->useLocalTax(1)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="lt1" value="localtax1on"'.(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> <label for="lt1">'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
print '<div class="nobordernopadding">';
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
print '<label for="lt1">'.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
if (!isOnlyOneLocalTax(1)) {
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
@@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) {
print "</div>";
print "</td></tr>\n";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax1" id="nolt1" value="localtax1off"'.((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> <label for="nolt1">'.$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."</i>\n" : "");
print "<label for=\"nolt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
print "</td></tr>\n";
} else {
if (empty($mysoc->country_code)) {
@@ -765,7 +765,7 @@ print "</tr>\n";
if ($mysoc->useLocalTax(2)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="lt2" value="localtax2on"'.(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> <label for="lt2">'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
print '<div class="nobordernopadding">';
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
@@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) {
print "</div>";
print "</td></tr>\n";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</td>";
print '<tr class="oddeven"><td><input type="radio" name="optionlocaltax2" id="nolt2" value="localtax2off"'.((empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> <label for="nolt2">'.$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."</label></td>";
print '<td colspan="2">';
print "<div>";
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
@@ -803,7 +803,7 @@ print "</table>";
print '<br>';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td width="25%">'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
print '<td>'.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).'</td><td>'.$langs->trans("Description").'</td>';
print '<td class="right">&nbsp;</td>';
print "</tr>\n";
if ($mysoc->useRevenueStamp()) {

View File

@@ -104,13 +104,11 @@ print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
// Social networks
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
print '<td class="titlefieldcreate">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
print "</tr>\n";

View File

@@ -220,7 +220,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.position FR
$tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]);
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
@@ -233,7 +233,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR
$tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
$tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
$tabsql[38] = "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity = ".getEntity($tabname[38]);
$tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel";
$tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact";
$tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode";
@@ -1175,6 +1175,8 @@ if ($id) {
$sql .= natural_search("r.code_region", $search_code);
} elseif ($search_code != '' && $id == 7) {
$sql .= natural_search("a.code", $search_code);
} elseif ($search_code != '' && $id == 10) {
$sql .= natural_search("t.code", $search_code);
} elseif ($search_code != '' && $id != 9) {
$sql .= natural_search("code", $search_code);
}
@@ -1452,6 +1454,10 @@ if ($id) {
print $tdsoffields;
// Line to enter new values
print '<!-- line to add new entry -->';
print '<tr class="oddeven nodrag nodrop nohover">';
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd')) {
@@ -1471,9 +1477,6 @@ if ($id) {
unset($fieldlist[2]); // Remove field ??? if dictionary Regions
}
// Line to enter new values
print '<!-- line to add new entry -->';
print '<tr class="oddeven nodrag nodrop nohover">';
if (empty($reshook)) {
fieldList($fieldlist, $obj, $tabname[$id], 'add');

View File

@@ -232,7 +232,7 @@ class PrestaShopWebservice
if ($response != '') {
libxml_clear_errors();
libxml_use_internal_errors(true);
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA);
$xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
if (libxml_get_errors()) {
$msg = var_export(libxml_get_errors(), true);
libxml_clear_errors();

View File

@@ -84,7 +84,7 @@ class Dolistore
try {
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
// Here we set the option array for the Webservice : we want categories resources
@@ -134,7 +134,7 @@ class Dolistore
try {
$this->api = new PrestaShopWebservice($conf->global->MAIN_MODULE_DOLISTORE_API_SRV, $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $this->debug_api);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
dol_syslog("Call API with MAIN_MODULE_DOLISTORE_API_SRV = ".getDolGlobalString('MAIN_MODULE_DOLISTORE_API_SRV'));
// $conf->global->MAIN_MODULE_DOLISTORE_API_KEY is for the login of basic auth. There is no password as it is public data.
// Here we set the option array for the Webservice : we want products resources
@@ -217,15 +217,15 @@ class Dolistore
for ($i = 0; $i < $nbofcateg; $i++) {
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.$cat->id.'" ';
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a></h3>';
$html .= '<li class="root"><h3 class="nomargesupinf"><a class="nomargesupinf link2cat" href="?mode=marketplace&categorie='.((int) $cat->id).'" ';
$html .= 'title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'">'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a></h3>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.$cat->id.'"';
$html .= '<li><a class="link2cat'.$select.'" href="?mode=marketplace&categorie='.((int) $cat->id).'"';
$html .= ' title="'.dol_escape_htmltag(strip_tags($cat->description->language[$this->lang - 1])).'" ';
$html .= '>'.$cat->name->language[$this->lang - 1].' <sup>'.$cat->nb_products_recursive.'</sup></a>';
$html .= '>'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' <sup>'.dol_escape_htmltag($cat->nb_products_recursive).'</sup></a>';
$html .= self::get_categories($cat->id);
$html .= "</li>\n";
}
@@ -267,9 +267,9 @@ class Dolistore
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
$images = '<a href="'.$image_url.'" class="documentpreview" target="_blank" mime="image/png" title="'.$product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version.'">';
$images .= '<img src="'.$image_url.'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
$images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
$images .= '<img src="'.urlencode($image_url).'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
}
@@ -277,11 +277,11 @@ class Dolistore
// free or pay ?
if ($product->price > 0) {
$price = '<h3>'.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} else {
$price = '<h3>'.$langs->trans('Free').'</h3>';
$download_link = '<a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" href="'.$this->shop_url.$product->id.'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
}
//checking versions
@@ -319,14 +319,14 @@ class Dolistore
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app oddeven '.$compatible.'">
<td class="center" width="210"><div class="newAppParent">'.$newapp.$images.'</div></td>
<td class="margeCote"><h2 class="appTitle">'.$product->name->language[$this->lang - 1]
.'<br><small>'.$version.'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.'</small><br><br>'.$product->description_short->language[$this->lang - 1].'</td>';
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td>
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1])
.'<br><small>'.dol_escape_htmltag($version).'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
// do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.$price.'</td>';
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>';
}
@@ -343,7 +343,7 @@ class Dolistore
public function get_previous_link($text = '<<')
{
// phpcs:enable
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
return '<a href="'.$this->get_previous_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -356,7 +356,7 @@ class Dolistore
public function get_next_link($text = '>>')
{
// phpcs:enable
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
return '<a href="'.$this->get_next_url().'" class="button">'.dol_escape_htmltag($text).'</a>';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@@ -48,8 +48,8 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
@@ -213,7 +213,7 @@ if ($action == 'edit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@@ -264,7 +264,7 @@ if ($action == 'edit') {
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db);
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
} elseif ($val['type'] == 'securekey') {
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
if (!empty($conf->use_javascript_ajax)) {
@@ -309,7 +309,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@@ -366,7 +366,7 @@ if ($action == 'edit') {
$product = new Product($db);
$resprod = $product->fetch($conf->global->{$constname});
if ($resprod > 0) {
print $product->ref;
print $product->getNomUrl(1);
} elseif ($resprod < 0) {
setEventMessages(null, $object->errors, "errors");
}

View File

@@ -47,6 +47,8 @@ if (!$user->admin) {
// Constant and translation of the module description
$modules = array(
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
'SOCIETE' => 'FCKeditorForCompany',
'PRODUCTDESC' => 'FCKeditorForProduct',
'DETAILS' => 'FCKeditorForProductDetails',
@@ -54,11 +56,11 @@ $modules = array(
'MAILING' => 'FCKeditorForMailing',
'MAIL' => 'FCKeditorForMail',
'TICKET' => 'FCKeditorForTicket',
'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
);
// Conditions for the option to be offered
$conditions = array(
'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1,
'SOCIETE' => 1,
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
@@ -66,11 +68,11 @@ $conditions = array(
'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
'TICKET' => !empty($conf->ticket->enabled),
'NOTE_PUBLIC' => 1,
'NOTE_PRIVATE' => 1,
);
// Picto
$picto = array(
'NOTE_PUBLIC' => 'generic',
'NOTE_PRIVATE' => 'generic',
'SOCIETE' => 'generic',
'PRODUCTDESC' => 'product',
'DETAILS' => 'product',
@@ -78,8 +80,6 @@ $picto = array(
'MAILING' => 'email',
'MAIL' => 'email',
'TICKET' => 'ticket',
'NOTE_PUBLIC' => 'generic',
'NOTE_PRIVATE' => 'generic',
);

View File

@@ -109,8 +109,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
print $hookmanager->resPrint;
if (empty($reshook)) {
// Show into other
print '<span class="opacitymedium">'.$langs->trans("SetupDescription5")."</span><br>";
print "<br>";
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("SetupDescription5")."</span><br>";
print '<br class="hideonsmartphone">';
// Show logo
print '<div class="center"><div class="logo_setup"></div></div>';

View File

@@ -43,6 +43,7 @@ $action = GETPOST('action', 'aZ09');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('adminldap', 'globaladmin'));
/*
* Actions
*/
@@ -150,7 +151,7 @@ $arraylist['0'] = $langs->trans("No");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr");
$arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnSynchroActiveExample");
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnSynchroActiveExample").'</span>';
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
print '<br><font class="error">'.$langs->trans("LDAPSetupNotComplete").'</font>';
}
@@ -163,7 +164,7 @@ if (!empty($conf->societe->enabled)) {
$arraylist['0'] = $langs->trans("No");
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnContactActiveExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>';
}
// Synchro member active
@@ -174,7 +175,7 @@ if (!empty($conf->adherent->enabled)) {
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnMemberActiveExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>';
}
// Synchro member type active
@@ -185,7 +186,7 @@ if (!empty($conf->adherent->enabled)) {
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE);
print '</td><td>'.$langs->trans("LDAPDnMemberTypeActiveExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>';
}
// Fields from hook
@@ -214,33 +215,33 @@ $arraylist = array();
$arraylist['3'] = 'Version 3';
$arraylist['2'] = 'Version 2';
print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION);
print '</td><td>'.$langs->trans("LDAPServerProtocolVersion").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerProtocolVersion").'</span></td></tr>';
// Serveur primaire
print '<tr class="oddeven"><td>';
print $langs->trans("LDAPPrimaryServer").'</td><td>';
print '<input size="25" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
print '<input class="minwidth200" type="text" name="host" value="'.$conf->global->LDAP_SERVER_HOST.'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
// Serveur secondaire
print '<tr class="oddeven"><td>';
print $langs->trans("LDAPSecondaryServer").'</td><td>';
print '<input size="25" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
print '<input class="minwidth200" type="text" name="slave" value="'.$conf->global->LDAP_SERVER_HOST_SLAVE.'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerExample").'</span></td></tr>';
// Port
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerPort").'</td><td>';
if (!empty($conf->global->LDAP_SERVER_PORT)) {
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
print '<input class="width75" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
} else {
print '<input size="25" type="text" name="port" value="389">';
print '<input class="width75" type="text" name="port" value="389">';
}
print '</td><td>'.$langs->trans("LDAPServerPortExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerPortExample").'</span></td></tr>';
// DNserver
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerDn").'</td><td>';
print '<input size="25" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
print '</td><td>'.$langs->trans("LDAPServerDnExample").'</td></tr>';
print '<input class="minwidth300" type="text" name="dn" value="'.$conf->global->LDAP_SERVER_DN.'">';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerDnExample").'</span></td></tr>';
// Utiliser TLS
print '<tr class="oddeven"><td>'.$langs->trans("LDAPServerUseTLS").'</td><td>';
@@ -248,7 +249,7 @@ $arraylist = array();
$arraylist['0'] = $langs->trans("No");
$arraylist['1'] = $langs->trans("Yes");
print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS);
print '</td><td>'.$langs->trans("LDAPServerUseTLSExample").'</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPServerUseTLSExample").'</span></td></tr>';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("ForANonAnonymousAccess").'</td>';
@@ -257,18 +258,18 @@ print "</tr>\n";
// DNAdmin
print '<!-- LDAP_ADMIN_DN -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPAdminDn").'</td><td>';
print '<input size="25" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
print '<input class="minwidth300" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
print '</td><td class="maxwidthhalf"><span class="opacitymedium">'.$langs->trans("LDAPAdminDnExample").'</span></td></tr>';
// Pass
print '<!-- LDAP_ADMIN_PASS -->';
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
print '<input class="minwidth150" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
} else {
print '<input size="25" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
print '<input class="minwidth150" type="text" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';
}
print '</td><td>'.$langs->trans('Password').' (ex: secret)</td></tr>';
print '</td><td><span class="opacitymedium">'.$langs->trans('Password').' (ex: secret)</span></td></tr>';
print '</table>';

View File

@@ -237,7 +237,7 @@ if (empty($mysoc->country_code)) {
$sql = "SELECT taux as vat_rate, t.code as vat_code, t.localtax1 as localtax_rate1, t.localtax2 as localtax_rate2";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <>0 OR t.localtax2 <>0)";
$sql .= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$db->escape($mysoc->country_code)."' AND (t.taux <> 0 OR t.localtax1 <> '0' OR t.localtax2 <> '0')";
$sql .= " ORDER BY t.taux ASC";
$resql = $db->query($sql);
if ($resql) {

View File

@@ -132,6 +132,7 @@ print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '<td>'.$langs->trans("Example").'</td>';
print "</tr>\n";
print '<tr class="oddeven"><td>';
@@ -140,7 +141,8 @@ print '<input size="32" type="text" name="MAILING_EMAIL_FROM" value="'.$conf->gl
if (!empty($conf->global->MAILING_EMAIL_FROM) && !isValidEmail($conf->global->MAILING_EMAIL_FROM)) {
print ' '.img_warning($langs->trans("BadEMail"));
}
print '</td></tr>';
print '</td><td><span class="opacitymedium">'.dol_escape_htmltag(($mysoc->name ? $mysoc->name : 'MyName').' <noreply@example.com>').'</span></td>';
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("MailingEMailError").'</td><td>';
@@ -148,12 +150,14 @@ print '<input size="32" type="text" name="MAILING_EMAIL_ERRORSTO" value="'.$conf
if (!empty($conf->global->MAILING_EMAIL_ERRORSTO) && !isValidEmail($conf->global->MAILING_EMAIL_ERRORSTO)) {
print ' '.img_warning($langs->trans("BadEMail"));
}
print '</td></tr>';
print '</td><td><span class="opacitymedium">webmaster@example.com></span></td>';
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("MailingDelay").'</td><td>';
print '<input class="width75" type="text" name="MAILING_DELAY" value="'.$conf->global->MAILING_DELAY.'">';
print '</td></tr>';
print '</td><td></td>';
print '</tr>';
// Constant to add salt into the unsubscribe and check read tag.
@@ -165,15 +169,17 @@ print '<input size="32" type="text" name="MAILING_EMAIL_UNSUBSCRIBE_KEY" id="MAI
if (!empty($conf->use_javascript_ajax)) {
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
}
print '</td></tr>';
print '</td><td></td>';
print '</tr>';
// default blacklist from mailing
print '<tr class="oddeven">';
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus") . '</td>';
print '<td>' . $langs->trans("DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv("No_Email")) . '</td>';
print '<td>';
$blacklist_setting=array(0=>$langs->trans('No'),1=>$langs->trans('Yes'),-1=>$langs->trans('DefaultStatusEmptyMandatory'));
$blacklist_setting=array(0=>$langs->trans('No'), 1=>$langs->trans('Yes'), 2=>$langs->trans('DefaultStatusEmptyMandatory'));
print $form->selectarray("MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS);
print '</td>';
print '<td></td>';
print '</tr>';
@@ -181,7 +187,8 @@ if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >=
print '<tr class="oddeven"><td>';
print $langs->trans("MailAdvTargetRecipients").'</td><td>';
print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR');
print '</td></tr>';
print '</td><td></td>';
print '</tr>';
}
print '</table>';

View File

@@ -833,23 +833,23 @@ if ($action == 'edit') {
if ($conf->global->MAIN_MAIL_SENDMODE == 'mail') {
if (!empty($conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD)) {
// List of string to add in SPF if the setup use the mail method. Example 'include:sendgrid.net include:spf.mydomain.com'
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_MAIL_SPF_STRING_TO_ADD);
} else {
// MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS is list of IPs where email is sent from. Example: '1.2.3.4, [aaaa:bbbb:cccc:dddd]'.
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
// List of IP show as record to add in SPF if we use the mail method
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
}
}
} else {
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS)) {
// List of IP show as record to add as allowed IP if we use the smtp method. Value is '1.2.3.4, [aaaa:bbbb:cccc:dddd]'
// TODO Add a key to allow to show the IP/name of server detected dynamically
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS -->'.$langs->trans("WarningPHPMail2", $conf->global->MAIN_EXTERNAL_SMTP_CLIENT_IP_ADDRESS);
}
if (!empty($conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD)) { // Should be required only if you have preset the Dolibarr to use your own SMTP and you want to warn users to update their domain name to match your SMTP server.
// List of string to add in SPF if we use the smtp method. Example 'include:spf.mydomain.com'
$text .= ($text ? '<br><br>' : '').$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
$text .= ($text ? '<br><br>' : '').'<!-- MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD -->'.$langs->trans("WarningPHPMailSPF", $conf->global->MAIN_EXTERNAL_SMTP_SPF_STRING_TO_ADD);
}
}

View File

@@ -160,6 +160,7 @@ if (empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) {
$tabhelp = array();
$tabhelp[25] = array(
'label'=>$langs->trans('EnterAnyCode'),
'topic'=>'<span class="small">'.$helpsubstit.'</span>',
'joinfiles'=>$langs->trans('AttachMainDocByDefault'),
'content'=>'<span class="small">'.$helpsubstit.'</span>',
@@ -228,7 +229,7 @@ if (!empty($conf->agenda->enabled)) {
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
}
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
$elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
$elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
}
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership'));
@@ -564,8 +565,8 @@ $sql = "SELECT rowid as rowid, module, label, type_template, lang, fk_user, priv
$sql .= " FROM ".MAIN_DB_PREFIX."c_email_templates";
$sql .= " WHERE entity IN (".getEntity('email_template').")";
if (!$user->admin) {
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".$user->id."))"; // Show only public and private to me
$sql .= " AND (active = 1 OR fk_user = ".$user->id.")"; // Show only active or owned by me
$sql .= " AND (private = 0 OR (private = 1 AND fk_user = ".((int) $user->id)."))"; // Show only public and private to me
$sql .= " AND (active = 1 OR fk_user = ".((int) $user->id).")"; // Show only active or owned by me
}
if (empty($conf->global->MAIN_MULTILANGS)) {
$sql .= " AND (lang = '".$db->escape($langs->defaultlang)."' OR lang IS NULL OR lang = '')";
@@ -683,8 +684,8 @@ if ($action == 'view') {
$tmpaction = 'create';
$parameters = array(
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]
'fieldlist' => $fieldlist,
'tabname' => $tabname[$id]
);
$reshook = $hookmanager->executeHooks('createEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
$error = $hookmanager->error;
@@ -822,7 +823,7 @@ if ($resql) {
print '</td>';
} elseif ($value == 'fk_user') {
print '<td class="liste_titre">';
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth150');
print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'maxwidth150');
print '</td>';
} elseif ($value == 'topic') {
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
@@ -1071,8 +1072,8 @@ if ($resql) {
if ($showfield) {
print '<!-- '.$fieldlist[$field].' -->';
print '<td class="'.$class.'"';
if ($value == 'topic') {
print ' title="'.$valuetoshow.'"';
if (in_array($value, array('code', 'label', 'topic'))) {
print ' title="'.dol_escape_htmltag($valuetoshow).'"';
}
print '>';
print $valuetoshow;
@@ -1187,7 +1188,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
if ($value == 'fk_user') {
print '<td>';
if ($user->admin) {
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 1, '', 0, '', 'maxwidth200');
print $form->select_dolusers(empty($obj->{$value}) ? '' : $obj->{$value}, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth150 maxwidth300');
} else {
if ($context == 'add') { // I am not admin and we show the add form
print $user->getNomUrl(1); // Me

View File

@@ -133,7 +133,7 @@ if ($action == 'install') {
// $original_file should match format module_modulename-x.y[.z].zip
$original_file = basename($_FILES["fileinstall"]["name"]);
$original_file = preg_replace('/\(\d+\)\.zip$/i', '.zip', $original_file);
$original_file = preg_replace('/\s*\(\d+\)\.zip$/i', '.zip', $original_file);
$newfile = $conf->admin->dir_temp.'/'.$original_file.'/'.$original_file;
if (!$original_file) {
@@ -588,6 +588,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
$disabled_modules = array();
if (!empty($_SESSION["disablemodules"])) {
$disabled_modules = explode(',', $_SESSION["disablemodules"]);
}
// Show list of modules
$oldfamily = '';
$foundoneexternalmodulewithupdate = 0;
@@ -613,6 +618,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
continue;
}
$modulenameshort = strtolower(preg_replace('/^mod/i', '', get_class($objMod)));
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod)));
// Check filters
@@ -754,6 +760,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$codeenabledisable = '';
$codetoconfig = '';
// Force disable of module disabled into session (for demo for example)
if (in_array($modulenameshort, $disabled_modules)) {
$objMod->disabled = true;
}
// Activate/Disable and Setup (2 columns)
if (!empty($conf->global->$const_name)) { // If module is already activated
// Set $codeenabledisable
@@ -761,6 +772,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
if (!empty($arrayofwarnings[$modName])) {
$codeenabledisable .= '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n";
}
if (!empty($objMod->disabled)) {
$codeenabledisable .= $langs->trans("Disabled");
} elseif (!empty($objMod->always_enabled) || ((!empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity != 1))) {
@@ -1013,16 +1025,16 @@ if ($mode == 'marketplace') {
print '<div class="liste_titre liste_titre_bydiv centpercent"><div class="divsearchfield">';
print '<form method="POST" class="centpercent" id="searchFormList" action="'.$dolistore->url.'">';
print '<form method="POST" class="centpercent" id="searchFormList" action="'.urlencode($dolistore->url).'">';
?>
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
<input type="hidden" name="mode" value="marketplace">
<div class="divsearchfield">
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo $options['search'] ?>"><br>
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo dol_escape_htmltag($options['search']) ?>"><br>
</div>
<div class="divsearchfield">
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
<a class="buttonreset" href="<?php echo $dolistore->url ?>"><?php echo $langs->trans('Reset') ?></a>
<a class="buttonreset" href="<?php echo urlencode($dolistore->url) ?>"><?php echo $langs->trans('Reset') ?></a>
&nbsp;
</div>
@@ -1039,7 +1051,7 @@ if ($mode == 'marketplace') {
<div id="category-tree-left">
<ul class="tree">
<?php echo $dolistore->get_categories(); ?>
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?>
</ul>
</div>
<div id="listing-content">

View File

@@ -92,7 +92,7 @@ if (empty($action) || $action == 'edit' || $action == 'updateedit') {
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("Day").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("Monday"), $langs->trans("OpeningHoursFormatDesc"));

View File

@@ -55,7 +55,8 @@ if ($action == 'update') {
if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_RIGHT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_TOP')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_TOP", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);

View File

@@ -100,7 +100,7 @@ if (empty($conf->use_javascript_ajax)) {
print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT", $arrval, $conf->global->RESOURCE_USE_SEARCH_TO_SELECT);
print '</td>';
print '<td class="right">';
print '<input type="submit" class="button" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
print '<input type="submit" class="button small" name="RESOURCE_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
print '</td>';
}
print '</tr>';
@@ -108,7 +108,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('DisabledResourceLinkUser').'</td>';
print '<td>';
print '<td class="right">';
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER');
print '</td>';
print '<td></td>';
@@ -117,7 +117,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('DisabledResourceLinkContact').'</td>';
print '<td>';
print '<td class="right">';
echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY');
print '</td>';
print '<td></td>';
@@ -126,7 +126,7 @@ print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans('EnableResourceUsedInEventCheck').'</td>';
print '<td>';
print '<td class="right">';
echo ajax_constantonoff('RESOURCE_USED_IN_EVENT_CHECK');
print '</td>';
print '<td></td>';

View File

@@ -683,6 +683,8 @@ if ($conf->use_javascript_ajax) {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("SOCIETE_ASK_FOR_WAREHOUSE", $arrval, $conf->global->SOCIETE_ASK_FOR_WAREHOUSE);
}
print "</td>";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringPropal").'</td>';
@@ -693,6 +695,9 @@ if ($conf->use_javascript_ajax) {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL);
}
print "</td>";
print "</tr>\n";
print '<tr class="oddeven">';
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringOrder").'</td>';
print '<td class="right">';
@@ -702,10 +707,23 @@ if ($conf->use_javascript_ajax) {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER);
}
print "</td>";
print '</td>';
print "</tr>\n";
/*
print '<tr class="oddeven">';
print '<td>'.$langs->trans("WarehouseAskWarehouseDuringProject").'</td>';
print '<td class="right">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT", $arrval, $conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT);
}
print '</td>';
print "</tr>\n";
*/
print '<tr class="oddeven">';
print '<td>';
print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc"));

View File

@@ -51,7 +51,7 @@ if ($action == 'getlastversion') {
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
if (function_exists('simplexml_load_string')) {
$sfurl = simplexml_load_string($result['content']);
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
} else {
setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
}
@@ -505,7 +505,7 @@ if ($resql) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="tdoverflowmax300">'.$obj->name.'</td>'."\n";
print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
print '<td class="tdoverflowmax300">';
if (isASecretKey($obj->name)) {
if (empty($dolibarr_main_prod)) {

View File

@@ -171,7 +171,7 @@ if (GETPOST('target') == 'remote') {
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
$xmlfile = $xmlarray['content'];
//print "xmlfilestart".$xmlfile."xmlfileend";
$xml = simplexml_load_string($xmlfile);
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
} else {
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
setEventMessages($errormsg, null, 'errors');

View File

@@ -63,7 +63,7 @@ print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
$test = !function_exists('xdebug_is_enabled');
if ($test) {
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';

View File

@@ -91,7 +91,13 @@ print '<br>';
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Strict').")</span><br>\n";
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
} elseif (ini_get('session.cookie_samesite') == 'Strict') {
print ' &nbsp; '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
}
print "<br>\n";
print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";

View File

@@ -207,6 +207,9 @@ if (in_array($type, array('mysql', 'mysqli'))) {
//if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=1&amp;radio_dump=postgresql_options">'.$langs->trans("UnHidePassword").'</a>';
//else print '<br><a href="'.$_SERVER["PHP_SELF"].'?showpass=0&amp;radio_dump=mysql_options">'.$langs->trans("HidePassword").'</a>';
print '</div>';
print '<br>';
print '</fieldset>';
}

View File

@@ -110,7 +110,7 @@ if (!empty($conf->syslog->enabled)) {
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFilesShort").'</label><br><br>';
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';

View File

@@ -61,7 +61,7 @@ $version = '0.0';
if ($action == 'getlastversion') {
$result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
//var_dump($result['content']);
$sfurl = simplexml_load_string($result['content']);
$sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
}

View File

@@ -37,6 +37,7 @@ if (!$user->admin) {
$id = GETPOST('rowid', 'int');
$action = GETPOST('action', 'aZ09');
$optioncss = GETPOST('optionscss', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ09');
$langcode = GETPOST('langcode', 'alphanohtml');
$transkey = GETPOST('transkey', 'alphanohtml');
@@ -458,18 +459,8 @@ if ($mode == 'searchkey') {
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
print '<td align="center"></td>';
print "</tr>\n";
// Line to search new record
print "\n";
print '<tr class="oddeven"><td>';
print '<tr class="liste_titre_filter"><td>';
//print $formadmin->select_language($langcode,'langcode',0,null,$langs->trans("All"),0,0,'',1);
print $formadmin->select_language($langcode, 'langcode', 0, null, 0, 0, 0, 'maxwidth250', 1);
print '</td>'."\n";
@@ -495,6 +486,15 @@ if ($mode == 'searchkey') {
print '</td>';
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("Key", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder);
print_liste_field_titre("CurrentTranslationString", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder);
//if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder);
print '<td align="center"></td>';
print "</tr>\n";
if ($sortfield == 'transkey' && strtolower($sortorder) == 'asc') {
ksort($recordtoshow);
}
@@ -541,7 +541,7 @@ if ($mode == 'searchkey') {
print $form->textwithpicto('', $htmltext, 1, 'info');
} elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
//print $key.'-'.$val;
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("Overwrite")).'</a>';
print '<a class="reposition paddingrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=overwrite&langcode='.urlencode($langcode).'&transkey='.urlencode($key).'">'.img_edit_add($langs->trans("TranslationOverwriteKey")).'</a>';
}
if (!empty($conf->global->MAIN_FEATURES_LEVEL)) {

View File

@@ -80,7 +80,7 @@ class DolibarrApiAccess implements iAuthenticate
public function __isAllowed()
{
// phpcs:enable
global $conf, $db;
global $conf, $db, $user;
$login = '';
$stored_key = '';
@@ -147,8 +147,13 @@ class DolibarrApiAccess implements iAuthenticate
if ($result <= 0) {
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
}
$fuser->getrights();
// Set the property $user to the $user of API
static::$user = $fuser;
// Set also the global variable $user to the $user of API
$user = $fuser;
if ($fuser->socid) {
static::$role = 'external';

View File

@@ -504,7 +504,7 @@ class Documents extends DolibarrApi
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
*
* @param string $filename Name of file to create ('FA1705-0123.txt')
* @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
* @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)

View File

@@ -1683,7 +1683,7 @@ class Setup extends DolibarrApi
if (!$xmlarray['curl_error_no'] && $xmlarray['http_code'] != '400' && $xmlarray['http_code'] != '404') {
$xmlfile = $xmlarray['content'];
//print "xmlfilestart".$xmlfile."endxmlfile";
$xml = simplexml_load_string($xmlfile);
$xml = simplexml_load_string($xmlfile, 'SimpleXMLElement', LIBXML_NOCDATA|LIBXML_NONET);
} else {
$errormsg = $langs->trans('XmlNotFound').': '.$xmlremote.' - '.$xmlarray['http_code'].(($xmlarray['http_code'] == 400 && $xmlarray['content']) ? ' '.$xmlarray['content'] : '').' '.$xmlarray['curl_error_no'].' '.$xmlarray['curl_error_msg'];
throw new RestException(500, $errormsg);

View File

@@ -389,7 +389,7 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print '<tbody>';
print "</table>\n";

View File

@@ -71,6 +71,10 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
if ($object->id > 0) {
$object->calculateCosts();
}
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();
@@ -112,8 +116,13 @@ if (empty($reshook)) {
$triggermodname = 'BOM_MODIFY'; // Name of trigger action code to execute when we modify record
// Actions cancel, add, update, delete or clone
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
// The fetch/fetch_lines was redone into the inc.php so we must recall the calculateCosts()
if ($action == 'confirm_validate' && $object->id > 0) {
$object->calculateCosts();
}
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
@@ -311,8 +320,6 @@ if (($id || $ref) && $action == 'edit') {
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$res = $object->fetch_optionals();
$head = bomPrepareHead($object);
print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom');

View File

@@ -98,7 +98,7 @@ class BOM extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'),
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
@@ -381,7 +381,7 @@ class BOM extends CommonObject
if ($result > 0 && !empty($this->table_element_line)) {
$this->fetchLines();
}
$this->calculateCosts();
//$this->calculateCosts(); // This consume a high number of subrequests. Do not call it into fetch but when you need it.
return $result;
}
@@ -431,13 +431,13 @@ class BOM extends CommonObject
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
if ($key == 't.rowid') {
$sqlwhere[] = $key.'='.$value;
$sqlwhere[] = $key.' = '.((int) $value);
} elseif (strpos($key, 'date') !== false) {
$sqlwhere[] = $key.' = \''.$this->db->idate($value).'\'';
$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
} elseif ($key == 'customsql') {
$sqlwhere[] = $value;
} else {
$sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\'';
$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
}
}
}
@@ -946,7 +946,7 @@ class BOM extends CommonObject
$this->lines = array();
$objectline = new BOMLine($this->db);
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.$this->id));
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_bom = '.((int) $this->id)));
if (is_numeric($result)) {
$this->error = $this->error;
@@ -1035,7 +1035,8 @@ class BOM extends CommonObject
}
/**
* BOM costs calculation based on cost_price or pmp of each BOM line
* BOM costs calculation based on cost_price or pmp of each BOM line.
* Set the property ->total_cost and ->unit_cost of BOM.
*
* @return void
*/
@@ -1045,30 +1046,36 @@ class BOM extends CommonObject
$this->unit_cost = 0;
$this->total_cost = 0;
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
foreach ($this->lines as &$line) {
if (is_array($this->lines) && count($this->lines)) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$productFournisseur = new ProductFournisseur($this->db);
$tmpproduct = new Product($this->db);
$result = $tmpproduct->fetch($line->fk_product);
if ($result < 0) {
$this->error = $tmpproduct->error;
return -1;
}
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
if (empty($line->unit_cost)) {
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
$line->unit_cost = $productFournisseur->fourn_unitprice;
foreach ($this->lines as &$line) {
$tmpproduct->cost_price = 0;
$tmpproduct->pmp = 0;
$result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
if ($result < 0) {
$this->error = $tmpproduct->error;
return -1;
}
$line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
if (empty($line->unit_cost)) {
if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
$line->unit_cost = $productFournisseur->fourn_unitprice;
}
}
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
$this->total_cost += $line->total_cost;
}
$line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
$this->total_cost += $line->total_cost;
}
$this->total_cost = price2num($this->total_cost, 'MT');
if ($this->qty) {
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
$this->total_cost = price2num($this->total_cost, 'MT');
if ($this->qty) {
$this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
}
}
}
}

View File

@@ -54,7 +54,9 @@ function bomAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
//); // to remove a tab
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom');
complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp');
complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove');
return $head;
}

View File

@@ -169,7 +169,7 @@ if ($action == 'create') {
// Target
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
$liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow"));
print $form->selectarray('target', $liste, 1);
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1);
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
// Owner

View File

@@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print '</table>';

View File

@@ -540,7 +540,7 @@ class Categorie extends CommonObject
$sql .= ", visible = ".(int) $this->visible;
$sql .= ", fk_parent = ".(int) $this->fk_parent;
$sql .= ", fk_user_modif = ".(int) $user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::update", LOG_DEBUG);
if ($this->db->query($sql)) {
@@ -686,7 +686,7 @@ class Categorie extends CommonObject
if ($this->db->query($sql)) {
if (!empty($conf->global->CATEGORIE_RECURSIV_ADD)) {
$sql = 'SELECT fk_parent FROM '.MAIN_DB_PREFIX.'categorie';
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::add_type", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -774,7 +774,7 @@ class Categorie extends CommonObject
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]);
$sql .= " WHERE fk_categorie = ".$this->id;
$sql .= " WHERE fk_categorie = ".((int) $this->id);
$sql .= " AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $obj->id);
dol_syslog(get_class($this).'::del_type', LOG_DEBUG);
@@ -826,11 +826,11 @@ class Categorie extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as c";
$sql .= ", ".MAIN_DB_PREFIX.(empty($this->MAP_OBJ_TABLE[$type]) ? $type : $this->MAP_OBJ_TABLE[$type])." as o";
$sql .= " WHERE o.entity IN (".getEntity($obj->element).")";
$sql .= " AND c.fk_categorie = ".$this->id;
$sql .= " AND c.fk_categorie = ".((int) $this->id);
$sql .= " AND c.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = o.rowid";
// Protection for external users
if (($type == 'customer' || $type == 'supplier') && $user->socid > 0) {
$sql .= " AND o.rowid = ".$user->socid;
$sql .= " AND o.rowid = ".((int) $user->socid);
}
if ($limit > 0 || $offset > 0) {
$sql .= $this->db->plimit($limit + 1, $offset);
@@ -870,7 +870,7 @@ class Categorie extends CommonObject
public function containsObject($type, $object_id)
{
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type]);
$sql .= " WHERE fk_categorie = ".$this->id." AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $object_id);
$sql .= " WHERE fk_categorie = ".((int) $this->id)." AND fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".((int) $object_id);
dol_syslog(get_class($this)."::containsObject", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
@@ -1501,7 +1501,7 @@ class Categorie extends CommonObject
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id;
// This seems useless because the table already contains id of category of 1 unique type. So commented.
// So now it works also with external added categories.
//$sql .= " AND c.type = ".$this->MAP_ID[$type];
//$sql .= " AND c.type = ".((int) $this->MAP_ID[$type]);
$sql .= " AND c.entity IN (".getEntity('category').")";
$res = $this->db->query($sql);
@@ -1796,7 +1796,7 @@ class Categorie extends CommonObject
foreach ($langs_available as $key => $value) {
$sql = "SELECT rowid";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang";
$sql .= " WHERE fk_category=".$this->id;
$sql .= " WHERE fk_category=".((int) $this->id);
$sql .= " AND lang = '".$this->db->escape($key)."'";
$result = $this->db->query($sql);
@@ -1806,10 +1806,10 @@ class Categorie extends CommonObject
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
$sql2 .= " SET label='".$this->db->escape($this->label)."',";
$sql2 .= " description='".$this->db->escape($this->description)."'";
$sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'";
$sql2 .= " WHERE fk_category=".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
} else {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
$sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->label);
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->label);
$sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
}
dol_syslog(get_class($this).'::setMultiLangs', LOG_DEBUG);
@@ -1822,10 +1822,10 @@ class Categorie extends CommonObject
$sql2 = "UPDATE ".MAIN_DB_PREFIX."categorie_lang";
$sql2 .= " SET label='".$this->db->escape($this->multilangs["$key"]["label"])."',";
$sql2 .= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'";
$sql2 .= " WHERE fk_category=".$this->id." AND lang='".$this->db->escape($key)."'";
$sql2 .= " WHERE fk_category=".((int) $this->id)." AND lang='".$this->db->escape($key)."'";
} else {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."categorie_lang (fk_category, lang, label, description)";
$sql2 .= " VALUES(".$this->id.",'".$key."','".$this->db->escape($this->multilangs["$key"]["label"]);
$sql2 .= " VALUES(".$this->id.",'".$this->db->escape($key)."','".$this->db->escape($this->multilangs["$key"]["label"]);
$sql2 .= "','".$this->db->escape($this->multilangs["$key"]["description"])."')";
}
@@ -1864,7 +1864,7 @@ class Categorie extends CommonObject
$sql = "SELECT lang, label, description";
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_lang";
$sql .= " WHERE fk_category=".$this->id;
$sql .= " WHERE fk_category=".((int) $this->id);
$result = $this->db->query($sql);
if ($result) {
@@ -1963,6 +1963,12 @@ class Categorie extends CommonObject
if ($type == 'bank_account') {
$type = 'account';
}
if ($type == 'customer') {
$type = 'societe';
}
if ($type == 'supplier') {
$type = 'fournisseur';
}
if (empty($searchList) && !is_array($searchList)) {
return "";

View File

@@ -205,10 +205,14 @@ foreach ($fulltree as $key => $val) {
$entry .= '<a href="'.DOL_URL_ROOT.'/categories/viewcat.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_view().'</a>';
$entry .= '</td>';
$entry .= '<td class="right" width="20px;">';
$entry .= '<a class="editfielda" href="'.DOL_URL_ROOT.'/categories/edit.php?id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'">'.img_edit().'</a>';
if ($user->rights->categorie->creer) {
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type) . '">' . img_edit() . '</a>';
}
$entry .= '</td>';
$entry .= '<td class="right" width="20px;">';
$entry .= '<a class="deletefilelink" href="'.DOL_URL_ROOT.'/categories/viewcat.php?action=delete&token='.newToken().'&id='.$val['id'].'&type='.$type.$moreparam.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'&backtolist='.urlencode($_SERVER["PHP_SELF"].'?type='.$type.$moreparam).'">'.img_delete().'</a>';
if ($user->rights->categorie->supprimer) {
$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . '&type=' . $type . $moreparam . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . $type . $moreparam) . '">' . img_delete() . '</a>';
}
$entry .= '</td>';
$entry .= '</tr>';

View File

@@ -70,9 +70,18 @@ $offsetvalue = GETPOST('offsetvalue', 'int');
$offsetunit = GETPOST('offsetunittype_duration', 'aZ09');
$remindertype = GETPOST('selectremindertype', 'aZ09');
$modelmail = GETPOST('actioncommsendmodel_mail', 'int');
$complete = GETPOST('complete', 'alpha'); // 'na' must be allowed
if ($complete == 'na' || $complete == -2) {
$complete = -1;
}
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
if ($fulldayevent) {
$datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
$datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
} else {
$datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
$datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
}
// Security check
$socid = GETPOST('socid', 'int');
@@ -240,7 +249,7 @@ if (empty($reshook) && $action == 'add') {
exit;
}
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
$datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
@@ -471,7 +480,7 @@ if (empty($reshook) && $action == 'update') {
$apmin = GETPOST('apmin', 'int');
$p2hour = GETPOST('p2hour', 'int');
$p2min = GETPOST('p2min', 'int');
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
// Clean parameters
if ($aphour == -1) {
@@ -1074,15 +1083,15 @@ if ($action == 'create') {
// Status
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
print '<td>';
$percent = GETPOST('complete')!=='' ? GETPOST('complete') : -1;
$percent = $complete !=='' ? $complete : -1;
if (GETPOSTISSET('status')) {
$percent = GETPOST('status');
} elseif (GETPOSTISSET('percentage')) {
$percent = GETPOST('percentage');
$percent = GETPOST('percentage', 'int');
} else {
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) {
if ($complete == '0' || GETPOST("afaire") == 1) {
$percent = '0';
} elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) {
} elseif ($complete == 100 || GETPOST("afaire") == 2) {
$percent = 100;
}
}
@@ -1214,7 +1223,11 @@ if ($action == 'create') {
if (!empty($projectid)) {
$projectsListId = $projectid;
}
$tid = GETPOST("projecttaskid") ? GETPOST("projecttaskid") : '';
if ($origin=='task') {
$tid= GETPOST("originid");
} else {
$tid = GETPOST("projecttaskid") ? GETPOST("projecttaskid") : '';
}
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId);
print '</td></tr>';
}
@@ -1222,12 +1235,16 @@ if ($action == 'create') {
// Object linked
if (!empty($origin) && !empty($originid)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
// We do not use link for object that already contains a hard coded
print '<tr><td class="titlefieldcreate">'.$langs->trans("LinkedObject").'</td>';
print '<td colspan="3">'.dolGetElementUrl($originid, $origin, 1).'</td></tr>';
print '<input type="hidden" name="fk_element" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="elementtype" value="'.GETPOST('origin').'">';
print '<input type="hidden" name="originid" value="'.GETPOST('originid', 'int').'">';
print '<input type="hidden" name="origin" value="'.GETPOST('origin').'">';
}
}
$reg = array();
@@ -1254,7 +1271,7 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
print '</table>';
@@ -1348,7 +1365,7 @@ if ($id > 0) {
$result5 = $object->fetch_optionals();
if ($listUserAssignedUpdated || $donotclearsession) {
$percentage = in_array(GETPOST('status'), array(-1, 100)) ?GETPOST('status') : (in_array(GETPOST('complete'), array(-1, 100)) ?GETPOST('complete') : GETPOST("percentage")); // If status is -1 or 100, percentage is not defined and we must use status
$percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuser');
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuser');
@@ -1542,7 +1559,7 @@ if ($id > 0) {
// Status
print '<tr><td class="nowrap">'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td><td colspan="3">';
$percent = GETPOST("percentage") ? GETPOST("percentage") : $object->percentage;
$percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage;
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
print '</td></tr>';

View File

@@ -585,12 +585,15 @@ class ActionComm extends CommonObject
//dol_syslog(var_export($this->userassigned, true));
$already_inserted = array();
foreach ($this->userassigned as $key => $val) {
if (!is_array($val)) { // For backward compatibility when val=id
// Common value with new behavior is to have $val = array('id'=>iduser, 'transparency'=>0|1) and $this->userassigned is an array of iduser => $val.
if (!is_array($val)) { // For backward compatibility when $val='id'.
$val = array('id'=>$val);
}
if ($val['id'] > 0) {
if (!empty($already_inserted[$val['id']])) continue;
if (!empty($already_inserted[$val['id']])) {
continue;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")";
@@ -612,7 +615,10 @@ class ActionComm extends CommonObject
if (!empty($this->socpeopleassigned)) {
$already_inserted = array();
foreach ($this->socpeopleassigned as $id => $val) {
if (!empty($already_inserted[$val['id']])) continue;
// Common value with new behavior is to have $val = iduser and $this->socpeopleassigned is an array of iduser => $val.
if (!empty($already_inserted[$id])) {
continue;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)";
@@ -623,7 +629,7 @@ class ActionComm extends CommonObject
dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR);
$this->errors[] = $this->db->lasterror();
} else {
$already_inserted[$val['id']] = true;
$already_inserted[$id] = true;
}
}
}
@@ -729,13 +735,14 @@ class ActionComm extends CommonObject
/**
* Load object from database
*
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @param string $email_msgid Email msgid
* @return int <0 if KO, >0 if OK
* @param int $id Id of action to get
* @param string $ref Ref of action to get
* @param string $ref_ext Ref ext to get
* @param string $email_msgid Email msgid
* @param string $loadresources 1=Load also resources
* @return int <0 if KO, >0 if OK
*/
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1)
{
global $langs;
@@ -852,8 +859,13 @@ class ActionComm extends CommonObject
$this->event_paid = $obj->event_paid;
$this->status = $obj->status;
$this->fetchResources();
$this->fetch_optionals();
if ($loadresources) {
$this->fetchResources();
}
}
$this->db->free($resql);
} else {
$this->error = $this->db->lasterror();
@@ -875,7 +887,7 @@ class ActionComm extends CommonObject
$sql = 'SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency';
$sql .= ' FROM '.MAIN_DB_PREFIX.'actioncomm_resources';
$sql .= ' WHERE fk_actioncomm = '.$this->id;
$sql .= ' WHERE fk_actioncomm = '.((int) $this->id);
$sql .= " AND element_type IN ('user', 'socpeople')";
$resql = $this->db->query($sql);
if ($resql) {
@@ -919,7 +931,7 @@ class ActionComm extends CommonObject
// phpcs:enable
$sql = "SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_resources";
$sql .= " WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
$sql .= " WHERE element_type = 'user' AND fk_actioncomm = ".((int) $this->id);
$resql2 = $this->db->query($sql);
if ($resql2) {
@@ -996,7 +1008,7 @@ class ActionComm extends CommonObject
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
$sql .= " WHERE fk_actioncomm = ".$this->id;
$sql .= " WHERE fk_actioncomm = ".((int) $this->id);
$res = $this->db->query($sql);
if (!$res) {
@@ -1159,7 +1171,7 @@ class ActionComm extends CommonObject
// Now insert assignedusers
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'user'";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".((int) $this->id)." AND element_type = 'user'";
$resql = $this->db->query($sql);
$already_inserted = array();
@@ -1184,7 +1196,7 @@ class ActionComm extends CommonObject
}
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".$this->id." AND element_type = 'socpeople'";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_resources where fk_actioncomm = ".((int) $this->id)." AND element_type = 'socpeople'";
$resql = $this->db->query($sql);
if (!empty($this->socpeopleassigned)) {
@@ -1320,7 +1332,7 @@ class ActionComm extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
}
if (!$user->rights->agenda->allactions->read) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".$user->id;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".((int) $user->id);
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql .= " WHERE 1 = 1";
@@ -1329,14 +1341,14 @@ class ActionComm extends CommonObject
}
$sql .= " AND a.entity IN (".getEntity('agenda').")";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($user->socid) {
$sql .= " AND a.fk_soc = ".$user->socid;
$sql .= " AND a.fk_soc = ".((int) $user->socid);
}
if (!$user->rights->agenda->allactions->read) {
$sql .= " AND (a.fk_user_author = ".$user->id." OR a.fk_user_action = ".$user->id." OR a.fk_user_done = ".$user->id;
$sql .= " OR ar.fk_element = ".$user->id; // Added by PV
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id);
$sql .= " OR ar.fk_element = ".((int) $user->id);
$sql .= ")";
}
@@ -2226,7 +2238,7 @@ class ActionComm extends CommonObject
//Select all action comm reminders for event
$sql = "SELECT rowid as id, typeremind, dateremind, status, offsetvalue, offsetunit, fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm_reminder";
$sql .= " WHERE fk_actioncomm = ".$this->id;
$sql .= " WHERE fk_actioncomm = ".((int) $this->id);
if ($onlypast) {
$sql .= " AND dateremind <= '".$this->db->idate(dol_now())."'";
}

View File

@@ -484,7 +484,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@@ -689,7 +689,7 @@ if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= ' AND a.fk_soc = '.$socid;

View File

@@ -447,7 +447,7 @@ if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -608,7 +608,7 @@ if ($resql) {
$viewmode = '';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';

View File

@@ -416,7 +416,7 @@ $massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@@ -558,7 +558,7 @@ if ($pid) {
$sql .= " AND a.fk_project=".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= ' AND a.fk_soc = '.((int) $socid);

View File

@@ -426,7 +426,7 @@ $massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@@ -579,7 +579,7 @@ if ($pid) {
$sql .= " AND a.fk_project = ".((int) $pid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".$user->id.")";
$sql .= " AND (a.fk_soc IS NULL OR sc.fk_user = ".((int) $user->id).")";
}
if ($socid > 0) {
$sql .= ' AND a.fk_soc = '.((int) $socid);
@@ -892,15 +892,23 @@ while ($currentdaytoshow < $lastdaytoshow) {
}
} else {
/* Use this list to have for all users */
$sql = "SELECT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
$sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
if ($usergroup > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
$sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
$sql .= " AND ug.fk_user = u.rowid ";
} else {
if ($usergroup > 0) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON u.rowid = ug.fk_user";
}
$sql .= " WHERE u.entity IN (".getEntity('user').")";
}
$sql .= " WHERE u.statut = 1 AND u.entity IN (".getEntity('user').")";
if ($usergroup > 0) {
$sql .= " AND u.statut = 1";
if ($usergroup > 0) {
$sql .= " AND ug.fk_usergroup = ".((int) $usergroup);
}
//print $sql;
$resql = $db->query($sql);
if ($resql) {

View File

@@ -826,7 +826,7 @@ if ($object->id > 0) {
$sql .= ", p.datep as dp, p.fin_validite as date_limit";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
$sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND p.entity IN (".getEntity('propal').")";
$sql .= " ORDER BY p.datep DESC";
@@ -891,7 +891,7 @@ if ($object->id > 0) {
$sql .= ", c.facture as billed";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c";
$sql .= " WHERE c.fk_soc = s.rowid ";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND c.entity IN (".getEntity('commande').')';
$sql .= " ORDER BY c.date_commande DESC";
@@ -907,7 +907,7 @@ if ($object->id > 0) {
$sql2 .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql2 .= ', '.MAIN_DB_PREFIX.'commande as c';
$sql2 .= ' WHERE c.fk_soc = s.rowid';
$sql2 .= ' AND s.rowid = '.$object->id;
$sql2 .= ' AND s.rowid = '.((int) $object->id);
// Show orders with status validated, shipping started and delivered (well any order we can bill)
$sql2 .= " AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))";
@@ -967,7 +967,7 @@ if ($object->id > 0) {
$sql .= ', s.nom';
$sql .= ', s.rowid as socid';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."expedition as e";
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql .= " WHERE e.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND e.entity IN (".getEntity('expedition').")";
$sql .= ' GROUP BY e.rowid';
$sql .= ', e.ref';
@@ -1032,7 +1032,7 @@ if ($object->id > 0) {
$sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
$sql .= " WHERE c.fk_soc = s.rowid ";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND c.entity IN (".getEntity('contract').")";
$sql .= " ORDER BY c.datec DESC";
@@ -1106,7 +1106,7 @@ if ($object->id > 0) {
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
$sql .= " WHERE f.fk_soc = s.rowid";
$sql .= " AND s.rowid = ".$object->id;
$sql .= " AND s.rowid = ".((int) $object->id);
$sql .= " AND f.entity IN (".getEntity('intervention').")";
$sql .= " ORDER BY f.tms DESC";
@@ -1171,7 +1171,7 @@ if ($object->id > 0) {
$sql .= ', f.suspended as suspended';
$sql .= ', s.nom, s.rowid as socid';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= ' GROUP BY f.rowid, f.titre, f.total_ht, f.total_tva, f.total_ttc,';
$sql .= ' f.date_last_gen, f.datec, f.frequency, f.unit_frequency,';
@@ -1263,7 +1263,7 @@ if ($object->id > 0) {
$sql .= ', SUM(pf.amount) as am';
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON f.rowid=pf.fk_facture';
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".$object->id;
$sql .= " WHERE f.fk_soc = s.rowid AND s.rowid = ".((int) $object->id);
$sql .= " AND f.entity IN (".getEntity('invoice').")";
$sql .= ' GROUP BY f.rowid, f.ref, f.type, f.total_ht, f.total_tva, f.total_ttc,';
$sql .= ' f.datef, f.datec, f.paye, f.fk_statut,';

View File

@@ -90,7 +90,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
$sql .= " WHERE s.fk_stcomm = st.id";
$sql .= " AND p.entity IN (".getEntity('socpeople').")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($type == "c") {
$sql .= " AND s.client IN (1, 3)";

View File

@@ -106,10 +106,16 @@ print load_fiche_titre($langs->trans("CommercialArea"), '', 'commercial');
print '<div class="fichecenter"><div class="fichethirdleft">';
print getCustomerProposalPieChart($socid);
print '<br>';
print getCustomerOrderPieChart($socid);
print '<br>';
$tmp = getCustomerProposalPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
$tmp = getCustomerOrderPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
/*
* Draft customer proposals
@@ -130,7 +136,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$sql .= " AND p.fk_soc = s.rowid";
$sql .= " AND p.fk_statut = ".Propal::STATUS_DRAFT;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -227,7 +233,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
$sql .= " AND p.fk_statut = ".SupplierProposal::STATUS_DRAFT;
$sql .= " AND p.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -323,7 +329,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$sql .= " AND c.fk_statut = ".Commande::STATUS_DRAFT;
$sql .= " AND c.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
@@ -420,10 +426,10 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
$sql .= " AND cf.fk_statut = ".CommandeFournisseur::STATUS_DRAFT;
$sql .= " AND cf.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND cf.fk_soc = ".$socid;
$sql .= " AND cf.fk_soc = ".((int) $socid);
}
$resql = $db->query($sql);
@@ -517,7 +523,7 @@ if (!empty($conf->societe->enabled) && $user->rights->societe->lire) {
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
$sql .= " AND s.client IN (".Societe::CUSTOMER.", ".Societe::PROSPECT.", ".Societe::CUSTOMER_AND_PROSPECT.")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = $socid";
@@ -613,7 +619,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
$sql .= " WHERE s.entity IN (".getEntity($companystatic->element).")";
$sql .= " AND s.fournisseur = ".Societe::SUPPLIER;
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -719,7 +725,7 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) { // T
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.fk_product = p.rowid";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -794,7 +800,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
$sql .= " AND p.fk_soc = s.rowid";
$sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -910,7 +916,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
$sql .= " AND c.fk_soc = s.rowid";
$sql .= " AND c.fk_statut IN (".Commande::STATUS_VALIDATED.", ".Commande::STATUS_SHIPMENTONPROCESS.")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);

View File

@@ -726,7 +726,7 @@ if ($action == 'create') {
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (empty($reshook)) {
print $object->showOptionals($extrafields, 'edit');
print $object->showOptionals($extrafields, 'create');
}
print '</table>';

View File

@@ -60,7 +60,7 @@ $search_lastname = GETPOST("search_lastname", 'alphanohtml');
$search_firstname = GETPOST("search_firstname", 'alphanohtml');
$search_email = GETPOST("search_email", 'alphanohtml');
$search_other = GETPOST("search_other", 'alphanohtml');
$search_dest_status = GETPOST('search_dest_status', 'alphanohtml');
$search_dest_status = GETPOST('search_dest_status', 'int');
// Search modules dirs
$modulesdir = dolGetModulesDirs('/mailings');
@@ -473,7 +473,7 @@ if ($object->fetch($id) >= 0) {
$asearchcriteriahasbeenset++;
}
if ($search_dest_status != '' && $search_dest_status >= -1) {
$sql .= " AND mc.statut=".$db->escape($search_dest_status)." ";
$sql .= " AND mc.statut = ".((int) $search_dest_status);
$asearchcriteriahasbeenset++;
}
$sql .= $db->order($sortfield, $sortorder);
@@ -539,6 +539,8 @@ if ($object->fetch($id) >= 0) {
}
$morehtmlcenter .= ' &nbsp; <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
$massactionbutton = '';
print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
print '</form>';
@@ -633,11 +635,11 @@ if ($object->fetch($id) >= 0) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.$obj->email.'</td>';
print '<td>'.$obj->lastname.'</td>';
print '<td>'.$obj->firstname.'</td>';
print '<td class="tdoverflowmax150">'.img_picto('$obj->email', 'email', 'class="paddingright"').$obj->email.'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'.$obj->lastname.'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.$obj->firstname.'</td>';
print '<td>'.$obj->other.'</td>';
print '<td class="center">';
print '<td class="center tdoverflowmax150">';
if (empty($obj->source_id) || empty($obj->source_type)) {
print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility
} else {

View File

@@ -384,8 +384,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
$object->remise_percent = price2num(GETPOST('remise_percent'), 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->socid = GETPOST('socid', 'int');
$object->contact_id = GETPOST('contactid', 'int');
$object->fk_project = GETPOST('projectid', 'int');
@@ -826,8 +826,8 @@ if (empty($reshook)) {
$tva_tx = '';
}
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
if (empty($remise_percent)) {
$remise_percent = 0;
}
@@ -1214,6 +1214,8 @@ if (empty($reshook)) {
$date_start = dol_mktime(GETPOST('date_starthour'), GETPOST('date_startmin'), GETPOST('date_startsec'), GETPOST('date_startmonth'), GETPOST('date_startday'), GETPOST('date_startyear'));
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafields->getOptionalsFromPost($object->table_element_line);
@@ -1226,7 +1228,7 @@ if (empty($reshook)) {
}
// Define special_code for special lines
$special_code = GETPOST('special_code');
$special_code = GETPOST('special_code', 'int');
if (!GETPOST('qty')) {
$special_code = 3;
}
@@ -1245,7 +1247,7 @@ if (empty($reshook)) {
}
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@@ -1275,7 +1277,7 @@ if (empty($reshook)) {
$qty = price2num(GETPOST('qty', 'alpha'), 'MS');
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
$result = $object->updateline(GETPOST('lineid', 'int'), $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, 'HT', $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise);
if ($result >= 0) {
$db->commit();
@@ -1343,9 +1345,9 @@ if (empty($reshook)) {
// Terms of payment
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent')));
$result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue')));
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'setmode' && $usercancreate) {
// Payment choice
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
@@ -2581,7 +2583,7 @@ if ($action == 'create') {
// Create an invoice and classify billed
if ($object->statut == Propal::STATUS_SIGNED) {
if (!empty($conf->facture->enabled) && $usercancreateinvoice) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
}
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();

View File

@@ -1879,8 +1879,8 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET ref = '".$this->db->escape($num)."',";
$sql .= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
$sql .= " fk_statut = ".self::STATUS_VALIDATED.", date_valid='".$this->db->idate($now)."', fk_user_valid=".((int) $user->id);
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
dol_syslog(get_class($this)."::valid", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -1906,7 +1906,7 @@ class Propal extends CommonObject
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
// Now we rename also files into index
$sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'propale/".$this->db->escape($this->newref)."'";
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'propale/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'propale/".$this->db->escape($this->ref)."' and entity = ".((int) $conf->entity);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -1974,7 +1974,7 @@ class Propal extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET datep = '".$this->db->idate($date)."'";
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2030,7 +2030,7 @@ class Propal extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET fin_validite = ".($date_fin_validite != '' ? "'".$this->db->idate($date_fin_validite)."'" : 'null');
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2101,7 +2101,7 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
$sql .= " SET date_livraison = ".($delivery_date != '' ? "'".$this->db->idate($delivery_date)."'" : 'null');
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2156,9 +2156,9 @@ class Propal extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
$sql .= " SET fk_availability = '".$id."'";
$sql .= " WHERE rowid = ".$this->id;
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET fk_availability = ".((int) $id);
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(__METHOD__.' availability('.$id.')', LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2221,7 +2221,7 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal ";
$sql .= " SET fk_input_reason = ".((int) $id);
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2346,7 +2346,7 @@ class Propal extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal SET remise_percent = ".((float) $remise);
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2409,7 +2409,7 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET remise_absolue = ".((float) $remise);
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".self::STATUS_DRAFT;
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".self::STATUS_DRAFT;
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2530,7 +2530,7 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET fk_statut = ".((int) $status).", note_private = '".$this->db->escape($newprivatenote)."', date_signature='".$this->db->idate($now)."', fk_user_signature=".$user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
$resql = $this->db->query($sql);
if ($resql) {
@@ -2563,8 +2563,13 @@ class Propal extends CommonObject
$outputlangs->setDefaultLang($newlang);
}
// PDF
$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=$object->fetch($id); // Reload to get new records
$this->generateDocument($modelpdf, $outputlangs);
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
if (!$error) {
@@ -2651,8 +2656,13 @@ class Propal extends CommonObject
$outputlangs->setDefaultLang($newlang);
}
// PDF
$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=$object->fetch($id); // Reload to get new records
$this->generateDocument($modelpdf, $outputlangs);
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
}
$this->oldcopy = clone $this;
@@ -2707,7 +2717,7 @@ class Propal extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
$sql .= " SET fk_statut = ".self::STATUS_DRAFT;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
$resql = $this->db->query($sql);
if (!$resql) {
@@ -2780,7 +2790,7 @@ class Propal extends CommonObject
$sql .= " AND p.fk_soc = s.rowid";
$sql .= " AND p.fk_statut = c.id";
if (!$user->rights->societe->client->voir && !$socid) { //restriction
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -2789,7 +2799,7 @@ class Propal extends CommonObject
$sql .= " AND p.fk_statut = ".self::STATUS_DRAFT;
}
if ($notcurrentuser > 0) {
$sql .= " AND p.fk_user_author <> ".$user->id;
$sql .= " AND p.fk_user_author <> ".((int) $user->id);
}
$sql .= $this->db->order($sortfield, $sortorder);
$sql .= $this->db->plimit($limit, $offset);
@@ -2934,7 +2944,7 @@ class Propal extends CommonObject
if (!$error && !empty($this->table_element_line)) {
$tabletodelete = $this->table_element_line;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id).")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id);
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
$error++;
$this->error = $this->db->lasterror();
@@ -2970,7 +2980,7 @@ class Propal extends CommonObject
// Delete main record
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
$res = $this->db->query($sql);
if (!$res) {
$error++;
@@ -3285,7 +3295,7 @@ class Propal extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON p.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id;
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
$clause = " AND";
}
$sql .= $clause." p.entity IN (".getEntity('propal').")";
@@ -3296,7 +3306,7 @@ class Propal extends CommonObject
$sql .= " AND p.fk_statut = ".self::STATUS_SIGNED;
}
if ($user->socid) {
$sql .= " AND p.fk_soc = ".$user->socid;
$sql .= " AND p.fk_soc = ".((int) $user->socid);
}
$resql = $this->db->query($sql);
@@ -3462,7 +3472,7 @@ class Propal extends CommonObject
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON p.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id;
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
$clause = "AND";
}
$sql .= " ".$clause." p.entity IN (".getEntity('propal').")";
@@ -4156,7 +4166,7 @@ class PropaleLigne extends CommonObjectLine
$error = 0;
$this->db->begin();
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".$this->rowid;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."propaldet WHERE rowid = ".((int) $this->rowid);
dol_syslog("PropaleLigne::delete", LOG_DEBUG);
if ($this->db->query($sql)) {
// Remove extrafields

View File

@@ -94,10 +94,10 @@ class PropaleStats extends Stats
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
$this->where .= ($this->where ? ' AND ' : '')."p.entity IN (".getEntity('propal').")";
if (!$user->rights->societe->client->voir && !$this->socid) {
$this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
$this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($this->socid) {
$this->where .= " AND p.fk_soc = ".$this->socid;
$this->where .= " AND p.fk_soc = ".((int) $this->socid);
}
if ($this->userid > 0) {
$this->where .= ' AND fk_user_author = '.((int) $this->userid);

View File

@@ -67,8 +67,11 @@ print load_fiche_titre($langs->trans("ProspectionArea"), '', 'propal');
print '<div class="fichecenter">';
print '<div class="fichethirdleft">';
print getCustomerProposalPieChart($socid);
print '<br>';
$tmp = getCustomerProposalPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
/*
* Draft proposals
@@ -85,7 +88,7 @@ if (!empty($conf->propal->enabled)) {
$sql .= " AND p.fk_soc = s.rowid";
$sql .= " AND p.fk_statut =".Propal::STATUS_DRAFT;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND p.fk_soc = ".((int) $socid);
@@ -163,7 +166,7 @@ if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$sql .= " ORDER BY c.tms DESC";
$sql .= $db->plimit($max, 0);
@@ -236,7 +239,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propale->lire) {
$sql .= " AND p.entity IN (".getEntity($propalstatic->element).")";
$sql .= " AND p.fk_statut = ".Propal::STATUS_VALIDATED;
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -319,7 +322,7 @@ if (! empty($conf->propal->enabled))
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND c.fk_statut = 1";
if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid);
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
$sql.= " ORDER BY c.rowid DESC";
$resql=$db->query($sql);
@@ -394,7 +397,7 @@ if (! empty($conf->propal->enabled))
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND c.fk_statut = 2 ";
if ($socid) $sql.= " AND c.fk_soc = ".((int) $socid);
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
$sql.= " ORDER BY c.rowid DESC";
$resql=$db->query($sql);

View File

@@ -13,9 +13,9 @@
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -88,12 +88,30 @@ $search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
$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(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
$search_date_startday = GETPOST('search_date_startday', 'int');
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
$search_date_startyear = GETPOST('search_date_startyear', 'int');
$search_date_endday = GETPOST('search_date_endday', 'int');
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
$search_date_endyear = GETPOST('search_date_endyear', 'int');
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
$search_date_end_startday = GETPOST('search_date_end_startday', 'int');
$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int');
$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int');
$search_date_end_endday = GETPOST('search_date_end_endday', 'int');
$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int');
$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int');
$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int');
$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int');
$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int');
$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int');
$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int');
$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int');
$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
$search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
$search_availability = GETPOST('search_availability', 'int');
$search_categ_cus = GETPOST("search_categ_cus", 'int');
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
@@ -278,12 +296,30 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_type = '';
$search_country = '';
$search_type_thirdparty = '';
$search_date_startday = '';
$search_date_startmonth = '';
$search_date_startyear = '';
$search_date_endday = '';
$search_date_endmonth = '';
$search_date_endyear = '';
$search_date_start = '';
$search_date_end = '';
$search_dateend_start = '';
$search_dateend_end = '';
$search_datedelivery_start = '';
$search_datedelivery_end = '';
$search_date_end_startday = '';
$search_date_end_startmonth = '';
$search_date_end_startyear = '';
$search_date_end_endday = '';
$search_date_end_endmonth = '';
$search_date_end_endyear = '';
$search_date_end_start = '';
$search_date_end_end = '';
$search_date_delivery_startday = '';
$search_date_delivery_startmonth = '';
$search_date_delivery_startyear = '';
$search_date_delivery_endday = '';
$search_date_delivery_endmonth = '';
$search_date_delivery_endyear = '';
$search_date_delivery_start = '';
$search_date_delivery_end = '';
$search_availability = '';
$search_status = '';
$object_statut = '';
@@ -471,11 +507,11 @@ $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date
$sql .= ' p.note_public, p.note_private,';
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", sc.fk_soc, sc.fk_user";
}
if ($search_categ_cus) {
if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
$sql .= ", cc.fk_categorie, cc.fk_soc";
}
// Add fields from extrafields
@@ -493,7 +529,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
if (!empty($search_categ_cus)) {
if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
$sql .= ', '.MAIN_DB_PREFIX.'propal as p';
@@ -520,7 +556,7 @@ if ($search_user > 0) {
$sql .= ' WHERE p.fk_soc = s.rowid';
$sql .= ' AND p.entity IN ('.getEntity('propal').')';
if (!$user->rights->societe->client->voir && !$socid) { //restriction
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($search_town) {
@@ -592,6 +628,7 @@ if ($search_multicurrency_montant_ttc != '') {
if ($sall) {
$sql .= natural_search(array_keys($fieldstosearchall), $sall);
}
if ($search_categ_cus > 0) {
$sql .= " AND cc.fk_categorie = ".((int) $search_categ_cus);
}
@@ -627,17 +664,17 @@ if ($search_date_start) {
if ($search_date_end) {
$sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
}
if ($search_dateend_start) {
$sql .= " AND p.fin_validite >= '".$db->idate($search_dateend_start)."'";
if ($search_date_end_start) {
$sql .= " AND p.fin_validite >= '".$db->idate($search_date_end_start)."'";
}
if ($search_dateend_end) {
$sql .= " AND p.fin_validite <= '".$db->idate($search_dateend_end)."'";
if ($search_date_end_end) {
$sql .= " AND p.fin_validite <= '".$db->idate($search_date_end_end)."'";
}
if ($search_datedelivery_start) {
$sql .= " AND p.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
if ($search_date_delivery_start) {
$sql .= " AND p.date_livraison >= '".$db->idate($search_date_delivery_start)."'";
}
if ($search_datedelivery_end) {
$sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
if ($search_date_delivery_end) {
$sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'";
}
if ($search_sale > 0) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
@@ -712,12 +749,60 @@ if ($resql) {
if ($sall) {
$param .= '&sall='.urlencode($sall);
}
if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
if ($search_date_startday) {
$param .= '&search_date_startday='.urlencode($search_date_startday);
}
if ($search_date_startmonth) {
$param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
}
if ($search_date_startyear) {
$param .= '&search_date_startyear='.urlencode($search_date_startyear);
}
if ($search_date_endday) {
$param .= '&search_date_endday='.urlencode($search_date_endday);
}
if ($search_date_endmonth) {
$param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
}
if ($search_date_endyear) {
$param .= '&search_date_endyear='.urlencode($search_date_endyear);
}
if ($search_date_end_startday) {
$param .= '&search_date_end_startday='.urlencode($search_date_end_startday);
}
if ($search_date_end_startmonth) {
$param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
}
if ($search_date_end_startyear) {
$param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear);
}
if ($search_date_end_endday) {
$param .= '&search_date_end_endday='.urlencode($search_date_end_endday);
}
if ($search_date_end_endmonth) {
$param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
}
if ($search_date_end_endyear) {
$param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear);
}
if ($search_date_delivery_startday) {
$param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
}
if ($search_date_delivery_startmonth) {
$param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
}
if ($search_date_delivery_startyear) {
$param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
}
if ($search_date_delivery_endday) {
$param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
}
if ($search_date_delivery_endmonth) {
$param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
}
if ($search_date_delivery_endyear) {
$param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
}
if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref);
}
@@ -1017,10 +1102,10 @@ if ($resql) {
if (!empty($arrayfields['p.fin_validite']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_dateend_start ? $search_dateend_start : -1, 'search_dateend_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_dateend_end ? $search_dateend_end : -1, 'search_dateend_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print '</div>';
print '</td>';
}
@@ -1028,10 +1113,10 @@ if ($resql) {
if (!empty($arrayfields['p.date_livraison']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print '</div>';
print '</td>';
}
@@ -1708,8 +1793,8 @@ if ($resql) {
$userstatic->login = $obj->login;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->email = $obj->email;
$userstatic->statut = $obj->statut;
$userstatic->email = $obj->user_email;
$userstatic->statut = $obj->user_statut;
$userstatic->entity = $obj->user_entity;
$userstatic->photo = $obj->photo;
$userstatic->office_phone = $obj->office_phone;

View File

@@ -709,8 +709,8 @@ if ($socid > 0) {
//$sql.= " UNION ";
// Discount linked to invoices
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture_line, rc.fk_facture,";
$sql2 .= " rc.fk_facture_source,";
$sql2 .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
$sql2 .= " rc.datec as dc, rc.description, rc.fk_facture, rc.fk_facture_source,";
$sql2 .= " u.login, u.rowid as user_id,";
$sql2 .= " f.rowid as invoiceid, f.ref,";
$sql2 .= " fa.ref as invoice_source_ref, fa.type as type";
@@ -850,7 +850,7 @@ if ($socid > 0) {
// Discount linked to invoice lines
$sql = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
$sql .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
$sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
$sql .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line,";
$sql .= " rc.fk_invoice_supplier_source,";
$sql .= " u.login, u.rowid as user_id,";
$sql .= " f.rowid as invoiceid, f.ref as ref,";
@@ -869,7 +869,8 @@ if ($socid > 0) {
//$sql.= " UNION ";
// Discount linked to invoices
$sql2 = "SELECT rc.rowid, rc.amount_ht, rc.amount_tva, rc.amount_ttc, rc.tva_tx, rc.vat_src_code,";
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier_line, rc.fk_invoice_supplier,";
$sql2 .= " rc.multicurrency_amount_ht, rc.multicurrency_amount_tva, rc.multicurrency_amount_ttc,";
$sql2 .= " rc.datec as dc, rc.description, rc.fk_invoice_supplier,";
$sql2 .= " rc.fk_invoice_supplier_source,";
$sql2 .= " u.login, u.rowid as user_id,";
$sql2 .= " f.rowid as invoiceid, f.ref as ref,";

View File

@@ -278,6 +278,7 @@ if (empty($reshook)) {
if (!empty($origin) && !empty($originid)) {
// Parse element/subelement (ex: project_task)
$element = $subelement = $origin;
$regs = array();
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
$element = $regs [1];
$subelement = $regs [2];
@@ -597,9 +598,9 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
$result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
$result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'addline' && GETPOST('submitforalllines', 'alpha') && GETPOST('vatforalllines', 'alpha') !== '') {
// Define vat_rate
$vat_rate = (GETPOST('vatforalllines') ? GETPOST('vatforalllines') : 0);
@@ -629,7 +630,7 @@ if (empty($reshook)) {
$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha')) : 0);
$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
if (empty($remise_percent)) {
$remise_percent = 0;
}
@@ -1019,6 +1020,8 @@ if (empty($reshook)) {
$special_code = 3;
}
$remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Check minimum price
$productid = GETPOST('productid', 'int');
if (!empty($productid)) {
@@ -1034,7 +1037,7 @@ if (empty($reshook)) {
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@@ -1059,7 +1062,7 @@ if (empty($reshook)) {
}
}
}
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), price2num(GETPOST('remise_percent'), 2), $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
if ($result >= 0) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
@@ -1392,6 +1395,7 @@ if (empty($reshook)) {
/*
* View
*/
$title = $langs->trans('Order')." - ".$langs->trans('Card');
$help_url = 'EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes|DE:Modul_Kundenaufträge';
llxHeader('', $title, $help_url);
@@ -1717,7 +1721,7 @@ if ($action == 'create' && $usercancreate) {
}
};
print $object->showOptionals($extrafields, 'edit', $parameters);
print $object->showOptionals($extrafields, 'create', $parameters);
}
// Template to use by default
@@ -2345,17 +2349,17 @@ if ($action == 'create' && $usercancreate) {
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
// Multicurrency Amount HT
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>';
// Multicurrency Amount VAT
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).'</td>';
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>';
// Multicurrency Amount TTC
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).'</td>';
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '<td class="valuefield nowrap">'.price($object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>';
}
@@ -2365,23 +2369,23 @@ if ($action == 'create' && $usercancreate) {
$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
}
print '<tr><td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
print '<td class="valuefield">'.price($object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).$alert.'</td>';
print '<td class="valuefield">'.price($object->total_ht, 1, '', 1, -1, -1, $conf->currency).$alert.'</td>';
// Total VAT
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td class="valuefield">'.price($object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td class="valuefield">'.price($object->total_tva, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
// Amount Local Taxes
if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
print '<td class="valuefield">'.price($object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<td class="valuefield">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
}
if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 IRPF
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
print '<td class="valuefield">'.price($object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<td class="valuefield">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
}
// Total TTC
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="valuefield">'.price($object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="valuefield">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td></tr>';
// Statut
//print '<tr><td>' . $langs->trans('Status') . '</td><td>' . $object->getLibStatut(4) . '</td></tr>';

View File

@@ -717,6 +717,8 @@ class Orders extends DolibarrApi
throw new RestException(404, 'Order not found');
}
$result = $this->commande->fetch_thirdparty(); // do not check result, as failure is not fatal (used only for mail notification substitutes)
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
@@ -729,13 +731,6 @@ class Orders extends DolibarrApi
throw new RestException(500, 'Error when validating Order: '.$this->commande->error);
}
$result = $this->commande->fetch($id);
if (!$result) {
throw new RestException(404, 'Order not found');
}
if (!DolibarrApi::_checkAccessToResource('commande', $this->commande->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->commande->fetchObjectLinked();

View File

@@ -299,13 +299,9 @@ class Commande extends CommonOrder
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>56),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80),
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
@@ -344,6 +340,10 @@ class Commande extends CommonOrder
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300),
'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302),
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>304),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400),
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
);
@@ -493,8 +493,8 @@ class Commande extends CommonOrder
$sql .= " SET ref = '".$this->db->escape($num)."',";
$sql .= " fk_statut = ".self::STATUS_VALIDATED.",";
$sql .= " date_valid='".$this->db->idate($now)."',";
$sql .= " fk_user_valid = ".$user->id;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " fk_user_valid = ".((int) $user->id);
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::valid", LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -624,7 +624,7 @@ class Commande extends CommonOrder
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
$sql .= " SET fk_statut = ".self::STATUS_DRAFT;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
if ($this->db->query($sql)) {
if (!$error) {
@@ -807,7 +807,7 @@ class Commande extends CommonOrder
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
$sql .= " SET fk_statut = ".self::STATUS_CANCELED;
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
$sql .= " AND fk_statut = ".self::STATUS_VALIDATED;
dol_syslog(get_class($this)."::cancel", LOG_DEBUG);
@@ -2543,7 +2543,7 @@ class Commande extends CommonOrder
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
$sql .= " SET date_commande = ".($date ? "'".$this->db->idate($date)."'" : 'null');
$sql .= " WHERE rowid = ".$this->id." AND fk_statut = ".((int) self::STATUS_DRAFT);
$sql .= " WHERE rowid = ".((int) $this->id)." AND fk_statut = ".((int) self::STATUS_DRAFT);
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2615,7 +2615,7 @@ class Commande extends CommonOrder
$sql = "UPDATE ".MAIN_DB_PREFIX."commande";
$sql .= " SET date_livraison = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null');
$sql .= " WHERE rowid = ".$this->id;
$sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);
@@ -2688,7 +2688,7 @@ class Commande extends CommonOrder
$sql .= " WHERE c.entity IN (".getEntity('commande').")";
$sql .= " AND c.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) { //restriction
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($socid) {
$sql .= " AND s.rowid = ".((int) $socid);
@@ -2697,7 +2697,7 @@ class Commande extends CommonOrder
$sql .= " AND c.fk_statut = ".self::STATUS_DRAFT;
}
if (is_object($excluser)) {
$sql .= " AND c.fk_user_author <> ".$excluser->id;
$sql .= " AND c.fk_user_author <> ".((int) $excluser->id);
}
$sql .= $this->db->order($sortfield, $sortorder);
$sql .= $this->db->plimit($limit, $offset);
@@ -3395,8 +3395,8 @@ class Commande extends CommonOrder
// Delete extrafields of lines and lines
if (!$error && !empty($this->table_element_line)) {
$tabletodelete = $this->table_element_line;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id.")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".$this->id;
$sqlef = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete."_extrafields WHERE fk_object IN (SELECT rowid FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id).")";
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabletodelete." WHERE ".$this->fk_element." = ".((int) $this->id);
if (!$this->db->query($sqlef) || !$this->db->query($sql)) {
$error++;
$this->error = $this->db->lasterror();
@@ -3432,7 +3432,7 @@ class Commande extends CommonOrder
// Delete main record
if (!$error) {
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".$this->id;
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
$res = $this->db->query($sql);
if (!$res) {
$error++;
@@ -3507,14 +3507,14 @@ class Commande extends CommonOrder
$sql .= " FROM ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON c.fk_soc = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id;
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
$clause = " AND";
}
$sql .= $clause." c.entity IN (".getEntity('commande').")";
//$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0";
$sql .= " AND ((c.fk_statut IN (".self::STATUS_VALIDATED.",".self::STATUS_SHIPMENTONPROCESS.")) OR (c.fk_statut = ".self::STATUS_CLOSED." AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected
if ($user->socid) {
$sql .= " AND c.fk_soc = ".$user->socid;
$sql .= " AND c.fk_soc = ".((int) $user->socid);
}
$resql = $this->db->query($sql);
@@ -3917,7 +3917,7 @@ class Commande extends CommonOrder
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON co.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql .= " WHERE sc.fk_user = ".$user->id;
$sql .= " WHERE sc.fk_user = ".((int) $user->id);
$clause = "AND";
}
$sql .= " ".$clause." co.entity IN (".getEntity('commande').")";
@@ -4649,7 +4649,7 @@ class OrderLine extends CommonOrderLine
$sql .= ",total_localtax1='".price2num($this->total_localtax1)."'";
$sql .= ",total_localtax2='".price2num($this->total_localtax2)."'";
$sql .= ",total_ttc='".price2num($this->total_ttc)."'";
$sql .= " WHERE rowid = ".$this->rowid;
$sql .= " WHERE rowid = ".((int) $this->rowid);
dol_syslog("OrderLine::update_total", LOG_DEBUG);

View File

@@ -94,13 +94,13 @@ class CommandeStats extends Stats
$this->where .= ($this->where ? ' AND ' : '').'c.entity IN ('.getEntity('commande').')';
if (!$user->rights->societe->client->voir && !$this->socid) {
$this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
$this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if ($this->socid) {
$this->where .= " AND c.fk_soc = ".$this->socid;
$this->where .= " AND c.fk_soc = ".((int) $this->socid);
}
if ($this->userid > 0) {
$this->where .= ' AND c.fk_user_author = '.$this->userid;
$this->where .= ' AND c.fk_user_author = '.((int) $this->userid);
}
if ($typentid) {

View File

@@ -87,7 +87,7 @@ if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " WHERE s.fk_stcomm = st.id AND c.fk_soc = s.rowid";
$sql .= " AND s.entity IN (".getEntity('societe').")";
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
if (GETPOST("search_nom")) {
$sql .= natural_search("s.nom", GETPOST("search_nom"));

View File

@@ -77,8 +77,11 @@ print load_fiche_titre($langs->trans("OrdersArea"), '', 'order');
print '<div class="fichecenter"><div class="fichethirdleft">';
print getCustomerOrderPieChart($socid);
print '<br>';
$tmp = getCustomerOrderPieChart($socid);
if ($tmp) {
print $tmp;
print '<br>';
}
/*
@@ -101,7 +104,7 @@ if (!empty($conf->commande->enabled)) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$resql = $db->query($sql);
@@ -169,7 +172,7 @@ if ($socid) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$sql .= " ORDER BY c.tms DESC";
$sql .= $db->plimit($max, 0);
@@ -253,7 +256,7 @@ if (!empty($conf->commande->enabled)) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$sql .= " ORDER BY c.rowid DESC";
@@ -342,7 +345,7 @@ if (!empty($conf->commande->enabled)) {
$sql .= " AND c.fk_soc = ".((int) $socid);
}
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
$sql .= " ORDER BY c.rowid DESC";

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