2
0
forked from Wavyzz/dolibarr

Compare commits

...

246 Commits
6.0.3 ... 6.0.5

Author SHA1 Message Date
Laurent Destailleur
92cace6747 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-26 01:40:55 +01:00
Laurent Destailleur
40b63be4b9 Fix package 2018-01-26 01:40:32 +01:00
Laurent Destailleur
47d0b6583e Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-01-26 01:40:04 +01:00
Laurent Destailleur
c0e719e3d8 Fix package scripts 2018-01-26 01:39:42 +01:00
Laurent Destailleur
d3c0414b4f Update changelog 2018-01-26 01:16:36 +01:00
Laurent Destailleur
2c0eeaf8de FIX #8093 2018-01-25 20:57:51 +01:00
Laurent Destailleur
1da7b154c1 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-24 11:48:31 +01:00
Laurent Destailleur
54fb59d8db Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/compta/paiement.php
2018-01-24 11:45:43 +01:00
Laurent Destailleur
e66b266432 Merge pull request #8090 from atm-arnaud/FIX_sepa_mail_encode
FIX email sent was not in HTML
2018-01-24 11:17:16 +01:00
Laurent Destailleur
f339719ae9 Merge pull request #8088 from atm-john/fix_sql_check_margin
Fix SQL error when multiple entities are used
2018-01-24 11:16:00 +01:00
Laurent Destailleur
adb70e0456 Merge pull request #8086 from atm-ph/fix_5.0_align_payment_total
Fix each total isn't aligned on payment card
2018-01-24 11:14:43 +01:00
arnaud
c0481be8d8 FIX subject mail sepa 2018-01-23 17:01:03 +01:00
arnaud
19c616756a FIX email sent was not in HTML 2018-01-23 12:14:22 +01:00
John
f2ae3ee41d Fix get entity if multiple 2018-01-23 09:49:21 +01:00
atm-ph
054d98a2ba Fix each total isn't aligned on payment card 2018-01-22 17:09:17 +01:00
Laurent Destailleur
1420149b95 Merge pull request #8069 from atm-maxime/fix_contrat_validate
Fix validate contrat was not using force_number parameter
2018-01-20 12:33:50 +01:00
Maxime Kohlhaas
4c0dc21ca0 Fix validate contrat was not using force_number parameter 2018-01-18 14:07:32 +01:00
Laurent Destailleur
bc7bd77cea Fix permission to open supplier order 2018-01-17 15:54:27 +01:00
Laurent Destailleur
5d4eda68e0 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-16 19:53:02 +01:00
Laurent Destailleur
94b1d59f2b Fix missing check on object entity 2018-01-16 19:52:14 +01:00
Laurent Destailleur
f307fecaf6 Merge pull request #8064 from atm-quentin/6.0
FIX missing hook invoice index
2018-01-16 12:15:06 +01:00
atm-quentin
6feacab4f5 FIX missing hook invoice index 2018-01-15 14:24:19 +01:00
Laurent Destailleur
4c8af0ff50 Fix name alias on list 2018-01-15 12:24:56 +01:00
Laurent Destailleur
b154357683 Merge pull request #7982 from simnandez/6.0
FIX: Bad name alias showing in name of third column
2018-01-15 12:22:40 +01:00
Laurent Destailleur
3b9aee7d4c Update list.php 2018-01-15 12:22:21 +01:00
Laurent Destailleur
9f6118ed52 Code comments 2018-01-14 03:12:22 +01:00
Laurent Destailleur
c947502efa Fix typo 2018-01-13 17:22:59 +01:00
Laurent Destailleur
dbb9caa196 Prepare 6.0.5 2018-01-11 09:53:47 +01:00
Laurent Destailleur
764646634d Merge pull request #8051 from atm-florian/6.0
fix: search translation into external module files also
2018-01-11 01:12:53 +01:00
Laurent Destailleur
0ae02d76a3 Merge pull request #8049 from fmarcet/6.0
Fix: Still using property ->client instead of ->thirdparty.
2018-01-11 01:03:47 +01:00
Laurent Destailleur
e9bf6ed4ce Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-11 00:56:01 +01:00
Laurent Destailleur
54228b4f98 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-11 00:55:51 +01:00
Laurent Destailleur
58589b8454 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-01-11 00:55:10 +01:00
Laurent Destailleur
387dd967e2 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-01-11 00:55:00 +01:00
Laurent Destailleur
5adeaf9d76 Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2018-01-11 00:54:30 +01:00
Laurent Destailleur
205e715b7f Merge pull request #8046 from hregis/6.0_bug
Fix: avoid Warning: A non-numeric value encountered
2018-01-11 00:53:07 +01:00
Laurent Destailleur
79562f8d5b Merge pull request #8036 from atm-ph/fix_6.0_model_pdf_invoice_payment
Fix wrong address used into PDF model of supplier payment
2018-01-11 00:37:37 +01:00
Laurent Destailleur
b5fe953a64 Merge pull request #8035 from pdermody/6.0
Fix #8034 - Surface and volume units are calculated incorrectly
2018-01-11 00:36:00 +01:00
Laurent Destailleur
df22a311c2 Merge pull request #8030 from steschuser/5.0
FIX #8029 Unable to make leave request in holyday module
2018-01-11 00:32:45 +01:00
Laurent Destailleur
9253fed754 Revert "Code comment"
This reverts commit 8000777864.
2018-01-11 00:17:32 +01:00
florian HENRY
c8c550cd33 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr.git into 6.0 2018-01-10 20:49:48 +01:00
Laurent Destailleur
8000777864 Code comment 2018-01-10 20:43:56 +01:00
florian HENRY
0bd45dc64b fix: search translation into external module files also 2018-01-10 20:34:32 +01:00
Ferran Marcet
d99535d9da Fix: Still using property ->client instead of ->thirdparty. 2018-01-10 16:40:43 +01:00
Regis Houssin
0f51aa15d8 Fix: avoid Warning: A non-numeric value encountered 2018-01-10 10:52:30 +01:00
atm-ph
22d92c0540 Fix wrong address used into PDF model of supplier payment 2018-01-08 15:25:18 +01:00
Paul Dermody
a1ac285a25 Fixed automated computation of surface and volume to use correct units. It was failing for inches and feet. 2018-01-07 12:42:14 -06:00
sschwebel
7e8fda2d71 FIX #8029 Unable to make leave request in holyday module
wrong variable name in card.php
2018-01-05 12:09:45 +01:00
Laurent Destailleur
301f509611 Merge pull request #8019 from atm-gauthier/6.0_fix_vat_mass_update
FIX : $oldvatrateclean & $newvatrateclean must be set if preg_match === false
2018-01-04 21:03:20 +01:00
Laurent Destailleur
550fc37e62 Merge pull request #8017 from atm-florian/6.0
fix : linked object (new format  of linked_object atribut on 6.0)
2018-01-04 21:02:31 +01:00
Laurent Destailleur
a14a3db2e9 Merge pull request #8013 from atm-john/FIX_invoice_filter_type
fix filter for TYPE_SITUATION invoice
2018-01-04 20:59:32 +01:00
Laurent Destailleur
e4d37c3e23 Merge pull request #8012 from ATM-Nicolas/fix_product_best_price
Fix product best price
2018-01-04 20:58:59 +01:00
Laurent Destailleur
b2feac9d90 CVE-2017-17971 2018-01-04 19:25:52 +01:00
Juanjo Menent
762ab74940 FIX: Cashdesk should not sell to inactive third parties 2018-01-04 18:09:25 +01:00
Juanjo Menent
9471495dca Merge remote-tracking branch 'upstream/6.0' into 6.0 2018-01-04 18:05:55 +01:00
gauthier
58470e0913 FIX : $oldvatrateclean & $newvatrateclean must be set if preg_match === false 2018-01-04 12:01:21 +01:00
Laurent Destailleur
f6ff6610e4 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-03 20:13:56 +01:00
Laurent Destailleur
c7798d11ce Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-03 20:13:17 +01:00
florian HENRY
25390e5f73 fix : linked object (new format of linked_object atribut on 6.0) 2018-01-03 17:03:00 +01:00
ATM-Nicolas
2e6c036ad8 Merge branch '6.0' of github.com:Dolibarr/dolibarr into fix_product_best_price 2018-01-02 17:22:53 +01:00
ATM-Nicolas
61efda4cbd FIX : product best price on product list 2018-01-02 17:21:04 +01:00
John
1331e8add7 fix filter for TYPE_SITUATION invoice 2018-01-02 17:19:42 +01:00
Laurent Destailleur
0abe19c30d Merge pull request #7998 from hregis/6.0_bug
Fix: avoid warning
2017-12-28 12:53:04 +01:00
Laurent Destailleur
bbcf70cf4e Remove spaces 2017-12-28 09:48:41 +01:00
Laurent Destailleur
70e75753f8 Merge pull request #7994 from fmarcet/6.0
Fix: Missing include for Project class
2017-12-28 08:48:41 +01:00
Laurent Destailleur
3ac413084f Merge branch '6.0' into 6.0 2017-12-28 08:46:22 +01:00
Laurent Destailleur
3d4e6c9169 Merge pull request #7987 from atm-arnaud/FIX_trans_product_stats
FIX stats trad for customerinvoice
2017-12-28 07:10:14 +01:00
Laurent Destailleur
56bc0dbd25 Merge pull request #7986 from atm-arnaud/FIX_contractline_trans_unactivate
FIX trans unactivate on contractline
2017-12-28 07:09:28 +01:00
Laurent Destailleur
31b5d9df52 Merge pull request #7985 from atm-arnaud/FIX_search_contact_list
FIX search on contact list
2017-12-28 07:07:47 +01:00
Laurent Destailleur
de305cb3b2 Merge pull request #7980 from hregis/6.0_bug2
Fix: avoid php warning
2017-12-28 06:53:09 +01:00
Regis Houssin
59a89b250d Fix: avoid warning (https://github.com/Dolibarr/dolibarr/issues/7993) 2017-12-27 11:56:58 +01:00
Ferran Marcet
1c7b99d3dc Fix: Missing include for Project class 2017-12-26 12:13:35 +01:00
Juanjo Menent
b650ba21c4 Merge remote-tracking branch 'upstream/6.0' into 6.0 2017-12-26 10:52:46 +01:00
Laurent Destailleur
b70dd36ffa Better js comment 2017-12-24 12:16:48 +01:00
Laurent Destailleur
6a62e13960 FIX security vulnerability reported by ADLab of Venustech 2017-12-21 13:32:16 +01:00
Laurent Destailleur
62f895e2ec Fix: avoid infinite loop 2017-12-21 13:31:39 +01:00
Laurent Destailleur
4a5988accb FIX security vulnerability reported by ADLab of Venustech 2017-12-21 12:52:19 +01:00
arnaud
b1ce3fc5c8 FIX stats trad for customerinvoice 2017-12-21 12:12:50 +01:00
arnaud
4ba039d229 FIX trans unactivate on contractline 2017-12-21 12:07:29 +01:00
arnaud
ae7f8c3fe4 FIX search on contact list 2017-12-21 12:01:30 +01:00
Juanjo Menent
dc930dd6c5 FIX: Bad name alias showing in name of third column 2017-12-20 16:46:49 +01:00
Laurent Destailleur
3f6b3b51ca Fix css 2017-12-20 15:09:58 +01:00
Laurent Destailleur
6900771c70 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-20 13:17:39 +01:00
Laurent Destailleur
ca8ae3c723 Fix option MAIN_USE_JQUERY_JEDITABLE 2017-12-20 13:17:21 +01:00
Laurent Destailleur
b1f98b5903 Fix inline edit 2017-12-20 12:45:38 +01:00
Regis Houssin
2821459894 Fix: avoid php warning 2017-12-20 11:36:51 +01:00
Laurent Destailleur
a020dbf3d7 Merge pull request #7953 from atm-ph/fix_6.0_checkbox_credit_note
Fix since jquery 3 we can check all checkbox of credit note options
2017-12-16 01:13:55 +01:00
Laurent Destailleur
aaadc6e001 Merge pull request #7954 from atm-ph/fix_6.0_wrong_char_in_url_param
Fix wrong or missing char for url
2017-12-16 01:10:37 +01:00
Laurent Destailleur
0db03cfbcc Merge pull request #7957 from frederic34/patch-1
Update product.php
2017-12-16 01:08:30 +01:00
Frédéric FRANCE
ab558ee5fa Update product.php 2017-12-14 09:49:55 +01:00
atm-ph
a2f4afbf88 Fix wrong or missing char for url 2017-12-13 16:17:22 +01:00
atm-ph
46770178d2 Fix since jquery 3 we can check all checkbox of credit note options 2017-12-13 15:24:09 +01:00
Laurent Destailleur
ef9468f78a Fix missing field label 2017-12-12 11:48:51 +01:00
Laurent Destailleur
48499fb506 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-11 15:21:22 +01:00
Laurent Destailleur
f2e429e28f Fix file integrity checker (exclude files excluded from package) 2017-12-11 15:03:34 +01:00
Laurent Destailleur
4017d09613 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-10 21:28:36 +01:00
Laurent Destailleur
fd85088a6c Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-10 21:27:03 +01:00
Laurent Destailleur
1d9d8980a9 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-10 21:16:49 +01:00
Laurent Destailleur
d3150ede42 Merge pull request #7942 from delcroip/fixDeleteSalaries
fix: unable to remove salaries, plus correct default rights management
2017-12-10 21:09:15 +01:00
Laurent Destailleur
f18edd5787 Update security.lib.php 2017-12-10 21:08:13 +01:00
Laurent Destailleur
7e69a31dd6 Merge pull request #7941 from atm-maxime/fix_errmsg_stockneg
Fix display error message when stock not enough on invoice validation #7846
2017-12-10 21:05:23 +01:00
Laurent Destailleur
3a181a5d28 Merge pull request #7936 from atm-maxime/5.0
Fix event late alert on third event list #7912
2017-12-10 20:58:32 +01:00
Laurent Destailleur
59aa49076c Merge pull request #7934 from aspangaro/6.0
FIX : Edit accountancy account and warning message on loan
2017-12-10 20:56:34 +01:00
Laurent Destailleur
e4725f4248 FIX #7933 2017-12-10 20:55:51 +01:00
patrick Delcroix
033016da7f fix: unable to remove salaries, plus correct default rights management 2017-12-10 20:02:26 +01:00
Maxime Kohlhaas
12d0928244 Fix display error message when stock not enough on invoice validation 2017-12-10 19:59:56 +01:00
Maxime Kohlhaas
3db4d10fc0 Fix event late alert on third event list #7912 2017-12-10 08:12:49 +01:00
Alexandre SPANGARO
60fc500fa8 FIX : Edit accountancy account and warning message on loan 2017-12-10 07:00:46 +01:00
Laurent Destailleur
3ddc582edd Merge pull request #7913 from atm-ph/fix_6.0_var_name
Fix $boad instead of $board
2017-12-08 16:55:28 +01:00
Laurent Destailleur
5128ad6e24 Merge pull request #7926 from atm-florian/6.0
fix MAIN_COPY_FILE_IN_EVENT_AUTO
2017-12-08 16:55:12 +01:00
florian HENRY
eb03f8f08e fix MAIN_COPY_FILE_IN_EVENT_AUTO 2017-12-08 15:03:42 +01:00
Laurent Destailleur
b671edb116 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-08 13:10:30 +01:00
Laurent Destailleur
09d3db145b Merge 2017-12-08 13:10:13 +01:00
Laurent Destailleur
8dc3d7323d Merge pull request #7923 from fmarcet/6.0
FIX #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO varieable
2017-12-08 13:02:07 +01:00
Laurent Destailleur
9b9b5adf66 Fix must be compatible with old and new storage location 2017-12-08 13:01:45 +01:00
Laurent Destailleur
08abb1490a Remove code using not defined var 2017-12-08 12:54:08 +01:00
Laurent Destailleur
8a5c53550b Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-08 12:43:53 +01:00
Laurent Destailleur
049a038f56 Merge pull request #7925 from hregis/5.0_bug
Fix: wrong translation if multilang activated
2017-12-08 12:43:37 +01:00
Laurent Destailleur
e526162e8e Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-08 12:42:22 +01:00
Regis Houssin
1b16eb731d Fix: missing load product translation file 2017-12-08 11:00:23 +01:00
Regis Houssin
1bdffa961f Fix: wrong translation if multilang activated 2017-12-08 10:41:14 +01:00
Laurent Destailleur
6de3a40546 Merge pull request #7916 from atm-ph/fix_4.0_require_class
Fix include class WorkboardResponse
2017-12-08 10:40:26 +01:00
Laurent Destailleur
5f71165020 Merge pull request #7924 from hregis/6.0_bug2
Fix: Avoid warning "A non-numeric value encountered"
2017-12-08 10:34:54 +01:00
Regis Houssin
04327189f7 Fix: access error when user not right to view all customers 2017-12-08 09:41:33 +01:00
Regis Houssin
c4b2c3e697 FIXME $accounts[$bid] is a label ! 2017-12-08 09:17:12 +01:00
Regis Houssin
8e1a9064cb Fix: avoid warning again 2017-12-08 09:00:05 +01:00
Regis Houssin
95fa183fac Fix: Avoid warning "A non-numeric value encountered" 2017-12-08 08:49:03 +01:00
Ferran Marcet
bfc476a118 FIX #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO varieable 2017-12-07 18:44:33 +01:00
atm-ph
c90ece1188 Fix include class WorkboardResponse 2017-12-06 14:22:37 +01:00
atm-ph
c70dff89dd Fix $boad instead of $board 2017-12-06 12:13:15 +01:00
Laurent Destailleur
340287f073 FIX #7903
Conflicts:
	htdocs/holiday/class/holiday.class.php
2017-12-05 11:56:32 +01:00
Laurent Destailleur
365639a6c0 Prepare 6.0.5 2017-12-05 11:54:26 +01:00
Laurent Destailleur
44e5566ee5 Update changelog 2017-12-02 14:17:49 +01:00
Laurent Destailleur
38be224665 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-02 14:14:26 +01:00
Laurent Destailleur
29568287ef Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-02 14:13:44 +01:00
Laurent Destailleur
5fae19b4d6 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-02 14:13:29 +01:00
Laurent Destailleur
c7d0e917fb Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2017-12-02 14:12:43 +01:00
Laurent Destailleur
9cafb08759 Merge pull request #7853 from atm-ph/fix_5.0_invoice_updateline_calcul_price_total
Fix product type is ignored and can generate a diffrent result with s…
2017-12-02 14:06:25 +01:00
Laurent Destailleur
03fd69c3b9 Fix missing lang 2017-12-01 16:48:43 +01:00
Laurent Destailleur
a832bbb348 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/compta/facture/stats/index.php
2017-12-01 16:18:03 +01:00
Laurent Destailleur
5308acdcde Merge pull request #7895 from atm-alexis/FIX_add_line_bad_price_and_ref
FIX add line bad price and ref
2017-12-01 16:03:21 +01:00
Alexis ALGOUD
b2effa7cc8 fix travis 2017-11-30 11:36:35 +01:00
root
b7f26ea788 FIX add line bad price and ref 2017-11-30 11:10:01 +01:00
Laurent Destailleur
d2135fd139 Merge pull request #7888 from atm-gauthier/5.0_fix_where_fk_status
FIX : test for filter fk_status
2017-11-29 15:32:51 +01:00
Laurent Destailleur
acd2d0121d Merge pull request #7886 from ptibogxiv/patch-8
Fix for multicompany
2017-11-29 15:31:21 +01:00
Laurent Destailleur
9fa6bfd1a5 Fix edit external user or not 2017-11-29 15:30:41 +01:00
Laurent Destailleur
359e82fd3e Merge pull request #7884 from jfefe/patch-15
FIX : external user cannot be set as internal
2017-11-29 15:07:18 +01:00
Laurent Destailleur
dbde97f25f Update card.php 2017-11-29 15:07:09 +01:00
gauthier
f04af6c1b3 FIX : test for filter fk_status 2017-11-29 11:06:33 +01:00
ptibogxiv
c194538609 Update fraise.modules.php 2017-11-29 10:45:16 +01:00
ptibogxiv
883c9dbf99 Fix for multicompany
last fix for multicompany compliance
2017-11-29 09:28:03 +01:00
jfefe
d0ab117488 FIX : external user cannot be set as internal 2017-11-28 15:06:23 +01:00
Laurent Destailleur
3071796bc3 Merge pull request #7876 from ptibogxiv/patch-6
fix for multicompany
2017-11-28 12:12:50 +01:00
Laurent Destailleur
fa1bb9d672 Merge pull request #7874 from ptibogxiv/patch-4
Fix stat  don in multicompany
2017-11-28 12:10:35 +01:00
ptibogxiv
a9e4fcfdca Update fraise.modules.php 2017-11-27 15:49:28 +01:00
ptibogxiv
780e8ce470 fix for multicompany 2017-11-27 15:13:14 +01:00
ptibogxiv
2e9952439e Fix stat don in multicompany 2017-11-27 15:03:34 +01:00
atm-ph
5fef6478a5 Fix wrong calcul_price_total() update 2017-11-27 11:26:41 +01:00
Laurent Destailleur
61798d1af0 FIX list of module not complete when module mb_strlen not available
Conflicts:
	dev/dolibarr_changes.txt
2017-11-25 02:34:24 +01:00
Laurent Destailleur
4cbcf5189a FIX #7806 2017-11-25 01:24:24 +01:00
Laurent Destailleur
38c770ffb3 FIX #7806 2017-11-25 01:16:12 +01:00
Laurent Destailleur
07cd1fb3c2 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-24 16:54:38 +01:00
Laurent Destailleur
2493c2468d Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/core/class/conf.class.php
	htdocs/core/lib/files.lib.php
2017-11-24 16:51:59 +01:00
Laurent Destailleur
306dcf3600 Merge pull request #7863 from atm-quentin/6.0
FIX too much users on holiday list
2017-11-24 16:39:06 +01:00
Laurent Destailleur
c2f84309db Update holiday.class.php 2017-11-24 16:38:52 +01:00
atm-quentin
314c30f489 FIX too much users on holiday list 2017-11-23 14:26:26 +01:00
Laurent Destailleur
1e4844fd1c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-22 17:25:49 +01:00
Laurent Destailleur
e1344eb97c Fix edit of time spent 2017-11-22 17:25:31 +01:00
atm-ph
219e58d0e4 Fix product type is ignored and can generate a diffrent result with situation invoice 2017-11-22 12:15:02 +01:00
Laurent Destailleur
356f36c5bf Merge pull request #7851 from atm-gauthier/5.0_backport_feature
Fix: some problems with medias in multicompany (backport 6.0 commit 762b4eb876)
2017-11-22 11:58:09 +01:00
Laurent Destailleur
9a75cb466a Merge pull request #7834 from ptibogxiv/patch-2
FIX list of donation not filtered on multicompany
2017-11-22 11:23:13 +01:00
Laurent Destailleur
dc5127e619 Merge pull request #7831 from ptibogxiv/patch-1
FIX createfromorder
2017-11-22 11:17:00 +01:00
Regis Houssin
a9bfe0f48f Fix: some problems with medias in multicompany (backport 6.0 commit 762b4eb876) 2017-11-22 10:12:51 +01:00
ptibogxiv
5d6555b9dd Update list.php 2017-11-19 21:54:14 +01:00
ptibogxiv
3f360601af Fix entity
Fix entity in list.php
2017-11-19 21:52:18 +01:00
ptibogxiv
35182066a8 update createfromorder
lack of 2 fields date_start and date_end not imported from order
2017-11-19 16:25:35 +01:00
Laurent Destailleur
a6e4e4ddb0 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/product/stock/replenishorders.php
2017-11-17 14:17:49 +01:00
Laurent Destailleur
c3c14277e1 Merge 2017-11-17 14:15:07 +01:00
Laurent Destailleur
42b7d80567 FIX #7824
Conflicts:
	htdocs/product/stock/replenishorders.php
2017-11-17 14:12:53 +01:00
Laurent Destailleur
fde33594a2 FIX #7824 2017-11-17 14:06:08 +01:00
Laurent Destailleur
7f28c9fff6 FIX #7824
Conflicts:
	htdocs/product/stock/replenishorders.php
2017-11-17 14:01:21 +01:00
Laurent Destailleur
57a6ada2a3 FIX #7824 2017-11-17 13:57:40 +01:00
Laurent Destailleur
5741d4d67d Merge pull request #7811 from atm-florian/6.0_fixvatcodesupplier
fix : return vat code for supplier price
2017-11-17 13:02:56 +01:00
Laurent Destailleur
4b90510b82 Fix time assigned to wrong user 2017-11-16 22:35:55 +01:00
Laurent Destailleur
924cf871a7 FIX CSS for IE10 2017-11-15 10:40:24 +01:00
Laurent Destailleur
77b6ef7396 Code comment 2017-11-14 19:41:57 +01:00
Laurent Destailleur
388b90a94c Fix repair of utf8 2017-11-14 19:00:52 +01:00
Laurent Destailleur
f789714f14 Fix translation 2017-11-14 18:16:01 +01:00
florian HENRY
e195cf0b95 fix : return vat code for supplier price 2017-11-14 09:53:06 +01:00
Laurent Destailleur
a2c80a704f Code comment 2017-11-13 19:06:58 +01:00
Laurent Destailleur
b5196b7164 FIX A lot of several fix on local taxes and NPR tax 2017-11-13 14:24:40 +01:00
Laurent Destailleur
1a5bbef266 FIX Locatax were not propagated when cloning order or proposal 2017-11-13 13:07:31 +01:00
Laurent Destailleur
05683bbf61 Code comment 2017-11-13 11:41:37 +01:00
Laurent Destailleur
90615a8682 Fix busy tag not set sometimes 2017-11-13 02:44:02 +01:00
Laurent Destailleur
36b4d50cff FIX #7737 2017-11-12 20:41:25 +01:00
Laurent Destailleur
d421b90376 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-12 20:18:56 +01:00
Laurent Destailleur
356525730d FIX #7786 2017-11-12 20:12:56 +01:00
Laurent Destailleur
d29233f553 Merge pull request #7801 from atm-maxime/fix_multi_vat_deposit
Fix multi VAT deposit when special lines are in origin document
2017-11-11 18:03:31 +01:00
Laurent Destailleur
5703c704f9 Merge pull request #7792 from atm-ph/fix_6.0_pdf_width_payment_term
Fix width of payment term is to large
2017-11-11 17:45:54 +01:00
Laurent Destailleur
50ed463b9f Merge pull request #7784 from frederic34/patch-3
account number on create bank account
2017-11-11 17:37:29 +01:00
Laurent Destailleur
3889941406 Merge pull request #7783 from frederic34/patch-2
Update card.php
2017-11-11 17:36:51 +01:00
Laurent Destailleur
0d38e154cf Merge pull request #7781 from frederic34/patch-1
Fetch right account
2017-11-11 17:33:26 +01:00
Maxime Kohlhaas
22a3721dda Fix multi VAT deposit when special lines are in origin document 2017-11-11 16:10:06 +01:00
atm-ph
2636c2470b Fix width of payment term is to large 2017-11-10 10:52:58 +01:00
Frédéric FRANCE
1ea6df14d0 Update card.php 2017-11-08 11:35:15 +01:00
Frédéric FRANCE
fe3ce78ae4 Update card.php 2017-11-08 11:24:33 +01:00
Frédéric FRANCE
27ace14fb7 Fetch right account 2017-11-07 16:28:51 +01:00
Laurent Destailleur
6eb2204c2b Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
	htdocs/product/list.php
2017-11-06 21:20:06 +01:00
Laurent Destailleur
1d9873e1a9 FIX #7756 Add better error message 2017-11-06 21:17:30 +01:00
Laurent Destailleur
bc9b816719 Fix deletion of files that contains __ 2017-11-06 17:54:18 +01:00
Laurent Destailleur
825ceeaa8d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-06 11:47:20 +01:00
Laurent Destailleur
864af9cc3b Fix error not returned if output directory not writable 2017-11-06 11:47:03 +01:00
Laurent Destailleur
d453961afc Merge pull request #7758 from atm-maxime/fix_search_service
Fix : type was forced to 0 so service are not in the list
2017-11-05 18:30:20 +01:00
Laurent Destailleur
7d4b43f368 Merge pull request #7757 from atm-maxime/fix_search_product
Fix display of product/service list
2017-11-05 18:29:24 +01:00
Laurent Destailleur
d3a0cff30a Merge pull request #7755 from frederic34/currency
default currency on propal create
2017-11-05 18:28:40 +01:00
Laurent Destailleur
52421406ce FIX #7751 2017-11-05 18:25:33 +01:00
Laurent Destailleur
eb4a5f6570 Fix link can't be a htm link in innosetup 2017-11-05 18:21:29 +01:00
Maxime Kohlhaas
e992e4bea5 Fix : type was forced to 0 so service are not in the list 2017-11-03 09:09:07 +01:00
Maxime Kohlhaas
13667e4850 Fix display of product/service list 2017-11-03 08:56:23 +01:00
Frédéric FRANCE
b58df17545 default currency on propal create 2017-11-02 18:14:55 +01:00
Laurent Destailleur
a291919cf7 Merge pull request #7754 from atm-gauthier/6.0_fix_filter_typeactioncomm_with_multiselect
FIX : Wrong alias sql
2017-11-02 16:40:40 +01:00
gauthier
03544f783a FIX : Wrong alias sql 2017-11-02 16:16:29 +01:00
Laurent Destailleur
6ea69f421f Merge pull request #7752 from atm-gauthier/6.0_fix_filter_typeactioncomm_with_multiselect
FIX : Filter type on actioncomm with multiselect doesn't work
2017-11-02 15:51:49 +01:00
Laurent Destailleur
310bf4bde4 Update peruser.php 2017-11-02 15:51:35 +01:00
Laurent Destailleur
ec3a07cd52 Try to restore compatibility when actioncode=CODE1,CODE2,... 2017-11-02 15:50:55 +01:00
Laurent Destailleur
63a363080e Update index.php 2017-11-02 15:48:56 +01:00
Laurent Destailleur
323a0d7d0d Update index.php 2017-11-02 15:48:24 +01:00
gauthier
b7cf434ebd FIX : Filter type on actioncomm with multiselect doesn't work 2017-11-02 14:58:33 +01:00
Laurent Destailleur
555b37411f Merge pull request #7750 from atm-florian/6.0_missinghook
fix : missing hook in accountancy
2017-11-02 13:53:45 +01:00
florian HENRY
bd68b94411 fix : missing hook in accountancy 2017-11-02 13:27:09 +01:00
Laurent Destailleur
141df52dd6 Merge pull request #7741 from frederic34/patch-1
swap llxfooter() and $db->close()
2017-11-02 09:53:06 +01:00
Laurent Destailleur
fb3f1ef667 Code comment 2017-11-02 09:49:41 +01:00
Laurent Destailleur
4755197503 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-02 09:42:47 +01:00
Laurent Destailleur
59df957181 Fix return HTTP code 501 if calling a non existing api 2017-11-02 01:43:27 +01:00
Laurent Destailleur
192dc43b87 Fix regression 2017-11-02 01:16:42 +01:00
Laurent Destailleur
91fbb4da41 Fix changelog 2017-11-01 20:12:15 +01:00
Laurent Destailleur
a6879775bb FIX Search into language is ok for file into external modules two. 2017-11-01 20:05:28 +01:00
Frédéric FRANCE
01a3787664 swap llxfooter() and $db->close() 2017-10-31 13:45:13 +01:00
Laurent Destailleur
3db101ffdd Clean packager 2017-10-31 01:06:07 +01:00
Laurent Destailleur
2b966e630b Doc 2017-10-30 19:49:48 +01:00
Laurent Destailleur
892798bf79 Code comment 2017-10-30 12:40:12 +01:00
Laurent Destailleur
007783cf76 FIX Searching translation should not be case sensitive 2017-10-30 01:45:39 +01:00
Laurent Destailleur
0de1b878bd Prepare 6.0.4 2017-10-29 16:17:52 +01:00
Laurent Destailleur
777d2f7027 Prepare 5.0.8 2017-10-29 16:17:36 +01:00
Laurent Destailleur
78645c718f Fix position of quick search 2017-10-29 16:15:54 +01:00
Laurent Destailleur
0b271cca46 Prepare 5.0.7 2017-10-29 10:38:57 +01:00
241 changed files with 2648 additions and 1542 deletions

View File

@@ -2,9 +2,51 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
FIX: security vulnerability reported by ADLab of Venustech
CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900
FIX: #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO variable
FIX: #7903
FIX: #7933
FIX: #8029 Unable to make leave request in holyday module
FIX: #8093
FIX: Bad name alias showing in name of third column
FIX: Cashdesk should not sell to inactive third parties
FIX: Edit accountancy account and warning message on loan
FIX: $accounts[$bid] is a label !
FIX: $oldvatrateclean & $newvatrateclean must be set if preg_match === false
FIX: product best price on product list
FIX: search on contact list
FIX: stats trad for customerinvoice
FIX: translate unactivate on contractline
FIX: email sent was not in HTML
FIX: missing hook invoice index
FIX: subject mail sepa
***** ChangeLog for 6.0.4 compared to 6.0.3 *****
FIX: #7737
FIX: #7751
FIX: #7756 Add better error message
FIX: #7786
FIX: #7806
FIX: #7824
FIX: add line bad price and ref
FIX: A lot of several fix on local taxes and NPR tax
FIX: createfromorder
FIX: CSS for IE10
FIX: external user cannot be set as internal
FIX: Filter type on actioncomm with multiselect doesn't work
FIX: list of donation not filtered on multicompany
FIX: list of module not complete when module mb_strlen not available
FIX: Locatax were not propagated when cloning order or proposal
FIX: Searching translation should not be case sensitive
FIX: Search into language is ok for file into external modules two.
FIX: test for filter fk_status
FIX: too much users on holiday list
FIX: Wrong alias sql
***** ChangeLog for 6.0.3 compared to 6.0.2 *****
FIX: #7211 Update qty dispatched on qty change
FIX: #7458
FIX: #7593
@@ -18,8 +60,7 @@ FIX: API to get object does not return data of linked objects
FIX: Bad localtax apply
FIX: Bad ressource list in popup in gantt view
FIX: bankentries search conciliated if val 0
FIX: hook formObjectOptions() must use $expe and not $object which i…
FIX: hook formObjectOptions() must use $expe and not $object which is an order here
FIX: hook formObjectOptions() must use $expe and not $object
FIX: make of link to other object during creation
FIX: Missing function getLinesArray
FIX: old batch not shown in multi shipping
@@ -32,7 +73,6 @@ FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 6.0.2 compared to 6.0.1 *****
FIX: #7148
FIX: #7288
FIX: #7366 renaming table with pgsql
@@ -66,7 +106,6 @@ FIX: wrong basePath in the swagger view
FIX: Implementation of a Luracast recommandation for the REST api server
***** ChangeLog for 6.0.1 compared to 6.0.* *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7330
@@ -108,7 +147,6 @@ FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-142
CVE-2017-14242
***** ChangeLog for 6.0.0 compared to 5.0.* *****
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
NEW: Add a payment module for Stripe.
NEW: Add module "Product variant" (like red, blue for the product shoes)
@@ -257,6 +295,23 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint".
***** ChangeLog for 5.0.7 compared to 5.0.6 *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7148
FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7366 renaming table with pgsql
FIX: #7391
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: Bad link to unpayed suppliers invoices
FIX: bankentries search conciliated if val 0
FIX: multicompany better accuracy in rounding and with revenue stamp.
FIX: PDF output was sharing 2 different currencies in same total
FIX: Upgrade missing on field
FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 5.0.6 compared to 5.0.5 *****
FIX: Removed a bad symbolic link into custom directory.
FIX: Renaming a resource ref rename also the directory of attached files.

View File

@@ -353,7 +353,7 @@ begin
begin
// TODO Copy file or ask to install package ?
//CustomMessage('YouWillInstallDoliWamp')+#13#13
MsgBox('The package vcredist_x86.exe must have been installed first. It seems it is not. Please install it first from <a href="http://www.microsoft.com/en-us/download/details.aspx?id=30679">http://www.microsoft.com/en-us/download/details.aspx?id=30679</a> then restart DoliWamp installation/upgrade.',mbInformation,MB_OK);
MsgBox('The Visual C++ Redistributable package should be installed, it seems it is not. Please install the 32-bit version from http://www.microsoft.com/en-us/download/details.aspx?id=30679, then restart the DoliWAMP installation/upgrade.',mbInformation,MB_OK);
end;
// Pb seems similar with msvcp110.dll
//vcredist_x64.exe

View File

@@ -131,7 +131,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
*/
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
$dir='';
$needtoclose=0;

View File

@@ -19,7 +19,7 @@ use Term::ANSIColor;
# Change this to defined target for option 98 and 99
$PROJECT="dolibarr";
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
$PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@@ -556,9 +556,6 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
@@ -571,6 +568,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
@@ -579,6 +577,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
@@ -590,6 +589,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";

View File

@@ -99,7 +99,7 @@ JQUERYFILETREE:
RESTLER:
--------
* Add 2 lines into function
* Add 2 lines into file AutoLoader.php to complete function
private function alias($className, $currentClass)
{
...
@@ -110,4 +110,25 @@ to get
if ($className == 'Luracast\Restler\string') return;
if ($className == 'Luracast\Restler\mixed') return;
...
PARSEDOWN
---------
* Fix to avoid fatal error when mb_strlen not available:
// @CHANGE LDR Fix when mb_strlen is not available
//$shortage = 4 - mb_strlen($line, 'utf-8') % 4;
if (function_exists('mb_strlen')) $len = mb_strlen($line, 'utf-8');
else $len = strlen($line);
$shortage = 4 - $len % 4;
JEDITABLE.JS
------------
* <button type="submit" /> => <button class="button" type="submit" />
* <button type="cancel" /> => <button class="button" type="cancel" />

View File

@@ -631,7 +631,7 @@ if ($action == 'create') {
print "</tr>\n";
}
if ($total_debit != $total_credit)
if (price2num($total_debit) != price2num($total_credit))
{
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_credit, $total_debit)), 'warnings');
}

View File

@@ -85,6 +85,9 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->bind->write)
accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('accountancycustomerlist'));
$formaccounting = new FormAccounting($db);
$accounting = new AccountingAccount($db);
$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT, 1);
@@ -98,26 +101,33 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOU
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
$search_lineid = '';
$search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_lineid = '';
$search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
// Mass actions
$objectclass='AccountingAccount';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
// Mass actions
$objectclass='Skeleton';
$objectlabel='Skeleton';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
if ($massaction == 'ventil') {
$msg='';
@@ -182,6 +192,9 @@ $sql = "SELECT f.facnumber, f.rowid as facid, f.datef, f.type as ftype,";
$sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
$sql .= " aa.rowid as aarowid";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
@@ -223,6 +236,11 @@ if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
}
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records

View File

@@ -85,6 +85,9 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->bind->write)
accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('accountancysupplierlist'));
$formaccounting = new FormAccounting($db);
$accounting = new AccountingAccount($db);
// TODO: we should need to check if result is a really exist accountaccount rowid.....
@@ -99,26 +102,32 @@ $aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUN
if (GETPOST('cancel')) { $action='list'; $massaction=''; }
if (! GETPOST('confirmmassaction') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_lineid = '';
$search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Mass actions
$objectclass='Skeleton';
$objectlabel='Skeleton';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
if (empty($reshook))
{
// Purge search criteria
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_lineid = '';
$search_ref = '';
$search_invoice = '';
$search_label = '';
$search_desc = '';
$search_amount = '';
$search_account = '';
$search_vat = '';
}
// Mass actions
$objectclass='AccountingAccount';
$permtoread = $user->rights->accounting->read;
$permtodelete = $user->rights->accounting->delete;
$uploaddir = $conf->accounting->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
if ($massaction == 'ventil') {
$msg='';
@@ -184,6 +193,9 @@ $sql = "SELECT f.rowid as facid, f.ref, f.ref_supplier, f.libelle as invoice_lab
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht as price, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_buy as code_buy, p.tva_tx as tva_tx_prod,";
$sql.= " aa.rowid as aarowid";
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
@@ -220,6 +232,11 @@ if (strlen(trim($search_vat))) {
}
$sql .= " AND f.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql .= $db->order($sortfield, $sortorder);
// Count total nb of records

View File

@@ -15,6 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
$prefix = $conf->global->ACCOUNTING_EXPORT_PREFIX_SPEC;
$format = $conf->global->ACCOUNTING_EXPORT_FORMAT;
$nodateexport = $conf->global->ACCOUNTING_EXPORT_NO_DATE_IN_FILENAME;

View File

@@ -14,8 +14,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_CREATE.TPL.PHP DEFAULT -->

View File

@@ -14,9 +14,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
$contact = $GLOBALS['objcanvas']->control->object;
?>

View File

@@ -14,10 +14,18 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
$contact = $GLOBALS['objcanvas']->control->object;
?>
<!-- BEGIN PHP TEMPLATE ADHERENTCARD_VIEW.TPL.PHP DEFAULT -->

View File

@@ -36,7 +36,7 @@ $langs->load("users");
if (!$user->rights->adherent->lire)
accessforbidden();
$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
$rowid=GETPOST("rowid",'int');
@@ -44,10 +44,10 @@ $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"];
* View
*/
llxHeader();
$form = new Form($db);
llxHeader();
$object = new Subscription($db);
$result = $object->fetch($rowid);

View File

@@ -15,8 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
@@ -33,7 +40,7 @@ $var=true;
$total=0;
foreach($linkedObjectBlock as $key => $objectlink)
{
?>
<tr <?php echo $GLOBALS['bc'][$var]; ?> >
<td><?php echo $langs->trans("Subscription"); ?></td>

View File

@@ -212,7 +212,7 @@ if ($xml)
// Defined qualified files (must be same than into generate_filelist_xml.php)
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
// Fill file_list with files in signature, new files, modified files

View File

@@ -338,6 +338,9 @@ if ($mode == 'searchkey')
$recordtoshow=array();
// Search modules dirs
$modulesdir = dolGetModulesDirs();
$nbempty=0;
/*var_dump($langcode);
var_dump($transkey);
@@ -351,29 +354,38 @@ if ($mode == 'searchkey')
}
else
{
// Load all translations keys
foreach($conf->file->dol_document_root as $keydir => $searchdir)
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
foreach($modulesdir as $keydir => $tmpsearchdir)
{
// Directory of translation files
$dir_lang = $searchdir."/langs/".$langcode;
$dir_lang_osencoded=dol_osencode($dir_lang);
$searchdir = $tmpsearchdir; // $searchdir can be '.../htdocs/core/modules/' or '.../htdocs/custom/mymodule/core/modules/'
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
// Directory of translation files
$dir_lang = dirname(dirname($searchdir))."/langs/".$langcode; // The 2 dirname is to go up in dir for 2 levels
$dir_lang_osencoded=dol_osencode($dir_lang);
foreach($filearray as $file)
{
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
}
$filearray=dol_dir_list($dir_lang_osencoded,'files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
foreach($filearray as $file)
{
$tmpfile=preg_replace('/.lang/i', '', basename($file['name']));
//Detect if trans coming from extranl module
foreach ($conf->file->dol_document_root as $keyconf=>$dirconfalt) {
if (($keyconf!='main') && (preg_match('$'.preg_quote($dirconfalt).'$i', $file['fullname']))) {
//In this case load modulename@nmodulename
$tmpfile=$tmpfile.'@'.$tmpfile;
break;
}
}
$newlang->load($tmpfile, 0, 0, '', 0); // Load translation files + database overwrite
$newlangfileonly->load($tmpfile, 0, 0, '', 1); // Load translation files only
//print 'After loading lang '.$tmpfile.', newlang has '.count($newlang->tab_translate).' records<br>'."\n";
}
}
// Now search into translation array
foreach($newlang->tab_translate as $key => $val)
{
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/', $key)) continue;
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/', $val)) continue;
if ($transkey && ! preg_match('/'.preg_quote($transkey).'/i', $key)) continue;
if ($transvalue && ! preg_match('/'.preg_quote($transvalue).'/i', $val)) continue;
$recordtoshow[$key]=$val;
}
}

View File

@@ -36,7 +36,7 @@ class Login
*
* Request the API token for a couple username / password.
* Using method POST is recommanded for security reasons (method GET is often logged by default by web servers with parameters so with login and pass into server log file).
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "api_key" into field at the top right of page (Note: "api_key" can be found/set on the user page).
* Both methods are provided for developer conveniance. Best is to not use at all the login API method and enter directly the "DOLAPIKEY" into field at the top right of page. Note: Tha API key (DOLAPIKEY) can be found/set on the user page.
*
* @param string $login User login
* @param string $password User password

View File

@@ -128,7 +128,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
foreach ($modulesdir as $dir)
{
// Search available module
dol_syslog("Scan directory ".$dir." for module descriptor to after search for API files");
dol_syslog("Scan directory ".$dir." for module descriptor files, then search for API files");
$handle=@opendir(dol_osencode($dir));
if (is_resource($handle))
@@ -139,14 +139,14 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
{
$module = strtolower($regmod[1]);
$moduledirforclass = getModuleDirForApiClass($module);
$moduleforperm = $module;
if ($module == 'propale') { $moduleforperm='propal'; }
$modulenameforenabled = $module;
if ($module == 'propale') { $modulenameforenabled='propal'; }
//dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
// Defined if module is enabled
$enabled=true;
if (empty($conf->$moduleforperm->enabled)) $enabled=false;
if (empty($conf->$modulenameforenabled->enabled)) $enabled=false;
if ($enabled)
{
@@ -235,7 +235,13 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
if ($module == 'order') { $classname='Commande'; }
//var_dump($classfile);var_dump($classname);exit;
require_once $dir_part_file;
$res = include_once $dir_part_file;
if (! $res)
{
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
exit(0);
}
if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/');
}
else
@@ -246,7 +252,14 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
$classname=ucwords($module);
require_once $dir_part_file;
$res = include_once $dir_part_file;
if (! $res)
{
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
exit(0);
}
if (class_exists($classname)) $api->r->addAPIClass($classname);
}
}

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2017 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
@@ -103,7 +103,7 @@ print "</tr>\n";
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
print '<td colspan="2">';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0);
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',1,0,1,array(),0);
print '</td></tr>';
if (! empty($conf->banque->enabled))
{

View File

@@ -114,10 +114,13 @@ switch($action)
{
if (count($prodcustprice->lines) > 0)
{
$pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx;
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
else

View File

@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@@ -105,7 +105,7 @@ print '<td>';
$disabled=0;
$langs->load("companies");
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',!$disabled,$disabled,1);
print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',!$disabled,$disabled,1);
//print '<input name="warehouse_id" class="texte_login" type="warehouse_id" value="" />';
print '</td>';
print "</tr>\n";

View File

@@ -19,6 +19,14 @@
*
*/
// Protection to avoid direct call of template
if (empty($langs) || ! is_object($langs))
{
print "Error, template page can't be called as URL";
exit;
}
$langs->load("main");
$langs->load("bills");
$langs->load("cashdesk");

View File

@@ -17,6 +17,14 @@
*
*/
// Protection to avoid direct call of template
if (empty($langs) || ! is_object($langs))
{
print "Error, template page can't be called as URL";
exit;
}
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -19,6 +19,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($langs) || ! is_object($langs))
{
print "Error, template page can't be called as URL";
exit;
}
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
@@ -71,7 +79,7 @@ print '<li class="menu_choix0">'.$langs->trans("User").': '.$_SESSION['firstname
print ' <a href="deconnexion.php">'.img_picto($langs->trans('Logout'), 'logout.png').'</a><br>';
print '<form id="frmThirdparty" class="formulaire1 inline-block" method="post" action="facturation_verif.php?action=change_thirdparty">';
print $langs->trans("CashDeskThirdParty").': ';
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3)', '', 0, 0, null, 0, 'valignmiddle inline-block');
print $form->select_company($_SESSION["CASHDESK_ID_THIRDPARTY"], 'CASHDESK_ID_THIRDPARTY', 's.client IN (1,3) AND s.status = 1', '', 0, 0, null, 0, 'valignmiddle inline-block');
print '<input class="button bouton_change_thirdparty inline-block valignmiddle" type="submit" id="bouton_change_thirdparty" value="'.$langs->trans("Modify").'">';
//print $companyLink;
print '<br>';

View File

@@ -16,6 +16,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($langs) || ! is_object($langs))
{
print "Error, template page can't be called as URL";
exit;
}
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("main");

View File

@@ -16,6 +16,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($langs) || ! is_object($langs))
{
print "Error, template page can't be called as URL";
exit;
}
$langs->load("main");
$langs->load("bills");
$langs->load("banks");

View File

@@ -17,6 +17,14 @@
*
*/
// Protection to avoid direct call of template
if (empty($langs) || ! is_object($langs))
{
print "Error, template page can't be called as URL";
exit;
}
$langs->load("main");
$langs->load("bills");

View File

@@ -1329,6 +1329,8 @@ if ($id > 0)
print '</div>';
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
{
//var_dump($object->userassigned);
//var_dump($listofuserid);
print '<div class="myavailability">';
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
print '</div>';

View File

@@ -225,11 +225,11 @@ class ActionComm extends CommonObject
if ($this->elementtype=='commande') $this->elementtype='order';
if ($this->elementtype=='contrat') $this->elementtype='contract';
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array
{
$tmpid=$this->userassigned;
$this->userassigned=array();
$this->userassigned[$tmpid]=array('id'=>$tmpid);
$this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
}
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
@@ -240,7 +240,7 @@ class ActionComm extends CommonObject
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
$this->userassigned = array($userownerid=>array('id'=>$userownerid));
$this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency));
if (! $this->type_id || ! $this->type_code)
{

View File

@@ -297,7 +297,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
@@ -482,7 +486,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
if (is_array($actioncode))
{
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
}
}

View File

@@ -169,7 +169,11 @@ $listofextcals=array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($actioncode != '') $param.="&actioncode=".$actioncode;
if ($actioncode != '') {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status != '' && $status > -1) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
@@ -227,7 +231,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',',$actioncode))."')";
if (is_array($actioncode))
{
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
}
}

View File

@@ -203,7 +203,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode;
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
@@ -394,7 +398,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')";
if (is_array($actioncode))
{
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
}
}
}

View File

@@ -30,7 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$langs->load("orders");
$langs->load("companies");
$_socid = $_GET["id"];
$id = GETPOST('id','int');
$_socid = GETPOST("id",'int');
// Security check
if ($user->societe_id > 0)
{
@@ -45,10 +46,10 @@ if ($user->societe_id > 0)
if ($_POST["action"] == 'setpricelevel')
{
$soc = New Societe($db);
$soc->fetch($_GET["id"]);
$soc->fetch($id);
$soc->set_price_level($_POST["price_level"],$user);
header("Location: multiprix.php?id=".$_GET["id"]);
header("Location: multiprix.php?id=".$id);
exit;
}
@@ -87,7 +88,7 @@ if ($_socid > 0)
print '<form method="POST" action="multiprix.php?id='.$objsoc->id.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="setpricelevel">';
dol_fiche_head($head, $tabchoice, $langs->trans("ThirdParty"), 0, 'company');
print '<table width="100%" border="0">';
@@ -122,12 +123,12 @@ if ($_socid > 0)
print "</table>";
dol_fiche_end();
print '<div align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print "</form>";
print '<br><br>';

View File

@@ -805,6 +805,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}
@@ -864,13 +867,33 @@ if (empty($reshook))
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt = '(';
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id','alpha'))
$newlang = GETPOST('lang_id','alpha');
if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
}
if (! empty($prod->customcode))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
} else {
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
}
$tmptxt .= ')';
$desc = dol_concatdesc($desc, $tmptxt);
}

View File

@@ -371,12 +371,12 @@ class Propal extends CommonObject
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
* and desc must already have the right value (it's up to the caller to manage multilanguage)
*
* @param string $desc Description de la ligne
* @param float $pu_ht Prix unitaire
* @param float $qty Quantite
* @param float $txtva Taux de tva
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param string $desc Description of line
* @param float $pu_ht Unit price
* @param float $qty Quantity
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id du produit/service predefini
* @param float $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC
@@ -836,8 +836,9 @@ class Propal extends CommonObject
if (empty($this->availability_id)) $this->availability_id=0;
if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
// Multicurrency
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
{
$this->multicurrency_code = $conf->currency;
@@ -1017,11 +1018,15 @@ class Propal extends CommonObject
$fk_parent_line = 0;
}
// Complete vat rate with code
$vatrate = $this->lines[$i]->tva_tx;
if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')';
$result = $this->addline(
$this->lines[$i]->desc,
$this->lines[$i]->subprice,
$this->lines[$i]->qty,
$this->lines[$i]->tva_tx,
$vatrate,
$this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product,
@@ -1226,7 +1231,6 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Create clone
$result=$clonedObj->create($user);
if ($result < 0) $error++;
else

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('compta');
$langs->load('other');

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +28,9 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('propal');
$langs->load('compta');

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,6 +29,9 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('propal');
$langs->load('compta');

View File

@@ -22,6 +22,14 @@
* \ingroup propal
* \brief Template to show objects linked to proposals
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
@@ -40,7 +48,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
@@ -71,7 +79,7 @@ if (count($linkedObjectBlock) > 1)
<td align="right"></td>
<td align="right"></td>
</tr>
<?php
<?php
}
?>

View File

@@ -766,10 +766,13 @@ if (empty($reshook))
{
if (count($prodcustprice->lines) > 0)
{
$pu_ht = price($prodcustprice->lines [0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx;
$pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
else
@@ -821,12 +824,33 @@ if (empty($reshook))
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
$tmptxt = '(';
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id','alpha'))
$newlang = GETPOST('lang_id','alpha');
if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
}
if (! empty($prod->customcode))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
} else {
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
}
$tmptxt .= ')';
$desc = dol_concatdesc($desc, $tmptxt);
}

View File

@@ -709,7 +709,7 @@ class Commande extends CommonOrder
// $date_commande is deprecated
$date = ($this->date_commande ? $this->date_commande : $this->date);
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
@@ -821,11 +821,15 @@ class Commande extends CommonOrder
$fk_parent_line = 0;
}
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline(
$line->desc,
$line->subprice,
$line->qty,
$line->tva_tx,
$vatrate,
$line->localtax1_tx,
$line->localtax2_tx,
$line->fk_product,
@@ -1211,9 +1215,9 @@ class Commande extends CommonOrder
* @param string $desc Description of line
* @param float $pu_ht Unit price (without tax)
* @param float $qty Quantite
* @param float $txtva Taux de tva force, sinon -1
* @param float $txlocaltax1 Local tax 1 rate
* @param float $txlocaltax2 Local tax 2 rate
* @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of product
* @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('companies');

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +27,9 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
if (!$user->rights->commande->lire) accessforbidden();

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +28,9 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("companies");

View File

@@ -15,8 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
@@ -36,7 +43,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
@@ -76,7 +83,7 @@ if (count($linkedObjectBlock) > 1)
<td align="right"></td>
<td align="right"></td>
</tr>
<?php
<?php
}
?>

View File

@@ -99,7 +99,7 @@ if ($action == 'add')
$object->owner_address = trim($_POST["owner_address"]);
$account_number = GETPOST('account_number','alpha');
if ($account_number <= 0) { $object->account_number = ''; } else { $object->account_number = $account_number; }
if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; } else { $object->account_number = $account_number; }
$fk_accountancy_journal = GETPOST('fk_accountancy_journal','int');
if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
@@ -656,7 +656,7 @@ else
print '<td>';
if (! empty($conf->accounting->enabled)) {
$accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('',$object->account_number);
$accountingaccount->fetch('',$object->account_number, 1);
print $accountingaccount->getNomUrl(0,1,1,'',1);
} else {

View File

@@ -83,6 +83,11 @@ if ($action == 'add_confirm')
$accountto=new Account($db);
$accountto->fetch(GETPOST('account_to','int'));
if ($accountto->currency_code != $accountfrom->currency_code) {
$error++;
setEventMessages($langs->trans("ErrorTransferBetweenDifferentCurrencyNotPossible"), null, 'errors');
}
if ($accountto->id != $accountfrom->id)
{
$db->begin();

View File

@@ -1075,6 +1075,7 @@ if (empty($reshook))
$TTotalByTva = array();
foreach ($srcobject->lines as &$line)
{
if(! empty($line->special_code)) continue;
$TTotalByTva[$line->tva_tx] += $line->total_ttc ;
}
@@ -1588,6 +1589,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}
@@ -1640,12 +1644,32 @@ if (empty($reshook))
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
$tmptxt = '(';
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
$newlang = '';
if (empty($newlang) && GETPOST('lang_id','alpha'))
$newlang = GETPOST('lang_id','alpha');
if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
}
if (! empty($prod->customcode))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
} else {
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
}
$tmptxt .= ')';
$desc = dol_concatdesc($desc, $tmptxt);
}
@@ -2510,10 +2534,10 @@ if ($action == 'create')
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
print $desc;
print '<div id="credit_note_options" class="clearboth">';
print '&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
print '<br>&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
print '</div>';
print '<div id="credit_note_options" class="clearboth">';
print '&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
print '<br>&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
print '</div>';
print '</div></div>';
}

View File

@@ -244,7 +244,7 @@ class Facture extends CommonInvoice
$this->brouillon = 1;
if (empty($this->entity)) $this->entity = $conf->entity;
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate)
// Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency))
@@ -575,11 +575,15 @@ class Facture extends CommonInvoice
$fk_parent_line = 0;
}
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline(
$line->desc,
$line->subprice,
$line->qty,
$line->tva_tx,
$vatrate,
$line->localtax1_tx,
$line->localtax2_tx,
$line->fk_product,
@@ -935,7 +939,8 @@ class Facture extends CommonInvoice
{
$this->db->commit();
return $this->id;
}
}
else
{
$this->db->rollback();
@@ -985,6 +990,8 @@ class Facture extends CommonInvoice
$line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->fk_unit = $object->lines[$i]->fk_unit;
$line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
@@ -2190,6 +2197,7 @@ class Facture extends CommonInvoice
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($result < 0) {
$error++;
$this->error = $mouvP->error;
}
}
}
@@ -2427,8 +2435,8 @@ class Facture extends CommonInvoice
* @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param double $txlocaltax1 Local tax 1 rate (deprecated)
* @param double $txlocaltax2 Local tax 2 rate (deprecated)
* @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line
* @param int $date_start Date start of service

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("bills");
$langs->load("companies");

View File

@@ -4,6 +4,8 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 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
@@ -32,6 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('propal');
$langs->load('compta');
@@ -189,6 +194,6 @@ else
print $langs->trans("ErrorUnknown");
}
$db->close();
llxFooter();
$db->close();

View File

@@ -530,6 +530,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +28,9 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("companies");
$langs->load("bills");

View File

@@ -552,14 +552,14 @@ if ($resql)
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($show_files) $param.='&show_files=' .$show_files;
if ($option) $param.="&option=".$option;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
@@ -785,7 +785,8 @@ if ($resql)
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
Facture::TYPE_SITUATION=>$langs->trans("InvoiceSituation"),
);
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');

View File

@@ -3,6 +3,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,6 +29,9 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("companies");
$langs->load("bills");

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,6 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
if (!$user->rights->facture->lire) accessforbidden();

View File

@@ -15,8 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
@@ -36,7 +43,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>
@@ -54,7 +61,7 @@ foreach($linkedObjectBlock as $key => $objectlink)
$total = $total + $sign * $objectlink->total_ht;
echo price($objectlink->total_ht);
}
else
else
{
echo '<strike>'.price($objectlink->total_ht).'</strike>';
}
@@ -76,7 +83,7 @@ if (count($linkedObjectBlock) > 1)
<td align="right"></td>
<td align="right"></td>
</tr>
<?php
<?php
}
?>

View File

@@ -15,8 +15,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
@@ -36,7 +43,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>

View File

@@ -63,6 +63,7 @@ if ($user->societe_id > 0)
$max=3;
$hookmanager->initHooks(array('invoiceindex'));
/*
* Actions
@@ -152,7 +153,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
$sql .= " AND f.fk_soc = $socid";
}
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerDraft',$parameters);
$sql.=$hookmanager->resPrint;
$resql = $db->query($sql);
if ( $resql )
@@ -228,9 +233,12 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$sql.= " AND f.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierDraft',$parameters);
$sql.=$hookmanager->resPrint;
$resql = $db->query($sql);
if ( $resql )
{
$num = $db->num_rows($resql);
@@ -310,6 +318,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$sql.= " AND f.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerLastModified',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
$sql.= " ORDER BY f.tms DESC ";
$sql.= $db->plimit($max, 0);
@@ -419,6 +432,11 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$sql.= " AND ff.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierLastModified',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, s.nom, s.rowid, s.code_fournisseur";
$sql.= " ORDER BY ff.tms DESC ";
$sql.= $db->plimit($max, 0);
@@ -498,6 +516,11 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
$sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
$sql.= " WHERE d.entity = ".$conf->entity;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereLastDonations',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= $db->order("d.tms","DESC");
$sql.= $db->plimit($max, 0);
@@ -569,6 +592,11 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$sql.= " WHERE c.fk_type = cc.id";
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " AND c.paye = 0";
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereSocialContributions',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY c.rowid, c.amount, c.date_ech, c.paye, cc.libelle";
$resql = $db->query($sql);
@@ -652,6 +680,11 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
if ($socid) $sql.= " AND c.fk_soc = ".$socid;
$sql.= " AND c.fk_statut = 3";
$sql.= " AND c.facture = 0";
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY s.nom, s.rowid, s.code_client, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
$resql = $db->query($sql);
@@ -756,6 +789,11 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
$sql.= " AND f.entity = ".$conf->entity;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerUnpaid',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement, s.nom, s.rowid, s.code_client";
$sql.= " ORDER BY f.datef ASC, f.facnumber ASC";
@@ -879,6 +917,11 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
$sql.= " AND ff.fk_statut = 1";
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql.= " AND ff.fk_soc = ".$socid;
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListWhereSupplierUnpaid',$parameters);
$sql.=$hookmanager->resPrint;
$sql.= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.paye,";
$sql.= " s.nom, s.rowid, s.code_client, s.code_fournisseur, ff.date_lim_reglement";
$sql.= " ORDER BY ff.date_lim_reglement ASC";

View File

@@ -102,7 +102,7 @@ if (empty($reshook))
$tmpinvoice=new Facture($db);
foreach ($_POST as $key => $value)
{
if (substr($key,0,7) == 'amount_')
if (substr($key,0,7) == 'amount_' && GETPOST($key) != '')
{
$cursorfacid = substr($key,7);
$amounts[$cursorfacid] = price2num(trim(GETPOST($key)));

View File

@@ -46,14 +46,14 @@ $confirm=GETPOST('confirm', 'alpha');
// Security check
$fieldname = (! empty($ref)?'ref':'rowid');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldname);
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','fk_user_author',$fieldname);
$sortfield=GETPOST('sortfield', 'alpha');
$sortorder=GETPOST('sortorder', 'alpha');
$page=GETPOST('page', 'int');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="b.dateo,b.rowid";
if ($page < 0) { $page = 0 ; }
if (empty($page) || $page == -1) { $page = 0; }
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$offset = $limit * $page ;
@@ -490,53 +490,55 @@ if ($action == 'new')
if (count($lines[$bid]))
{
foreach ($lines[$bid] as $lid => $value)
{
$account_id = $bid;
if (! isset($accounts[$bid]))
$accounts[$bid]=0;
$accounts[$bid] += 1;
foreach ($lines[$bid] as $lid => $value)
{
//$account_id = $bid; FIXME not used
print '<tr class="oddeven">';
print '<td>'.dol_print_date($value["date"],'day').'</td>';
print '<td>'.$value["numero"]."</td>\n";
print '<td>'.$value["emetteur"]."</td>\n";
print '<td>'.$value["banque"]."</td>\n";
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
// FIXME $accounts[$bid] is a label !
/*if (! isset($accounts[$bid]))
$accounts[$bid]=0;
$accounts[$bid] += 1;*/
// Link to payment
print '<td align="center">';
$paymentstatic->id=$value["paymentid"];
$paymentstatic->ref=$value["paymentid"];
if ($paymentstatic->id)
{
print $paymentstatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
// Link to bank transaction
print '<td align="center">';
$accountlinestatic->rowid=$value["id"];
if ($accountlinestatic->rowid)
{
print $accountlinestatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
print '<tr class="oddeven">';
print '<td>'.dol_print_date($value["date"],'day').'</td>';
print '<td>'.$value["numero"]."</td>\n";
print '<td>'.$value["emetteur"]."</td>\n";
print '<td>'.$value["banque"]."</td>\n";
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
print '<td align="center">';
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
print '</td>' ;
print '</tr>';
// Link to payment
print '<td align="center">';
$paymentstatic->id=$value["paymentid"];
$paymentstatic->ref=$value["paymentid"];
if ($paymentstatic->id)
{
print $paymentstatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
// Link to bank transaction
print '<td align="center">';
$accountlinestatic->rowid=$value["id"];
if ($accountlinestatic->rowid)
{
print $accountlinestatic->getNomUrl(1);
}
else
{
print '&nbsp;';
}
print '</td>';
$i++;
}
print '<td align="center">';
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
print '</td>' ;
print '</tr>';
$i++;
}
}
print "</table>";
print '</div>';
@@ -688,10 +690,12 @@ else
{
while ($objp = $db->fetch_object($resql))
{
$account_id = $objp->bid;
if (! isset($accounts[$objp->bid]))
//$account_id = $objp->bid; FIXME not used
// FIXME $accounts[$objp->bid] is a label
/*if (! isset($accounts[$objp->bid]))
$accounts[$objp->bid]=0;
$accounts[$objp->bid] += 1;
$accounts[$objp->bid] += 1;*/
print '<tr class="oddeven">';
print '<td align="center">'.$i.'</td>';

View File

@@ -1114,5 +1114,31 @@ class Paiement extends CommonObject
}*/
return '';
}
/**
* Load the third party of object, from id into this->thirdparty
*
* @param int $force_thirdparty_id Force thirdparty id
* @return int <0 if KO, >0 if OK
*/
function fetch_thirdparty($force_thirdparty_id=0)
{
require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
if (empty($force_thirdparty_id))
{
$billsarray = $this->getBillsArray(); // From payment, the fk_soc isn't available, we should load the first invoice to get him
if (!empty($billsarray))
{
$supplier_invoice = new FactureFournisseur($this->db);
if ($supplier_invoice->fetch($billsarray[0]) > 0)
{
$force_thirdparty_id = $supplier_invoice->fk_soc;
}
}
}
return parent::fetch_thirdparty($force_thirdparty_id);
}
}

View File

@@ -236,10 +236,10 @@ class RejetPrelevement
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$subject = $langs->trans("InfoRejectSubject");
$subject = $langs->transnoentities("InfoRejectSubject");
$sendto = $emuser->getFullName($langs)." <".$emuser->email.">";
$from = $this->user->getFullName($langs)." <".$this->user->email.">";
$msgishtml=0;
$msgishtml=1;
$arr_file = array();
$arr_mime = array();

View File

@@ -13,8 +13,15 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE CONTACTCARD_CREATE.TPL.PHP DEFAULT -->

View File

@@ -13,9 +13,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
$contact = $GLOBALS['objcanvas']->control->object;
?>

View File

@@ -13,9 +13,16 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
$contact = $GLOBALS['objcanvas']->control->object;
?>

View File

@@ -58,9 +58,7 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'ro
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if ($page == -1) {
$page = 0;
}
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $conf->liste_limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -108,7 +106,7 @@ if ($object->id)
}
$linkback = '<a href="'.DOL_URL_ROOT.'/contact/list.php">'.$langs->trans("BackToList").'</a>';
$morehtmlref='<div class="refidno">';
if (empty($conf->global->SOCIETE_DISABLE_CONTACTS))
{
@@ -120,11 +118,11 @@ if ($object->id)
else $morehtmlref.=$langs->trans("ContactNotLinkedToCompany");
}
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">';
@@ -147,7 +145,7 @@ if ($object->id)
print '</td></tr>';
}
}*/
// Civility
print '<tr><td class="titlefield">'.$langs->trans("UserTitle").'</td><td colspan="3">';
print $object->getCivilityLabel();
@@ -160,7 +158,7 @@ if ($object->id)
print '</div>';
dol_fiche_end();
$modulepart = 'contact';
$permission = $user->rights->societe->contact->creer;
$permtoedit = $user->rights->societe->contact->creer;

View File

@@ -68,6 +68,9 @@ $search_categ_thirdparty=GETPOST("search_categ_thirdparty",'int');
$search_categ_supplier=GETPOST("search_categ_supplier",'int');
$search_status=GETPOST("search_status",'int');
$search_type=GETPOST('search_type','alpha');
$search_zip=GETPOST('search_zip','alpha');
$search_town=GETPOST('search_town','alpha');
if ($search_status=='') $search_status=1; // always display activ customer first
$optioncss = GETPOST('optioncss','alpha');
@@ -289,7 +292,7 @@ if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_pos
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
if (strlen($search_fax)) $sql.= natural_search('p.phone_fax', $search_fax);
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
@@ -396,6 +399,7 @@ if ($search_email != '') $param.='&amp;search_email='.urlencode($search_email);
if ($search_status != '') $param.='&amp;search_status='.urlencode($search_status);
if ($search_priv == '0' || $search_priv == '1') $param.="&search_priv=".urlencode($search_priv);
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
foreach ($search_array_options as $key => $val)
{
@@ -491,12 +495,6 @@ if (! empty($arrayfields['p.firstname']['checked']))
print '<input class="flat" type="text" name="search_firstname" size="6" value="'.dol_escape_htmltag($search_firstname).'">';
print '</td>';
}
if (! empty($arrayfields['p.poste']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).'">';
print '</td>';
}
if (! empty($arrayfields['p.zip']['checked']))
{
print '<td class="liste_titre">';
@@ -509,6 +507,12 @@ if (! empty($arrayfields['p.town']['checked']))
print '<input class="flat" type="text" name="search_town" size="5" value="'.dol_escape_htmltag($search_town).'">';
print '</td>';
}
if (! empty($arrayfields['p.poste']['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_poste" size="5" value="'.dol_escape_htmltag($search_poste).'">';
print '</td>';
}
if (! empty($arrayfields['p.phone']['checked']))
{
print '<td class="liste_titre">';

View File

@@ -509,6 +509,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines [0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
}
}
}
@@ -1837,7 +1840,7 @@ else
{
$tmpaction='unactivateline';
$tmpactionpicto='playstop';
$tmpactiontext=$langs->trans("Unactivate");
$tmpactiontext=$langs->trans("Disable");
}
if (($tmpaction=='activateline' && $user->rights->contrat->activer) || ($tmpaction=='unactivateline' && $user->rights->contrat->desactiver))
{
@@ -1979,7 +1982,7 @@ else
print '<tr '.$bc[false].'>';
print '<td class="nohover">'.$langs->trans("Comment").'</td><td class="nohover"><input size="70" type="text" class="flat" name="comment" value="'.dol_escape_htmltag(GETPOST('comment', 'alpha')).'"></td>';
print '<td class="nohover right">';
print '<input type="submit" class="button" name="close" value="'.$langs->trans("Unactivate").'"> &nbsp; ';
print '<input type="submit" class="button" name="close" value="'.$langs->trans("Disable").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td>';
print '</tr>';

View File

@@ -322,7 +322,11 @@ class Contrat extends CommonObject
$result=$this->thirdparty->set_as_client();
// Define new ref
if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
if ($force_number)
{
$num = $force_number;
}
else if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) // empty should not happened, but when it occurs, the test save life
{
$num = $this->getNextNumRef($this->thirdparty);
}

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2005 Patrick Rouillon <patrick@rouillon.net>
* Copyright (C) 2005-2009 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,6 +29,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("contracts");

View File

@@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -32,6 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("other");
$langs->load("products");

View File

@@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,6 +26,9 @@ require ("../main.inc.php");
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("contracts");

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +27,9 @@
require ("../main.inc.php");
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load("companies");
$langs->load("contracts");

View File

@@ -14,6 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($conf) || ! is_object($conf))
{
print "Error, template page can't be called as URL";
exit;
}
?>
<!-- BEGIN PHP TEMPLATE -->
@@ -33,7 +41,7 @@ $var=true;
foreach($linkedObjectBlock as $key => $objectlink)
{
$ilink++;
$trclass=($var?'pair':'impair');
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) $trclass.=' liste_sub_total';
?>

View File

@@ -33,7 +33,7 @@
// Build doc
if ($action == 'builddoc' && $permissioncreate)
{
if (is_numeric(GETPOST('model')))
{
$error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Model"));
@@ -48,13 +48,13 @@ if ($action == 'builddoc' && $permissioncreate)
dol_print_error('Object must have been loaded by a fetch');
exit;
}*/
// Save last template used to generate document
if (GETPOST('model'))
{
$object->setDocModel($user, GETPOST('model','alpha'));
}
// Special case to force bank account
//if (property_exists($object, 'fk_bank'))
//{
@@ -76,13 +76,13 @@ if ($action == 'builddoc' && $permissioncreate)
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}
// To be sure vars is defined
if (empty($hidedetails)) $hidedetails=0;
if (empty($hidedesc)) $hidedesc=0;
if (empty($hideref)) $hideref=0;
if (empty($moreparams)) $moreparams=null;
$result= $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
if ($result <= 0)
{
@@ -91,11 +91,15 @@ if ($action == 'builddoc' && $permissioncreate)
}
else
{
if (empty($donotredirect)) // This is se when include is done by bulk action "Bill Orders"
if (empty($donotredirect)) // This is set when include is done by bulk action "Bill Orders"
{
setEventMessages($langs->trans("FileGenerated"), null);
header('Location: '.$_SERVER['REQUEST_URI'].'#builddoc');
$urltoredirect = $_SERVER['REQUEST_URI'];
$urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
$urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop
header('Location: '.$urltoredirect.'#builddoc');
exit;
}
}

View File

@@ -56,7 +56,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
{
if ($object->id)
{
$urlfile = GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$urlfile = GETPOST('urlfile', 'alpha', 0, null, null, 1); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
if (GETPOST('section', 'alpha')) $file = $upload_dir . "/" . $urlfile; // For a delete of GED module urlfile contains full path from upload_dir
else // For documents pages, upload_dir contains already path to file from module dir, so we clean path into urlfile.
{

View File

@@ -413,6 +413,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
$object->trackid = $trackid;
$object->fk_element = $object->id;
$object->elementtype = $object->element;
$object->attachedfiles = $attachedfiles;
// Call of triggers
if (! empty($trigger_name))

View File

@@ -94,10 +94,30 @@ if (! empty($field) && ! empty($element) && ! empty($table_element) && ! empty($
}
else $newelement = $element;
$_POST['action']='update'; // Hack so restrictarea will test permissions on write too
$feature = $newelement;
$feature2 = $subelement;
$object_id = $fk_element;
if ($feature == 'expedition' || $feature == 'shipping')
{
$feature = 'commande';
$object_id = 0;
}
if ($feature == 'shipping') $feature = 'commande';
if ($feature == 'payment') { $feature = 'facture'; }
if ($feature == 'payment_supplier') { $feature = 'fournisseur'; $feature2 = 'facture'; }
//var_dump(GETPOST('action','aZ09'));
//var_dump($newelement.'-'.$subelement."-".$feature."-".$object_id);
$check_access = restrictedArea($user, $feature, $object_id, '', $feature2);
//var_dump($user->rights);
/*
if (! empty($user->rights->$newelement->creer) || ! empty($user->rights->$newelement->create) || ! empty($user->rights->$newelement->write)
|| (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write)))
|| ($element == 'payment' && $user->rights->facture->paiement)
|| ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer))
|| (isset($subelement) && (! empty($user->rights->$newelement->$subelement->creer) || ! empty($user->rights->$newelement->$subelement->write)))
|| ($element == 'payment' && $user->rights->facture->paiement)
|| ($element == 'payment_supplier' && $user->rights->fournisseur->facture->creer))
*/
if ($check_access)
{
// Clean parameters
$newvalue = trim($value);

View File

@@ -49,92 +49,92 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
//global $hookmanager;
$hookmanager->initHooks(array('searchform'));
$search_boxvalue=GETPOST('q', 'none');
$search_boxvalue=GETPOST('q');
$arrayresult=array();
// Define $searchform
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire)
{
$arrayresult['searchintothirdparty']=array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintothirdparty']=array('img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('','object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire)
{
$arrayresult['searchintocontact']=array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
{
$arrayresult['searchintomember']=array('position'=>20, 'shortcut'=>'M', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintocontact']=array('img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('','object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php?sall='.urlencode($search_boxvalue));
}
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED))
{
$arrayresult['searchintoproduct']=array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintoproduct']=array('img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue),'text'=>img_picto('','object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire)
{
$arrayresult['searchintoprojects']=array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
$arrayresult['searchintoprojects']=array('img'=>'object_projectpub', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('','object_projectpub').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php?search_all='.urlencode($search_boxvalue));
}
if (! empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire)
{
$arrayresult['searchintotasks']=array('position'=>45, 'img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue));
$arrayresult['searchintotasks']=array('img'=>'object_task', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('','object_task').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php?search_all='.urlencode($search_boxvalue));
}
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
{
$arrayresult['searchintomember']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
{
$arrayresult['searchintouser']=array('img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire)
{
$arrayresult['searchintopropal']=array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintopropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire)
{
$arrayresult['searchintoorder']=array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire)
{
$arrayresult['searchintoshipment']=array('position'=>80, 'img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintoorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire)
{
$arrayresult['searchintoinvoice']=array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintoinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire)
{
$arrayresult['searchintoshipment']=array('img'=>'object_sending', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('','object_sending').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire)
{
$arrayresult['searchintosupplierpropal']=array('position'=>100, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintosupplierpropal']=array('img'=>'object_propal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('','object_propal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED) && $user->rights->fournisseur->commande->lire)
{
$arrayresult['searchintosupplierorder']=array('position'=>110, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
$arrayresult['searchintosupplierorder']=array('img'=>'object_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('','object_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php?search_all='.urlencode($search_boxvalue));
}
if (! empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED) && $user->rights->fournisseur->facture->lire)
{
$arrayresult['searchintosupplierinvoice']=array('position'=>120, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintosupplierinvoice']=array('img'=>'object_bill', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('','object_bill').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire)
{
$arrayresult['searchintocontract']=array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintocontract']=array('img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('','object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire)
{
$arrayresult['searchintointervention']=array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue));
$arrayresult['searchintointervention']=array('img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('','object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php?sall='.urlencode($search_boxvalue));
}
// HR
if (! empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire)
{
$arrayresult['searchintouser']=array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('','object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/index.php?sall='.urlencode($search_boxvalue));
}
if (! empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire)
{
$arrayresult['searchintoexpensereport']=array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
$arrayresult['searchintoexpensereport']=array('img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('','object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
}
if (! empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read)
{
$arrayresult['searchintoleaves']=array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
$arrayresult['searchintoleaves']=array('img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('','object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm&sall='.urlencode($search_boxvalue));
}
@@ -147,7 +147,7 @@ if (! empty($conf->hrm->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_EMPLO
*/
// Execute hook addSearchEntry
$parameters=array('search_boxvalue'=>$search_boxvalue, 'arrayresult'=>$arrayresult);
$parameters=array('search_boxvalue'=>$search_boxvalue);
$reshook=$hookmanager->executeHooks('addSearchEntry',$parameters);
if (empty($reshook))
{
@@ -155,8 +155,6 @@ if (empty($reshook))
}
else $arrayresult=$hookmanager->resArray;
// Sort on position
$arrayresult = dol_sort_array($arrayresult, 'position');
// Print output if called by ajax or do nothing (var $arrayresult will be used) if called by an include
if (! isset($usedbyinclude) || empty($usedbyinclude))

View File

@@ -3748,6 +3748,7 @@ abstract class CommonObject
// VAT Rate
$this->tpl['vat_rate'] = vatrate($line->tva_tx, true);
$this->tpl['vat_rate'] .= (($line->info_bits & 1) == 1) ? '*' : '';
if (! empty($line->vat_src_code) && ! preg_match('/\(/', $this->tpl['vat_rate'])) $this->tpl['vat_rate'].=' ('.$line->vat_src_code.')';
$this->tpl['price'] = price($line->subprice);

View File

@@ -83,8 +83,8 @@ class Conf
$this->file = new stdClass();
$this->db = new stdClass();
$this->global = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->user = new stdClass();
$this->syslog = new stdClass();
$this->browser = new stdClass();

View File

@@ -1651,9 +1651,16 @@ class ExtraFields
$error_field_required[] = $value;
}
if (in_array($key_type,array('date','datetime')))
if (in_array($key_type,array('date')))
{
// Clean parameters
// TODO GMT date in memory must be GMT so we should add gm=true in parameters
$value_key=dol_mktime(0, 0, 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
}
elseif (in_array($key_type,array('datetime')))
{
// Clean parameters
// TODO GMT date in memory must be GMT so we should add gm=true in parameters
$value_key=dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]);
}
else if (in_array($key_type,array('checkbox','chkbxlst')))
@@ -1692,12 +1699,12 @@ class ExtraFields
}
/**
* return array_options array for object by extrafields value (using for data send by forms)
* return array_options array of data of extrafields value of object sent by a search form
*
* @param array $extralabels $array of extrafields
* @param string $keyprefix Prefix string to add into name and id of field (can be used to avoid duplicate names)
* @param string $keysuffix Suffix string to add into name and id of field (can be used to avoid duplicate names)
* @return int 1 if array_options set / 0 if no value
* @return array|int array_options set or 0 if no value
*/
function getOptionalsFromPost($extralabels,$keyprefix='',$keysuffix='')
{

View File

@@ -166,7 +166,7 @@ class Form
$ret.='<input type="hidden" name="action" value="set'.$htmlname.'">';
$ret.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$ret.='<input type="hidden" name="id" value="'.$object->id.'">';
if (empty($notabletag)) $ret.='<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
if (empty($notabletag)) $ret.='<table class="nobordernopadding centpercent" cellpadding="0" cellspacing="0">';
if (empty($notabletag)) $ret.='<tr><td>';
if (preg_match('/^(string|email)/',$typeofdata))
{
@@ -189,7 +189,7 @@ class Form
$morealt=' style="width: '.$cols.'"';
$cols='';
}
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'').$morealt.'">'.($editvalue?$editvalue:$value).'</textarea>';
$ret.='<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1]?$tmp[1]:'20').'"'.($cols?' cols="'.$cols.'"':'class="quatrevingtpercent"').$morealt.'">'.($editvalue?$editvalue:$value).'</textarea>';
}
else if ($typeofdata == 'day' || $typeofdata == 'datepicker')
{
@@ -4170,12 +4170,12 @@ class Form
{
print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency));
}
elseif ($filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))")
elseif ($filter=="fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))")
{
// Replace trans key with CompanyHasDownPaymentOrCommercialDiscount
print $langs->trans("CompanyHasAbsoluteDiscount",price($amount,0,$langs,0,0,-1,$conf->currency));
}
else
else
{
print $langs->trans("CompanyHasCreditNote",price($amount,0,$langs,0,0,-1,$conf->currency));
}

View File

@@ -6,7 +6,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -938,9 +938,9 @@ class FormFile
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
}
// For backward compatiblity, we detect file is stored into an old path
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $file['level1name'] == 'photos')
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos')
{
$relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/';
$relativepath=preg_replace('/^.*\/produit\//','',$filearray[0]['path']).'/';
}
// Defined relative dir to DOL_DATA_ROOT
$relativedir = '';

View File

@@ -89,6 +89,7 @@ abstract class DoliDB implements Database
*/
function idate($param)
{
// TODO GMT $param should be gmt, so we should add tzouptut to 'gmt'
return dol_print_date($param,"%Y%m%d%H%M%S");
}
@@ -238,16 +239,16 @@ abstract class DoliDB implements Database
else $return.=', ';
$return.=preg_replace('/[^0-9a-z_\.]/i','',$val);
$tmpsortorder = trim($orders[$i]);
// Only ASC and DESC values are valid SQL
if (strtoupper($tmpsortorder) === 'ASC') {
$return .= ' ASC';
} elseif (strtoupper($tmpsortorder) === 'DESC') {
$return .= ' DESC';
}
$i++;
}
return $return;
@@ -279,6 +280,7 @@ abstract class DoliDB implements Database
*/
function jdate($string, $gm=false)
{
// TODO GMT must set param gm to true by default
if ($string==0 || $string=="0000-00-00 00:00:00") return '';
$string=preg_replace('/([^0-9])/i','',$string);
$tmp=$string.'000000';

View File

@@ -1,5 +1,5 @@
// Copyright (C) 2011-2014 Regis Houssin <regis.houssin@capnetworks.com>
// Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
// Copyright (C) 2011-2017 Laurent Destailleur <eldy@users.sourceforge.net>
//
// 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
@@ -26,6 +26,50 @@ $(document).ready(function() {
var table_element = $('#jeditable_table_element').html();
var fk_element = $('#jeditable_fk_element').html();
if ($('.editval_string').length > 0) {
$('.editval_string').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : withInPlace, /* Size of string area in px ? */
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'string');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_string').hover(
function () {
console.log("We are hover (entry) an editkey_string");
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
console.log("We are no more hover an editkey_string");
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.editkey_string').click(function() {
console.log("We click on the edit field");
$('#viewval_' + $(this).attr('id')).click();
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
$('.viewval_string.active').click(function() {
console.log("We click on the viewed value");
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
}
if ($('.editval_textarea').length > 0) {
$('.editval_textarea').editable(urlSaveInPlace, {
type : 'textarea',
@@ -127,49 +171,6 @@ $(document).ready(function() {
});
}
if ($('.editval_string').length > 0) {
$('.editval_string').editable(urlSaveInPlace, {
type : 'text',
id : 'field',
width : withInPlace, /* Size of string area in px ? */
tooltip : tooltipInPlace,
placeholder : placeholderInPlace,
cancel : cancelInPlace,
submit : submitInPlace,
indicator : indicatorInPlace,
submitdata : function(result, settings) {
return getParameters(this, 'string');
},
callback : function(result, settings) {
getResult(this, result);
},
onreset : function(result, settings) {
getDefault(settings);
}
});
$('.editkey_string').hover(
function () {
console.log("We are hover (entry) an editkey_string");
$('#viewval_' + $(this).attr('id')).addClass("viewval_hover");
},
function () {
console.log("We are no more hover an editkey_string");
$('#viewval_' + $(this).attr('id')).removeClass("viewval_hover");
}
);
$('.editkey_string').click(function() {
$( '#viewval_' + $(this).attr('id') ).click();
});
$('.viewval_string.active').click(function() {
$('#viewval_' + $(this).attr('id').substr(8)).hide();
$('#editval_' + $(this).attr('id').substr(8)).show().click();
});
$('.editkey_string').click(function() {
$('#viewval_' + $(this).attr('id')).hide();
$('#editval_' + $(this).attr('id')).show().click();
});
}
if ($('.editval_numeric').length > 0) {
$('.editval_numeric').editable(urlSaveInPlace, {
type : 'text',

View File

@@ -414,7 +414,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
if ($forcefocus) $msg.= '.select2(\'focus\')';
$msg.= ';'."\n";
if (count($events)) // If an array of js events to do were provided.
if (is_array($events) && count($events)) // If an array of js events to do were provided.
{
$msg.= '
jQuery("#'.$htmlname.'").change(function () {

View File

@@ -1359,10 +1359,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint=
else $out.='-'.dol_print_date($histo[$key]['dateend'],'dayhour');
}
$late=0;
if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] == 0 && ! $histo[$key]['datestart'] && $histo[$key]['dateend'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && $histo[$key]['dateend'] && $db->jdate($histo[$key]['dateend']) < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $db->jdate($histo[$key]['datestart']) < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] == 0 && $histo[$key]['datestart'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] == 0 && ! $histo[$key]['datestart'] && $histo[$key]['dateend'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && $histo[$key]['dateend'] && $histo[$key]['dateend'] < ($now - $delay_warning)) $late=1;
if ($histo[$key]['percent'] > 0 && $histo[$key]['percent'] < 100 && ! $histo[$key]['dateend'] && $histo[$key]['datestart'] && $histo[$key]['datestart'] < ($now - $delay_warning)) $late=1;
if ($late) $out.=img_warning($langs->trans("Late")).' ';
$out.="</td>\n";

View File

@@ -46,7 +46,7 @@ function dol_basename($pathfile)
* @param int $recursive Determines whether subdirectories are searched
* @param string $filter Regex filter to restrict list. This regex value must be escaped for '/' by doing preg_quote($var,'/'), since this char is used for preg_match function,
* but must not contains the start and end '/'. Filter is checked into basename only.
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked into fullpath.
* @param array $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')). Exclude is checked both into fullpath and into basename (So '^xxx' may exclude 'xxx/dirscanned/...' and dirscanned/xxx').
* @param string $sortcriteria Sort criteria ("","fullname","relativename","name","date","size")
* @param string $sortorder Sort order (SORT_ASC, SORT_DESC)
* @param int $mode 0=Return array minimum keys loaded (faster), 1=Force all keys like date and size to be loaded (slower), 2=Force load of date only, 3=Force load of size only
@@ -107,6 +107,7 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
while (false !== ($file = readdir($dir))) // $file is always a basename (into directory $newpath)
{
if (! utf8_check($file)) $file=utf8_encode($file); // To be sure data is stored in utf8 in memory
$fullpathfile=($newpath?$newpath.'/':'').$file;
$qualified=1;
@@ -120,10 +121,11 @@ function dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefil
// Check if file is qualified
foreach($excludefilterarray as $filt)
{
if (preg_match('/'.$filt.'/i',$file)) {
if (preg_match('/'.$filt.'/i', $file) || preg_match('/'.$filt.'/i', $fullpathfile)) {
$qualified=0; break;
}
}
//print $fullpathfile.' '.$file.' '.$qualified.'<br>';
if ($qualified)
{
@@ -968,7 +970,11 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
$file_name_osencoded=dol_osencode($file_name);
// Check if destination dir is writable
// TODO
if (! is_writable(dirname($file_name_osencoded)))
{
dol_syslog("Files.lib::dol_move_uploaded_file Dir ".dirname($file_name_osencoded)." is not writable. Return 'ErrorDirNotWritable'", LOG_WARNING);
return 'ErrorDirNotWritable';
}
// Check if destination file already exists
if (! $allowoverwrite)

View File

@@ -238,6 +238,17 @@ function dol_shutdown()
}
/**
* Return true if we are in a context of submitting a parameter
*
* @param string $paramname Name or parameter to test
* @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty)
*/
function GETPOSTISSET($paramname)
{
return (isset($_POST[$paramname]) || isset($_GET[$paramname]));
}
/**
* Return value of a param into GET or POST supervariable.
* Use the property $user->default_values[path]['creatform'] and/or $user->default_values[path]['filters'] and/or $user->default_values[path]['sortorder']
@@ -257,12 +268,13 @@ function dol_shutdown()
* 'custom'= custom filter specify $filter and $options)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'.
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'
* @param string $noreplace Force disable of replacement of __xxx__ strings.
* @return string|string[] Value found (string or array), or '' if check fails
*
* @TODO Set default value for check to alpha. Check all WYSIWYG edition (email and description...) is still ok with rich text.
*/
function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
{
global $mysoc,$user,$conf;
@@ -366,7 +378,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL)
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
if (! is_array($out) && empty($_POST[$paramname]))
if (! is_array($out) && empty($_POST[$paramname]) && empty($noreplace))
{
$maxloop=20; $loopnb=0; // Protection against infinite loop
while (preg_match('/__([A-Z0-9]+_?[A-Z0-9]+)__/i', $out, $reg) && ($loopnb < $maxloop)) // Detect '__ABCDEF__' as key 'ABCDEF' and '__ABC_DEF__' as key 'ABC_DEF'. Detection is also correct when 2 vars are side by side.
@@ -1236,7 +1248,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
&& (! file_exists($fileimagebis) || (filemtime($fileimagebis) < filemtime($file)))
)
{
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experienc trouble with pdf thumb generation and imagick, you can disable here.
if (empty($conf->global->MAIN_DISABLE_PDF_THUMBS)) // If you experience trouble with pdf thumb generation and imagick, you can disable here.
{
$ret = dol_convert_file($file, 'png', $fileimage);
if ($ret < 0) $error++;
@@ -1769,11 +1781,13 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
if (empty($localtz)) {
$localtz = new DateTimeZone('UTC');
}
//var_dump($localtz);
//var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute);
$dt = new DateTime(null,$localtz);
$dt->setDate($year,$month,$day);
$dt->setTime((int) $hour, (int) $minute, (int) $second);
$date=$dt->getTimestamp(); // should include daylight saving time
//var_dump($date);
return $date;
}
else
@@ -4305,6 +4319,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
{
$product->get_buyprice($idprodfournprice,0,0,0);
$ret=$product->vatrate_supplier;
if ($product->default_vat_code) $ret.=' ('.$product->default_vat_code.')';
}
else
{

View File

@@ -1822,7 +1822,7 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
{
if (empty($hookmanager)) global $hookmanager;
$reshook=0;
$result='';
//if (is_object($hookmanager) && ( (isset($object->lines[$i]->product_type) && $object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line) ) )
@@ -1841,10 +1841,14 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
if ($object->lines[$i]->special_code == 3) return '';
if (empty($hidedetails) || $hidedetails > 1)
{
if($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
$result = ( $object->lines[$i]->situation_percent - $prev_progress) . '%';
$prev_progress = 0;
if (method_exists($object, 'get_prev_progress'))
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
}
$result = ($object->lines[$i]->situation_percent - $prev_progress) . '%';
}
else
$result = $object->lines[$i]->situation_percent . '%';
@@ -1891,12 +1895,17 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
if (empty($hidedetails) || $hidedetails > 1)
{
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
if ($object->lines[$i]->situation_percent > 0 )
if ($object->lines[$i]->situation_percent > 0)
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
$progress = ( $object->lines[$i]->situation_percent - $prev_progress) /100;
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
}
$prev_progress = 0;
$progress = 1;
if (method_exists($object, 'get_prev_progress'))
{
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
$progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100;
}
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
}
else
$result.=price($sign * $total_ht, 0, $outputlangs);
}

View File

@@ -477,3 +477,42 @@ function measuring_units_string($unit,$measuring_style='')
return $measuring_units[$unit];
}
/**
* Transform a given unit into the square of that unit, if known
*
* @param int $unit Unit key (-3,-2,-1,0,98,99...)
* @return int Squared unit key (-6,-4,-2,0,98,99...)
* @see formproduct->load_measuring_units
*/
function measuring_units_squared($unit)
{
$measuring_units=array();
$measuring_units[0] = 0; // m -> m3
$measuring_units[-1] = -2; // dm-> dm2
$measuring_units[-2] = -4; // cm -> cm2
$measuring_units[-3] = -6; // mm -> mm2
$measuring_units[98] = 98; // foot -> foot2
$measuring_units[99] = 99; // inch -> inch2
return $measuring_units[$unit];
}
/**
* Transform a given unit into the cube of that unit, if known
*
* @param int $unit Unit key (-3,-2,-1,0,98,99...)
* @return int Cubed unit key (-9,-6,-3,0,88,89...)
* @see formproduct->load_measuring_units
*/
function measuring_units_cubed($unit)
{
$measuring_units=array();
$measuring_units[0] = 0; // m -> m2
$measuring_units[-1] = -3; // dm-> dm3
$measuring_units[-2] = -6; // cm -> cm3
$measuring_units[-3] = -9; // mm -> mm3
$measuring_units[98] = 88; // foot -> foot3
$measuring_units[99] = 89; // inch -> inch3
return $measuring_units[$unit];
}

View File

@@ -242,9 +242,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
{
foreach($feature2 as $subfeature)
{
if (empty($user->rights->$feature->$subfeature->creer)
&& empty($user->rights->$feature->$subfeature->write)
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
if (empty($user->rights->$feature->$subfeature->creer)
&& empty($user->rights->$feature->$subfeature->write)
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
else { $createok=1; break; } // Break to bypass second test if the first is ok
}
}
@@ -306,6 +306,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
else if ($feature == 'ftp')
{
if (! $user->rights->ftp->write) $deleteok=0;
}else if ($feature == 'salaries')
{
if (! $user->rights->salaries->delete) $deleteok=0;
}
else if (! empty($feature2)) // This should be used for future changes
{
@@ -379,7 +382,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
$checkother = array('contact','agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet','project'); // Test for project object
$checktask = array('projet_task');
$nocheck = array('barcode','stock','fournisseur'); // No test
$nocheck = array('barcode','stock'); // No test
$checkdefault = 'all other not already defined'; // Test on entity and link to third party. Not allowed if link is empty (Ex: invoice, orders...).
// If dbtablename not defined, we use same name for table than module name
@@ -499,7 +502,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
else if (! in_array($feature,$nocheck)) // By default we check with link to third party
else if (! in_array($feature,$nocheck)) // By default (case of $checkdefault), we check on object entity + link to third party on field $dbt_keyfield
{
// If external user: Check permission for external users
if ($user->societe_id > 0)
@@ -521,7 +524,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid=0, $tableandsh
$sql.= " WHERE dbt.".$dbt_select." = ".$objectid;
$sql.= " AND sc.fk_soc = dbt.".$dbt_keyfield;
$sql.= " AND dbt.".$dbt_keyfield." = s.rowid";
$sql.= " AND s.entity IN (".getEntity($sharedelement, 1).")";
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
$sql.= " AND sc.fk_user = ".$user->id;
}
// If multicompany and internal users with all permissions, check user is in correct entity

View File

@@ -667,13 +667,13 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');
$pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$posy=$pdf->GetY()+3;
}

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -280,14 +281,14 @@ class doc_generic_contract_odt extends ModelePDFContract
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->client;
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
$socobject=$object->client;
$socobject=$object->thirdparty;
}
// Make substitution
$substitutionarray=array(

View File

@@ -892,13 +892,13 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetFont('','B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
$titre = $outputlangs->transnoentities("PaymentConditions").':';
$pdf->MultiCell(80, 4, $titre, 0, 'L');
$pdf->MultiCell(43, 4, $titre, 0, 'L');
$pdf->SetFont('','', $default_font_size - 2);
$pdf->SetXY($posxval, $posy);
$lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
$lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
$pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');
$pdf->MultiCell(67, 4, $lib_condition_paiement,0,'L');
$posy=$pdf->GetY()+3;
}

View File

@@ -20,9 +20,9 @@
*/
/**
* \file htdocs/core/modules/import/import_csv.modules.php
* \file htdocs/core/modules/import/import_xlsx.modules.php
* \ingroup import
* \brief File to load import files with CSV format
* \brief File to load import files with Excel format
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/import/modules_import.php';
@@ -54,10 +54,10 @@ class ImportXlsx extends ModeleImports
var $cacheconvert=array(); // Array to cache list of value found after a convertion
var $cachefieldtable=array(); // Array to cache list of value found into fields@tables
var $workbook; // temporary import file
var $record; // current record
var $headers;
var $headers;
/**
@@ -95,7 +95,7 @@ class ImportXlsx extends ModeleImports
if (preg_match('/^societe_/',$datatoimport)) $this->thirpartyobject=new Societe($this->db);
}
/**
* Output header of an example file for this format
*
@@ -144,7 +144,7 @@ class ImportXlsx extends ModeleImports
foreach($headerlinefields as $field) {
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, 1, $outputlangs->transnoentities($field));
// set autowidth
//$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true);
//$this->workbook->getActiveSheet()->getColumnDimension($this->column2Letter($col + 1))->setAutoSize(true);
$col++;
}
return ''; // final output will be generated in footer
@@ -211,10 +211,10 @@ class ImportXlsx extends ModeleImports
return $ret;
}
/**
* Return nb of records. File must be closed.
*
*
* @param string $file Path of filename
* @return int <0 if KO, >=0 if OK
*/
@@ -222,15 +222,15 @@ class ImportXlsx extends ModeleImports
{
$reader = new PHPExcel_Reader_Excel2007();
$this->workbook = $reader->load($file);
$rowcount = $this->workbook->getActiveSheet()->getHighestDataRow();
$this->workbook->disconnectWorksheets();
unset($this->workbook);
return $rowcount;
}
/**
* Input header line from file
@@ -399,7 +399,7 @@ class ImportXlsx extends ModeleImports
if (! is_numeric($newval) && $newval != '' && ! preg_match('/^id:/i',$newval)) $isidorref='ref';
$newval=preg_replace('/^(id|ref):/i','',$newval); // Remove id: or ref: that was used to force if field is id or ref
//print 'Val is now '.$newval.' and is type '.$isidorref."<br>\n";
if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor
{
$file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);
@@ -502,9 +502,9 @@ class ImportXlsx extends ModeleImports
}
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
$newval=$defaultref;
}
}
elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')
{
$newval = price2num($newval);
@@ -616,7 +616,7 @@ class ImportXlsx extends ModeleImports
// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)
if (empty($lastinsertid)) {
$sqlSelect = 'SELECT rowid FROM '.$tablename;
$data = array_combine($listfields, $listvalues);
$where = array();
$filters = array();
@@ -627,7 +627,7 @@ class ImportXlsx extends ModeleImports
$filters[] = $col.' = '.$data[$key];
}
$sqlSelect.= ' WHERE '.implode(' AND ', $where);
$resql=$this->db->query($sqlSelect);
if($resql) {
$res = $this->db->fetch_object($resql);
@@ -650,23 +650,23 @@ class ImportXlsx extends ModeleImports
$error++;
}
}
if (!empty($lastinsertid)) {
// Build SQL UPDATE request
$sqlstart = 'UPDATE '.$tablename;
$data = array_combine($listfields, $listvalues);
$set = array();
foreach ($data as $key => $val) {
$set[] = $key.' = '.$val;
}
$sqlstart.= ' SET '.implode(', ', $set);
if(empty($keyfield)) $keyfield = 'rowid';
$sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid;
$sql = $sqlstart.$sqlend;
// Run update request
$resql=$this->db->query($sql);
if($resql) {
@@ -691,14 +691,14 @@ class ImportXlsx extends ModeleImports
if (! empty($tablewithentity_cache[$tablename])) {
$sqlstart.= ', entity';
$sqlend.= ', '.$conf->entity;
}
}
if (! empty($objimport->array_import_tables_creator[0][$alias])) {
$sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias];
$sqlend.=', '.$user->id;
}
$sql = $sqlstart.$sqlend.')';
dol_syslog("import_xlsx.modules", LOG_DEBUG);
// Run insert request
if ($sql)
{

View File

@@ -65,7 +65,7 @@ class mailing_fraise extends MailingTargets
*/
function getSqlArrayForStats()
{
global $langs;
global $conf, $langs;
$langs->load("members");
@@ -73,7 +73,7 @@ class mailing_fraise extends MailingTargets
$statssql=array();
$statssql[0] ="SELECT '".$this->db->escape($langs->trans("FundationMembers"))."' as label, count(*) as nb";
$statssql[0].=" FROM ".MAIN_DB_PREFIX."adherent where statut = 1";
$statssql[0].=" FROM ".MAIN_DB_PREFIX."adherent where statut = 1 and entity IN (".getEntity('member').")";
return $statssql;
}
@@ -89,9 +89,11 @@ class mailing_fraise extends MailingTargets
*/
function getNbOfRecipients($sql='')
{
global $conf;
$sql = "SELECT count(distinct(a.email)) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a";
$sql .= " WHERE (a.email IS NOT NULL AND a.email != '')";
$sql .= " WHERE (a.email IS NOT NULL AND a.email != '') AND a.entity IN (".getEntity('member').")";
// La requete doit retourner un champ "nb" pour etre comprise
// par parent::getNbOfRecipients
@@ -201,7 +203,7 @@ class mailing_fraise extends MailingTargets
$sql.= " a.lastname, a.firstname,";
$sql.= " a.datefin, a.civility as civility_id, a.login, a.societe"; // Other fields
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
$sql.= " WHERE a.email <> ''"; // Note that null != '' is false
$sql.= " WHERE a.entity IN (".getEntity('member').") AND a.email <> ''"; // Note that null != '' is false
$sql.= " AND a.email NOT IN (SELECT email FROM ".MAIN_DB_PREFIX."mailing_cibles WHERE fk_mailing=".$mailing_id.")";
if (isset($_POST["filter"]) && $_POST["filter"] == '-1') $sql.= " AND a.statut=-1";
if (isset($_POST["filter"]) && $_POST["filter"] == '1a') $sql.= " AND a.statut=1 AND a.datefin >= '".$this->db->idate($now)."'";

View File

@@ -307,14 +307,14 @@ class doc_generic_product_odt extends ModelePDFProduct
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact;
else {
$socobject = $object->client;
$socobject = $object->thirdparty;
// if we have a CUSTOMER contact and we dont use it as recipient we store the contact object for later use
$contactobject = $object->contact;
}
}
else
{
$socobject=$object->client;
$socobject=$object->thirdparty;
}
// Make substitution
$substitutionarray=array(

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