2
0
forked from Wavyzz/dolibarr

Compare commits

..

1079 Commits
8.0.1 ... 8.0.5

Author SHA1 Message Date
Juanjo Menent
7041c3246e Prepare 8.0.5 2019-05-11 22:35:56 +02:00
Juanjo Menent
40229c9d96 Merge pull request #11166 from simnandez/8.0
Merge branch '7.0' into 8.0
2019-05-11 18:06:20 +02:00
Juanjo Menent
f4ca6916cd Merge remote-tracking branch 'upstream/7.0' into 8.0
# Conflicts:
#	htdocs/contrat/services_list.php
#	htdocs/expensereport/list.php
#	htdocs/projet/list.php
2019-05-11 17:31:23 +02:00
Juanjo Menent
3a99ef7319 Fix: missing GETPOST params 2019-05-11 17:04:05 +02:00
Juanjo Menent
3ae2d71ea6 Fix: missing GETPOST params 2019-05-11 17:00:55 +02:00
Juanjo Menent
91ae365588 Fix: missing GETPOST params 2019-05-11 16:58:00 +02:00
Juanjo Menent
6206519456 Fix: missing GETPOST params 2019-05-11 16:54:56 +02:00
Juanjo Menent
2e6cb2afaa Fix: missing GETPOST params 2019-05-11 16:53:16 +02:00
Juanjo Menent
dc9f8a349f Fix: missing GETPOST params 2019-05-11 16:50:31 +02:00
Juanjo Menent
80ef97e215 FIX: #11025 2019-05-11 16:41:01 +02:00
Juanjo Menent
759427f6ac FIX: #11025 2019-05-11 16:36:35 +02:00
Juanjo Menent
81bf7d07e3 Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-05-11 16:32:02 +02:00
Juanjo Menent
72dd3705ed Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-05-10 09:13:33 +02:00
Laurent Destailleur
6a5af0511d Merge pull request #11105 from atm-greg/FIX_stock_movement_link_to_project
fix project link for stock correction
2019-05-03 11:27:17 +02:00
atm-greg
e0c3cf8360 fix project link for stock correction 2019-05-03 10:24:49 +02:00
Laurent Destailleur
45d618cd7a Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-05-02 14:37:54 +02:00
Laurent Destailleur
ae7ba162f2 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-05-02 14:37:46 +02:00
Laurent Destailleur
1a16dc1166 Merge pull request #11089 from frederic34/patch-5
Fix do not delete all discount when splitting (supplier)
2019-05-02 14:05:49 +02:00
Laurent Destailleur
50b1a54dca FIX Update/delete currency on same languages 2019-05-01 14:06:30 +02:00
Frédéric FRANCE
d9a1c2b235 Fix do not delete all discount when splitting 2019-04-30 13:54:50 +02:00
Laurent Destailleur
a7530b7eff Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-04-27 13:28:36 +02:00
Laurent Destailleur
0532598ecf Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-27 13:28:05 +02:00
Laurent Destailleur
410a3801da Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-27 13:27:52 +02:00
Laurent Destailleur
5259547b96 Merge pull request #11069 from atm-gauthier/6.0_fix_select_prev_situ
Fix prev situation invoice selection (backport fix 8.0)
2019-04-25 18:59:48 +02:00
gauthier
31897f54ac Fix prev situation invoice selection (backport fix 8.0) 2019-04-25 12:37:05 +02:00
Laurent Destailleur
50a4d54d8a Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-04-25 01:37:32 +02:00
Laurent Destailleur
07caf22647 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-04-25 01:37:25 +02:00
Laurent Destailleur
b62323939e Merge pull request #11064 from atm-greg/FIX_create_supplier_invoice_button
FIX test to display create invoice button on supplier_order card
2019-04-24 21:07:15 +02:00
atm-greg
70017da95a testing if customer invoice module is activated doesn't make sense on supplier commande card... 2019-04-24 14:59:54 +02:00
Laurent Destailleur
fb01f550f4 Merge pull request #11016 from ATM-Nicolas/fix_activity_perweek
FIX : Total per day in timespent per week
2019-04-24 10:21:08 +02:00
Laurent Destailleur
21b79d314a Merge pull request #11059 from atm-greg/FIX_actioncomm_for_long_trigger_name
fix actioncomm module for long trigger names
2019-04-24 10:06:55 +02:00
atm-greg
6e425d1895 add origin of line in fourn orderstoinvoice.php 2019-04-24 08:56:06 +02:00
atm-greg
3231e54abd fix actioncomm module for long trigger names 2019-04-23 16:19:58 +02:00
Laurent Destailleur
bf7fcce1b2 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-04-23 12:24:25 +02:00
Laurent Destailleur
11d737f23a Merge pull request #11029 from ATM-Marc/FIX_7.0_sort_events
FIX: actioncomm: sort events by date after external calendars and hook (into 7.0)
2019-04-19 13:06:09 +02:00
Laurent Destailleur
c9445ee700 Merge pull request #11038 from atm-john/FIX_error_messages_not_displayed
FIX error messages not displayed
2019-04-19 12:55:30 +02:00
John BOTELLA
0855d84ccf FIX error messages not displayed 2019-04-18 10:40:34 +02:00
Laurent Destailleur
91af1f8702 Merge pull request #11011 from ATM-Nicolas/fix_search_contact_list
FIX : Wrong variable name
2019-04-16 23:43:58 +02:00
Laurent Destailleur
c0defe3965 Update index.php 2019-04-16 23:27:45 +02:00
Marc de Lima Lucio
1669d497b4 FIX: actioncomm: sort events by date after external calendars and hook 2019-04-16 17:36:27 +02:00
ATM-Nicolas
93365addd1 FIX : Total per day shows 00:00 if the total time spent is equal to 12:00 2019-04-15 11:40:58 +02:00
ATM-Nicolas
d4a7c0abc6 FIX : Wrong variable name 2019-04-15 10:05:46 +02:00
Juanjo Menent
1b5cabad71 Fix: #10956 2019-04-12 18:50:48 +02:00
Laurent Destailleur
6cd24ab210 Merge pull request #10998 from atm-gauthier/8.0_fix_ProductAccountancySellIntraCode_is_feature_level_1
FIX : Product accountancey sell intra code must be visible if main feature level 1
2019-04-11 16:20:11 +02:00
gauthier
9a24007c0a FIX : better test 2019-04-11 15:32:50 +02:00
gauthier
524b186959 FIX : Product accountancey sell intra code must be visible if main feature level 1 2019-04-11 15:19:40 +02:00
Laurent Destailleur
ffca289bff Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-04-08 14:04:42 +02:00
Laurent Destailleur
125796b0f5 Merge pull request #10967 from atm-ph/fix_7.0_timesheet_init_hook
Fix no init hook on timesheet
2019-04-08 13:49:21 +02:00
Laurent Destailleur
c1f0826005 Update perweek.php 2019-04-08 13:49:16 +02:00
Laurent Destailleur
153e563c9f Update perday.php 2019-04-08 13:49:05 +02:00
Laurent Destailleur
cd1322de79 Merge pull request #10959 from atm-arnaud/8.0_fix_shipping_default_warehouse_if_one
FIX shipping default warehouse if only one warehouse
2019-04-08 13:32:34 +02:00
atm-ph
ea87b2ddb6 Fix no init hook on timesheet 2019-04-05 11:26:11 +02:00
Laurent Destailleur
eaf9a2402a Fix length of label 2019-04-04 17:39:51 +02:00
Laurent Destailleur
4489db2a70 Fix field surface/weight not loaded 2019-04-04 17:06:26 +02:00
atm-arnaud
0b6c7d2d63 FIX shipping default warehouse if only one warehouse 2019-04-04 11:17:44 +02:00
Laurent Destailleur
17a61b3232 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-04-02 19:34:49 +02:00
Laurent Destailleur
26fbd6e2ec Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-02 19:34:16 +02:00
Laurent Destailleur
cb1489e2fa Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-04-02 19:34:10 +02:00
Laurent Destailleur
2f51221660 Merge pull request #10933 from atm-greg/Add_final_hooks_on_replenish
Add all missing hooks on replenish
2019-03-31 18:50:34 +02:00
Laurent Destailleur
f671b8bce7 Merge pull request #10945 from aspangaro/7_p1
FIX: Don't show accountingjournal:getNomUrl without data
2019-03-31 18:49:50 +02:00
Laurent Destailleur
143cbba09b Update card.php 2019-03-31 18:49:38 +02:00
Laurent Destailleur
5dfc1c0897 Merge pull request #10921 from atm-greg/Fix_hook_in_margins_heads
FIX missing hook completeTabsHead in margins module
2019-03-31 18:21:48 +02:00
Alexandre SPANGARO
5588fe5b81 FIX: Don't show journal:getNomUrl without data
ErrorBadValueForParamNotAString
2019-03-30 09:42:13 +01:00
atm-greg
957fae1081 missing params 2019-03-28 11:07:27 +01:00
atm-greg
11343e986c add all missing hooks on replenish 2019-03-28 10:47:32 +01:00
atm-greg
83d7750274 FIX missing hook completeTabsHead in margins module 2019-03-27 09:33:51 +01:00
Laurent Destailleur
e5f54bd14c FIX Remane of project 2019-03-26 12:35:44 +01:00
Laurent Destailleur
3ede626932 FIX If we build one invoice for several orders, we must put the ref of
order on the line to not lose information.

Conflicts:
	htdocs/commande/list.php
	htdocs/core/actions_massactions.inc.php
2019-03-23 22:34:10 +01:00
Laurent Destailleur
37cc5b7d35 Merge pull request #10901 from fmarcet/8.0
FIX: The minimum amount filter does not work in VAT report by customer
2019-03-22 12:27:30 +01:00
Ferran Marcet
f37c1b9287 FIX: The minimum amount filter does not work in the VAT report per customer 2019-03-22 09:28:50 +01:00
Laurent Destailleur
75b94d373f Merge pull request #10897 from frederic34/patch-4
Update extrafields.class.php
2019-03-21 18:27:04 +01:00
Laurent Destailleur
1075ef8cf2 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-21 18:25:43 +01:00
Laurent Destailleur
f7f20df323 Merge pull request #10891 from atm-greg/Add_hook_on_replenish
Add hook on replenish
2019-03-21 18:23:06 +01:00
Frédéric FRANCE
d10b94e72b Update extrafields.class.php 2019-03-21 14:08:49 +01:00
Laurent Destailleur
a1fe1bb58c FIX when 2 extra fields are mandatory in 2 different entities 2019-03-21 12:33:39 +01:00
Laurent Destailleur
032aa869e4 FIX Can't insert if there is extrafields mandatory on another entity.
FIX Can't set default value of extrafield of type varchar
2019-03-21 12:14:15 +01:00
Laurent Destailleur
4c85068a85 FIX Can't insert if there is extrafields mandatory on another entity. 2019-03-21 11:53:04 +01:00
Laurent Destailleur
b11403103b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-19 13:09:48 +01:00
Laurent Destailleur
8664594fc8 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-19 13:09:39 +01:00
Laurent Destailleur
775aa5ff91 Merge pull request #10870 from hregis/8.0_mc2
FIX missing entity filter and wrong var name
2019-03-19 11:11:22 +01:00
Laurent Destailleur
89087c6847 Merge pull request #10800 from atm-quentin/FIX_wrong_vat_deposit_invoice
Wrong vat if deposit from propal with multiple vat
2019-03-18 11:14:11 +01:00
Regis Houssin
57091f08b0 FIX missing entity filter and wrong var name 2019-03-18 10:53:43 +01:00
Laurent Destailleur
468af5380f Merge pull request #10857 from atm-maxime/fix_creditnote_refund
Fix #9961 : deal with supplier credit note refund like with customers
2019-03-16 19:40:22 +01:00
Maxime Kohlhaas
46b39dd6a9 Fix #9961 : deal with supplier credit note refund like with customers 2019-03-16 18:13:43 +01:00
Laurent Destailleur
ae35c982af Merge pull request #9652 from atm-gauthier/7.0_fix_round_debitcredit
FIX : need to round with 2 decimals to avoid movements not correctly balanced
2019-03-16 14:27:03 +01:00
Laurent Destailleur
55718cc7da Merge pull request #10855 from atm-maxime/fix_missing_lang
Fix #9311
2019-03-16 13:43:35 +01:00
Laurent Destailleur
efeb7b0c22 Merge pull request #10854 from atm-maxime/fix_civility_third_creation
Fix #10177
2019-03-16 13:41:29 +01:00
Maxime Kohlhaas
21e2d36421 Fix #9311 2019-03-16 09:28:47 +01:00
Maxime Kohlhaas
68945c7d51 Fix #10177 2019-03-16 09:11:43 +01:00
Laurent Destailleur
681d626284 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-15 19:17:31 +01:00
Laurent Destailleur
4bb45ad1c1 Merge pull request #10824 from atm-gauthier/7.0_fix_nocreateline_deposit_if_amount_zero
FIX : when we create deposit with multi tva, we mustn't add line if a…
2019-03-15 19:16:56 +01:00
Laurent Destailleur
b33c366b02 Update card.php 2019-03-15 19:16:49 +01:00
Laurent Destailleur
abf529770d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-15 19:13:23 +01:00
Laurent Destailleur
482a37a2c9 Merge pull request #10850 from atm-ph/fix_7.0_var_name
Fix var name
2019-03-15 19:12:55 +01:00
atm-ph
2da60fb885 Fix var name 2019-03-15 15:15:03 +01:00
Laurent Destailleur
84bff41543 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-15 11:00:24 +01:00
Laurent Destailleur
6c2cad3d48 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/security.lib.php
2019-03-15 11:00:00 +01:00
Laurent Destailleur
8711e51bce Merge pull request #10841 from atm-gauthier/6.0_notest_tab_documents_on_expensereport
FIX : no need to test anything to display documents tabs on expense report
2019-03-15 10:56:53 +01:00
gauthier
8375b47e74 FIX : in fact expensereport must be in $check array 2019-03-15 10:21:50 +01:00
Laurent Destailleur
a8bd8a2101 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-14 18:49:24 +01:00
Laurent Destailleur
5ec8adb7f5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-03-14 18:48:35 +01:00
Laurent Destailleur
4f84a1614c Merge pull request #10808 from ATM-Marc/FIX_8.0_shipment_hooks
FIX: several hooks in shipping/delivery cards
2019-03-14 18:07:57 +01:00
gauthier
3fb6978bc8 FIX : no need to test anything to display documents tabs on expense report 2019-03-14 17:36:49 +01:00
Laurent Destailleur
eab1e13343 Merge pull request #10839 from atm-gauthier/6.0_fix_useless_join
FIX : useless join
2019-03-14 17:12:38 +01:00
gauthier
885797b748 FIX : useless join 2019-03-14 17:00:51 +01:00
Laurent Destailleur
feaca165ad Merge pull request #10809 from joanlouis/fix-extrafields-calls-from-cards-8
Fix extrafields calls from cards for Dolibarr 8 See #10803
2019-03-14 14:22:31 +01:00
gauthier
a524bbc5c6 FIX : when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line) 2019-03-13 15:59:41 +01:00
Marc de Lima Lucio
36b44b1348 FIX: several hooks in shipping/delivery cards 2019-03-12 11:28:36 +01:00
Joan Louis
17647de4cc Fix extrafields calls from cards for Dolibarr 8 See #10803 2019-03-12 11:24:54 +01:00
Laurent Destailleur
15cc21b89f Merge pull request #10783 from aspangaro/8.0_EBP_export-TXT
FIX: Accountancy - Format EBP import
2019-03-11 17:52:34 +01:00
atm-quentin
ab781c32c7 Wrong vat if deposit from propal with multiple vat 2019-03-11 11:28:25 +01:00
Alexandre SPANGARO
49f72b6a9a Merge remote-tracking branch 'upstream/8.0' into 8.0_EBP_export-TXT 2019-03-09 05:50:16 +01:00
Laurent Destailleur
5596b2e9bf Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/fourn/class/fournisseur.facture.class.php
2019-03-09 00:02:56 +01:00
Laurent Destailleur
520387c03d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/holiday/card.php
2019-03-09 00:01:29 +01:00
Laurent Destailleur
4022d5f529 FIX Can not create contract with numbering module without autogen rule 2019-03-08 23:58:04 +01:00
Laurent Destailleur
233bd4374a Fix phpcs 2019-03-08 19:52:26 +01:00
Alexandre SPANGARO
d926657534 FIX: Accountancy - Format EBP import
Add doc
2019-03-08 10:57:14 +01:00
Laurent Destailleur
9a9fd15077 Fix doxygen 2019-03-07 14:10:33 +01:00
Laurent Destailleur
d2f1d0cc33 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/fourn/class/fournisseur.facture.class.php
2019-03-07 14:06:11 +01:00
Laurent Destailleur
e96f84a3d6 Merge pull request #10765 from altatof/sd8
FIX : supplier discount was not retrieved when choosing a product
2019-03-07 13:26:44 +01:00
Laurent Destailleur
0349f9bfaa Update objectline_create.tpl.php 2019-03-07 13:26:25 +01:00
Laurent Destailleur
2ae3d75df4 Merge pull request #10752 from atm-gauthier/7.0_fix_fourninvoice_specialcode
FIX : we need to keep originline special_code
2019-03-07 12:29:00 +01:00
Laurent Destailleur
e3fb228a4d Update fournisseur.facture.class.php 2019-03-07 12:28:19 +01:00
Christophe Battarel
96b8da0d62 fix supllier discount 2019-03-06 22:04:01 +01:00
gauthier
0ff2905180 FIX : we need to keep originline special_code 2019-03-06 12:10:24 +01:00
Laurent Destailleur
22bb62d900 Merge pull request #10737 from atm-gauthier/6.0_fix_wrong_redirect_link
FIX : wrong redirect link on holiday refuse
2019-03-05 18:43:57 +01:00
Laurent Destailleur
3db8218cba Merge pull request #10745 from frederic34/patch-6
add session newtoken
2019-03-05 18:41:50 +01:00
Laurent Destailleur
98f5bb2ed3 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-05 15:55:08 +01:00
Frédéric FRANCE
1bbf6737ec add session newtoken 2019-03-05 15:27:31 +01:00
Laurent Destailleur
54b9681257 More log to help debug 2019-03-04 20:15:31 +01:00
gauthier
dada8c8ff5 FIX : wrong redirect link on holiday refuse 2019-03-04 17:23:29 +01:00
Laurent Destailleur
acaf5cabef Merge pull request #10332 from ATM-Nicolas/fix_check_picture_name
FIX : Check for old picture name if the new one was not found
2019-03-04 16:20:29 +01:00
Laurent Destailleur
76dd9e42d2 Merge pull request #10726 from frederic34/patch-3
Update DolibarrModules.class.php
2019-03-04 16:05:06 +01:00
Laurent Destailleur
526bd1d02e Fix number format 2019-03-03 17:36:43 +01:00
Frédéric FRANCE
3037e4a157 Update DolibarrModules.class.php 2019-03-02 20:49:53 +01:00
Laurent Destailleur
aea5abd9a1 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-02 19:05:58 +01:00
Laurent Destailleur
8f8aaf1e8c Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-03-02 19:05:51 +01:00
Laurent Destailleur
a2eefab696 Merge pull request #10714 from ATM-Marc/FIX_7.0_export_actioncomm
FIX: actioncomm export: ORDER BY clause / event type filter
2019-03-02 18:44:34 +01:00
Laurent Destailleur
bc9218dee3 Merge pull request #10713 from atm-gauthier/8.0_fix_title_project
FIX : project_title for display of getNomUrl()
2019-03-02 18:36:42 +01:00
Marc de Lima Lucio
b96ac794e9 FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work 2019-02-28 16:15:32 +01:00
gauthier
786c114026 FIX : project_title for display of getNomUrl() 2019-02-28 16:13:45 +01:00
Laurent Destailleur
c9d240cb73 Merge pull request #10671 from hregis/8.0_mc
FIX could not create several superadmin in transversal mode
2019-02-28 12:24:50 +01:00
Laurent Destailleur
855aaaffd8 Better fix for type of discount 2019-02-28 11:44:10 +01:00
Laurent Destailleur
92259810c1 Merge pull request #10712 from atm-florian/8.0
fix relative discount for prospect and supplier
2019-02-28 11:26:50 +01:00
Laurent Destailleur
74dec41496 Merge pull request #10705 from atm-gauthier/8.0_fix_best_error_msg
FIX : if empty error message, we just see "error" displayed
2019-02-28 11:25:13 +01:00
Laurent Destailleur
cefaeb583f Update xinputfile.modules.php 2019-02-28 11:24:43 +01:00
Laurent Destailleur
85d46a5270 Update xinputfile.modules.php 2019-02-28 11:24:07 +01:00
florian HENRY
4ebf4780c2 fix relative discount for prospect and supplier 2019-02-28 09:09:06 +01:00
gauthier
1237a6d3e9 FIX : same thing here 2019-02-27 14:58:10 +01:00
gauthier
49e03b009f FIX : if empty error message, we just see "error" displayed 2019-02-27 14:50:01 +01:00
Laurent Destailleur
86e2ffe323 Merge pull request #10390 from glu000/8.0
Fix #10278
2019-02-27 02:24:55 +01:00
Laurent Destailleur
238894a7e4 Merge pull request #10624 from frederic34/patch-2
selectMulticurrency avoid malformed empty value
2019-02-27 02:06:24 +01:00
Laurent Destailleur
a48e9fdba4 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-02-27 01:23:26 +01:00
Laurent Destailleur
c1fa48889e Merge pull request #10677 from frederic34/patch-6
fix #10385
2019-02-24 20:46:04 +01:00
Laurent Destailleur
6fdd0191f4 Merge pull request #10676 from frederic34/patch-5
fix #10656
2019-02-24 20:45:13 +01:00
Laurent Destailleur
2f300ae63f Standardize code with customer invoices 2019-02-24 20:26:54 +01:00
Laurent Destailleur
f41d504ba1 Merge pull request #10518 from atm-greg/8.0_FIX_bad_values_in_fourn_credit_note
FIX positive values IN supplier credit notes creating diff on addline rounding
2019-02-24 20:21:22 +01:00
Frédéric FRANCE
2ad91213b2 Update combinations.php 2019-02-24 12:09:57 +01:00
Frédéric FRANCE
ca2eba866c Update list.php 2019-02-24 11:56:17 +01:00
Frédéric FRANCE
435b416f93 fix #10656 2019-02-24 11:50:06 +01:00
Regis Houssin
0ea7bf3b0b FIX could not create several superadmin in transversal mode 2019-02-24 08:21:56 +01:00
Laurent Destailleur
4e19a83f1b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-02-23 16:01:38 +01:00
Laurent Destailleur
af6c482f26 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-02-23 16:01:30 +01:00
Laurent Destailleur
f2a73eecf2 Merge pull request #10645 from atm-gauthier/7.0_fix_feature_not_finished
FIX : function sendEmailsReminder isn't completely developed, then MA…
2019-02-23 15:01:44 +01:00
Laurent Destailleur
4c32aed2f4 Merge pull request #10650 from fappels/8.0_fix_dispatch
FIX fk_default_warehouse missing in group by
2019-02-23 14:08:28 +01:00
Francis Appels
c38b0c4dbe FIX fk_default_warehouse missing in group by 2019-02-22 12:17:34 +01:00
gauthier
58d82eb477 FIX : function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it 2019-02-21 11:08:55 +01:00
Laurent Destailleur
ad7b8371da FIX Mark credit note as available for credit note in other currency
Conflicts:
	htdocs/compta/paiement.php
	htdocs/core/class/discount.class.php
2019-02-18 18:30:15 +01:00
Frédéric FRANCE
b017213131 selectMulticurrency avoid malformed empty value 2019-02-17 20:59:39 +01:00
Laurent Destailleur
c0b22e86c2 Merge pull request #10619 from atm-gauthier/8.0_fix_cant_reopen_fourn_creditnote
FIX : we want to be able to reopen fourn credit note
2019-02-15 15:32:38 +01:00
gauthier
70f1a9d13d FIX : we want to be able to reopen fourn credit note 2019-02-15 11:41:02 +01:00
Laurent Destailleur
f456cc5e77 Merge pull request #10605 from hregis/8.0_mc
FIX missing $ismultientitymanaged for previous/next ref
2019-02-14 16:24:12 +01:00
Regis Houssin
45d05da6ed FIX missing $ismultientitymanaged for previous/next ref 2019-02-14 16:14:19 +01:00
Laurent Destailleur
c8b4265c12 Merge pull request #10602 from hregis/8.0_mc
FIX missing entity filter in function "build_filterField()" (export module)
2019-02-14 15:24:12 +01:00
Laurent Destailleur
2c2052d113 Update card.php
Avoid regression on restrictArea
2019-02-14 15:23:34 +01:00
Laurent Destailleur
4ac086ab70 Update info.php 2019-02-14 15:23:07 +01:00
Laurent Destailleur
173d28cf5a Update mouvement.php
Avoid regression on restrictArea
2019-02-14 15:22:22 +01:00
Laurent Destailleur
d2ee00d4bb Update security.lib.php
Avoid regression on test of restrictArea
2019-02-14 15:21:01 +01:00
Regis Houssin
359318392f FIX missing entity filter in function "build_filterField()" (export) 2019-02-14 10:47:07 +01:00
Regis Houssin
aa4c5ae839 FIX missing access security checking with multicompany 2019-02-14 10:12:15 +01:00
Laurent Destailleur
53a8f1cd3b Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-02-12 13:36:05 +01:00
Laurent Destailleur
04b0216277 Merge pull request #10548 from aspangaro/7.0_accountancy_multicomp_movement
FIX: Accountancy - Add transaction with multicompany use only the first entity
2019-02-12 13:19:00 +01:00
Alexandre SPANGARO
2dc4edb68c FIX: Accountancy - Add transaction with multicompany use all the time 1st entity 2019-02-11 11:36:12 +01:00
gauthier
2142ccee8a FIX : better method 2019-02-08 15:17:40 +01:00
Laurent Destailleur
43fbcf7081 Prepare 8.0.5 2019-02-08 10:28:59 +01:00
Laurent Destailleur
1c129a78ae Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-02-08 10:22:55 +01:00
Laurent Destailleur
679a13e48c Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/expedition/class/expedition.class.php
2019-02-08 10:22:36 +01:00
Laurent Destailleur
3318baa664 Merge pull request #10522 from atm-ph/fix_8.0_crabe_payment_table
Fix display payment table on multiple pages
2019-02-08 10:08:46 +01:00
Laurent Destailleur
3d58e93a3c Merge pull request #10525 from atm-greg/8.0_FIX_supplier_proposal_lines_added_without_unit
FIX add fk_unit on addline action
2019-02-08 10:01:29 +01:00
Laurent Destailleur
4997b5968f Merge pull request #10506 from ATM-Marc/FIX_7.0_parent_line
FIX: line edit template: keep fk_parent_line
2019-02-08 09:52:21 +01:00
Laurent Destailleur
76b021d061 Merge pull request #10505 from ATM-Marc/FIX_7.0_expedition_status
FIX: expedition: reset status on rollback
2019-02-08 09:46:14 +01:00
Laurent Destailleur
92ef0d75cf Merge pull request #10504 from atm-quentin/FIX_supplier_invoice_paiement_credit_deposit
FIX supplier invoice payment total doesnnt care about deposit or credit
2019-02-08 09:44:42 +01:00
Laurent Destailleur
ccda5719cf Merge pull request #10503 from atm-quentin/FIX_product_stat_supplier_invoice
FIX supplier invoice product stats total ht is line total not invoice…
2019-02-08 09:43:38 +01:00
Laurent Destailleur
8abebb091c Var no more used 2019-02-08 09:33:01 +01:00
Laurent Destailleur
24955088de Merge pull request #10501 from hregis/8.0_mc
FIX [URGENT] broken feature, "$usercancreate" is for Dolibarr 9
2019-02-08 09:31:26 +01:00
Laurent Destailleur
e5d7a862b4 Merge pull request #10527 from atm-ph/fix_8.0_psql_search_insensitive_accent
Fix psql search insensitive accent
2019-02-08 09:29:59 +01:00
Laurent Destailleur
bd3f0da19c Merge pull request #10515 from atm-gauthier/8.0_fix_can_addline_on_invoices
FIX : can't add lines on invoices
2019-02-08 09:27:51 +01:00
Laurent Destailleur
0ac995b37c Merge pull request #10512 from atm-florian/8.0
fix php warning
2019-02-08 09:27:18 +01:00
atm-ph
51515a487e Fix search unaccent from left menu search box 2019-02-07 17:58:25 +01:00
atm-ph
ec7ef265b7 Fix psql search insensitive accent 2019-02-07 17:47:17 +01:00
atm-greg
9d0e0c2798 FIX add fk_unit on addline action 2019-02-07 15:17:52 +01:00
atm-ph
8e6a567b09 Fix display payment table on multiple pages 2019-02-07 12:36:22 +01:00
atm-greg
4624f1b1b8 FIX positive values creating diff on addline rounding 2019-02-06 17:19:16 +01:00
gauthier
29e4fce450 FIX : can't add lines on invoices 2019-02-06 12:35:23 +01:00
florian HENRY
95cc9faf7e fix php warning 2019-02-06 09:01:24 +01:00
Marc de Lima Lucio
428efa9227 FIX: line edit template: keep fk_parent_line 2019-02-05 12:02:49 +01:00
Marc de Lima Lucio
64739098ae FIX: expedition: reset status on rollback + replace hardcoded status with const 2019-02-05 11:58:49 +01:00
atm-quentin
da0c863f45 FIX supplier invoice payment total dont care about deposit or credit 2019-02-05 10:30:38 +01:00
atm-quentin
730a2a90ff FIX supplier invoice product stats total ht is line total not invoice total 2019-02-05 09:43:14 +01:00
Regis Houssin
4a19cba257 FIX [URGENT] broken feature, "$usercancreate" is for Dolibarr 9 2019-02-05 06:34:05 +01:00
Laurent Destailleur
cdfeeafab9 FIX #10381 2019-02-03 21:12:05 +01:00
Laurent Destailleur
72f78ecf3b FIX #10460 compatibility with MariaDB 10.4 2019-02-03 20:02:05 +01:00
Laurent Destailleur
4538d13add Merge pull request #10450 from atm-gauthier/8.0_fIX_fetch_member
FIX : wrong tests on fetch
2019-02-03 19:25:25 +01:00
Laurent Destailleur
bd2c7092a4 Update user.class.php 2019-02-03 19:25:11 +01:00
Laurent Destailleur
62d677118d Update adherent.class.php 2019-02-03 19:24:18 +01:00
Laurent Destailleur
d773c74f09 Merge pull request #10483 from atm-maxime/fix_warehouse_fetch
Fix warehouse fetch was not checking parameters. Fixes #10414
2019-02-03 19:11:47 +01:00
Maxime Kohlhaas
bb3225809b Fix warehouse fetch was not checking parameters. Fixes #10414 2019-02-02 18:43:25 +01:00
Laurent Destailleur
75845a990f FIX Missing province in export of invoice 2019-02-01 22:55:28 +01:00
Laurent Destailleur
e366ab551c Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-02-01 16:01:26 +01:00
Laurent Destailleur
dee2a373c1 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
2019-02-01 16:01:18 +01:00
Laurent Destailleur
dbf7ae4c25 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-02-01 15:56:58 +01:00
Laurent Destailleur
452dfafd32 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-02-01 15:56:47 +01:00
Laurent Destailleur
bff2f33022 Merge pull request #10404 from atm-john/6.0_fix_supplier_order_line_fetch
Fix fetch test
2019-02-01 15:56:26 +01:00
Laurent Destailleur
dbab955cbd Merge pull request #10471 from mapiolca/patch-9
#Fix : Error in Total Products/Services
2019-02-01 15:43:47 +01:00
Laurent Destailleur
f00271fee6 Merge pull request #10467 from atm-gauthier/7.0_fix_nextnumref
FIX : need an order by in case we found other invoice with same number but not same date
2019-02-01 15:38:16 +01:00
Laurent Destailleur
a08a0b4c1d Merge pull request #10469 from atm-gauthier/7.0_fix_wrong_test_enabled
FIX : wrong test enabled
2019-02-01 15:34:55 +01:00
Laurent Destailleur
cc17aff405 Merge pull request #10472 from atm-florian/8.0
FIX : quick search for supplier orders
2019-02-01 15:31:57 +01:00
florian HENRY
f7bed44441 FIX : quick search for supplier orders 2019-01-31 21:39:02 +01:00
Pierre Ardoin
2d6f5ca8ab #Fix : Error in Total Products/Services
Its correct an error in the total of stat Products/Services total.
2019-01-31 20:22:56 +01:00
Laurent Destailleur
14dea53700 FIX Missing field in import/export of users 2019-01-31 15:51:02 +01:00
gauthier
caa937660d FIX : wrong test enabled 2019-01-31 12:43:39 +01:00
gauthier
bfc7265cbc FIX : better test on fetch 2019-01-31 11:53:10 +01:00
gauthier
09ba059c21 FIX : need an order by in case we found other invoice with same number but not same date 2019-01-31 11:03:06 +01:00
Laurent Destailleur
4c2b27560d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/viewimage.php
2019-01-31 10:22:32 +01:00
Laurent Destailleur
484b4371c1 FIX XSS
Conflicts:
	htdocs/viewimage.php
2019-01-31 10:19:23 +01:00
Laurent Destailleur
5e46a359e0 FIX XSS 2019-01-31 10:18:06 +01:00
gauthier
0c4e5a6487 FIX : better test 2019-01-31 09:30:07 +01:00
Laurent Destailleur
ae1c4e065b Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-30 18:53:56 +01:00
Laurent Destailleur
231395dab8 Merge pull request #10398 from atm-john/fix_trigger
Fix missing trigger
2019-01-30 18:53:10 +01:00
Laurent Destailleur
41e20a9d4f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-30 16:44:08 +01:00
Laurent Destailleur
81ae4c52c5 Merge pull request #10446 from mapiolca/8.0
Fix #10317 et #10318
2019-01-30 16:43:14 +01:00
Laurent Destailleur
104364ed02 Merge pull request #10459 from atm-gauthier/7.0_FIX_cmd_fourn_enabled
FIX : $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
2019-01-30 15:51:09 +01:00
Laurent Destailleur
8d9b92698d Merge pull request #10443 from EuskalMoneta/7.0
FIX Fix PHP warning "count(): Parameter must be an array..."
2019-01-30 15:48:31 +01:00
Laurent Destailleur
869159c09f Fix regression in look and feel (if empty, we do not sho value) 2019-01-30 15:31:39 +01:00
Laurent Destailleur
96f46ec261 Merge pull request #10448 from hregis/8.0_mc
FIX multicompany compatibility
2019-01-30 15:25:16 +01:00
Laurent Destailleur
57e7df8acf Merge pull request #10457 from atm-gauthier/8.0_FIX_commande_fourn_enabled
FIX : $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
2019-01-30 15:03:08 +01:00
gauthier
9490929216 FIX : $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled 2019-01-30 10:49:32 +01:00
gauthier
412940b5ca FIX : $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled 2019-01-30 10:19:13 +01:00
Pierre Ardoin
99892c13b0 FIX : Erreur dans le Total
Corrige l'erreur de calcul dans le total des produits et services
2019-01-29 23:26:08 +01:00
gauthier
3477cf6bd3 FIX : must fetch member in current entity 2019-01-29 18:01:28 +01:00
Laurent Destailleur
c6755b3cf1 Fix formatting of number in quantity field 2019-01-29 15:59:41 +01:00
Pierre Ardoin
80cfe86508 Update objectline_view.tpl.php 2019-01-29 14:26:14 +01:00
Pierre Ardoin
5ea1cf0775 Update objectline_edit.tpl.php 2019-01-29 14:25:34 +01:00
Regis Houssin
9539bea68a FIX bad sql request 2019-01-29 12:17:51 +01:00
Regis Houssin
39b696af02 FIX multicompany compatibility 2019-01-29 12:01:40 +01:00
Pierre Ardoin
b6df02e795 Correction oubli date de livraison
Corrige l'oubli de la substitution de la date de livraison pour les commandes et demande de prix fournisseurs
2019-01-29 11:47:39 +01:00
Pierre Ardoin
e75170137e Correction de la filtration de l'entité
Corrige pour que la marge réalisée sur d'autres entités n'apparaisse pas sur celle sur laquelle l'utilisateur est connecté.
2019-01-29 11:42:44 +01:00
Pierre Ardoin
f9b8622545 Prise en charge de Multicompany
Correction pour éviter que les factures appartenant à d'autres entités n'apparaissent dans celle qui est consultée sur le moment.
2019-01-29 11:33:22 +01:00
Pierre Ardoin
dd0f6b3829 Edition Ligne Travaux Supplémentaires
Correction pour permettre l'édition si la ligne n'existe pas dans une précédente situation. Permet l'édition d'une ligne si elle a été ajouté dans la situation actuelle.
2019-01-29 11:30:14 +01:00
Pierre Ardoin
30548d977f Prise en charge des Travaux supplémentaires
Corrige la filtration pour permettre l'ajout de ligne lors de la présence de travaux supplémentaires en cours de chantier.
2019-01-29 11:19:11 +01:00
Pierre Ardoin
508fb5c9cb Prise en charge des Travaux supplémentaires
Corrige la filtration lors des situations client afin de prendre en compte la possibilité d'ajouter des travaux en cours de chantier.
2019-01-29 11:13:11 +01:00
Pierre Ardoin
eca1a2cd64 Update societe.class.php 2019-01-29 11:08:13 +01:00
Xebax
b24f5fda68 FIX Fix PHP warning "count(): Parameter must be an array..." 2019-01-29 08:47:46 +01:00
Laurent Destailleur
b726939d32 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-28 16:27:25 +01:00
Laurent Destailleur
9d1a02b0d7 Fix language 2019-01-28 16:25:37 +01:00
Laurent Destailleur
9dbf41d6b2 Fix lang format 2019-01-28 16:25:06 +01:00
Laurent Destailleur
4545c0f13a Fix lang format of en_ZA 2019-01-28 16:25:01 +01:00
John BOTELLA
6f12cdf236 Fix travis 2019-01-28 11:58:16 +01:00
John BOTELLA
5dbc9ddae0 fix travis 2019-01-28 11:56:20 +01:00
John BOTELLA
9a666b265f Use an other test 2019-01-28 11:53:19 +01:00
Laurent Destailleur
a78db45178 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-27 18:12:36 +01:00
Laurent Destailleur
3e78807cbc Merge pull request #10424 from EuskalMoneta/7.0
FIX 'statut' is ignored when updating a user with the REST API.
2019-01-27 17:56:14 +01:00
Laurent Destailleur
d59097f65c Fix upload of module file 2019-01-27 17:40:56 +01:00
Xebax
94d3f038eb FIX 'statut' is ignored when updating a user with the REST API. 2019-01-27 13:20:33 +01:00
Laurent Destailleur
7785f3e3e2 Merge pull request #10397 from atm-gauthier/8.0_fix_discount_on_excess_with_creditnote_or_deposit
FIX : when we add a payment on an invoice which already has payments …
2019-01-26 14:24:06 +01:00
John BOTELLA
15e1d3b456 Fix fetch test 2019-01-24 09:40:58 +01:00
John BOTELLA
624d17c96a Fix missing no trigger arg 2019-01-23 17:32:49 +01:00
John BOTELLA
1c51716997 Fix missing trigger 2019-01-23 17:02:20 +01:00
gauthier
84e1f92acd FIX : when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc; 2019-01-23 15:16:51 +01:00
Günter Lukas
1cf786acff Fix #10278
Fix #10278
2019-01-22 00:09:36 +01:00
Günter Lukas
46139399ed Merge pull request #9 from Dolibarr/8.0
forksync 8.0
2019-01-22 00:05:52 +01:00
Laurent Destailleur
a4017fa823 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-21 20:47:22 +01:00
Laurent Destailleur
6f553db93d Remove bad text 2019-01-21 20:47:07 +01:00
Laurent Destailleur
57c9104f1c Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-21 02:43:18 +01:00
Laurent Destailleur
5ab6c41dfa Fix missing multicurrency fields in export 2019-01-21 02:43:08 +01:00
Laurent Destailleur
b868397902 Fix colspan 2019-01-21 02:27:13 +01:00
Laurent Destailleur
623bd6ef7a Merge pull request #10377 from frederic34/patch-2
get_codeclient return void
2019-01-20 19:46:31 +01:00
Frédéric FRANCE
077b9f1996 get_codeclient return void
1ac55b0800/htdocs/societe/class/societe.class.php (L2421-L2441)
2019-01-20 15:23:48 +01:00
Laurent Destailleur
0e843c56d0 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-19 13:20:21 +01:00
Laurent Destailleur
1ac55b0800 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/html.formfile.class.php
	htdocs/core/lib/security2.lib.php
2019-01-19 13:19:58 +01:00
wdammak
aaa61254ac Update stats.class.php
Fix div/0 warnings
2019-01-19 11:36:09 +01:00
wdammak
191900d258 Update stats.class.php
Fix div/0 warnings
2019-01-19 11:35:16 +01:00
Laurent Destailleur
45ea1647d0 Merge pull request #10357 from hregis/8.0_mc
FIX broken external authentication module feature and avoid warning
2019-01-17 19:15:40 +01:00
Laurent Destailleur
c1c3eb61f8 Merge pull request #10356 from atm-gauthier/6.0_fix_dol_loginfunction
FIX : if(!function_exists(dol_loginfunction))
2019-01-17 19:14:46 +01:00
Laurent Destailleur
be9f63274f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-17 19:10:35 +01:00
Laurent Destailleur
cb59c97ef7 Merge pull request #10350 from a-schild/7.0
Fix for issue #10333 branch 7.0
2019-01-17 18:59:52 +01:00
Laurent Destailleur
55771bdb3d Merge pull request #10349 from a-schild/8.0
Fix for issue #10333 branch 8.0
2019-01-17 18:59:36 +01:00
Regis Houssin
1d33b6ccbb FIX broken external authentication module feature and avoid warning 2019-01-17 16:01:32 +01:00
gauthier
d997309bcb FIX : if(!method_exists(dol_loginfunction)) 2019-01-17 14:49:30 +01:00
Laurent Destailleur
688311c761 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-16 16:45:38 +01:00
Laurent Destailleur
698222c769 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/adherents/subscription.php
2019-01-16 16:45:30 +01:00
Laurent Destailleur
476527e71e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2019-01-16 16:34:46 +01:00
Laurent Destailleur
6becdc8af4 Fix missing substitution of ID 2019-01-16 16:34:36 +01:00
a-schild
7e3bfd332e Fix for issue #10333
paymentterm.class.php invalid SQL in fetch
2019-01-16 13:07:00 +01:00
a-schild
7df86cb630 Fix for issue #10333
paymentterm.class.php invalid SQL in fetch
2019-01-16 13:06:12 +01:00
Laurent Destailleur
346028c8d5 Merge pull request #10340 from atm-quentin/FIX_Credit_Note_Free_Line
FIX credit note can have negative value
2019-01-16 12:11:21 +01:00
atm-quentin
0d384eea00 FIX credit note can have negative value 2019-01-16 09:33:24 +01:00
Laurent Destailleur
f51b4288da Merge pull request #10336 from hregis/8.0_bug
FIX avoid php warning
2019-01-15 17:59:09 +01:00
Laurent Destailleur
6dd905048c Merge pull request #10334 from hregis/8.0_mc
FIX problem with multicompany transverse mode
2019-01-15 17:57:45 +01:00
Laurent Destailleur
adc4422323 Update card.php 2019-01-15 17:57:30 +01:00
Laurent Destailleur
05dc40b6b9 Merge pull request #10331 from frederic34/patch-2
correct list of links
2019-01-15 17:52:05 +01:00
Regis Houssin
41a38b3a0a FIX avoid php warning
Signed-off-by: Regis Houssin <regis.houssin@inodbox.com>
2019-01-15 15:44:45 +01:00
Regis Houssin
7c9d85d091 FIX problem with multicompany transverse mode
Signed-off-by: Regis Houssin <regis.houssin@inodbox.com>
2019-01-15 12:18:04 +01:00
ATM-Nicolas
2a7b3c7d7d FIX : Check for old picture name if the new one was not found 2019-01-14 10:48:34 +01:00
Frédéric FRANCE
cf55b54cf5 correct list of links 2019-01-14 10:02:48 +01:00
Laurent Destailleur
1aa2b7a164 FIX SQL injection on rowid of dict.php 2019-01-10 03:26:34 +01:00
Laurent Destailleur
0d9367b09d Merge pull request #10305 from tuxgasy/8.0_bill_orders
Fix #10301 mass bill orders
2019-01-08 16:50:48 +01:00
Laurent Destailleur
a1f5ede736 Update actions_massactions.inc.php 2019-01-08 16:50:27 +01:00
Laurent Destailleur
47448b77f0 Update actions_massactions.inc.php 2019-01-08 16:47:30 +01:00
TuxGasy
2c2f86736a Fix #10301 mass bill orders and replicate extrafields 2019-01-08 15:59:20 +01:00
Laurent Destailleur
1ee0d42408 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-08 14:08:22 +01:00
Laurent Destailleur
6ca163c68b Merge pull request #10311 from ATM-Marc/FIX_7.0_hook_action_list
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
2019-01-08 14:06:24 +01:00
Laurent Destailleur
9a6c3ac3df FIX Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER 2019-01-08 14:05:07 +01:00
Marc de Lima Lucio
68802c659e FIX: action list: add printFieldListSelect and printFieldListWhere hooks 2019-01-08 11:41:58 +01:00
Laurent Destailleur
9d8b084115 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	ChangeLog
	htdocs/core/actions_sendmails.inc.php
	htdocs/filefunc.inc.php
2019-01-08 01:48:54 +01:00
Laurent Destailleur
8e3df45cbf Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/holiday/define_holiday.php
2019-01-08 01:46:03 +01:00
Laurent Destailleur
f85389ac29 Fix missing td column 2019-01-08 01:11:34 +01:00
Laurent Destailleur
41743056bf Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-08 01:09:21 +01:00
Laurent Destailleur
087a4400b0 FIX Default value on sales representative on third party creation 2019-01-08 01:05:42 +01:00
Laurent Destailleur
3d578cab28 Merge pull request #10308 from EuskalMoneta/7.0
FIX Civility not saved when creating a member.
2019-01-07 14:10:00 +01:00
Xebax
fbb1b344d1 Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-01-06 13:44:13 +01:00
Xebax
2c496d2ac0 FIX Civility not saved when creating a member. 2019-01-06 13:42:41 +01:00
Juanjo Menent
e8424ebec3 Merge pull request #10304 from simnandez/7.0
Change to 7.0.6
2019-01-05 14:47:24 +01:00
Juanjo Menent
74442911a7 Change to 7.0.6 2019-01-05 14:45:23 +01:00
Juanjo Menent
709d173669 Merge pull request #10303 from simnandez/7.0
Fix #8152 and prepare 7.0.5
2019-01-05 14:00:02 +01:00
Juanjo Menent
96967100ba Prepare 7.0.5 2019-01-05 13:35:32 +01:00
Juanjo Menent
7908550937 Merge remote-tracking branch 'upstream/7.0' into 7.0 2019-01-05 13:05:50 +01:00
Juanjo Menent
61fbfaf356 Merge pull request #10298 from fmarcet/7.0
FIX: Can't generate invoice pdf
2019-01-05 13:02:58 +01:00
Ferran Marcet
f3dd875fc7 FIX: Can't generate invoice pdf 2019-01-04 12:00:39 +01:00
Ferran Marcet
4694af0488 FIX: Can't generate invoice pdf 2019-01-04 11:45:02 +01:00
Ferran Marcet
3e358c90b3 Merge branch '7.0up' into 7.0 2019-01-04 11:32:19 +01:00
Ferran Marcet
15cc45b8ae FIX: Can't generate invoice pdf 2019-01-04 10:52:10 +01:00
Laurent Destailleur
66b2a82be6 Merge pull request #10292 from atm-gauthier/6.0_fix_holidays
FIX : holidays get natural_search if search params are set only
2019-01-02 20:04:39 +01:00
Laurent Destailleur
1202bb3173 Merge pull request #10274 from fmarcet/8.0
FIX: Loan impossible to account
2019-01-02 19:50:46 +01:00
Laurent Destailleur
a39336c80d Simple join is better than RIGHT JOIN 2019-01-02 19:50:23 +01:00
ldestailleur
d8d47763aa Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-02 19:39:42 +01:00
ldestailleur
3d8479291d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2019-01-02 19:39:35 +01:00
Laurent Destailleur
bab501a1aa Merge pull request #10294 from frederic34/patch-2
Update societe.class.php
2019-01-02 19:35:10 +01:00
ldestailleur
8645a7f524 FIX Interface regression for bind people. Fix option
MAIN_OPTIMIZEFORTEXTBROWSER
2019-01-02 18:58:45 +01:00
Frédéric FRANCE
cad95c7dc2 Update societe.class.php 2019-01-02 15:39:22 +01:00
gauthier
fc3da0f5be FIX : holidays get natural_search if search params are set only 2019-01-02 10:02:30 +01:00
Juanjo Menent
cf64053fa5 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-29 15:07:09 +01:00
Ferran Marcet
dc93cccbe1 FIX: Loan impossible to account 2018-12-28 12:57:04 +01:00
Laurent Destailleur
63beb50465 Fix missing migration of external site module 2018-12-26 21:22:12 +01:00
Laurent Destailleur
730f5d1ad4 Prepare 8.0.4 2018-12-23 14:05:37 +01:00
Laurent Destailleur
94ee18a20a Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-22 19:00:15 +01:00
Laurent Destailleur
8d39edf430 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/html.form.class.php
	htdocs/product/price.php
2018-12-22 18:59:49 +01:00
Laurent Destailleur
0646d4ab7a Merge pull request #10262 from hregis/8.0_mc
FIX check if "entity" is already defined in "$param"
2018-12-22 18:25:00 +01:00
Laurent Destailleur
b76c45e8d0 Merge pull request #10264 from hregis/7.0_price
FIX avoid Class 'AdherentType' not found
2018-12-22 18:16:40 +01:00
Laurent Destailleur
f8b0e535fa Code comment 2018-12-22 17:30:22 +01:00
Laurent Destailleur
2b088a73c1 FIX CVE-2018-19998 2018-12-22 17:16:08 +01:00
Laurent Destailleur
74e75a7e2b Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-22 17:12:48 +01:00
Laurent Destailleur
bacd5110fb FIX CVE-2018-19995 and CVE-2018-19998 2018-12-22 17:12:38 +01:00
Laurent Destailleur
4b8be6ed64 FIX CVE-2018-19995 2018-12-22 17:08:55 +01:00
Laurent Destailleur
850b939ffd FIX CVE-2018-19994 2018-12-22 17:03:50 +01:00
Laurent Destailleur
fc3fcc5455 FIX CVE-2018-19993 2018-12-22 16:59:30 +01:00
Laurent Destailleur
0f06e39d23 FIX CVE-2018-19992 2018-12-22 16:55:31 +01:00
Regis Houssin
09ce84ca93 FIX avoid Class 'AdherentType' not found 2018-12-21 16:38:02 +01:00
Regis Houssin
9b215e117a FIX check if "entity" is already defined in "$param" 2018-12-21 11:23:44 +01:00
Laurent Destailleur
ed13f7b729 Merge pull request #10252 from ATM-Nicolas/fix_call_to_update_price
FIX : Function updatePrice with wrong parameters
2018-12-19 13:02:00 +01:00
Laurent Destailleur
2978522006 Merge pull request #10251 from ATM-Marc/FIX_7.0_contact_change
FIX: contact/address tab issue when changing company
2018-12-19 12:59:32 +01:00
Laurent Destailleur
707af49025 FIX Missing last month on vat report per month 2018-12-19 12:07:26 +01:00
Laurent Destailleur
4b7f373802 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-18 21:37:34 +01:00
Laurent Destailleur
fb8c3f01a4 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/modules/project/doc/pdf_baleine.modules.php
	htdocs/core/modules/project/doc/pdf_beluga.modules.php
2018-12-18 21:35:30 +01:00
Laurent Destailleur
4b6ae9d424 FIX Error reported when creation of thirdparty from member fails
Conflicts:
	htdocs/adherents/subscription.php
	htdocs/core/class/commonobject.class.php
2018-12-18 21:32:41 +01:00
Laurent Destailleur
b8429c607e FIX Can't create a thirdparty from member if customer code is mandatory. 2018-12-18 21:29:53 +01:00
Laurent Destailleur
6851232314 Fix removing constant no more required 2018-12-18 21:29:36 +01:00
Laurent Destailleur
f2318716ec FIX Error reported when creation of thirdparty from member fails 2018-12-18 21:27:16 +01:00
Laurent Destailleur
31d032d5d3 FIX Can't create a thirdparty from member if customer code is mandatory. 2018-12-18 21:00:06 +01:00
Laurent Destailleur
2e6a41228f Fix removing constant no more required 2018-12-18 20:49:48 +01:00
ATM-Nicolas
96144e18f1 FIX : Function updatePrice with wrong parameters 2018-12-18 15:27:32 +01:00
Marc de Lima Lucio
7e2eca661b FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account 2018-12-18 09:40:58 +01:00
Laurent Destailleur
051853fc00 Merge pull request #10246 from atm-ph/fix_7.0_user_attached_files
Fix attached files from user mail form don't work
2018-12-17 21:11:43 +01:00
atm-ph
1aadcc50f1 Fix attached files from user mail form don't work 2018-12-17 15:48:27 +01:00
Laurent Destailleur
af4405c669 FIX Replenishment with option STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE 2018-12-16 20:29:08 +01:00
Laurent Destailleur
d8b5cd4bdf Remove white lines 2018-12-16 19:31:59 +01:00
Laurent Destailleur
efb88292dd Clean code 2018-12-16 19:30:54 +01:00
Laurent Destailleur
003c463ee4 FIX Can't delete a line of minimal stock per warehouse 2018-12-16 19:23:53 +01:00
Laurent Destailleur
20d24f2feb Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-16 18:45:30 +01:00
Laurent Destailleur
2d05b7c790 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-16 18:45:13 +01:00
Laurent Destailleur
9b844df315 FIX Extrafields on shipment module 2018-12-16 18:44:58 +01:00
Laurent Destailleur
6275355cd5 Merge pull request #10234 from aspangaro/7.0_alert_bank
Fix: Accountancy - remove alert on bank account configuration when bank account is closed
2018-12-16 17:41:23 +01:00
Laurent Destailleur
9558020ea3 Merge pull request #10233 from simnandez/8.0
FIX: Vendor translations are in english
2018-12-16 17:40:37 +01:00
Laurent Destailleur
cca3b4870a FIX CVE-2018-19799 2018-12-16 13:36:51 +01:00
Juanjo Menent
a61677dcc6 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-16 11:31:06 +01:00
Juanjo Menent
6ce0d3e279 FIX: Vendor translations are in english 2018-12-16 11:16:12 +01:00
Alexandre SPANGARO
6eb9013430 Fix: Accountancy - remove alert on bank account configuration when bank account is closed 2018-12-16 06:36:55 +01:00
Norbert Penel
0f3a063c91 Events are not linked to products
when created from a product card, the events are not linked to the product
2018-12-15 15:57:15 +01:00
Laurent Destailleur
72b44a9a32 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-15 14:05:48 +01:00
Laurent Destailleur
e069da69ba Revert "Fix screen size fall"
This reverts commit abb6b41f91.
2018-12-15 12:35:37 +01:00
Laurent Destailleur
dbe5d285e8 Merge pull request #9965 from atm-john/fix_responsive
FIX screen size fall
2018-12-15 12:33:35 +01:00
Laurent Destailleur
8e08ea5c14 Merge pull request #10143 from atm-florian/8.0_fix9964
8.0 fix #9964
2018-12-14 19:40:53 +01:00
Laurent Destailleur
063e589a1b Merge branch '8.0' into 8.0_fix9964 2018-12-14 19:37:40 +01:00
Laurent Destailleur
45115a9590 Merge pull request #10191 from fappels/7.0_fix_issue#10186
Fix issue #10186 no display of stock per batch series.
2018-12-14 19:34:11 +01:00
Laurent Destailleur
ea35e45f76 Merge pull request #10197 from atm-maxime/fix_import_bank
Fix unexistant fields
2018-12-14 17:40:45 +01:00
PMickael
37daface19 [Accounting][VAT] Fix balance should be based on period
[Accounting][VAT] Fix balance should be based on period
2018-12-14 17:23:45 +01:00
Laurent Destailleur
539e2c55cd FIX #9629 #9625 2018-12-14 10:33:07 +01:00
Laurent Destailleur
735d04bd2a Merge 2018-12-13 20:48:07 +01:00
Laurent Destailleur
dcb43214d6 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-12-13 20:46:05 +01:00
Laurent Destailleur
7a3ab13196 FIX #10183 using backport of fix done in 9.0 2018-12-13 20:45:51 +01:00
Laurent Destailleur
603656c7de Merge pull request #10219 from simnandez/8.0
FIX: #10218 Bad redirection after deleting a user or group
2018-12-13 20:02:53 +01:00
Laurent Destailleur
4413b2e886 Merge pull request #10215 from atm-quentin/8.0_FIX_if_qty_is_0
FIX if qty is 0
2018-12-13 19:56:38 +01:00
Laurent Destailleur
6ad106d14a Update fournisseur.facture.class.php 2018-12-13 19:56:22 +01:00
florian HENRY
2e57a8be51 better fix 2018-12-13 12:37:40 +01:00
florian HENRY
56923caeec Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8.0_fix9964 2018-12-13 12:34:39 +01:00
Juanjo Menent
22c34bd656 Fix: MenuBankCash Translation is in english in es_ES 2018-12-12 12:09:07 +01:00
Juanjo Menent
d1eed14488 FIX: #10218 Bad redirection after deleting a user or group 2018-12-11 13:25:33 +01:00
Laurent Destailleur
4a61c1b6ed FIX lang not loaded 2018-12-11 13:25:09 +01:00
atm-quentin
3da9650003 FIX if qty is 0 2018-12-10 16:06:11 +01:00
Laurent Destailleur
42d4cf9992 Fix sql 2018-12-10 10:17:54 +01:00
Laurent Destailleur
ff8f235b7e Fix regression when disabling table 2018-12-10 00:15:22 +01:00
Laurent Destailleur
930312b425 FIX Migration do not create not used table 2018-12-08 11:51:46 +01:00
Laurent Destailleur
9ed34e2b35 FIX Can relaunch install on v8 2018-12-08 11:51:01 +01:00
Laurent Destailleur
eaa7fe5d14 Removed deprecated code 2018-12-08 11:41:55 +01:00
Laurent Destailleur
d2f0c87d8f FIX Removed not use table 2018-12-08 11:41:08 +01:00
Maxime Kohlhaas
550df138a6 Fix unexistant fields 2018-12-07 12:19:50 +01:00
Juanjo Menent
531cfe791d Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-07 11:34:42 +01:00
fappels
e2727f6d91 Fix issue #10186 no display of stock per batch series. 2018-12-06 21:43:10 +01:00
Laurent Destailleur
5ce26bae1b Fix form of bank info for CH 2018-12-04 22:01:35 +01:00
Laurent Destailleur
f142238817 Fix missing field canvas 2018-12-04 21:25:59 +01:00
Laurent Destailleur
8e333c3feb Standardize code 2018-12-04 14:54:58 +01:00
Laurent Destailleur
d80baaea69 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/comm/propal/class/propal.class.php
	htdocs/commande/class/commande.class.php
	htdocs/contrat/class/contrat.class.php
	htdocs/expensereport/class/expensereport.class.php
	htdocs/fourn/class/fournisseur.commande.class.php
	htdocs/fourn/class/fournisseur.facture.class.php
2018-12-04 14:29:47 +01:00
Laurent Destailleur
779d33cf02 Merge pull request #10085 from fmarcet/7.0
FIX Lines are not inserted correctly if VAT have code
2018-12-04 13:55:57 +01:00
Laurent Destailleur
b67ed87103 Merge pull request #10166 from atm-maxime/fix_pdf_footer
Fix pdf footer height for all documents
2018-12-04 13:35:11 +01:00
Laurent Destailleur
6d57c1b5f9 Merge pull request #10165 from atm-maxime/fix_user_noperm
Fix #6610
2018-12-04 13:34:11 +01:00
Laurent Destailleur
5061a9b0c2 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/install/mysql/tables/llx_paiementfourn.sql
2018-12-04 13:17:25 +01:00
Laurent Destailleur
347384734d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/install/mysql/tables/llx_paiementfourn.sql
2018-12-04 13:15:32 +01:00
Ferran Marcet
602986ced8 Merge remote-tracking branch 'origin/7.0' into 7.0
# Conflicts:
#	htdocs/comm/propal/class/propal.class.php
#	htdocs/commande/class/commande.class.php
#	htdocs/expensereport/class/expensereport.class.php
#	htdocs/fourn/class/fournisseur.commande.class.php
2018-12-03 12:33:18 +01:00
Ferran Marcet
7247b14bd9 FIX Lines are not inserted correctly if VAT have code 2018-12-03 12:28:17 +01:00
Ferran Marcet
135a94dfed Merge branch '7.0up' into 7.0 2018-12-03 11:59:46 +01:00
Ferran Marcet
8312d57d16 FIX Lines are not inserted correctly if VAT have code 2018-12-03 11:58:39 +01:00
Maxime Kohlhaas
8fea6338e1 Fix #6565
Fix pdf footer height for all documents
2018-12-02 18:51:49 +01:00
Maxime Kohlhaas
42c97cf7d5 Fix #6610 2018-12-02 17:59:11 +01:00
Laurent Destailleur
07425e4e19 Merge pull request #10156 from grandoc/7.0_bug
FIX #3234
2018-12-02 17:06:06 +01:00
Juanjo Menent
4b785b22f6 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-12-02 15:53:14 +01:00
Philippe GRAND
8ec2bac36a FIX #3234 2018-12-02 10:02:05 +01:00
Laurent Destailleur
0668f90e14 Merge pull request #10146 from atm-maxime/fix_ecm_expensereport
Fix expense report in ecm auto dir
2018-12-01 23:02:09 +01:00
Maxime Kohlhaas
5e2f3a53c9 Fix expense report in ecm auto dir 2018-12-01 19:39:00 +01:00
Laurent Destailleur
cb9ada2119 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/html.form.class.php
	htdocs/core/class/html.formmail.class.php
	htdocs/core/modules/modSociete.class.php
	htdocs/product/price.php
2018-12-01 18:19:45 +01:00
Laurent Destailleur
a49a083629 Merge pull request #10142 from atm-maxime/fix_import_fk_dept
Fix add missing fk_department and fk_pays in contact/bank imports
2018-12-01 17:14:27 +01:00
Laurent Destailleur
e30bee50a2 Merge pull request #10139 from atm-john/fix_#8741
FIX #8741
2018-12-01 17:12:55 +01:00
Maxime Kohlhaas
13806124b2 Fix add missing fk_department and fk_pays in contact/bank imports 2018-12-01 17:11:04 +01:00
ATM John BOTELLA
474228cbd6 FIX #8741 2018-12-01 17:01:11 +01:00
Laurent Destailleur
b41e0a40e7 Merge pull request #10138 from inoveaconseil/patch-4
FIX #6580
2018-12-01 16:56:31 +01:00
Juanjo Menent
642a86ba25 Fix #8152 2018-12-01 16:55:45 +01:00
florian HENRY
6236f727c9 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8.0_fix9964 2018-12-01 16:51:51 +01:00
florian HENRY
c422904b99 fix #9964 2018-12-01 16:51:40 +01:00
Inovea Conseil
18281d9d43 FIX #6580
FIX #6580
2018-12-01 16:48:50 +01:00
Laurent Destailleur
e4bc9f8f87 Merge pull request #10136 from grandoc/8.0
fix :#9967
2018-12-01 16:45:37 +01:00
Maxime Kohlhaas
748dd12e4d Merge pull request #9056 from ATM-Nicolas/fix_default_preselected_mail_model
FIX : Select first mail model by default
2018-12-01 16:39:22 +01:00
Laurent Destailleur
3d09b05338 Merge pull request #10135 from atm-florian/8.0_fix9999
fix #9999
2018-12-01 16:31:02 +01:00
Philippe GRAND
bbf3b3baac fix :#9967 2018-12-01 16:27:14 +01:00
florian HENRY
c320dcd161 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8.0_fix9999 2018-12-01 16:24:20 +01:00
florian HENRY
589511f38c fix #9999 2018-12-01 16:23:40 +01:00
Laurent Destailleur
3ea69cb1f1 Merge pull request #10130 from inoveaconseil/patch-3
Fix #9572
2018-12-01 16:22:38 +01:00
Laurent Destailleur
508cb459eb Merge pull request #10134 from frederic34/patch-18
devcamp 2018 fix #9642
2018-12-01 16:21:30 +01:00
Frédéric FRANCE
61322b9ce2 devcamp 2018 fix #9642 2018-12-01 16:19:54 +01:00
Inovea Conseil
0ba5fda3da Update price.php 2018-12-01 16:11:49 +01:00
Laurent Destailleur
3b4ee295f3 Merge pull request #10129 from simnandez/8.0
Fix #9929
2018-12-01 15:58:38 +01:00
Inovea Conseil
8964ec7ea1 Fix #9572
Fix #9572
2018-12-01 15:58:37 +01:00
Juanjo Menent
7d4553179d Fix #9929 2018-12-01 15:48:46 +01:00
Laurent Destailleur
03a67cee99 Merge pull request #10113 from frederic34/patch-9
llx_paiementfourn.sql #8723
2018-12-01 14:54:57 +01:00
Laurent Destailleur
305ab85f5d Merge pull request #10114 from frederic34/patch-17
Update 6.0.0-7.0.0.sql #8723
2018-12-01 14:54:31 +01:00
Laurent Destailleur
60610ca49d Merge pull request #10119 from simnandez/8.0
Fix #10097
2018-12-01 14:48:39 +01:00
Juanjo Menent
6104d16b08 Merge pull request #10117 from atm-maxime/fix_pdf_contract
Fix pdf strato for contract with multipage
2018-12-01 11:14:38 +01:00
Juanjo Menent
1c04c2b5f4 Fix #10097 2018-12-01 10:38:40 +01:00
Juanjo Menent
163f67d600 Merge pull request #10115 from atm-florian/8.0
fix #10006
2018-12-01 08:57:23 +01:00
Maxime Kohlhaas
2b5bf0e2dd Fix pdf strato for contract with multipage 2018-12-01 01:07:15 +01:00
florian HENRY
cddb6e0c47 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8.0 2018-12-01 00:40:12 +01:00
florian HENRY
38059ed60d fix #10006 2018-12-01 00:39:37 +01:00
Frédéric FRANCE
335327827d Update 6.0.0-7.0.0.sql 2018-12-01 00:34:17 +01:00
Frédéric FRANCE
0270da7d8c Update 5.0.0-6.0.0.sql 2018-12-01 00:28:58 +01:00
Frédéric FRANCE
6ab12b5911 Update llx_paiementfourn.sql 2018-12-01 00:26:51 +01:00
Juanjo Menent
ace14434e9 Merge pull request #10111 from atm-florian/8.0
fix #10069
2018-11-30 23:58:16 +01:00
Juanjo Menent
d1df592c7e Merge pull request #10110 from atm-maxime/fix_supp_pay_specimen
Fix #9074
2018-11-30 23:57:49 +01:00
Juanjo Menent
859d6c4401 Merge pull request #10109 from atm-maxime/fix_dupl_code
Fix #9070
2018-11-30 23:57:32 +01:00
Juanjo Menent
6d8f3aedc3 Merge pull request #10107 from atm-maxime/fix_import_extrafields
Fix extrafields in import tool
2018-11-30 23:56:57 +01:00
florian HENRY
7a182c7880 fix #10069 2018-11-30 23:25:44 +01:00
Maxime Kohlhaas
e8a02a971d Fix #9074 2018-11-30 23:05:12 +01:00
Maxime Kohlhaas
7585461486 Fix #9070 2018-11-30 22:16:17 +01:00
Maxime Kohlhaas
5dcb3d2a1f Fix extrafields in import tool 2018-11-30 19:23:05 +01:00
Laurent Destailleur
d8ab614efb Merge pull request #10088 from ATM-Marc/FIX_7.0_select_type_actions
FIX: form actions: select_type_actions could be too small + bad $db init
2018-11-29 11:16:57 +01:00
Laurent Destailleur
28902e18ee Fix for screen with antiblue system 2018-11-28 16:32:53 +01:00
ptibogxiv
21f4d474b4 Fix sql don.class.php 2018-11-28 16:11:10 +01:00
Laurent Destailleur
0373cad2cd FIX Method setValid not found 2018-11-28 16:11:00 +01:00
Marc de Lima Lucio
c13cc5d697 FIX: form actions: select_type_actions could be too small + bad init 2018-11-28 15:46:27 +01:00
Juanjo Menent
2f61d29b06 FIX: #10080 Supplier translations are in english 2018-11-28 10:40:45 +01:00
Ferran Marcet
9d6c95e8a9 Merge remote-tracking branch 'upstream/7.0' into 7.0 2018-11-27 11:39:07 +01:00
Ferran Marcet
d8537a3c76 FIX Lines are not inserted correctly if VAT have code 2018-11-27 11:36:31 +01:00
Laurent Destailleur
b5c136bc32 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-26 23:02:23 +01:00
Laurent Destailleur
653b99cb33 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-26 23:02:07 +01:00
Laurent Destailleur
ecb6ea9151 Merge pull request #10058 from frederic34/patch-2
correct link and avoid warning in resource list
2018-11-24 11:17:56 +01:00
Laurent Destailleur
fe4d8e36be Merge pull request #10072 from fappels/7.0_fix_expensereport_paid
Fix expensereport class fetch method
2018-11-24 11:06:47 +01:00
fappels
322ce410d7 Add missing paid field in fetch sql 2018-11-23 09:42:43 +01:00
Laurent Destailleur
1d4c756783 FIX Remote ip detection was wrong with proxy (example: cloudflare) 2018-11-22 11:44:37 +01:00
Laurent Destailleur
084516b885 Fix ip detection of geoip 2018-11-21 15:11:57 +01:00
Frédéric FRANCE
e8cac0df35 correct link and avoid warning in resource list 2018-11-21 14:06:06 +01:00
Laurent Destailleur
25ee999d27 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-19 20:05:32 +01:00
Laurent Destailleur
20dbbaf5cc Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-19 20:05:04 +01:00
Laurent Destailleur
fb6aa01207 FIX #10030 better german chart 2018-11-19 20:04:31 +01:00
Laurent Destailleur
8191df4857 Merge pull request #9962 from atm-john/fix_extrafield_view
FIX hidden extrafield
2018-11-19 18:37:18 +01:00
Laurent Destailleur
8535844737 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-19 18:27:00 +01:00
Laurent Destailleur
1931fd33eb Merge pull request #10041 from atm-ph/fix_8.0_optional_param
Fix new params has been added not optional
2018-11-19 18:26:21 +01:00
Laurent Destailleur
bd8856b988 Merge pull request #10033 from frederic34/patch-9
Update CMailFile.class.php
2018-11-19 18:20:20 +01:00
Laurent Destailleur
7a3f088fcb Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-19 18:19:11 +01:00
Laurent Destailleur
77bc1c4313 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
2018-11-19 18:18:43 +01:00
Laurent Destailleur
fcb9b693cf Merge pull request #10042 from atm-gauthier/6.0_fix_massaction_sendinvoicebymail
FIX : We want to be able to send PDF of paid invoices
2018-11-19 18:14:12 +01:00
Laurent Destailleur
1e50e0576b Merge pull request #10039 from atm-florian/7.0
fix list agenda extrafield visibility
2018-11-19 18:09:21 +01:00
Laurent Destailleur
4bedeabc5b FIX #10036 2018-11-19 18:02:29 +01:00
gauthier
ecdfa5219b FIX : We want to be able to send PDF of paid invoices 2018-11-19 17:31:45 +01:00
Laurent Destailleur
2d09008610 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-19 15:55:59 +01:00
Laurent Destailleur
f85ab8d0a6 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/comm/propal/card.php
2018-11-19 15:55:41 +01:00
atm-ph
129034ba76 Fix new params has been added not optional 2018-11-19 15:46:30 +01:00
florian HENRY
dc2f1e9812 fix list agenda extrafield visibility 2018-11-19 11:25:48 +01:00
Frédéric FRANCE
30b1db34cd Update CMailFile.class.php 2018-11-17 11:33:01 +01:00
Laurent Destailleur
f2bbb54b8f Merge pull request #10011 from atm-gauthier/7.0_fix_search_categ_product_on_supplierorderlist
FIX : filter on product category doesn't work
2018-11-15 16:44:40 +01:00
Laurent Destailleur
f3228dc4f8 Merge pull request #10010 from atm-john/Fix_cat_photo_upload
Fix event message on upload category picture fail
2018-11-15 16:43:59 +01:00
Laurent Destailleur
1b377c0c48 Merge pull request #10004 from atm-gauthier/7.0_fix_payment_modes
FIX : fourn payment modes musn't be available on customer docs
2018-11-15 16:28:26 +01:00
Laurent Destailleur
3ca45e0e40 Fix double dot in sql filename 2018-11-15 10:59:55 +01:00
gauthier
85dd0ec2dd FIX : filter on product category doesn't work 2018-11-13 15:24:53 +01:00
John BOTELLA
c6cf748ba7 Fix envent message on upload category picture 2018-11-13 14:44:10 +01:00
John BOTELLA
500bb7bc96 best conditions testing 2018-11-13 10:20:34 +01:00
gauthier
f404cae546 FIX : Same on customer card 2018-11-12 16:04:42 +01:00
gauthier
66ea8bbe87 FIX : fourn payment modes musn't be available on customer docs 2018-11-12 15:58:41 +01:00
Laurent Destailleur
7f79bb1ffb Merge pull request #10002 from tarrsalah/fix-sql-performance-on-create-supplier-invoice
FIX slow SQL query on creating a new supplier invoice
2018-11-12 12:54:05 +01:00
tarrsalah
5eb897e049 FIX sql query performance on list_qualified_avoir_supplier_invoices. 2018-11-12 12:11:40 +01:00
Laurent Destailleur
9447e66da1 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-10 15:51:04 +01:00
Laurent Destailleur
7f0ede0c39 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-10 15:50:48 +01:00
Laurent Destailleur
c492b3328b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-10 15:50:00 +01:00
Laurent Destailleur
edc59b9290 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-11-10 15:49:20 +01:00
Laurent Destailleur
24c499aa44 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-11-10 15:48:53 +01:00
Laurent Destailleur
8eac45a762 Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2018-11-10 15:48:07 +01:00
Laurent Destailleur
3d85407619 Merge branch '3.8' of git@github.com:Dolibarr/dolibarr.git into 3.9 2018-11-10 15:46:31 +01:00
Laurent Destailleur
ca1e3b4d55 Merge branch '3.7' of git@github.com:Dolibarr/dolibarr.git into 3.8 2018-11-10 15:15:33 +01:00
Laurent Destailleur
94bb1ac511 Merge branch '3.6' of git@github.com:Dolibarr/dolibarr.git into 3.7 2018-11-10 12:49:22 +01:00
Laurent Destailleur
5ec602cafa Merge pull request #9983 from hregis/8.0_bug
FIX missing field "visible"
2018-11-10 12:19:35 +01:00
Laurent Destailleur
a12c0d9b53 Merge pull request #9982 from hregis/8.0_pg
FIX missing action "edit" for the hook
2018-11-10 12:17:33 +01:00
Laurent Destailleur
8893d8d59f Fix compatiblity with new version of PHP 2018-11-10 11:56:23 +01:00
Regis Houssin
ee06f36f4c FIX missing field "visible" 2018-11-09 11:36:20 +01:00
Regis Houssin
5d1d77a966 FIX missing action "edit" for the hook 2018-11-09 10:32:08 +01:00
Laurent Destailleur
9bced281db Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-09 01:28:47 +01:00
Laurent Destailleur
d827601857 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-09 01:25:35 +01:00
Laurent Destailleur
aad0b700d4 Fix travis 2018-11-09 01:22:56 +01:00
Laurent Destailleur
f889c9994b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-11-09 01:21:13 +01:00
Laurent Destailleur
0d6709c9f7 Update phpcs config 2018-11-09 01:20:57 +01:00
Laurent Destailleur
8a89da25c6 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/margin/tabs/thirdpartyMargins.php
2018-11-08 20:18:13 +01:00
Laurent Destailleur
400b48bd9b Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-08 20:14:59 +01:00
Laurent Destailleur
9012f6ecc5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-08 20:14:40 +01:00
Laurent Destailleur
1b8649be6f Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-08 20:14:02 +01:00
Laurent Destailleur
d6bd325f70 Merge pull request #9980 from atm-john/fix_supplier_order_list_socid
FIX supplier order list keep socid
2018-11-08 20:13:52 +01:00
Laurent Destailleur
9a31a61c9d FIX #9971 2018-11-08 20:05:01 +01:00
Laurent Destailleur
f919e6ddb0 Merge pull request #9971 from atm-gauthier/FIX_langs_projet
FIX : OppStatusShort doesn't exists
2018-11-08 20:00:49 +01:00
Laurent Destailleur
76ac3bd457 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-08 19:57:42 +01:00
Laurent Destailleur
be788e6167 FIX responsive 2018-11-08 19:57:31 +01:00
Laurent Destailleur
e84e7f02c8 Merge pull request #9963 from atm-john/fix_marge_sign
FIX marge sign
2018-11-08 19:37:52 +01:00
Laurent Destailleur
01baddb096 Merge pull request #9959 from hregis/8.0_bug
FIX export only prices of the current entity !
2018-11-08 19:26:09 +01:00
Laurent Destailleur
d1aabf9566 Merge pull request #9976 from atm-john/fix_warning
FIX Warning: count()
2018-11-08 19:25:32 +01:00
Laurent Destailleur
78778e4c58 Merge pull request #9948 from frederic34/patch-9
FIX mode is only customer in stats fichinter
2018-11-08 19:16:00 +01:00
Laurent Destailleur
588de2cc86 Fix filter on entity on project 2018-11-08 18:45:02 +01:00
Laurent Destailleur
27dcf18637 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-08 18:43:31 +01:00
Laurent Destailleur
e92a63ba73 FIX If we change customer/supplier rule we can't edit old thirdparty. 2018-11-08 17:15:35 +01:00
John BOTELLA
98548337ae FIX supplier order list keep socid 2018-11-08 15:38:25 +01:00
Frédéric FRANCE
8bb1545ed0 Update index.php 2018-11-08 12:16:05 +01:00
Frédéric FRANCE
670eed1e68 Update index.php 2018-11-08 12:13:07 +01:00
John BOTELLA
7c4dad2728 FIX Warning: count() 2018-11-08 12:12:45 +01:00
Laurent Destailleur
c55f83b0b7 Fix multicompany filter missing 2018-11-08 11:25:29 +01:00
gauthier
70826c3191 FIX : same on lines 2018-11-07 16:32:23 +01:00
gauthier
05a679a10c FIX : OppStatusShort doesn't exists 2018-11-07 16:26:25 +01:00
John BOTELLA
abb6b41f91 Fix screen size fall 2018-11-07 11:25:13 +01:00
John BOTELLA
9d780a1722 Fix sign 2018-11-07 10:11:29 +01:00
John BOTELLA
4f7be36249 fix extrafield hidden 2018-11-07 09:14:29 +01:00
Regis Houssin
d32fd9fda5 FIX export only prices of the current entity ! 2018-11-06 18:08:29 +01:00
Laurent Destailleur
7e33af6677 Fix max size 2018-11-06 17:40:59 +01:00
Laurent Destailleur
52aa860008 Code comment 2018-11-06 09:39:22 +01:00
Laurent Destailleur
f0305a7beb Prepare 8.0.4 2018-11-05 13:50:12 +01:00
Laurent Destailleur
4c591daab1 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/html.formprojet.class.php
2018-11-05 10:39:22 +01:00
Laurent Destailleur
56a70ab4e5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-05 10:23:15 +01:00
Laurent Destailleur
693cf72fca Merge pull request #9920 from ATM-Marc/FIX_6.0_task_activity_access
FIX: task time screen: bad task assignments
2018-11-05 10:21:28 +01:00
Laurent Destailleur
2900947019 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-11-05 09:56:57 +01:00
Laurent Destailleur
e1e0001fda Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-11-05 09:56:00 +01:00
Laurent Destailleur
8b373fb7a3 Merge pull request #9935 from atm-maxime/fix_socdelete_unlink_parent
Fix parent link was not removed on societe deletion #9106
2018-11-05 09:35:41 +01:00
Laurent Destailleur
98a3af620b FIX #9934 2018-11-05 09:26:23 +01:00
Laurent Destailleur
02eaaaa53e Merge pull request #9934 from atm-maxime/fix_mandatory_tracking
Fix tracking field in dictionnary should not be mandatory #8919
2018-11-05 09:22:24 +01:00
Laurent Destailleur
d130e79384 Merge pull request #9936 from ptibogxiv/patch-84
Fix payout
2018-11-05 09:17:18 +01:00
Laurent Destailleur
63454c4e88 Merge pull request #9949 from frederic34/patch-15
typo
2018-11-05 09:16:55 +01:00
Frédéric FRANCE
488ac8c8f0 Update index.php 2018-11-03 23:44:25 +01:00
Frédéric FRANCE
c01113e28b typo 2018-11-03 22:49:30 +01:00
Frédéric FRANCE
d6b909a280 Update index.php 2018-11-03 18:26:11 +01:00
Frédéric FRANCE
8ab53012b7 mode is only customer in stats fichinter 2018-11-03 18:20:36 +01:00
ptibogxiv
263e8ed4af Fix payout 2018-11-01 20:45:08 +01:00
Maxime Kohlhaas
29c0448a2e Fix parent link was not removed on societe deletion #9106 2018-11-01 15:41:58 +01:00
Maxime Kohlhaas
d1133916e0 Fix tracking field in dictionnary should not be mandatory 2018-11-01 15:33:14 +01:00
Laurent Destailleur
1140735554 Fix css 2018-11-01 15:20:05 +01:00
Laurent Destailleur
5b83026fcd Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-31 15:41:52 +01:00
Laurent Destailleur
4b402aa6d1 Fix regression on name of array 2018-10-31 15:41:00 +01:00
Laurent Destailleur
be8e48b265 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
	htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
	htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
	htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
	htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
2018-10-31 15:38:29 +01:00
Laurent Destailleur
07719eaf1e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-31 15:31:44 +01:00
Laurent Destailleur
ca726e6c94 FIX Error generating ODT when option to use contact on doc on 2018-10-31 15:31:22 +01:00
Laurent Destailleur
6c4a2728ca Fix build 2018-10-31 12:33:08 +01:00
Laurent Destailleur
19134e82cb Prepare 8.0.3 2018-10-31 12:23:53 +01:00
Laurent Destailleur
693570c48b Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/modules/modSociete.class.php
2018-10-31 11:50:29 +01:00
Laurent Destailleur
c9ef298839 Fix setup template emails 2018-10-31 11:38:04 +01:00
Laurent Destailleur
ea5b0f53d0 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-30 22:32:54 +01:00
Laurent Destailleur
866729cd21 FIX bad link in notification 2018-10-30 22:32:42 +01:00
Laurent Destailleur
a183c7d131 Merge pull request #9926 from frederic34/patch-9
fix display holiday month report if none
2018-10-30 21:21:28 +01:00
Frédéric FRANCE
46fd3bcaf8 fix display holiday month report if none 2018-10-30 21:15:52 +01:00
Laurent Destailleur
064417dcf1 Merge pull request #9889 from atm-maxime/fix_invoice_from_contract2
Fix invoice creation from contract was invoicing closed services #9087
2018-10-30 21:13:38 +01:00
Marc de Lima Lucio
2fbc305683 FIX: task time screen: last fix was overkill 2018-10-30 16:00:56 +01:00
Laurent Destailleur
b9078c6d58 Fix phpcs 2018-10-30 15:30:04 +01:00
Laurent Destailleur
ecdecfcbce Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-30 15:28:23 +01:00
Laurent Destailleur
2b526f7469 Fix phpcs 2018-10-30 15:28:11 +01:00
Laurent Destailleur
68804cf8a5 Merge pull request #9890 from atm-maxime/fix_import_societe_alias
FIX missing name alias field in societe import/export #9091
2018-10-30 15:00:34 +01:00
Laurent Destailleur
4dca94480e Merge pull request #9892 from atm-maxime/fix_supp_inv_clone
Fix invoice supplier clone was not getting all lines parameters #9800
2018-10-30 14:59:48 +01:00
Laurent Destailleur
cb2a5baa45 Merge pull request #9919 from atm-john/Fix_clone_fourn_invoice
Fix clone fourn order and invoice lines special code
2018-10-30 14:55:50 +01:00
Laurent Destailleur
2c8b7a4a3d Merge pull request #9905 from atm-maxime/fix_currency_change
Fix changing currency in a doc was recalculating amounts in company currency #9801
2018-10-30 14:48:46 +01:00
Laurent Destailleur
afe61579e8 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-30 14:29:26 +01:00
Laurent Destailleur
b0ef8680ff Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-30 14:28:25 +01:00
Laurent Destailleur
a231932972 Merge pull request #9904 from atm-maxime/fix_replenish_qtymin
FIX replenish wasn't caring about supplier price min quantity #9561
2018-10-30 14:25:55 +01:00
Laurent Destailleur
38396e490a Merge pull request #9891 from frederic34/patch-17
Update brouillon when validate order
2018-10-30 14:17:29 +01:00
Laurent Destailleur
8ce035fc36 Merge pull request #9894 from librethic-code/patch-1
FIX: keep external module element when adding resource
2018-10-30 14:06:38 +01:00
Laurent Destailleur
0127682996 Merge pull request #9881 from grandoc/8.0
merging and typo
2018-10-30 12:41:56 +01:00
Laurent Destailleur
ca6d15a3eb Merge pull request #9820 from laudeco/hotfix/9640_member_email
FIX the member e-mail on resign and validation.
2018-10-30 12:41:34 +01:00
Laurent Destailleur
9bb1572e63 Update functions.lib.php 2018-10-30 12:41:06 +01:00
Laurent Destailleur
06bffeeca5 Merge pull request #9910 from atm-ph/fix_8.0_pgsql
Fix pgsql : operator does not exist: timestamp without time zone ~~ u…
2018-10-30 12:31:04 +01:00
Laurent Destailleur
a8e6c3832e Update list.php 2018-10-30 12:30:56 +01:00
Marc de Lima Lucio
8911d72be8 FIX: task time screen: prevent users with access to all project from assigning to tasks they're not allowed to do 2018-10-30 12:28:04 +01:00
Laurent Destailleur
7f1776c3a1 Merge pull request #9903 from atm-maxime/fix_loan_accounting
FIX default accounting accounts on loan creation #9643
2018-10-30 12:21:25 +01:00
John BOTELLA
1e819ca7c1 FIX special code on create supplier invoice from supplier order 2018-10-30 10:46:33 +01:00
John BOTELLA
ca47d1b8b1 Fix clone fourn order and invoice lines special code 2018-10-30 10:26:59 +01:00
Laurent Destailleur
8fbf5b1f33 FIX deletion on draft is allowed if we are allwoed to create 2018-10-29 18:28:19 +01:00
Laurent Destailleur
0266db7aa8 FIX deletion on draft is allowed if we are allwoed to create 2018-10-29 18:19:40 +01:00
Laurent Destailleur
d02fccd7e4 Fix deletion of draft invoice 2018-10-29 14:56:00 +01:00
Laurent Destailleur
824757bca6 Fix perm to delete 2018-10-29 14:47:33 +01:00
Laurent Destailleur
27d82d0e8e FIX Delete of draft invoice 2018-10-29 14:41:00 +01:00
Laurent Destailleur
85b8c9f219 FIX Delete of draft invoice 2018-10-29 14:35:42 +01:00
atm-ph
c83e67123d Fix pgsql : operator does not exist: timestamp without time zone ~~ unknown 2018-10-29 11:04:16 +01:00
Laurent Destailleur
04f80f0925 FIX Do not show check box if not applicable 2018-10-29 02:27:51 +01:00
Laurent Destailleur
553e984465 FIX Selection of addmaindocfile is lost on error 2018-10-29 02:14:41 +01:00
Laurent Destailleur
244c7f8dc3 FIX thirdparty property of object not loaded when only one record 2018-10-29 02:14:36 +01:00
Laurent Destailleur
6e3822345c Fix use setup of template for attached files in mass actions 2018-10-29 02:14:31 +01:00
Maxime Kohlhaas
b68b8fe412 Fix changing currency in a doc was recalculating amounts in company currency #9801 2018-10-28 11:02:51 +01:00
Maxime Kohlhaas
46d3bec104 Fix replenish wasn't caring about supplier price min quantity #9561 2018-10-28 10:25:56 +01:00
Maxime Kohlhaas
2fe4763570 Fix default accounting accounts on loan creation #9643 2018-10-28 09:22:55 +01:00
Librethic
fcd687642c FIX: keep external module element when adding resource
When adding object from external module as a resource we need to keep @modulename as defined into url rather than use `element` property (which do not contain @modulename).
2018-10-27 11:46:12 +02:00
Maxime Kohlhaas
4ec80b5136 Fix invoice supplier clone was not getting all lines parameters #9800 2018-10-27 10:53:01 +02:00
Frédéric FRANCE
a30091fd74 Update commande.class.php 2018-10-27 09:51:19 +02:00
Maxime Kohlhaas
abb343d37e Fix missing name alias field in societe import/export #9091 2018-10-27 09:42:08 +02:00
Maxime Kohlhaas
1b054f1b36 Fix invoice creation from contract was invoicing closed services #9087 2018-10-27 09:21:49 +02:00
Laurent Destailleur
d800fe9256 FIX extrafields of taks not visible in creation 2018-10-26 16:21:01 +02:00
De Coninck Laurent
d347cf3a85 set a message 2018-10-26 16:18:27 +02:00
Philippe GRAND
f450e04856 Merge remote-tracking branch 'upstream/8.0' into 8.0 2018-10-26 15:38:15 +02:00
Laurent Destailleur
7c81124e66 Merge pull request #9869 from ATM-Marc/FIX_6.0_typhon_order_ref
FIX: pdf typhon: order reference duplicate
2018-10-26 15:18:19 +02:00
Laurent Destailleur
ed0393dfa8 Merge pull request #9875 from atm-john/Fix_title
FIX title
2018-10-26 15:14:44 +02:00
Laurent Destailleur
35421d135a FIX Total of timespent
Conflicts:
	htdocs/core/js/timesheet.js
2018-10-26 15:04:02 +02:00
atm-john
8a9b9f1736 Fix title 2018-10-25 21:53:48 +02:00
Marc de Lima Lucio
16c35035c1 FIX: pdf typhon: order reference duplicate 2018-10-25 12:07:40 +02:00
Laurent Destailleur
f44162715e Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-24 13:31:04 +02:00
Laurent Destailleur
30a2004d53 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-24 13:30:54 +02:00
Laurent Destailleur
9972521456 Merge pull request #9861 from atm-john/FIX_unit_select_form
FIX translation in select unit form
2018-10-24 12:25:55 +02:00
Laurent Destailleur
7a14a1716d Merge pull request #9860 from atm-gauthier/7.0_fix_nb_occurrences_contrat
FIX : wrong occurence number of contract on contact card, we must only count externals
2018-10-24 12:24:57 +02:00
John BOTELLA
fccea99e23 FIX translation in select unit form 2018-10-24 10:23:27 +02:00
gauthier
036f70860e FIX : wrong occurence number of contract on contact card, we must only count externals 2018-10-24 10:17:21 +02:00
Laurent Destailleur
f0dc2df526 Fix code comment 2018-10-24 03:30:06 +02:00
Laurent Destailleur
f8316abfc0 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/compta/bank/class/account.class.php
	htdocs/theme/md/style.css.php
2018-10-24 02:58:29 +02:00
Laurent Destailleur
919c4fc5bc Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/theme/md/style.css.php
2018-10-24 02:40:57 +02:00
Laurent Destailleur
4060dd5377 Merge pull request #9826 from frederic34/patch-9
Update ajax.lib.php
2018-10-24 02:29:20 +02:00
Laurent Destailleur
52364f0fd9 Merge pull request #9834 from frederic34/patch-19
missing semicolon in MD style css
2018-10-24 02:29:02 +02:00
Laurent Destailleur
2ba6f96765 Update style.css.php 2018-10-24 02:27:59 +02:00
Laurent Destailleur
6c3e1f6d26 Merge pull request #9842 from fappels/8.0
Deprecate class property expeditionbatch before removing it.
2018-10-24 02:25:02 +02:00
Laurent Destailleur
e39e57c5b9 Update expeditionbatch.class.php 2018-10-24 02:24:47 +02:00
Laurent Destailleur
ddd267f4c3 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-24 02:21:53 +02:00
Laurent Destailleur
acaaf53085 Merge pull request #9843 from ATM-Nicolas/fix_variable
FIX : Variable name
2018-10-24 02:07:11 +02:00
Laurent Destailleur
c8aa884462 Fix search all 2018-10-23 17:16:46 +02:00
Laurent Destailleur
b7d91c30d9 FIX missing symbol for indian rupies 2018-10-23 12:38:12 +02:00
Laurent Destailleur
7bb5e7c31f Fix responsive 2018-10-23 11:52:21 +02:00
Laurent Destailleur
bf46a35a31 Fix size of key for extrafield of type select 2018-10-22 19:05:04 +02:00
ATM-Nicolas
cf28e4e442 FIX : Variable name 2018-10-22 15:19:33 +02:00
fappels
beb906b5f1 Deprecate class property before removing it. 2018-10-21 22:52:53 +02:00
fappels
749a1e6242 Merge remote-tracking branch 'refs/remotes/Dolibarr/8.0' into 8.0 2018-10-21 18:20:56 +02:00
Frédéric FRANCE
83e2951107 Update style.css.php 2018-10-21 09:59:14 +02:00
Frédéric FRANCE
28c86a613d Update style.css.php 2018-10-21 09:39:07 +02:00
Frédéric FRANCE
c4029f5e5f Update style.css.php 2018-10-21 09:23:33 +02:00
Frédéric FRANCE
f322c73dd7 Update ajax.lib.php 2018-10-19 22:52:18 +02:00
De Coninck Laurent
402bbbe839 fix the member e-mail on resign and validation.
Since the member module is only using the new configuration and the name of the global variabels changed you have a blocking e-mail error when you try to resign or validate a member. In order to fix that I fallback on the previous variable like that it's still working.

[see: #9640]
2018-10-19 17:23:53 +02:00
Laurent Destailleur
33cd0e84d2 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
2018-10-19 14:44:50 +02:00
Laurent Destailleur
57ad200ae5 Fix regression in creating discount 2018-10-19 14:43:10 +02:00
Laurent Destailleur
91745491ff Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-19 14:27:37 +02:00
Laurent Destailleur
5a1a5548df Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/actions_massactions.inc.php
	htdocs/core/class/discount.class.php
	htdocs/core/lib/payments.lib.php
	htdocs/product/index.php
	htdocs/product/list.php
	htdocs/societe/class/societe.class.php
2018-10-19 14:27:15 +02:00
Laurent Destailleur
47abbd3eb2 Fix bad merge 2018-10-19 14:23:36 +02:00
Laurent Destailleur
36ae81c749 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-19 14:17:20 +02:00
Laurent Destailleur
de4ead2558 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/accountancy/class/accountancycategory.class.php
	htdocs/core/actions_massactions.inc.php
	htdocs/product/reassort.php
2018-10-19 14:16:53 +02:00
Laurent Destailleur
6fde6e4250 Merge pull request #9787 from fmarcet/6.0
FIX: When delete a product, llx_product_association rows are not deleted
2018-10-19 14:06:50 +02:00
Laurent Destailleur
5e650bcc1f Merge pull request #9791 from atm-gauthier/7.0_fix_discount_with_multicurrency
FIX : use discount with multicurrency
2018-10-19 13:27:08 +02:00
gauthier
aea7299970 FIX : use discount with multicurrency 2018-10-17 15:49:08 +02:00
Ferran Marcet
ffde353441 FIX When delete a product, llx_product_association rows are not deleted 2018-10-17 10:06:06 +02:00
Ferran Marcet
bdae4e1c4d FIX When delete a product, llx_product_association rows are not deleted 2018-10-17 10:04:42 +02:00
Ferran Marcet
b462e7b217 FIX When delete a product, llx_product_association rows are not deleted 2018-10-17 10:01:02 +02:00
Laurent Destailleur
33031450a3 Merge pull request #9747 from atm-maxime/fix_status_tobatch
Fix missing status_batch var on product lists #9606
2018-10-16 20:02:56 +02:00
Laurent Destailleur
d56c237d4e Merge pull request #9756 from atm-maxime/fix_refused_proposal_in_total
Fix refused proposals were counted in totals in project overview
2018-10-16 19:46:19 +02:00
Laurent Destailleur
7cd8b36cea Merge pull request #9755 from atm-greg/fix_massaction_delete_tasks
FIX modify parenting before task deletion
2018-10-16 19:45:43 +02:00
Laurent Destailleur
330824748b Merge pull request #9750 from frederic34/patch-16
code comment
2018-10-16 19:37:32 +02:00
Laurent Destailleur
575038d3a3 Merge pull request #9769 from atm-ph/fix_7.0_list_duplicate_extrafield_value
Fix list from 'Contacts/Addresses' on company may show duplicate valu…
2018-10-16 19:36:37 +02:00
Laurent Destailleur
605a7896cf Merge pull request #9744 from atm-maxime/fix_numbering_supplier_credit_note
Fix numbering of supplier credit notes (issue #9624)
2018-10-16 19:17:47 +02:00
Laurent Destailleur
08fa0deb24 FIX Bad label on delete button 2018-10-16 18:41:50 +02:00
atm-ph
72dd182b1f Fix list from 'Contacts/Addresses' on company may show duplicate value for extrafields 2018-10-16 18:22:43 +02:00
Laurent Destailleur
70366e9d91 Missing translation 2018-10-16 03:31:33 +02:00
Laurent Destailleur
35f9371343 Fix missing es translation string 2018-10-16 03:30:17 +02:00
Maxime Kohlhaas
dfe239bf8d Fix refused proposals were counted in totals in project overview 2018-10-15 16:58:53 +02:00
atm-greg
06477b40a0 modify parenting before task deletion 2018-10-15 12:34:14 +02:00
Laurent Destailleur
2684767b19 Fix pagination
Conflicts:
	htdocs/accountancy/bookkeeping/balance.php
2018-10-15 11:08:40 +02:00
Laurent Destailleur
e29fb85cec Fix limit 2018-10-15 11:07:16 +02:00
Laurent Destailleur
aa6996e2d0 Fix pagination show two times the same account on balance of accounts 2018-10-15 11:07:07 +02:00
Laurent Destailleur
9afc53ca06 Fix remove step in accountancy if module expense report not used 2018-10-15 11:05:20 +02:00
Laurent Destailleur
47d98ab69d FIX content lost when editing a label with " 2018-10-15 11:05:04 +02:00
Frédéric FRANCE
4d6d3afbea code comment 2018-10-15 08:39:46 +02:00
Maxime Kohlhaas
af813f8214 Fix missing status_batch var on product lists #9606 2018-10-14 19:55:25 +02:00
Maxime Kohlhaas
c66823d72f Fix numbering of supplier credit notes (issue #9624) 2018-10-14 17:07:38 +02:00
Laurent Destailleur
aedc6fadf4 Merge pull request #9740 from frederic34/patch-14
reduce complexity of payments.lib.php
2018-10-14 16:27:31 +02:00
Laurent Destailleur
fabc11191d Merge pull request #9739 from frederic34/patch-11
fix size of $head when replacing by hook
2018-10-14 16:27:14 +02:00
Laurent Destailleur
f9a66a34d0 Merge pull request #9738 from frederic34/patch-9
fix doc in import.lib.php
2018-10-14 16:24:47 +02:00
Laurent Destailleur
995f54ca52 Merge pull request #9735 from atm-ph/fix_6.0_sort_product_stock_list
Fix 6.0 sort product stock list
2018-10-14 16:23:30 +02:00
Frédéric FRANCE
787658ac98 reduce complexity of payments.lib.php 2018-10-14 10:56:03 +02:00
Frédéric FRANCE
70a98743e8 Update functions.lib.php 2018-10-14 10:48:06 +02:00
Frédéric FRANCE
1f1a614b47 Update import.lib.php 2018-10-14 10:21:06 +02:00
Laurent Destailleur
e19453450d Fix closing tag 2018-10-13 19:57:34 +02:00
Laurent Destailleur
532e05c42e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
2018-10-13 14:29:51 +02:00
Laurent Destailleur
c15505bc13 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-13 14:27:50 +02:00
Laurent Destailleur
76e6968a21 Merge pull request #9730 from atm-ph/fix_7.0_extrafield_date_not_show
Fix extrafield contact typed as date isn't show in the list from 'con…
2018-10-13 12:03:07 +02:00
Laurent Destailleur
72381d3697 Merge pull request #9734 from frederic34/patch-9
remove var_dump
2018-10-13 12:01:27 +02:00
atm-ph
7b17b453bf Fix sort and switch page 2018-10-12 23:29:35 +02:00
atm-ph
23e4cd57f3 Fix warnings PHP7 2018-10-12 23:27:38 +02:00
Frédéric FRANCE
0f8ac57c85 remove var_dump 2018-10-12 22:34:23 +02:00
atm-ph
e2748953c3 Fix print extrafield date in list 2018-10-12 22:31:47 +02:00
Laurent Destailleur
87f744896d Merge pull request #9733 from ATM-Marc/FIX_6.0_propal_customcode
FIX: propal pdf: missing parenthesis for customs code
2018-10-12 21:14:40 +02:00
Laurent Destailleur
b78932b9f7 Prepare 7.0.5 2018-10-12 21:11:40 +02:00
Laurent Destailleur
d8edb1f6b8 Fix regression in online payment 2018-10-12 20:28:26 +02:00
Laurent Destailleur
83642ffa4d Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-12 20:19:51 +02:00
Laurent Destailleur
bd60fe6ffd Prepare 7.0.4 2018-10-12 19:13:11 +02:00
Laurent Destailleur
bb606df5e0 Prepare 7.0.4 2018-10-12 19:12:20 +02:00
Laurent Destailleur
067b29c9f8 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-12 19:09:45 +02:00
Laurent Destailleur
9f27dd41e5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
	htdocs/societe/class/societe.class.php
2018-10-12 19:08:06 +02:00
Laurent Destailleur
d4b02c0552 Release 6.0.8 2018-10-12 19:03:03 +02:00
Laurent Destailleur
2d2b9a030c Fix app name to match Stripe advice 2018-10-12 19:01:01 +02:00
Laurent Destailleur
60a5444c14 Fix app name to match Stripe advice 2018-10-12 18:50:33 +02:00
Marc de Lima Lucio
afd9b4ea1a FIX: propal pdf: missing parenthesis for customs code 2018-10-12 18:19:17 +02:00
Laurent Destailleur
fd46ae13d6 Merge pull request #9731 from atm-ph/fix_7.0_empty_column_physical_stock
Fix display 0 (as virtual stock) instead of empty string
2018-10-12 18:17:04 +02:00
Laurent Destailleur
a2aa491c51 Merge pull request #9728 from atm-john/8.0_Fix_count_error
Fix count on no countable object
2018-10-12 17:52:30 +02:00
Laurent Destailleur
1ab6cd4b59 Update card.php 2018-10-12 17:51:32 +02:00
Laurent Destailleur
8c843fdccd Merge pull request #9727 from atm-john/fix_situation_prev_percent
FIX situation prev percent
2018-10-12 17:49:24 +02:00
Laurent Destailleur
062d8a4bdb Merge pull request #9724 from Librethic/fix_position_email_template
FIX : position 0 for emails templates
2018-10-12 17:48:52 +02:00
Laurent Destailleur
2fdc1a9883 Merge pull request #9718 from frederic34/patch-9
define $code for all execution paths
2018-10-12 17:42:07 +02:00
Laurent Destailleur
817920f282 Prepare 6.0.8 2018-10-12 17:36:49 +02:00
atm-ph
79420593f4 Fix display 0 (as virtual stock) instead of empty string 2018-10-11 17:14:22 +02:00
atm-ph
4b32c8e100 Fix extrafield contact typed as date isn't show in the list from 'contact/address' tab of company 2018-10-11 14:24:55 +02:00
Laurent Destailleur
e6f179b6cb Fix look 2018-10-11 13:33:44 +02:00
Laurent Destailleur
88ff7241f5 FIX Quick hack to solve pb of bad definition of public holidays 2018-10-11 13:12:36 +02:00
Laurent Destailleur
e1e1599a6d FIX shared link ko on proposals 2018-10-11 11:59:14 +02:00
Laurent Destailleur
ced4038443 FIX qty not visible for a lot when making shipment on a dedicated stock 2018-10-11 11:56:52 +02:00
John BOTELLA
92686100b2 Fix count on no countable object 2018-10-11 10:51:54 +02:00
John BOTELLA
ee225a2b8b FIX situation prev percent 2018-10-11 10:14:22 +02:00
jfefe
8fc4e2066f FIX : position 0 for emails templates
Closes #9548 #8737 #9478
2018-10-10 18:18:02 +02:00
Laurent Destailleur
40f89d138f Fix height of confirm popup 2018-10-10 10:52:29 +02:00
Laurent Destailleur
d75828567c Fix amount last subscription 2018-10-10 01:44:56 +02:00
Laurent Destailleur
b1289632e0 CSS 2018-10-10 01:27:31 +02:00
Laurent Destailleur
b73a2a24ef FIX Tooltip on invoice widget 2018-10-10 01:16:53 +02:00
Laurent Destailleur
2539f0047f FIX Sending of reminder for expired subscriptions 2018-10-09 23:10:39 +02:00
Laurent Destailleur
df0ec95b22 Code comment and better error message 2018-10-09 21:21:10 +02:00
Frédéric FRANCE
c3f07dd2e0 define $code for all execution paths 2018-10-09 19:28:52 +02:00
Laurent Destailleur
01c32525df Merge 2018-10-09 17:06:08 +02:00
Laurent Destailleur
84605bc59b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-10-09 16:59:47 +02:00
Laurent Destailleur
dc498173c8 Code comment 2018-10-09 16:58:55 +02:00
Laurent Destailleur
430f833222 Merge pull request #9626 from OPEN-DSI/fix_product_margin
FIX Product margin tab and credit note
2018-10-09 16:57:08 +02:00
Laurent Destailleur
b1c9d5e4d3 Merge 2018-10-09 16:27:30 +02:00
Laurent Destailleur
b4b82ce3d6 Drop both contraint and index 2018-10-09 16:25:57 +02:00
Laurent Destailleur
5af4b82503 Merge pull request #9250 from bugness-chl/8.0
Revert "FIX missing drop old postgresql unique key"
2018-10-09 16:25:39 +02:00
Laurent Destailleur
bd8cf3d81e Merge pull request #9704 from atm-gauthier/7.0_fix_userlist
FIX : when we're just admin and not super admin, if we create new use…
2018-10-09 16:17:49 +02:00
Laurent Destailleur
387d9d685a Update auguria menu 2018-10-09 14:52:53 +02:00
Laurent Destailleur
dd0cbabc91 Fix translation 2018-10-09 14:44:13 +02:00
Laurent Destailleur
9bea9edfd7 FIX Menu to show/edit Users categories was missing 2018-10-09 14:41:21 +02:00
Laurent Destailleur
a2a53a32f1 FIX Look and feel v8. Missing button "Create category" 2018-10-09 14:34:25 +02:00
Abbes Bahfir
073914572c Fix: users categories type is Categorie::TYPE_USER 2018-10-09 14:24:41 +02:00
Laurent Destailleur
f365a987c4 FIX restore last seach criteria
FIX filter on employee
2018-10-09 14:20:53 +02:00
Abbes Bahfir
603c70ffc7 Fix: Searching on employee field disables employee mode 2018-10-09 14:10:04 +02:00
Laurent Destailleur
f3647c45e6 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-09 14:06:56 +02:00
Laurent Destailleur
4d959bbea7 Fix consistency of label of proposal status 2018-10-09 14:06:45 +02:00
Laurent Destailleur
6a1610cdef Merge pull request #9705 from ebzao/patch-1
fix bank ref override "bordereau cheque" ref
2018-10-09 12:44:18 +02:00
Laurent Destailleur
67e7736eb2 Merge pull request #9698 from Dolibarr/atm-maxime-patch-1
Fix request on project overview
2018-10-09 12:40:51 +02:00
Laurent Destailleur
923b561aff FIX Option for prof id mandatory not working with custom type of company 2018-10-08 20:01:45 +02:00
Laurent Destailleur
91038af84d FIX properties on proposal must not be modified if error 2018-10-08 18:15:46 +02:00
Laurent Destailleur
c930218dd2 FIX Missing transaction around action 2018-10-08 17:40:17 +02:00
Nicolas Aupetit
c26fe00362 fix bank ref override "bordereau cheque" ref 2018-10-09 02:15:38 +11:00
gauthier
021f9552dd FIX : when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup 2018-10-08 15:41:31 +02:00
Laurent Destailleur
0c7b7ed7f4 FIX Required extrafield value numeric should accept '0' 2018-10-08 14:26:18 +02:00
Laurent Destailleur
7be9b6d94e Fix translation of source of proposals 2018-10-08 14:04:22 +02:00
Laurent Destailleur
d776fc423e Fix search criterai of contract 2018-10-08 00:52:21 +02:00
Laurent Destailleur
d4b6429ccd Fix regression into backup feature 2018-10-07 21:45:20 +02:00
Maxime Kohlhaas
320ca3db67 Fix request on project overview
Fixes #9220
2018-10-06 22:53:28 +02:00
Laurent Destailleur
476aab9bae Same order than top menu 2018-10-06 21:00:26 +02:00
Laurent Destailleur
a7d26409c7 FIX trackid into email sent from member module. 2018-10-06 20:51:35 +02:00
Laurent Destailleur
fef40439be responsive 2018-10-06 20:05:41 +02:00
Laurent Destailleur
3e49935eac Fix online payment 2018-10-06 15:48:47 +02:00
Laurent Destailleur
e165dce908 Merge pull request #9689 from ATM-Marc/FIX_6.0_facture_stats_situation
FIX: invoice stats: situation invoices were not counted
2018-10-06 12:46:25 +02:00
Laurent Destailleur
36b75031f5 Merge pull request #9681 from ptibogxiv/patch-70
Fix metadata for charge.php
2018-10-06 12:44:16 +02:00
Laurent Destailleur
5045bbc3bd Update newpayment.php 2018-10-06 12:44:06 +02:00
Laurent Destailleur
835ca4e4a5 Update newpayment.php 2018-10-06 12:42:14 +02:00
Laurent Destailleur
a97dafc1f2 Merge pull request #9688 from atm-florian/7.0_fix9161
7.0 fix9161
2018-10-06 12:40:42 +02:00
Laurent Destailleur
4e84ed0e80 FIX Symbol of currency in substitution variables 2018-10-05 13:59:46 +02:00
Marc de Lima Lucio
82651cd920 FIX: invoice stats: situation invoices were not counted 2018-10-05 12:12:04 +02:00
florian HENRY
cba4676032 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_fix9161 2018-10-05 10:36:03 +02:00
florian HENRY
68c99d01a7 OMG!!!! var_dump.... 2018-10-05 10:35:32 +02:00
ptibogxiv
0e83863d45 Add save or not source functionnality 2018-10-04 20:32:49 +02:00
ptibogxiv
f5966e6303 Update newpayment.php 2018-10-04 19:29:52 +02:00
Laurent Destailleur
b20dc5678c Merge pull request #9684 from atm-ph/fix_7.0_wrong_modulepart_name
FIX wrong value for module part and return access denied
2018-10-04 19:06:53 +02:00
Laurent Destailleur
8592b03b49 Merge pull request #9682 from atm-ph/fix_7.0_missing_hook
Fix missing hook on sellsjournal
2018-10-04 19:06:02 +02:00
Laurent Destailleur
571bc86836 Update newpayment.php 2018-10-04 19:03:18 +02:00
Laurent Destailleur
17e4af50ec Merge pull request #9680 from ATM-Nicolas/fix_wrong_variable_name
FIX : Wrong variable name
2018-10-04 18:47:08 +02:00
Laurent Destailleur
ac86eac508 Merge pull request #9675 from atm-ph/fix_7.0_dom_error
Fix minor error in dom
2018-10-04 18:32:52 +02:00
Laurent Destailleur
9fe5f242a7 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-10-04 17:53:59 +02:00
Laurent Destailleur
13759ea146 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/commande/class/commande.class.php
	htdocs/compta/facture/class/facture.class.php
2018-10-04 17:53:40 +02:00
Laurent Destailleur
3060647212 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/pdf.lib.php
2018-10-04 17:50:19 +02:00
Laurent Destailleur
8690d65479 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/pdf.lib.php
2018-10-04 17:47:22 +02:00
Laurent Destailleur
75b9140446 Merge pull request #9672 from atm-florian/8.0
FIX ressource list with extrafields
2018-10-04 17:40:42 +02:00
Laurent Destailleur
577192554d Merge pull request #9670 from oas-services/7.0
Fix issue #9434 : no array_options available when calling api on order line and invoice line
2018-10-04 17:39:37 +02:00
Laurent Destailleur
9e397206d3 Merge pull request #9668 from atm-greg/Fix_pdf_generation
fix error 500 on pdf_generation
2018-10-04 17:27:29 +02:00
Laurent Destailleur
1dd276b046 Merge pull request #9666 from atm-gauthier/7.0_wrongfunction
FIX : wrong function name
2018-10-04 17:26:59 +02:00
Laurent Destailleur
301f7349e0 Merge pull request #9656 from fmarcet/8.0
FIX Can't create shipping if have shipping line's extrafields
2018-10-04 17:22:24 +02:00
atm-ph
bfaf25ca2a Fix wrong value for module part and return access denied 2018-10-04 16:55:16 +02:00
Laurent Destailleur
75c968b4ae FIX Backup of database without mysqladmin available from cron. 2018-10-04 13:10:48 +02:00
Laurent Destailleur
7a94f4fc00 Add more logs 2018-10-04 11:34:46 +02:00
ptibogxiv
762abf7060 Update newpayment.php 2018-10-04 10:59:06 +02:00
atm-ph
58d1ac427e Fix missing hook on sellsjournal 2018-10-04 10:57:22 +02:00
ptibogxiv
d36dda37e6 Fix metadata for charge.php
Fix for dol_id, dol_type
2018-10-04 10:56:29 +02:00
ATM-Nicolas
c048f51562 FIX : Wrong variable name 2018-10-04 09:54:40 +02:00
florian HENRY
e95921eb93 better test 2018-10-04 09:47:04 +02:00
florian HENRY
7f4f27ebfe indent 2018-10-04 09:45:12 +02:00
florian HENRY
292dab192b FIX : #9161 2018-10-04 09:42:11 +02:00
atm-ph
2acd69033c Fix minor error in dom 2018-10-03 22:48:29 +02:00
florian HENRY
b8c88a2144 rename var 2018-10-03 15:43:00 +02:00
florian HENRY
1b18781299 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr.git into 8.0 2018-10-03 15:41:10 +02:00
florian HENRY
ef7ed97866 fix ressource list with extrafields 2018-10-03 15:40:58 +02:00
aplose
8ee7a48583 Fix issue #9434 : no array_options available when calling api :
I replace the deprecated code by the fetch_optionnals() recommanded call.
2018-10-03 15:15:46 +02:00
atm-greg
583ea05567 fix missing letter... 2018-10-03 12:13:53 +02:00
gauthier
587766b39b FIX : wrong function name 2018-10-03 10:38:47 +02:00
Chl
b578913d2b FIX correct migration of old postgresql unique key 2018-10-02 23:18:47 +02:00
Laurent Destailleur
e83149a344 Fix deletion of credit card when no Oauth set 2018-10-02 22:35:51 +02:00
Ferran Marcet
d66b2322c2 FIX Can't create shipping if have shipping line's extrafields 2018-10-02 09:37:44 +02:00
gauthier
d6a9da57e1 FIX : need to round with 2 decimals to avoid movements not correctly balanced 2018-10-01 14:11:19 +02:00
Laurent Destailleur
75b1cac33f FIX Pagination stats 2018-10-01 01:15:19 +02:00
Alexandre SPANGARO
14627abb27 FIX Title problem on admin RSS module 2018-10-01 01:14:43 +02:00
Laurent Destailleur
c07ab81e6a Fix trans 2018-09-28 02:22:23 +02:00
Philippe
06fe172669 FIX Product marge tabs on product card
Credit note are not negative so the grand total are false
2018-09-27 20:06:00 +02:00
Philippe
8deb2eaa0c Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-09-27 19:00:09 +02:00
Laurent Destailleur
575c63f87d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/CMailFile.class.php
2018-09-27 12:52:10 +02:00
Laurent Destailleur
6e7fd15e1e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-27 12:48:08 +02:00
Laurent Destailleur
291d477f65 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/commonobject.class.php
2018-09-27 12:47:48 +02:00
Laurent Destailleur
7b86776f6b Introduce option MAIN_INCLUDE_ZERO_VAT_IN_REPORTS to solve a regression
on feature to report vat by rate when rate is zero
2018-09-27 12:42:52 +02:00
Laurent Destailleur
96c1814793 FIX XSS vulnerability reported by Mary Princy E 2018-09-27 11:33:28 +02:00
Laurent Destailleur
4c8664b297 Merge pull request #9619 from ATM-Marc/FIX_6.0_extrafield_columns
FIX: showOptionals: column mismatches
2018-09-27 09:39:51 +02:00
Carsten Brandt
fee46ac845 Update german accounting file to use rowid
- fix "TODO Fix this file to use rowid"
2018-09-27 09:39:00 +02:00
Laurent Destailleur
2d88b69cf6 Merge pull request #9616 from frederic34/patch-14
add try catch for swiftmailer
2018-09-27 09:34:21 +02:00
Laurent Destailleur
bc5b794b1a Merge pull request #9613 from frederic34/patch-11
FIX Option MAIN_DISABLE_NOTES_TAB #9611
2018-09-27 09:30:56 +02:00
Laurent Destailleur
ee8b5030a0 Merge pull request #9610 from atm-john/FIX_situation_credit_note
Fix situation credit note
2018-09-27 09:26:23 +02:00
Laurent Destailleur
e3b1cb9fdb Update facture.class.php 2018-09-27 09:25:37 +02:00
Laurent Destailleur
77341470e1 Merge pull request #9608 from frederic34/patch-10
comparaison of two boolean in rssparser.class.php
2018-09-27 09:23:24 +02:00
Laurent Destailleur
46363a7705 Merge pull request #9607 from atm-gauthier/7.0_fix_replenish_entity
FIX : need to filter on current entity on replenish
2018-09-27 09:22:44 +02:00
Laurent Destailleur
ff3f1e933a Update replenish.php 2018-09-27 09:22:38 +02:00
Laurent Destailleur
e72dc26532 Merge pull request #9603 from atm-john/Fix_situation_invoice_selection
FIX previous situation invoice selection
2018-09-27 09:20:24 +02:00
Laurent Destailleur
2b8ccc0c81 FIX Link template invoice to contract 2018-09-27 01:53:12 +02:00
Marc de Lima Lucio
af93fc7484 FIX: showOptionals: column mismatches 2018-09-26 17:19:06 +02:00
Frédéric FRANCE
1bac3a0ccf swiftmailer is doing encodetorfc2822 2018-09-26 10:37:20 +02:00
Frédéric FRANCE
92a3faeaf7 add try catch for swiftmailer 2018-09-26 10:13:14 +02:00
Frédéric FRANCE
a9f7bdead6 fix Option MAIN_DISABLE_NOTES_TAB #9611 2018-09-25 15:22:08 +02:00
Laurent Destailleur
e39e54503e Fix responsive 2018-09-25 12:54:24 +02:00
Laurent Destailleur
515acbfee2 FIX Bad position of hook formattachOptions call 2018-09-25 11:46:42 +02:00
John BOTELLA
022f842cb0 Fix display good progress for new situation invoices 2018-09-25 10:28:47 +02:00
John BOTELLA
791c373db5 FIX credit note progression 2018-09-25 09:54:58 +02:00
Frédéric FRANCE
d15c52db3b Update rssparser.class.php 2018-09-25 08:16:05 +02:00
Laurent Destailleur
df64961c6b FIX nb of session in title 2018-09-24 21:56:57 +02:00
gauthier
fc7c0ce521 FIX : need to filter on current entity on replenish 2018-09-24 16:23:44 +02:00
John BOTELLA
b1380a6902 FIX situation invoice total with credit note 2018-09-24 16:12:00 +02:00
Laurent Destailleur
26d585ffbe Use latest instead of last 2018-09-24 10:43:01 +02:00
Laurent Destailleur
57e359cd40 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/langs/en_US/admin.lang
	htdocs/langs/fr_FR/agenda.lang
2018-09-24 10:18:13 +02:00
John BOTELLA
ceccd5a510 Fix prev situation invoice selection 2018-09-24 10:16:28 +02:00
Laurent Destailleur
40bed96a01 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-24 10:15:20 +02:00
Laurent Destailleur
dbb75e35a1 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/facture/list.php
	htdocs/langs/en_US/admin.lang
	htdocs/langs/fr_FR/agenda.lang
2018-09-24 10:14:38 +02:00
Laurent Destailleur
2dbb82fc76 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-09-24 10:03:21 +02:00
Laurent Destailleur
12690666e2 Missing trans 2018-09-24 10:03:08 +02:00
Laurent Destailleur
969be3a2a7 Merge pull request #9595 from ptibogxiv/patch-66
FIX number mailing for a contact with multicompany
2018-09-23 15:45:06 +02:00
Laurent Destailleur
39e9029e41 Update contact.class.php 2018-09-23 15:44:44 +02:00
Laurent Destailleur
9ddc1770e8 Merge pull request #9501 from atm-gauthier/7.0_fix_tva_if_buyer_hors_cee_and_particulier
FIX : According to french law, if seller is in France and buyer isn't…
2018-09-23 15:41:33 +02:00
Laurent Destailleur
1569770855 Rename hidden conf into MAIN_USE_VAT_OF_PRODUCT_FOR_INDIVIDUAL_CUSTOMER_OUT_OF_EEC 2018-09-23 15:41:22 +02:00
ptibogxiv
77dd516023 fix number mailing for a contact / multicompany 2018-09-22 14:45:15 +02:00
gauthier
7b46bedce6 NEW : hidden configuration 2018-09-21 14:35:36 +02:00
Laurent Destailleur
7a422c9d24 Merge pull request #9578 from fmarcet/8.0
FIX #9432 Assign yourself as a commercial when you don't have permission to see all thirds
2018-09-21 11:30:38 +02:00
Ferran Marcet
d6d58b1f68 FIX #9432 2018-09-21 10:18:54 +02:00
Ferran Marcet
1a7b38f22a FIX #9432 2018-09-21 10:14:23 +02:00
Laurent Destailleur
a0bc26a923 Merge pull request #9476 from atm-maxime/fix_invoicelist_creditnote
Fix invoicelist creditnote
2018-09-21 09:56:43 +02:00
Laurent Destailleur
37dcb33661 phpunit for Loan 2018-09-20 23:41:04 +02:00
Laurent Destailleur
eb80c5c338 Fix translation not loaded and test on multicompany 2018-09-20 19:45:13 +02:00
Laurent Destailleur
4ba057528f Fix permissionss 2018-09-20 19:37:28 +02:00
Laurent Destailleur
b421c29ea7 FIX #9510 2018-09-20 19:20:15 +02:00
Laurent Destailleur
df395847d3 FIX #9567 2018-09-20 19:14:32 +02:00
Laurent Destailleur
c55ebecff7 Include PHP unit of Loan class into Travis 2018-09-20 19:06:12 +02:00
Laurent Destailleur
9fc08c45cf Merge pull request #9575 from atm-maxime/new_phpunit_loan
NEW PHPUnitTest on Loan class #3163
2018-09-20 19:00:26 +02:00
Ferran Marcet
4597cd44e5 FIX #9432 2018-09-20 17:52:44 +02:00
Laurent Destailleur
e0dfab4c71 FIX The max size for upload file was not corectly shown 2018-09-20 16:21:36 +02:00
Maxime Kohlhaas
75104999d3 NEW PHPUnitTest on Loan class #3163 2018-09-20 15:04:00 +02:00
Laurent Destailleur
55e3d97842 Trans 2018-09-19 17:56:51 +02:00
Laurent Destailleur
779d7e9689 Merge pull request #9568 from atm-gauthier/6.0_fix_langs_fr
FIX : langs fr
2018-09-19 15:04:18 +02:00
Laurent Destailleur
824b572bd0 FIX Amount when using mutlicurrency on PDF
Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0

Conflicts:
	htdocs/comm/propal/class/propal.class.php
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
	htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php
2018-09-19 15:03:24 +02:00
Laurent Destailleur
9b190d2cbc Merge pull request #9201 from atm-quentin/FIX_select_element
FIX exclude element of the select
2018-09-19 14:55:31 +02:00
gauthier
d62118dca8 FIX : langs fr 2018-09-19 14:53:56 +02:00
Laurent Destailleur
dc7c27b162 Release 8.0.2 2018-09-19 14:53:39 +02:00
Laurent Destailleur
02617bd799 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-19 14:53:07 +02:00
Laurent Destailleur
2b67da3f34 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
2018-09-19 14:52:43 +02:00
Laurent Destailleur
d6bd0ed73e Merge pull request #9566 from frederic34/patch-9
call to deprecated add_object_linked was present two times
2018-09-19 14:37:05 +02:00
Laurent Destailleur
a6996169d6 Merge pull request #9565 from frederic34/multicpdf
correct typo in multicurrency doc pdf #9562
2018-09-19 14:30:15 +02:00
Frédéric FRANCE
1d43c6bc3a call to deprecated add_object_linked was present two times 2018-09-19 10:57:59 +02:00
Frédéric FRANCE
cdbb79a26c correct typo in multicurrency doc pdf 2018-09-19 09:26:56 +02:00
Laurent Destailleur
85180b117c Fix warnings 2018-09-18 23:48:02 +02:00
Laurent Destailleur
c56b02c1c4 Fix warning 2018-09-18 23:47:55 +02:00
Laurent Destailleur
79b248fc67 FIX warning picto when next run date passed 2018-09-18 23:27:26 +02:00
Laurent Destailleur
014da6c22c Fix translation 2018-09-18 18:11:07 +02:00
Laurent Destailleur
58e82008ac Prepare 8.0.2 2018-09-18 16:45:08 +02:00
Laurent Destailleur
99d214abd5 Fix family of module Payment of employee salaries 2018-09-18 16:38:51 +02:00
Laurent Destailleur
4580ed0b09 Fix bad link 2018-09-18 15:31:25 +02:00
Laurent Destailleur
85bed00474 Fix default fields 2018-09-18 11:50:04 +02:00
Laurent Destailleur
2d8eb034e3 FIX Maxi debug to allow to load chart of account with multicompany 2018-09-17 21:02:07 +02:00
Laurent Destailleur
1e36aba35f Trans
Conflicts:
	htdocs/langs/en_US/admin.lang
2018-09-17 16:42:44 +02:00
Laurent Destailleur
3fc3cc4688 Fix missing email in popup 2018-09-17 14:17:10 +02:00
Laurent Destailleur
f3ce7cb5a5 Quick hack to provide help to fix pb of undesirable files 2018-09-17 10:40:42 +02:00
Laurent Destailleur
f3f18bf8cb Fix sql 2018-09-17 02:23:11 +02:00
Laurent Destailleur
055a0b2859 Merge branch '8.0' of github.com:Dolibarr/dolibarr into 8.0 2018-09-16 13:29:13 +02:00
Laurent Destailleur
79b15b81f2 Fix list of tasks on time consumed 2018-09-16 13:28:37 +02:00
Laurent Destailleur
cc4fbfc3ef Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/core/class/commonobject.class.php
2018-09-16 12:54:39 +02:00
Laurent Destailleur
9c4f582f5c Merge 2018-09-16 12:52:11 +02:00
Laurent Destailleur
d06785e91a Fix responsive 2018-09-16 12:48:36 +02:00
Laurent Destailleur
74a9c680df FIX "Other ..." link so the "Back to" link works. 2018-09-16 12:27:56 +02:00
Laurent Destailleur
4151ca49eb Fix position of menu 2018-09-16 12:15:33 +02:00
Laurent Destailleur
a0bcf999c5 FIX #9043 2018-09-16 09:45:33 +02:00
Laurent Destailleur
a6d4185d6b FIX #9043 2018-09-16 09:44:52 +02:00
Laurent Destailleur
55e7989552 FIX #9043 2018-09-16 09:42:30 +02:00
Laurent Destailleur
2c8064967b Code comment 2018-09-16 09:31:06 +02:00
Laurent Destailleur
272944983c Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-09-16 09:27:54 +02:00
Laurent Destailleur
34b75828d3 Work on fix for #9043 2018-09-16 09:27:36 +02:00
Laurent Destailleur
ecfbe0a568 Merge pull request #9499 from tarrsalah/fix-show-default-vat-rate
FIX #9497
2018-09-15 17:14:05 +02:00
Laurent Destailleur
56b0a5f1ed FIX Mixing tickets of different thirdparties 2018-09-14 13:07:27 +02:00
Laurent Destailleur
16ed582124 Add comment 2018-09-14 01:45:03 +02:00
Laurent Destailleur
5655856ca5 Merge pull request #9504 from atm-gauthier/6.0_fix_refsupplier
FIX : wrong var name
2018-09-13 17:55:04 +02:00
gauthier
7838b75ec9 FIX : wrong var name 2018-09-13 16:11:42 +02:00
gauthier
b68523b9c1 FIX : According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product 2018-09-13 14:37:12 +02:00
tarrsalah
08453a5337 FIX #9497
Extract $defaultcode and $defaulttxt from the value returned by
get_default_tva function .
2018-09-13 11:04:11 +01:00
Laurent Destailleur
c5e30b61c0 Fix translation 2018-09-12 21:25:14 +02:00
Laurent Destailleur
3dca02d25b Fix translation 2018-09-12 21:07:34 +02:00
Laurent Destailleur
b7eeaa952c Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-09-12 19:41:02 +02:00
Laurent Destailleur
72f359fdc7 Revert "add capture option in payment function"
This reverts commit 849b7154a7.
2018-09-12 19:40:43 +02:00
Laurent Destailleur
163bc55e4a Merge pull request #9468 from jmarsac/numericextrafields9464
Convert localized numeric extrafields value before inserting/updating
2018-09-12 19:06:43 +02:00
ias-ceo
fece67b629 use correct resultset 2018-09-12 19:00:19 +02:00
Laurent Destailleur
23096354e0 Merge pull request #9463 from ptibogxiv/patch-57
add capture option in payment function
2018-09-12 18:38:10 +02:00
Laurent Destailleur
58ba1c3496 Merge pull request #9451 from hregis/7.0_price
FIX better compatibility with multicompany
2018-09-12 18:27:50 +02:00
Laurent Destailleur
e3a00c5dcd Merge pull request #9450 from frederic34/patch-15
Update accountancycategory.class.php
2018-09-12 18:25:54 +02:00
Laurent Destailleur
a57e82a300 Merge pull request #9479 from atm-quentin/FIX_character_bill_list
FIX character making error on bill list
2018-09-12 18:22:07 +02:00
Laurent Destailleur
0bf42085db Merge pull request #9484 from Dolibarr/revert-9453-patch-56
Revert "V8 style"
2018-09-12 18:21:29 +02:00
Laurent Destailleur
88e76b6127 Revert "V8 style" 2018-09-12 18:19:12 +02:00
Laurent Destailleur
71e8d4c728 Merge pull request #9453 from ptibogxiv/patch-56
V8 style
2018-09-12 18:18:45 +02:00
Laurent Destailleur
1ad8a3e190 Merge pull request #9466 from ptibogxiv/patch-58
Fix status display in transaction.php
2018-09-12 18:14:46 +02:00
Laurent Destailleur
b341cb9245 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Conflicts:
	htdocs/compta/facture/list.php
	htdocs/core/tpl/objectline_view.tpl.php
2018-09-12 18:11:51 +02:00
Laurent Destailleur
a3968b86df Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-12 18:05:47 +02:00
Laurent Destailleur
3662ebe3a3 Fix syntax error 2018-09-12 18:05:20 +02:00
Laurent Destailleur
eb242d58f2 Merge pull request #9469 from atm-ph/fix_7.0_classname_colht
Fix classname liencolht to linecolht
2018-09-12 17:30:36 +02:00
Laurent Destailleur
77d7c97750 Fix typo 2018-09-12 17:18:27 +02:00
Laurent Destailleur
fd93a22dca Fix missing field 2018-09-12 16:45:12 +02:00
Laurent Destailleur
48ae4de47b FIX Add paypal error message in alert email 2018-09-12 16:11:10 +02:00
Laurent Destailleur
9cbba2dc7d Add log 2018-09-12 15:28:59 +02:00
Laurent Destailleur
50478b1bd4 FIX capital must be empty and not 0 if undefined 2018-09-12 15:21:11 +02:00
Laurent Destailleur
729d03862f Fix warning 2018-09-12 15:02:59 +02:00
atm-quentin
c42f39cc34 FIX character making error on list 2018-09-12 14:44:08 +02:00
Laurent Destailleur
5bd2c01411 Fix email missing in tooltip 2018-09-12 14:43:05 +02:00
Laurent Destailleur
902bdf540e Update ChangeLog 2018-09-12 13:45:04 +02:00
Laurent Destailleur
53da80a79f FIX Missing translation in predefined email to membership renewal 2018-09-12 12:55:10 +02:00
Maxime Kohlhaas
c94689e9a9 FIX remain to pay for credit note was wrong on invoice list 2018-09-12 11:53:57 +02:00
Laurent Destailleur
aad6a0871f FIX Lose filter on payment type or category after a sort on invoice list
Conflicts:
	htdocs/compta/facture/list.php
2018-09-12 10:59:53 +02:00
Laurent Destailleur
7bea9f5ffb FIX Lose filter on payment type or category after a sort on invoice list 2018-09-12 10:57:09 +02:00
Jean-Marie Arsac
345c24990e Correction of variable name 2018-09-11 20:51:54 +02:00
atm-ph
40c79cb7cd Fix classname liencolht to linecolht 2018-09-11 17:56:11 +02:00
Jean-Marie Arsac
2f2dff8155 Convert localized numeric extrafields value before inserting
- add 'double' case in insertExtraFields and updateExtraFields to to convert localized value using price2num()
2018-09-11 14:57:31 +02:00
ptibogxiv
7f3f0f3643 Fix status display in transaction.php 2018-09-11 12:10:48 +02:00
ptibogxiv
849b7154a7 add capture option in payment function 2018-09-11 10:59:25 +02:00
Laurent Destailleur
d011204624 Fix switch of extrafields between all and only one entity 2018-09-10 17:36:46 +02:00
ptibogxiv
ccc415204e V8 style 2018-09-10 16:46:16 +02:00
Regis Houssin
43ac51b44c FIX remove debug 2018-09-10 10:11:07 +02:00
Regis Houssin
8699866062 FIX better compatibility with multicompany 2018-09-10 10:08:04 +02:00
Laurent Destailleur
20fa294ff1 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-09-10 01:22:16 +02:00
Laurent Destailleur
15aa99fc8e Fix css 2018-09-10 01:22:01 +02:00
Frédéric FRANCE
d8f77f040f Update accountancycategory.class.php 2018-09-09 23:12:16 +02:00
Frédéric FRANCE
9d8a4e463b Update accountancycategory.class.php 2018-09-09 23:09:52 +02:00
Laurent Destailleur
bcfb5fc42e Merge pull request #9425 from atm-maxime/8.0
FIX : Homepage links were using wrong topmenus
2018-09-07 19:35:10 +02:00
Laurent Destailleur
e2df3fd4ad Merge pull request #9423 from ptibogxiv/patch-55
Fix error when delete stripe customer
2018-09-07 19:34:45 +02:00
Laurent Destailleur
7c5ceff569 Fix search on project 2018-09-07 15:01:34 +02:00
Laurent Destailleur
0ef17fe581 FIX Problems with permissions of module to record payment of salaries 2018-09-07 13:32:56 +02:00
Laurent Destailleur
ff05997f0a FIX Several fixes on the management of minimal amount for orders 2018-09-06 17:37:02 +02:00
Maxime Kohlhaas
a5f4a74ecc FIX : Homepage links were using wrong topmenus 2018-09-06 14:49:48 +02:00
Philippe GRAND
9025fd5891 Merge branch '8.0' of https://github.com/Dolibarr/dolibarr into 8.0 2018-09-06 14:33:46 +02:00
Philippe GRAND
844333688b typo 2018-09-06 14:33:22 +02:00
ptibogxiv
da4e902645 Fix error when delete stripe customer 2018-09-06 11:35:19 +02:00
Laurent Destailleur
b25a0ca672 Fix no need of thumb when upload image for email 2018-09-05 23:25:17 +02:00
Laurent Destailleur
ed31eec5ee Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-09-05 20:40:19 +02:00
Laurent Destailleur
dfea391c88 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/pdf.lib.php
2018-09-05 20:39:38 +02:00
Laurent Destailleur
e3339f5f95 Fix trad 2018-09-05 19:01:00 +02:00
Laurent Destailleur
0bd4bc39dd Fix responsive 2018-09-05 16:03:43 +02:00
Laurent Destailleur
3650dc3ec9 FIX #8452 2018-09-05 15:25:47 +02:00
Laurent Destailleur
f1cb13634b FIX Entering negative price on order 2018-09-05 14:55:45 +02:00
Laurent Destailleur
19431a94ba Code style 2018-09-05 14:37:44 +02:00
Laurent Destailleur
1882043f19 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-09-05 14:26:24 +02:00
Laurent Destailleur
51901108ad FIX #9412 2018-09-05 14:26:12 +02:00
Laurent Destailleur
49b568f73f Merge pull request #9413 from fmarcet/8.0
FIX Expedition not showing extrafields on creation
2018-09-05 14:16:28 +02:00
Laurent Destailleur
f7d5172a74 Merge pull request #9410 from frederic34/patch-10
Create index.html
2018-09-05 14:15:22 +02:00
Laurent Destailleur
ead2a764c7 Merge pull request #9409 from frederic34/patch-9
Create index.html
2018-09-05 14:15:12 +02:00
Ferran Marcet
57be6a752e Fix: Expedition not showing extrafields on creation 2018-09-05 10:00:33 +02:00
Frédéric FRANCE
2015268b7e Create index.html 2018-09-04 22:06:24 +02:00
Frédéric FRANCE
e4afd4af00 Create index.html 2018-09-04 22:05:06 +02:00
Laurent Destailleur
aec0d4022b Fix responsive 2018-09-04 19:59:20 +02:00
Laurent Destailleur
154e44e761 Fix responsive 2018-09-04 19:57:20 +02:00
Laurent Destailleur
203c925c5b Fix look and feel v8 2018-09-04 12:03:21 +02:00
Laurent Destailleur
8c2eac4c93 FIX #9317 2018-09-04 11:34:23 +02:00
Laurent Destailleur
9042d341f0 FIX #9316 Error when listing invoices 2018-09-04 11:19:31 +02:00
Laurent Destailleur
e7d2bcc34c FIX #9316 Error when listing invoices 2018-09-04 11:17:08 +02:00
Laurent Destailleur
f2ec94e9fd FIX #9353 Bug: html error - div inside span on graphs 2018-09-04 11:13:54 +02:00
Laurent Destailleur
76703972ed FIX #9355 2018-09-04 10:53:42 +02:00
Laurent Destailleur
37afd79ec0 Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 8.0 2018-09-04 10:38:19 +02:00
Laurent Destailleur
9697bdf3b0 FIX #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES 2018-09-04 10:38:09 +02:00
Laurent Destailleur
38c8d9d008 FIX inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES 2018-09-04 10:37:29 +02:00
Laurent Destailleur
15b3fa73f4 FIX #9394 2018-09-04 10:16:16 +02:00
Laurent Destailleur
6b3ccddb65 FIX #9396 2018-09-04 10:14:45 +02:00
Laurent Destailleur
c59b0f95e6 FIX #9403 2018-09-04 10:10:47 +02:00
Laurent Destailleur
847189805a Merge pull request #9404 from ATM-Marc/FIX_6.0_pdf_address
FIX: PDF address: handle when contact thirdparty different from document thirdparty
2018-09-04 09:57:07 +02:00
Laurent Destailleur
252335318f Update pdf.lib.php 2018-09-04 09:57:01 +02:00
Laurent Destailleur
4a7bec2c04 Fix fax not required as visible by default on list 2018-09-04 09:48:30 +02:00
Laurent Destailleur
739c2822af Fix look and feel v8 2018-09-04 09:42:28 +02:00
Laurent Destailleur
cdc1e1fc76 Fix responsive 2018-09-04 09:37:51 +02:00
Laurent Destailleur
db6f80e2ff FIX invoice popup hide localtax2 and 3 if not defined 2018-09-04 00:42:15 +02:00
Laurent Destailleur
94c05fbd84 Look and feel v8 2018-09-04 00:29:31 +02:00
Laurent Destailleur
6ce37e588d Prepare 8.0.2 2018-09-04 00:22:14 +02:00
Laurent Destailleur
392f31abbd FIX invert mime type and name 2018-09-04 00:21:48 +02:00
Marc de Lima Lucio
e285b42a18 FIX: PDF address: handle when contact thirdparty different from document thirdparty 2018-09-03 17:57:30 +02:00
Laurent Destailleur
3d50c454c1 Code comment 2018-09-03 17:05:44 +02:00
Laurent Destailleur
47655f0725 Add comment as FIXME 2018-09-03 14:00:12 +02:00
Laurent Destailleur
d050c0654b FIX Add "-- ADD xxx to rowd" to avoid rowid conflict on account chart 2018-09-03 13:14:25 +02:00
Laurent Destailleur
6641a05744 Fix missing class 2018-09-03 11:59:19 +02:00
Laurent Destailleur
1249e597d4 Fix test param $id 2018-09-03 11:56:05 +02:00
atm-quentin
ec9eeb5201 FIX check !empty exclude select element 2018-08-27 10:17:18 +02:00
fappels
6c4ecc025e Merge remote-tracking branch 'refs/remotes/Dolibarr/8.0' into 8.0 2018-08-22 18:15:23 +02:00
Laurent Destailleur
0ee7befa19 Update replenish.php 2018-08-21 13:27:49 +02:00
atm-quentin
09dfcc6016 FIX exclude element of the select 2018-08-03 14:54:21 +02:00
ATM-Nicolas
59220c05e4 FIX : Select first mail model by default 2018-07-05 11:18:28 +02:00
atm-greg
2cdae2ec98 remove globalcard context 2018-06-18 11:30:38 +02:00
atm-greg
72449ddef4 add hooks on stock replenish 2018-06-15 16:55:23 +02:00
Philippe
4d72573484 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-05-21 14:44:22 +02:00
Philippe
cbf12b779d Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-02-21 12:50:23 +01:00
Philippe
7406d3c7ee Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-11 15:32:52 +01:00
Philippe
bcbbcc1c66 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-11 09:13:46 +01:00
Philippe
e66847d5c3 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-05 14:47:04 +01:00
Philippe
dd8ef47a25 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-12-18 15:37:46 +01:00
Philippe
2f2b0630e2 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-11-23 21:52:11 +01:00
Philippe
26e3593c98 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-10-25 14:15:59 +02:00
Laurent Destailleur
e61bcd03ed Fix travis 2017-09-16 13:03:27 +02:00
Laurent Destailleur
3295498e9e Remove code comment 2017-09-16 12:50:34 +02:00
Philippe
c88f5c560c Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-09-06 15:30:45 +02:00
Philippe
04466651d6 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-07-27 14:28:28 +02:00
397 changed files with 39764 additions and 37802 deletions

1
.gitignore vendored
View File

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

389
ChangeLog
View File

@@ -2,6 +2,272 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 8.0.5 compared to 8.0.4 *****
FIX: #10381
FIX: #10460 compatibility with MariaDB 10.4
FIX: #11025
FIX: Accountancy - Add transaction with multicompany use all the time 1st entity
FIX: Accountancy - Format EBP import
FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work
FIX: actioncomm: sort events by date after external calendars and hook
FIX: action list: add printFieldListSelect and printFieldListWhere hooks
FIX: add fk_unit on addline action
FIX: avoid php warning
FIX: bad sql request
FIX: better method
FIX: better test
FIX: better test on fetch
FIX: broken external authentication module feature and avoid warning
FIX: Can not create contract with numbering module without autogen rule
FIX: can't add lines on invoices
FIX: Can't generate invoice pdf
FIX: Can't insert if there is extrafields mandatory on another entity.
FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar
FIX: Check for old picture name if the new one was not found
FIX: Civility not saved when creating a member.
FIX: $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled
FIX: could not create several superadmin in transversal mode
FIX: credit note can have negative value
FIX: Default value on sales representative on third party creation
FIX: Don't show journal:getNomUrl without data
FIX: Erreur dans le Total
FIX: error messages not displayed
FIX: expedition: reset status on rollback + replace hardcoded status with const
FIX: Fix PHP warning "count(): Parameter must be an array..."
FIX: fk_default_warehouse missing in group by
FIX: function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it
FIX: holidays get natural_search if search params are set only
FIX: if empty error message, we just see "error" displayed
FIX: if(!method_exists(dol_loginfunction))
FIX: If we build one invoice for several orders, we must put the ref of order on the line to not lose information.
FIX: in fact expensereport must be in $check array
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: line edit template: keep fk_parent_line
FIX: Loan impossible to account
FIX: Mark credit note as available for credit note in other currency
FIX: missing access security checking with multicompany
FIX: missing entity filter and wrong var name
FIX: missing entity filter in function "build_filterField()" (export)
FIX: Missing field in import/export of users
FIX: missing hook completeTabsHead in margins module
FIX: missing $ismultientitymanaged for previous/next ref
FIX: Missing province in export of invoice
FIX: multicompany compatibility
FIX: must fetch member in current entity
FIX: need an order by in case we found other invoice with same number but not same date
FIX: need to round with 2 decimals to avoid movements not correctly balanced
FIX: no need to test anything to display documents tabs on expense report
FIX: positive values creating diff on addline rounding
FIX: problem with multicompany transverse mode
FIX: Product accountancey sell intra code must be visible if main feature level 1
FIX: project_title for display of getNomUrl()
FIX: quick search for supplier orders
FIX: Remane of project
FIX: same thing here
FIX: Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: several hooks in shipping/delivery cards
FIX: shipping default warehouse if only one warehouse
FIX: SQL injection on rowid of dict.php
FIX: 'statut' is ignored when updating a user with the REST API.
FIX: supplier invoice payment total dont care about deposit or credit
FIX: supplier invoice product stats total ht is line total not invoice total
FIX: The minimum amount filter does not work in the VAT report per customer
FIX: Total per day shows 00:00 if the total time spent is equal to 12:00
FIX: Update/delete currency on same languages
FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9
FIX: useless join
FIX: we need to keep originline special_code
FIX: we want to be able to reopen fourn credit note
FIX: when 2 extra fields are mandatory in 2 different entities
FIX: when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line)
FIX: wrong redirect link on holiday refuse
FIX: wrong test enabled
FIX: Wrong variable name
FIX: XSS
***** ChangeLog for 8.0.4 compared to 8.0.3 *****
FIX: #10030 better german chart
FIX: #10036
FIX: #10080 Supplier translations are in english
FIX: #10183 using backport of fix done in 9.0
FIX: #10218 Bad redirection after deleting a user or group
FIX: #3234
FIX: #6580
FIX: #8741
FIX: #9629 #9625
FIX: #9971
FIX: avoid Class 'AdherentType' not found
FIX: Can relaunch install on v8
FIX: Can't create a thirdparty from member if customer code is mandatory.
FIX: Can't delete a line of minimal stock per warehouse
FIX: check if "entity" is already defined in "$param"
FIX: contact/address tab issue when changing company
FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account
FIX: CVE-2018-19799
FIX: CVE-2018-19992
FIX: CVE-2018-19993
FIX: CVE-2018-19994
FIX: CVE-2018-19995 and CVE-2018-19998
FIX: Error reported when creation of thirdparty from member fails
FIX: export only prices of the current entity !
FIX: Extrafields on shipment module
FIX: filter on product category doesn't work
FIX: form actions: select_type_actions could be too small + bad $db init
FIX: form actions: select_type_actions could be too small + bad init
FIX: fourn payment modes musn't be available on customer docs
FIX: Function updatePrice with wrong parameters
FIX: hidden extrafield
FIX: if qty is 0
FIX: If we change customer/supplier rule we can't edit old thirdparty.
FIX: lang not loaded
FIX: Lines are not inserted correctly if VAT have code
FIX: marge sign
FIX: Method setValid not found
FIX: Migration do not create not used table
FIX: missing action "edit" for the hook
FIX: missing field "visible"
FIX: Missing last month on vat report per month
FIX: mode is only customer in stats fichinter
FIX: OppStatusShort doesn't exists
FIX: Remote ip detection was wrong with proxy (example: cloudflare)
FIX: Removed not use table
FIX: Replenishment with option STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE
FIX: responsive
FIX: Same on customer card
FIX: same on lines
FIX: screen size fall
FIX: Select first mail model by default
FIX: slow SQL query on creating a new supplier invoice
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
FIX: supplier order list keep socid
FIX: Same on customer card
FIX: same on lines
FIX: screen size fall
FIX: Select first mail model by default
FIX: slow SQL query on creating a new supplier invoice
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
FIX: supplier order list keep socid
FIX: Vendor translations are in english
FIX: Warning: count()
FIX: We want to be able to send PDF of paid invoices
***** ChangeLog for 8.0.3 compared to 8.0.2 *****
FIX: #9161
FIX: #9432
FIX: #9432 Assign yourself as a commercial when you don't have permission to see all thirds
FIX: #9510
FIX: #9567
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
FIX: Amount when using mutlicurrency on PDF
FIX: Backup of database without mysqladmin available from cron.
FIX: Bad label on delete button
FIX: bad link in notification
FIX: Bad position of hook formattachOptions call
FIX: Can't create shipping if have shipping line's extrafields
FIX: check !empty exclude select element
FIX: content lost when editing a label with "
FIX: correct migration of old postgresql unique key
FIX: credit note progression
FIX: default accounting accounts on loan creation #9643
FIX: Delete of draft invoice
FIX: deletion on draft is allowed if we are allwoed to create
FIX: Do not show check box if not applicable
FIX: exclude element of the select
FIX: extrafields of taks not visible in creation
FIX: filter on employee
FIX: invoice stats: situation invoices were not counted
FIX: keep external module element when adding resource
FIX: langs fr
FIX: Link template invoice to contract
FIX: Look and feel v8. Missing button "Create category"
FIX: Menu to show/edit Users categories was missing
FIX: missing name alias field in societe import/export #9091
FIX: missing symbol for indian rupies
FIX: Missing transaction around action
FIX: modify parenting before task deletion
FIX: nb of session in title
FIX: need to filter on current entity on replenish
FIX: number mailing for a contact with multicompany
FIX: Option for prof id mandatory not working with custom type of company
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
FIX: Pagination stats
FIX: pdf typhon: order reference duplicate
FIX: position 0 for emails templates
FIX: previous situation invoice selection
FIX: Product marge tabs on product card
FIX: Product margin tab and credit note
FIX: propal pdf: missing parenthesis for customs code
FIX: properties on proposal must not be modified if error
FIX: qty not visible for a lot when making shipment on a dedicated stock
FIX: Quick hack to solve pb of bad definition of public holidays
FIX: remain to pay for credit note was wrong on invoice list
FIX: replenish wasn't caring about supplier price min quantity #9561
FIX: Required extrafield value numeric should accept '0'
FIX: ressource list with extrafields
FIX: restore last seach criteria
FIX: Selection of addmaindocfile is lost on error
FIX: Sending of reminder for expired subscriptions
FIX: shared link ko on proposals
FIX: showOptionals: column mismatches
FIX: situation invoice total with credit note
FIX: situation invoice prev percent
FIX: special code on create supplier invoice from supplier order
FIX: Symbol of currency in substitution variables
FIX: The max size for upload file was not corectly shown
FIX: the member e-mail on resign and validation.
FIX: thirdparty property of object not loaded when only one record
FIX: title
FIX: Title problem on admin RSS module
FIX: Tooltip on invoice widget
FIX: Total of timespent
FIX: trackid into email sent from member module.
FIX: translation in select unit form
FIX: use discount with multicurrency
FIX: Variable name
FIX: When we delete a product, llx_product_association rows are not deleted
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
FIX: wrong function name
FIX: wrong occurence number of contract on contact card, we must only count externals
FIX: wrong value for module part and return access denied
FIX: Wrong variable name
FIX: XSS vulnerability reported by Mary Princy E
***** ChangeLog for 8.0.2 compared to 8.0.1 *****
FIX: #8452
FIX: #9043
FIX: #9316 Error when listing invoices
FIX: #9317
FIX: #9353 Bug: html error - div inside span on graphs
FIX: #9355
FIX: #9393 inconsistency behaviour. option FACTURE_ENABLE_NEGATIVE_LINES
FIX: #9394
FIX: #9396
FIX: #9403
FIX: #9412
FIX: #9497
FIX: Add paypal error message in alert email when online payment fails.
FIX: better compatibility with multicompany
FIX: capital must be empty and not 0 if undefined
FIX: character making error on bill list
FIX: Entering negative price on order.
FIX: Expedition not showing extrafields on creation.
FIX: Homepage links were using wrong topmenus
FIX: inconsistency behaviour on option FACTURE_ENABLE_NEGATIVE_LINES
FIX: invert mime type and name.
FIX: invoice popup hide localtax2 and 3 if not defined.
FIX: Lose filter on payment type or category after a sort on invoice list.
FIX: Maxi debug to allow to load chart of account with multicompany.
FIX: Missing translation in predefined email to membership renewal.
FIX: Mixing tickets of different thirdparties.
FIX: "Other ..." link so the "Back to" link works.
FIX: PDF address: handle when contact thirdparty is different from thirdparty of document
FIX: Problems with permissions of module to record payment of salaries
FIX: remove debug
FIX: Several fixes on the management of minimal amount for orders
FIX: wrong var name
***** ChangeLog for 8.0.1 compared to 8.0.0 *****
FIX: #9258
FIX: #9328
@@ -51,7 +317,7 @@ NEW: Add a tab to specify accountant/auditor of the company
NEW: Add Date delivery and Availability on Propals List
NEW: Add date in goods reception supplier order table
NEW: Add delivery_time_days of suppliers in export profile
NEW: Add Docments'tab to expedition module
NEW: Add Documents'tab to expedition module
NEW: Use dol_print_phone in thirdparty list page to format phone
NEW: Add entry for the GDPR contact
NEW: Add extrafield type "html"
@@ -221,8 +487,103 @@ Following changes may create regressions for some external modules, but were nec
* Remove method Categorie:get_nb_categories() that was not used.
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
are now replaced with hook getNomUrl.
* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
***** ChangeLog for 7.0.5 compared to 7.0.4 *****
FIX: #3234
FIX: #6580
FIX: #8741
FIX: #9934
FIX: avoid Class 'AdherentType' not found
FIX: Can't create a thirdparty from member if customer code is mandatory.
FIX: Can't generate invoice pdf
FIX: contact/adress tab: when changing company ajax combo, the first contact change is not taken into account
FIX: Error generating ODT when option to use contact on doc on
FIX: Error reported when creation of thirdparty from member fails
FIX: filter on product category doesn't work
FIX: form actions: select_type_actions could be too small + bad init
FIX: fourn payment modes musn't be available on customer docs
FIX: Function updatePrice with wrong parameters
FIX: If we change customer/supplier rule we can't edit old thirdparty.
FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER
FIX: Lines are not inserted correctly if VAT have code
FIX: OppStatusShort doesn't exists
FIX: pdf typhon: order reference duplicate
FIX: propal pdf: missing parenthesis for customs code
FIX: Same on customer card
FIX: same on lines
FIX: Select first mail model by default
FIX: sql query performance on list_qualified_avoir_supplier_invoices.
FIX: task time screen: last fix was overkill
FIX: task time screen: prevent users with access to all project from assigning to tasks they're not allowed to do
FIX: use discount with multicurrency
FIX: Variable name
FIX: We want to be able to send PDF of paid invoices
FIX: When delete a product, llx_product_association rows are not deleted
FIX: wrong occurence number of contract on contact card, we must only count externals
***** ChangeLog for 7.0.4 compared to 7.0.3 *****
FIX: #8984 button create expense report
FIX: #9032
FIX: #9161
FIX: #9328
FIX: According to french law, if seller is in France and buyer isn't in UE and isn't a company, TVA used = TVA product
FIX: Add calls to fetchComments function
FIX: better compatibility with multicompany
FIX: case when we valid form with keyboard
FIX: character making error on bill list
FIX: check !empty exclude select element
FIX: combo into popup become crazy with IE10
FIX: combo of stock in popup are crazy in IE
FIX: Deletion of files in migration
FIX: exclude element of the select
FIX: extrafieldkey
FIX: Fetch function will fetch comments
FIX: Fetch task will now fetch comments
FIX: filter supplier invoice list by societe name.
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: Force stripe api version to avoid trouble if we update stripe api
FIX: getEntity project and not projet
FIX: Get templates in a forced language
FIX: global $mysoc missing (to avoid php notice on lines 279, 280 & 281)
FIX: Injection
FIX: invoice stats: situation invoices were not counted
FIX: keep context filter on contact list on change column displayed
FIX: Keep same project when creating shipping from order
FIX: langs fr
FIX: Lose filter on payment type or category after a sort on invoice list
FIX: Missing behavior
FIX: missing hook to edit sql
FIX: multicompany compatibility !
FIX: need to filter on current entity on replenish
FIX: Option MAIN_DISABLE_NOTES_TAB #9611
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
FIX: Pagination on related item pages
FIX: Pagination on withdraw request list
FIX: PDF address: handle when contact thirdparty different from document thirdparty
FIX: PHP warning, undefined index notnull
FIX: Product marge tabs on product card
FIX: Product margin tab and credit note
FIX: propal: correctly preset project when creating with origin/originid
FIX: remain to pay for credit note was wrong on invoice list
FIX: remove debug
FIX: Remove fetchComments from project and task fetch function
FIX: remove rowid for multicompany compatibility
FIX: Search on Ref project on order list
FIX: search on ref project on propal list
FIX: showOptionals: column mismatches
FIX: SQL Injections reported by mu shcor (ADLab of Venustech)
FIX: stock replenish with multientity
FIX: table llx_chargessociales doesn't exists
FIX: we must see number of all shared projects
FIX: when stock is empty for current entity but > 0 in other entity, until this commit product wasn't displaied on replenishment, it must depends on multientity stock sharing
FIX: when we're just admin and not super admin, if we create new user with transverse mode, we don't see it then we can't add him in usergroup
FIX: wrong function name
FIX: Wrong position of firstname lastname
FIX: wrong value for module part and return access denied
FIX: Wrong variable and trigger name
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
FIX: 7.0 task contact card without withproject parameters
@@ -706,6 +1067,32 @@ Following changes may create regressions for some external modules, but were nec
multicompany module to a version that support Dolibarr v7, everything should work as expected.
***** ChangeLog for 6.0.8 compared to 6.0.7 *****
FIX: #8762
FIX: #9032
FIX: case when we valid form with keyboard
FIX: clause must not be there
FIX: dol_delete_file must work in a context without db handler loaded
FIX: entity test must be on product_fourn_price table and not product table
FIX: Fetch shipping will now fetch project id
FIX: $fk_account is always empty, must be $soc->fk_account
FIX: getEntity project and not projet
FIX: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
FIX: Keep supplier proposal price for supplier order
FIX: langs fr
FIX: missing filters during reordering
FIX: need to filter on aa.entity for same accounting accounts available in several entities
FIX: page must always be 0 when we search (to avoid case : when we're on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
FIX: PDF address: handle when contact thirdparty different from document thirdparty
FIX: propal: correctly preset project when creating with origin/originid
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
FIX: remain to pay for credit note was wrong on invoice list
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
FIX: showOptionals: column mismatches
FIX: sometimes amounts are identical but php find them different.
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: we must see number of all shared projects
FIX: wrong var name
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
FIX: #8023

View File

@@ -523,10 +523,17 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/doc/images/dolibarr_screenshot12.png`;
# Security to avoid to package data files
print "Remove documents dir\n";
$ret=`rm -fr $BUILDROOT/$PROJECT/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/documents`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/document`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/documents`;
print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
# Removed known external modules to avoid any error when packaging from env where external modules are tested
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/allscreens*`;
@@ -592,13 +599,6 @@ if ($nboftargetok) {
$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";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs but not files
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\;\n";
$ret=`find $BUILDROOT/$PROJECT/htdocs/custom/* -type l -exec rm -fr {} \\; >/dev/null 2>&1`; # For custom we want to remove all subdirs, even symbolic links, but not files
}
# Build package for each target

View File

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

View File

@@ -63,9 +63,9 @@ if (! $sortorder) $sortorder = "ASC";
$arrayfields=array(
'aa.account_number'=>array('label'=>$langs->trans("AccountNumber"), 'checked'=>1),
'aa.label'=>array('label'=>$langs->trans("Label"), 'checked'=>1),
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>0),
'aa.account_parent'=>array('label'=>$langs->trans("Accountparent"), 'checked'=>1),
'aa.pcg_type'=>array('label'=>$langs->trans("Pcgtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>1, 'help'=>'PcgtypeDesc'),
'aa.pcg_subtype'=>array('label'=>$langs->trans("Pcgsubtype"), 'checked'=>0, 'help'=>'PcgtypeDesc'),
'aa.active'=>array('label'=>$langs->trans("Activated"), 'checked'=>1)
);
@@ -121,14 +121,35 @@ if (empty($reshook))
if ($country_code)
{
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
$result = run_sql($sqlfile, 1, 0, 1);
$offsetforchartofaccount = 0;
// Get the comment line '-- ADD CCCNNNNN to rowid...' to find CCCNNNNN (CCC is country num, NNNNN is id of accounting account)
// and pass CCCNNNNN + (num of company * 100 000 000) as offset to the run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
// This is to be sure there is no conflict for each chart of account, whatever is country, whatever is company when multicompany is used.
$tmp = file_get_contents($sqlfile);
if (preg_match('/-- ADD (\d+) to rowid/ims', $tmp, $reg))
{
$offsetforchartofaccount += $reg[1];
}
$offsetforchartofaccount+=($conf->entity * 100000000);
$result = run_sql($sqlfile, 1, $conf->entity, 1, '', 'default', $offsetforchartofaccount);
if ($result > 0)
{
setEventMessages($langs->trans("ChartLoaded"), null);
}
else
{
setEventMessages($langs->trans("ErrorDuringChartLoad"), null, 'warnings');
}
}
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
$error++;
}
} else {
$error ++;
$error++;
}
}

View File

@@ -41,8 +41,23 @@ $page = GETPOST("page");
$sortorder = GETPOST("sortorder", 'alpha');
$sortfield = GETPOST("sortfield", 'alpha');
$action = GETPOST('action', 'alpha');
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
// Load variable for pagination
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
//if (! $sortfield) $sortfield="p.date_fin";
//if (! $sortorder) $sortorder="DESC";
$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int'));
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
if ($search_accountancy_code_start == - 1) {
@@ -53,14 +68,6 @@ if ($search_accountancy_code_end == - 1) {
$search_accountancy_code_end = '';
}
if (GETPOST("exportcsv",'alpha')) $action = 'export_csv';
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
if (empty($page) || $page < 0) { $page = 0; }
$offset = $limit * $page;
$object = new BookKeeping($db);
$formaccounting = new FormAccounting($db);
@@ -96,26 +103,29 @@ if ($sortorder == "")
if ($sortfield == "")
$sortfield = "t.numero_compte";
$options = '';
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
$filter = array ();
if (! empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$options .= '&amp;date_startmonth=' . GETPOST('date_startmonth', 'int') . '&amp;date_startday=' . GETPOST('date_startday', 'int') . '&amp;date_startyear=' . GETPOST('date_startyear', 'int');
$param .= '&amp;date_startmonth=' . GETPOST('date_startmonth', 'int') . '&amp;date_startday=' . GETPOST('date_startday', 'int') . '&amp;date_startyear=' . GETPOST('date_startyear', 'int');
}
if (! empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$options .= '&amp;date_endmonth=' . GETPOST('date_endmonth', 'int') . '&amp;date_endday=' . GETPOST('date_endday', 'int') . '&amp;date_endyear=' . GETPOST('date_endyear', 'int');
$param .= '&amp;date_endmonth=' . GETPOST('date_endmonth', 'int') . '&amp;date_endday=' . GETPOST('date_endday', 'int') . '&amp;date_endyear=' . GETPOST('date_endyear', 'int');
}
if (! empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$options .= '&amp;search_accountancy_code_start=' . $search_accountancy_code_start;
$param .= '&amp;search_accountancy_code_start=' . $search_accountancy_code_start;
}
if (! empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$options .= '&amp;search_accountancy_code_end=' . $search_accountancy_code_end;
$param .= '&amp;search_accountancy_code_end=' . $search_accountancy_code_end;
}
/*
* Action
*/
@@ -134,14 +144,14 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
* View
*/
if ($action == 'export_csv') {
if ($action == 'export_csv')
{
$sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
$filename = 'balance';
include DOL_DOCUMENT_ROOT . '/accountancy/tpl/export_journal.tpl.php';
$result = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter);
$result = $object->fetchAllBalance($sortorder, $sortfield, $limit, 0, $filter);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
@@ -187,7 +197,8 @@ else {
print '<input type="hidden" name="page" value="'.$page.'">';
$button = '<input type="submit" name="exportcsv" class="butAction" value="' . $langs->trans("Export") . ' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $options, $sortfield, $sortorder, $button, $result, $result, 'title_accountancy', 0);
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $button, $result, $nbtotalofrecords, 'title_accountancy', 0, '', '', $limit);
$moreforfilter = '';
@@ -225,12 +236,12 @@ else {
print '</tr>';
print '<tr class="liste_titre">';
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $options, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $options, "", $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $options, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $options, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $options, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $options, "", 'width="60" align="center"', $sortfield, $sortorder);
print_liste_field_titre("AccountAccounting", $_SERVER['PHP_SELF'], "t.numero_compte", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Label", $_SERVER['PHP_SELF'], "t.label_operation", "", $param, "", $sortfield, $sortorder);
print_liste_field_titre("Debit", $_SERVER['PHP_SELF'], "t.debit", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Credit", $_SERVER['PHP_SELF'], "t.credit", "", $param, 'align="right"', $sortfield, $sortorder);
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
print "</tr>\n";
$total_debit = 0;

View File

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

View File

@@ -621,7 +621,6 @@ if ($num > 0)
$object->id = $line->id;
$object->piece_num = $line->piece_num;
print $object->getNomUrl(1,'',0,'',1);
//print '<a href="./card.php?piece_num=' . $line->piece_num . '&save_lastsearch_values=1">' . $line->piece_num . '</a>';
print '</td>';
if (! $i) $totalarray['nbfield']++;
}

View File

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

View File

@@ -517,14 +517,19 @@ class AccountancyExport
print $line->id . $separator;
print $date . $separator;
print $line->code_journal . $separator;
print length_accountg($line->numero_compte) . $separator;
print substr(length_accountg($line->numero_compte),0,2) . $separator;
if (empty($line->subledger_account)) {
print $line->numero_compte . $separator;
} else {
print $line->subledger_account . $separator;
}
//print substr(length_accountg($line->numero_compte),0,2) . $separator;
print '"'.dol_trunc($line->label_operation,40,'right','UTF-8',1).'"' . $separator;
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$separator;
print price2num($line->montant).$separator;
print $line->sens.$separator;
print $date . $separator;
print 'EUR';
//print 'EUR';
print $end_line;
}
}

View File

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

View File

@@ -146,9 +146,12 @@ if ($conf->accounting->enabled)
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong>')."\n";
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
print "<br>\n";
if (! empty($conf->expensereport->enabled) || ! empty($conf->deplacement->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong>')."\n";
print "<br>\n";
}
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";

View File

@@ -8,6 +8,7 @@
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -369,6 +370,18 @@ if ($result) {
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentloanstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentloanid"] = $paymentloanstatic->id;
//$tabtp[$obj->rowid][$account_pay_loan] += $obj->amount;
$sqlmid = 'SELECT pl.amount_capital, pl.amount_insurance, pl.amount_interest, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest';
$sqlmid.= ' FROM '.MAIN_DB_PREFIX.'payment_loan as pl, '.MAIN_DB_PREFIX.'loan as l';
$sqlmid.= ' WHERE l.rowid = pl.fk_loan AND pl.fk_bank = '.$obj->rowid;
dol_syslog("accountancy/journal/bankjournal.php:: sqlmid=" . $sqlmid, LOG_DEBUG);
$resultmid = $db->query($sqlmid);
if ($resultmid) {
$objmid = $db->fetch_object($resultmid);
$tabtp[$obj->rowid][$objmid->accountancy_account_capital] -= $objmid->amount_capital;
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
}
} else if ($links[$key]['type'] == 'banktransfert') {
$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
@@ -858,7 +871,7 @@ if (empty($action) || $action == 'view') {
// Test that setup is complete
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL';
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE fk_accountancy_journal IS NULL AND clos=0';
$resql = $db->query($sql);
if ($resql)
{

View File

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

View File

@@ -428,7 +428,7 @@ if (empty($reshook))
}
$typeid=GETPOST("typeid",'int');
$civility_id=GETPOST("civility_id",'int');
$civility_id=GETPOST("civility_id",'alpha');
$lastname=GETPOST("lastname",'alpha');
$firstname=GETPOST("firstname",'alpha');
$societe=GETPOST("societe",'alpha');
@@ -634,17 +634,27 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}else{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs);
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, 2);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
else
@@ -705,18 +715,28 @@ if (empty($reshook))
$msg = $arraydefaultmessage->content;
}
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
if (empty($labeltouse) || (int) $labeltouse === -1) {
//fallback on the old configuration.
setEventMessages('WarningMandatorySetupNotComplete', [], 'errors');
$error++;
}else{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs);
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n";
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
$result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1);
}
if ($result < 0)
{
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
}
else
{
@@ -931,14 +951,14 @@ else
// Address
print '<tr><td class="tdtop">'.$langs->trans("Address").'</td><td>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alpha')?GETPOST('address','alpha'):$object->address).'</textarea>';
print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="2">'.(GETPOST('address','alphanohtml')?GETPOST('address','alphanohtml'):$object->address).'</textarea>';
print '</td></tr>';
// Zip / Town
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
print $formcompany->select_ziptown((GETPOST('zipcode','alpha')?GETPOST('zipcode','alpha'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print $formcompany->select_ziptown((GETPOST('zipcode','alphanohtml')?GETPOST('zipcode','alphanohtml'):$object->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
print ' ';
print $formcompany->select_ziptown((GETPOST('town','alpha')?GETPOST('town','alpha'):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print $formcompany->select_ziptown((GETPOST('town','alphanohtml')?GETPOST('town','alphanohtml'):$object->town),'town',array('zipcode','selectcountry_id','state_id'));
print '</td></tr>';
// Country

View File

@@ -79,7 +79,6 @@ class Adherent extends CommonObject
var $datec;
var $datem;
var $datefin;
var $datevalid;
var $birth;
@@ -95,6 +94,8 @@ class Adherent extends CommonObject
var $fk_soc;
var $datefin; // From member table
// Fields loaded by fetch_subscriptions()
var $first_subscription_date;
var $first_subscription_amount;
@@ -125,7 +126,7 @@ class Adherent extends CommonObject
/**
* Function sending an email has the adherent with the text supplied in parameter.
* Function sending an email to the current member with the text supplied in parameter.
*
* @param string $text Content of message (not html entities encoded)
* @param string $subject Subject of message
@@ -137,9 +138,10 @@ class Adherent extends CommonObject
* @param int $deliveryreceipt Ask a delivery receipt
* @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown need autodetection
* @param string $errors_to erros to
* @param string $moreinheader Add more html headers
* @return int <0 if KO, >0 if OK
*/
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='', $moreinheader='')
{
global $conf,$langs;
@@ -160,9 +162,11 @@ class Adherent extends CommonObject
$from=$conf->email_from;
if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
$trackid = 'mem'.$this->id;
// Send email (substitutionarray must be done just before this)
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml, '', '', $trackid, $moreinheader);
if ($mailfile->sendfile())
{
return 1;
@@ -215,7 +219,9 @@ class Adherent extends CommonObject
// Substitutions
$substitutionarray=array(
'__CIVILITY__'=>$this->getCivilityLabel(),
'__ID__'=>$this->id,
'__MEMBER_ID__'=>$this->id,
'__CIVILITY__'=>$this->getCivilityLabel(),
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
@@ -572,7 +578,7 @@ class Adherent extends CommonObject
$lthirdparty=new Societe($this->db);
$result=$lthirdparty->fetch($this->fk_soc);
if ($result >= 0)
if ($result > 0)
{
$lthirdparty->address=$this->address;
$lthirdparty->zip=$this->zip;
@@ -582,18 +588,19 @@ class Adherent extends CommonObject
$lthirdparty->phone=$this->phone;
$lthirdparty->state_id=$this->state_id;
$lthirdparty->country_id=$this->country_id;
$lthirdparty->country_id=$this->country_id;
//$lthirdparty->phone_mobile=$this->phone_mobile;
$result=$lthirdparty->update($this->fk_soc,$user,0,1,1,'update'); // Use sync to 0 to avoid cyclic updates
$result=$lthirdparty->update($this->fk_soc, $user, 0, 1, 1, 'update'); // Use sync to 0 to avoid cyclic updates
if ($result < 0)
{
$this->error=$lthirdparty->error;
$this->errors=$lthirdparty->errors;
dol_syslog(get_class($this)."::update ".$this->error,LOG_ERR);
$error++;
}
}
else
elseif ($result < 0)
{
$this->error=$lthirdparty->error;
$error++;
@@ -682,7 +689,6 @@ class Adherent extends CommonObject
$this->db->rollback();
return -1;
}
}
/**
@@ -1185,11 +1191,9 @@ class Adherent extends CommonObject
/**
* Fonction qui recupere pour un adherent les parametres
* first_subscription_date
* first_subscription_amount
* last_subscription_date
* last_subscription_amount
* Function to get member subscriptions data
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
*
* @return int <0 si KO, >0 si OK
*/
@@ -1219,10 +1223,14 @@ class Adherent extends CommonObject
{
if ($i==0)
{
$this->first_subscription_date=$obj->dateh;
$this->first_subscription_date=$this->db->jdate($obj->datec);
$this->first_subscription_date_start=$this->db->jdate($obj->dateh);
$this->first_subscription_date_end=$this->db->jdate($obj->datef);
$this->first_subscription_amount=$obj->subscription;
}
$this->last_subscription_date=$obj->dateh;
$this->last_subscription_date=$this->db->jdate($obj->datec);
$this->last_subscription_date_start=$this->db->jdate($obj->datef);
$this->last_subscription_date_end=$this->db->jdate($obj->datef);
$this->last_subscription_amount=$obj->subscription;
$subscription=new Subscription($this->db);
@@ -1307,9 +1315,9 @@ class Adherent extends CommonObject
{
// Change properties of object (used by triggers)
$this->last_subscription_date=dol_now();
$this->last_subscription_amount=$amount;
$this->last_subscription_date_start=$date;
$this->last_subscription_date_end=$datefin;
$this->last_subscription_amount=$amount;
}
if (! $error)
@@ -2238,8 +2246,13 @@ class Adherent extends CommonObject
$this->need_subscription=0;
$this->first_subscription_date=time();
$this->first_subscription_date_start=$this->first_subscription_date;
$this->first_subscription_date_end=dol_time_plus_duree($this->first_subscription_date_start, 1, 'y');
$this->first_subscription_amount=10;
$this->last_subscription_date=time();
$this->last_subscription_date=$this->first_subscription_date;
$this->last_subscription_date_start=$this->first_subscription_date;
$this->last_subscription_date_end=dol_time_plus_duree($this->last_subscription_date_start, 1, 'y');
$this->last_subscription_amount=10;
}
@@ -2539,10 +2552,10 @@ class Adherent extends CommonObject
* Send reminders by emails before subscription end
* CAN BE A CRON TASK
*
* @param int $daysbeforeend Nb of days before end of subscription (negative number = after subscription)
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
* @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
*/
public function sendReminderForExpiredSubscription($daysbeforeend=10)
public function sendReminderForExpiredSubscription($daysbeforeendlist='10')
{
global $conf, $langs, $mysoc, $user;
@@ -2560,92 +2573,110 @@ class Adherent extends CommonObject
}*/
$now = dol_now();
$nbok = 0;
$nbko = 0;
dol_syslog(__METHOD__, LOG_DEBUG);
$tmp=dol_getdate($now);
$datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']), -1 * $daysbeforeend, 'd');
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent';
$sql.= " WHERE datefin = '".$this->db->idate($datetosearchfor)."'";
$resql = $this->db->query($sql);
if ($resql)
$arraydaysbeforeend=explode(';',$daysbeforeendlist);
foreach($arraydaysbeforeend as $daysbeforeend) // Loop on each delay
{
$num_rows = $this->db->num_rows($resql);
dol_syslog(__METHOD__.' - Process delta = '.$daysbeforeend, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$adherent = new Adherent($this->db);
$formmail = new FormMail($this->db);
$i=0;
$nbok = 0;
$nbko = 0;
while ($i < $num_rows)
if (! is_numeric($daysbeforeend))
{
$obj = $this->db->fetch_object($resql);
$blockingerrormsg="Value for delta is not a positive or negative numeric";
$nbko++;
break;
}
$adherent->fetch($obj->rowid);
$tmp=dol_getdate($now);
$datetosearchfor = dol_time_plus_duree(dol_mktime(0, 0, 0, $tmp['mon'], $tmp['mday'], $tmp['year']), $daysbeforeend, 'd');
if (empty($adherent->email))
$sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'adherent';
$sql.= " WHERE datefin = '".$this->db->idate($datetosearchfor)."'";
$resql = $this->db->query($sql);
if ($resql)
{
$num_rows = $this->db->num_rows($resql);
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$adherent = new Adherent($this->db);
$formmail = new FormMail($this->db);
$i=0;
while ($i < $num_rows)
{
$nbko++;
}
else
{
$adherent->fetch_thirdparty();
$obj = $this->db->fetch_object($resql);
// Send reminder email
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
$adherent->fetch($obj->rowid, '', '', '', true, true);
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
if (empty($adherent->email))
{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent);
//if (is_array($adherent->thirdparty)) $substitutionarraycomp = ...
complete_substitutions_array($substitutionarray, $outputlangs, $adherent);
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
$msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
$from = $conf->global->ADHERENT_MAIL_FROM;
$to = $adherent->email;
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1);
$result = $cmail->sendfile();
if (! $result)
{
$error++;
$this->error = $cmail->error;
$this->errors += $cmail->errors;
$nbko++;
}
else
{
$nbok++;
}
$nbko++;
}
else
{
$blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding";
$nbko++;
break;
}
}
$adherent->fetch_thirdparty();
$i++;
// Send reminder email
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse);
if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0)
{
$substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent);
//if (is_array($adherent->thirdparty)) $substitutionarraycomp = ...
complete_substitutions_array($substitutionarray, $outputlangs, $adherent);
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
$msg = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
$from = $conf->global->ADHERENT_MAIL_FROM;
$to = $adherent->email;
$trackid = 'mem'.$adherent->id;
$moreinheader='X-Dolibarr-Info: sendReminderForExpiredSubscription'."\r\n";
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1, '', '', $trackid, $moreinheader);
$result = $cmail->sendfile();
if (! $result)
{
$error++;
$this->error = $cmail->error;
$this->errors += $cmail->errors;
$nbko++;
}
else
{
$nbok++;
// TODO Add event email sent for member
}
}
else
{
$blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding";
$nbko++;
break;
}
}
$i++;
}
}
else
{
$this->error = $this->db->lasterror();
return 1;
}
}
else
{
$this->error = $this->db->lasterror();
return 1;
}
if ($blockingerrormsg)

View File

@@ -120,7 +120,7 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
{
// Creation of thirdparty
$company = new Societe($db);
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'));
$result=$company->create_from_member($object, GETPOST('companyname', 'alpha'), GETPOST('companyalias', 'alpha'), GETPOST('customercode', 'alpha'));
if ($result < 0)
{
@@ -347,7 +347,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
if (! $error)
{
// Send confirmation Email
if ($object->email && $sendalsoemail)
if ($object->email && $sendalsoemail) // $object is 'Adherent'
{
$subject = '';
$msg= '';
@@ -359,7 +359,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
$outputlangs->loadLangs(array("main", "members"));
// Get email content fro mtemplae
// Get email content from templae
$arraydefaultmessage=null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION;
@@ -392,7 +392,9 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
$listofmimes=array(dol_mimetype($file));
}
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1);
$moreinheader='X-Dolibarr-Info: send_an_email by adherents/subscription.php'."\r\n";
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1, '', $moreinheader);
if ($result < 0)
{
$errmsg=$object->error;
@@ -852,6 +854,23 @@ if ($rowid > 0)
array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $companyname, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"'),
array('label' => $langs->trans("AliasNames"), 'type' => 'text', 'name' => 'companyalias', 'value' => $companyalias, 'morecss' => 'minwidth300', 'moreattr' => 'maxlength="128"')
);
// If customer code was forced to "required", we ask it at creation to avoid error later
if (! empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED))
{
$tmpcompany = new Societe($db);
$tmpcompany->name=$companyname;
$tmpcompany->get_codeclient($tmpcompany, 0);
$customercode = $tmpcompany->code_client;
$formquestion[]=array(
'label' => $langs->trans("CustomerCode"),
'type' => 'text',
'name' => 'customercode',
'value' => $customercode,
'morecss' => 'minwidth300',
'moreattr' => 'maxlength="128"',
);
}
// @TODO Add other extrafields mandatory for thirdparty creation
print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
}

View File

@@ -40,7 +40,7 @@ $search_account=GETPOST('search_account','int');
$search_amount=GETPOST('search_amount','alpha');
$optioncss = GETPOST('optioncss','alpha');
$date_select=isset($_GET["date_select"])?$_GET["date_select"]:$_POST["date_select"];
$date_select=GETPOST("date_select",'alpha');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
@@ -126,7 +126,8 @@ $sql.= " WHERE d.rowid = c.fk_adherent";
$sql.= " AND d.entity IN (".getEntity('adherent').")";
if (isset($date_select) && $date_select != '')
{
$sql.= " AND c.dateadh LIKE '".$date_select."%'";
$sql.= " AND c.dateadh >= '".$date_select."-01-01 00:00:00'";
$sql.= " AND c.dateadh < '".($date_select+1)."-01-01 00:00:00'";
}
if ($search_ref)
{

View File

@@ -42,7 +42,7 @@ $backtopage = GETPOST('backtopage','alpha');
$search_lastname = GETPOST('search_lastname','alpha');
$search_login = GETPOST('search_login','alpha');
$search_email = GETPOST('search_email','alpha');
$type = GETPOST('type','alpha');
$type = GETPOST('type','intcomma');
$status = GETPOST('status','alpha');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
@@ -59,8 +59,8 @@ if (! $sortfield) { $sortfield="d.lastname"; }
$label=GETPOST("label","alpha");
$subscription=GETPOST("subscription","int");
$vote=GETPOST("vote","int");
$comment=GETPOST("comment");
$mail_valid=GETPOST("mail_valid");
$comment=GETPOST("comment",'alphanohtml');
$mail_valid=GETPOST("mail_valid",'none');
// Security check
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');

View File

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

View File

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

View File

@@ -327,20 +327,20 @@ if ($action == 'edit' || $action == 'updateedit')
// Name
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
print '<input name="nom" id="name" class="minwidth200" value="'. ($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
print '<input name="nom" id="name" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM?$conf->global->MAIN_INFO_SOCIETE_NOM: GETPOST("nom",'nohtml')) . '" autofocus="autofocus"></td></tr>'."\n";
// Addresse
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS: GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml')) . '</textarea></td></tr>'."\n";
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'. ($conf->global->MAIN_INFO_SOCIETE_ADDRESS?$conf->global->MAIN_INFO_SOCIETE_ADDRESS:GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml')) . '</textarea></td></tr>'."\n";
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. ($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP: GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha')) . '"></td></tr>'."\n";
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP?$conf->global->MAIN_INFO_SOCIETE_ZIP:GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha')) . '"></td></tr>'."\n";
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. ($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN: GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml')) . '"></td></tr>'."\n";
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN?$conf->global->MAIN_INFO_SOCIETE_TOWN:GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml')) . '"></td></tr>'."\n";
// Country
@@ -362,29 +362,29 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
print '<input name="tel" id="phone" value="'. $conf->global->MAIN_INFO_SOCIETE_TEL . '"></td></tr>';
print '<input name="tel" id="phone" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL) . '"></td></tr>';
print '</td></tr>'."\n";
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
print '<input name="fax" id="fax" value="'. $conf->global->MAIN_INFO_SOCIETE_FAX . '"></td></tr>';
print '<input name="fax" id="fax" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_FAX) . '"></td></tr>';
print '</td></tr>'."\n";
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
print '<input name="mail" id="email" class="minwidth200" value="'. $conf->global->MAIN_INFO_SOCIETE_MAIL . '"></td></tr>';
print '<input name="mail" id="email" class="minwidth200" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL) . '"></td></tr>';
print '</td></tr>'."\n";
// Web
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
print '<input name="web" id="web" class="minwidth300" value="'. $conf->global->MAIN_INFO_SOCIETE_WEB . '"></td></tr>';
print '<input name="web" id="web" class="minwidth300" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB) . '"></td></tr>';
print '</td></tr>'."\n";
// Barcode
if (! empty($conf->barcode->enabled)) {
print '<tr class="oddeven"><td><label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
print '<input name="barcode" id="barcode" class="minwidth150" value="'. $conf->global->MAIN_INFO_SOCIETE_GENCOD . '"></td></tr>';
print '<input name="barcode" id="barcode" class="minwidth150" value="'. dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_GENCOD) . '"></td></tr>';
print '</td></tr>';
}
@@ -423,19 +423,19 @@ if ($action == 'edit' || $action == 'updateedit')
// Managing Director(s)
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . $conf->global->MAIN_INFO_SOCIETE_MANAGERS . '"></td></tr>';
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="director" class="minwidth200" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MANAGERS) . '"></td></tr>';
// GDPR contact
print '<tr class="oddeven"><td>';
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
print '</td><td>';
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . $conf->global->MAIN_INFO_GDPR . '"></td></tr>';
print '<input name="MAIN_INFO_GDPR" id="director" class="minwidth500" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_GDPR) . '"></td></tr>';
// Capital
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
print '<input name="capital" id="capital" class="minwidth100" value="' . $conf->global->MAIN_INFO_CAPITAL . '"></td></tr>';
print '<input name="capital" id="capital" class="minwidth100" value="' . dol_escape_htmltag($conf->global->MAIN_INFO_CAPITAL) . '"></td></tr>';
// Juridical Status
@@ -454,7 +454,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid1">'.$langs->transcountry("ProfId1",$mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code))
{
print '<input name="siren" id="profid1" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
print '<input name="siren" id="profid1" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIREN) ? $conf->global->MAIN_INFO_SIREN : '') . '">';
}
else
{
@@ -470,7 +470,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid2">'.$langs->transcountry("ProfId2",$mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code))
{
print '<input name="siret" id="profid2" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
print '<input name="siret" id="profid2" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_SIRET) ? $conf->global->MAIN_INFO_SIRET : '' ) . '">';
}
else
{
@@ -486,7 +486,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid3">'.$langs->transcountry("ProfId3",$mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code))
{
print '<input name="ape" id="profid3" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
print '<input name="ape" id="profid3" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_APE) ? $conf->global->MAIN_INFO_APE : '') . '">';
}
else
{
@@ -502,7 +502,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid4">'.$langs->transcountry("ProfId4",$mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code))
{
print '<input name="rcs" id="profid4" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
print '<input name="rcs" id="profid4" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_RCS) ? $conf->global->MAIN_INFO_RCS : '') . '">';
}
else
{
@@ -518,7 +518,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid5">'.$langs->transcountry("ProfId5",$mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code))
{
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
print '<input name="MAIN_INFO_PROFID5" id="profid5" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_PROFID5) ? $conf->global->MAIN_INFO_PROFID5 : '') . '">';
}
else
{
@@ -534,7 +534,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<tr class="oddeven"><td><label for="profid6">'.$langs->transcountry("ProfId6",$mysoc->country_code).'</label></td><td>';
if (! empty($mysoc->country_code))
{
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
print '<input name="MAIN_INFO_PROFID6" id="profid6" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_PROFID6) ? $conf->global->MAIN_INFO_PROFID6 : '') . '">';
}
else
{
@@ -546,7 +546,7 @@ if ($action == 'edit' || $action == 'updateedit')
// TVA Intra
print '<tr class="oddeven"><td><label for="intra_vat">'.$langs->trans("VATIntra").'</label></td><td>';
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . (! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
print '<input name="tva" id="intra_vat" class="minwidth200" value="' . dol_escape_htmltag(! empty($conf->global->MAIN_INFO_TVAINTRA) ? $conf->global->MAIN_INFO_TVAINTRA : '') . '">';
print '</td></tr>';
// Object of the company

View File

@@ -376,6 +376,11 @@ if ($result)
print '</td>';
}
if (! empty($conf->multicompany->enabled) && !$user->entity)
{
print '<td></td>';
}
// Actions
print '<td align="center">';
if ($action != 'edit' || GETPOST('rowid') != $obj->rowid)

View File

@@ -618,7 +618,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($value == 'formula' && empty($_POST['formula'])) continue;
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
if ((! isset($_POST[$value]) || $_POST[$value]=='')
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory
&& (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory
&& (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
)
)
@@ -794,7 +794,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'";
$i++;
}
$sql.= " WHERE ".$rowidcol." = '".$rowid."'";
$sql.= " WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
if (in_array('entity', $listfieldmodify)) $sql.= " AND entity = '".getEntity($tabname[$id])."'";
dol_syslog("actionmodify", LOG_DEBUG);
@@ -818,7 +818,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
else { $rowidcol="rowid"; }
$sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
$sql = "DELETE FROM ".$tabname[$id]." WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
dol_syslog("delete", LOG_DEBUG);
$result = $db->query($sql);
@@ -842,7 +842,7 @@ if ($action == $acts[0])
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
@@ -862,7 +862,7 @@ if ($action == $acts[1])
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
@@ -882,7 +882,7 @@ if ($action == 'activate_favorite')
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
@@ -902,7 +902,7 @@ if ($action == 'disable_favorite')
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$rowid."'".($entity != '' ? " AND entity = " . (int) $entity : '');
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol."='".$db->escape($rowid)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code='".dol_escape_htmltag($code)."'".($entity != '' ? " AND entity = " . (int) $entity : '');
@@ -967,7 +967,7 @@ if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha
// Confirmation de la suppression de la ligne
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.$rowid.'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
}
//var_dump($elementList);
@@ -1367,8 +1367,8 @@ if ($id)
print '<td colspan="3" align="center">';
print '<div name="'.(! empty($obj->rowid)?$obj->rowid:$obj->code).'"></div>';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="rowid" value="'.$rowid.'">';
print '<input type="hidden" name="page" value="'.dol_escape_htmltag($page).'">';
print '<input type="hidden" name="rowid" value="'.dol_escape_htmltag($rowid).'">';
if (! is_null($withentity))
print '<input type="hidden" name="entity" value="'.$withentity.'">';
print '<input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
@@ -1622,14 +1622,14 @@ if ($id)
if ($id == 4)
{
print '<td align="center" class="nowrap">';
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
if ($iserasable) print '<a class="reposition" href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
else print $langs->trans("AlwaysActive");
print '</td>';
}
// Active
print '<td align="center" class="nowrap">';
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
if ($canbedisabled) print '<a class="reposition" href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
else
{
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");

View File

@@ -242,10 +242,10 @@ if ($resql)
{
$obj = $db->fetch_object($resql);
preg_match('/^([0-9]+)/i',$obj->note,$reg);
preg_match('/^([0-9]+)/i',$obj->note,$reg);
$idrss = $reg[1];
$keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss;
$keyrsstitle="EXTERNAL_RSS_URLRSS_".$idrss;
$keyrsstitle="EXTERNAL_RSS_TITLE_".$idrss;
$keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss;
//print "x".$idrss;
$rssparser=new RssParser($db);

View File

@@ -24,6 +24,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeoip.class.php';
// Security check
@@ -150,6 +151,25 @@ if ($geoip)
if ($result) print $result;
else print $langs->trans("Error");
*/
//var_dump($_SERVER);
$ip = getUserRemoteIP();
//$ip='91.161.249.43';
$isip=is_ip($ip);
if ($isip == 1)
{
print '<br>'.$ip.' -> ';
$result=dol_print_ip($ip,1);
if ($result) print $result;
else print $langs->trans("Error");
}
else
{
print '<br>'.$ip.' -> ';
$result=dol_print_ip($ip,1);
if ($result) print $result;
else print $langs->trans("NotAPublicIp");
}
$geoip->close();
}

View File

@@ -319,10 +319,11 @@ if (empty($reshook))
if ($i) $sql.=",";
$sql.= $field."=";
// print $keycode.' - '.$_POST[$keycode].'<br>';
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
//print $keycode.' - '.$_POST[$keycode].'<br>';
if ($_POST[$keycode] == '' || ($keycode != 'langcode' && $keycode != 'position' && $keycode != 'private' && empty($_POST[$keycode]))) $sql.="null"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($_POST[$keycode] == '0' && $keycode == 'langcode') $sql.="''"; // lang must be '' if not defined so the unique key that include lang will work
elseif ($keycode == 'private') $sql.=((int) $_POST[$keycode]); // private must be 0 or 1
elseif ($keycode == 'position') $sql.=((int) $_POST[$keycode]);
else $sql.="'".$db->escape($_POST[$keycode])."'";
$i++;
}

View File

@@ -40,6 +40,7 @@ $langs->loadLangs(array("errors","admin","modulebuilder"));
$mode=GETPOST('mode', 'alpha');
if (empty($mode)) $mode='common';
$action=GETPOST('action','alpha');
//var_dump($_POST);exit;
$value=GETPOST('value', 'alpha');
$page_y=GETPOST('page_y','int');
$search_keyword=GETPOST('search_keyword','alpha');
@@ -140,6 +141,12 @@ if ($action=='install')
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules",$original_file, 'module_*-x.y*.zip'), null, 'errors');
$error++;
}
if (empty($_FILES['fileinstall']['tmp_name']))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
$error++;
}
}
if (! $error)
@@ -150,14 +157,14 @@ if ($action=='install')
dol_mkdir($conf->admin->dir_temp.'/'.$original_file);
}
$tmpdir=preg_replace('/\.zip$/','',$original_file).'.dir';
$tmpdir=preg_replace('/\.zip$/i','',$original_file).'.dir';
if ($tmpdir)
{
@dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$tmpdir);
dol_mkdir($conf->admin->dir_temp.'/'.$tmpdir);
}
$result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'],$newfile,1,0,$_FILES['fileinstall']['error']);
$result=dol_move_uploaded_file($_FILES['fileinstall']['tmp_name'], $newfile, 1, 0, $_FILES['fileinstall']['error']);
if ($result > 0)
{
$result=dol_uncompress($newfile,$conf->admin->dir_temp.'/'.$tmpdir);
@@ -205,6 +212,7 @@ if ($action=='install')
}
else
{
setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors');
$error++;
}
}
@@ -833,6 +841,8 @@ if ($mode == 'common')
dol_fiche_end();
print '<br>';
// Show warning about external users
print info_admin(showModulesExludedForExternal($modules))."\n";
@@ -999,10 +1009,46 @@ if ($mode == 'deploy')
print '<br>';
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="install">';
print '<input type="hidden" name="mode" value="deploy">';
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
print $langs->trans("YouCanSubmitFile");
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1;
if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024;
if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024;
if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024;
// Now $max and $maxphp are in Kb
$maxmin = $max;
if ($maxphp > 0) $maxmin=min($max,$maxphp);
if ($maxmin > 0)
{
// MAX_FILE_SIZE doit précéder le champ input de type file
print '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
}
print '<input class="flat minwidth400" type="file" name="fileinstall"> ';
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
if (! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($user->admin)
{
$langs->load('other');
print ' ';
print info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
}
}
else
{
print ' ('.$langs->trans("UploadDisabled").')';
}
print '</form>';
print '<br>';

View File

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

View File

@@ -56,9 +56,12 @@ $specimenthirdparty->initAsSpecimen();
if ($action == 'updateMask')
{
$maskconstinvoice=GETPOST('maskconstinvoice','alpha');
$maskvalue=GETPOST('maskinvoice','alpha');
$maskconstcredit=GETPOST('maskconstcredit','alpha');
$maskinvoice=GETPOST('maskinvoice','alpha');
$maskcredit=GETPOST('maskcredit','alpha');
if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskvalue,'chaine',0,'',$conf->entity);
if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity);
if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;

View File

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

View File

@@ -337,7 +337,12 @@ if (! $error && $xml)
$i++;
$out.='<tr class="oddeven">';
$out.='<td>'.$i.'</td>' . "\n";
$out.='<td>'.$file['filename'].'</td>' . "\n";
$out.='<td>'.$file['filename'];
if (! preg_match('/^win/i',PHP_OS)) {
$htmltext=$langs->trans("YouCanDeleteFileOnServerWith", 'rm '.DOL_DOCUMENT_ROOT.'/'.$file['filename']);
$out.=' '.$form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'helprm');
}
$out.='</td>' . "\n";
$out.='<td align="center">'.$file['expectedmd5'].'</td>' . "\n";
$out.='<td align="center">'.$file['md5'].'</td>' . "\n";
$size = dol_filesize(DOL_DOCUMENT_ROOT.'/'.$file['filename']);

View File

@@ -129,7 +129,7 @@ if ($what == 'mysql')
{
$arrayofallowedcommand=explode(',', $dolibarr_main_restrict_os_commands);
$ok=0;
dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that on of this command is inside ".$cmddump);
dol_syslog("Command are restricted to ".$dolibarr_main_restrict_os_commands.". We check that one of this command is inside ".$cmddump);
foreach($arrayofallowedcommand as $allowedcommand)
{
if (preg_match('/'.preg_quote($allowedcommand,'/').'/', $cmddump))
@@ -235,176 +235,3 @@ $time_end = time();
$db->close();
// MYSQL NO BINARIES (only php)
/** Backup the db OR just a table without mysqldump binary (does not require any exec permission)
* Author: David Walsh (http://davidwalsh.name/backup-mysql-database-php)
* Updated and enhanced by Stephen Larroque (lrq3000) and by the many commentators from the blog
* Note about foreign keys constraints: for Dolibarr, since there are a lot of constraints and when imported the tables will be inserted in the dumped order, not in constraints order, then we ABSOLUTELY need to use SET FOREIGN_KEY_CHECKS=0; when importing the sql dump.
* Note2: db2SQL by Howard Yeend can be an alternative, by using SHOW FIELDS FROM and SHOW KEYS FROM we could generate a more precise dump (eg: by getting the type of the field and then precisely outputting the right formatting - in quotes, numeric or null - instead of trying to guess like we are doing now).
*
* @param string $outputfile Output file name
* @param string $tables Table name or '*' for all
* @return int <0 if KO, >0 if OK
*/
function backup_tables($outputfile, $tables='*')
{
global $db, $langs;
global $errormsg;
// Set to UTF-8
if (is_a($db, 'DoliDBMysqli')) {
/** @var DoliDBMysqli $db */
$db->db->set_charset('utf8');
} else {
/** @var DoliDB $db */
$db->query('SET NAMES utf8');
$db->query('SET CHARACTER SET utf8');
}
//get all of the tables
if ($tables == '*')
{
$tables = array();
$result = $db->query('SHOW FULL TABLES WHERE Table_type = \'BASE TABLE\'');
while($row = $db->fetch_row($result))
{
$tables[] = $row[0];
}
}
else
{
$tables = is_array($tables) ? $tables : explode(',',$tables);
}
//cycle through
$handle = fopen($outputfile, 'w+');
if (fwrite($handle, '') === false)
{
$langs->load("errors");
dol_syslog("Failed to open file ".$outputfile,LOG_ERR);
$errormsg=$langs->trans("ErrorFailedToWriteInDir");
return -1;
}
// Print headers and global mysql config vars
$sqlhead = '';
$sqlhead .= "-- ".$db::LABEL." dump via php with Dolibarr ".DOL_VERSION."
--
-- Host: ".$db->db->host_info." Database: ".$db->database_name."
-- ------------------------------------------------------
-- Server version ".$db->db->server_info."
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
";
if (GETPOST("nobin_disable_fk")) $sqlhead .= "SET FOREIGN_KEY_CHECKS=0;\n";
//$sqlhead .= "SET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";\n";
if (GETPOST("nobin_use_transaction")) $sqlhead .= "SET AUTOCOMMIT=0;\nSTART TRANSACTION;\n";
fwrite($handle, $sqlhead);
$ignore = '';
if (GETPOST("nobin_sql_ignore")) $ignore = 'IGNORE ';
$delayed = '';
if (GETPOST("nobin_delayed")) $delayed = 'DELAYED ';
// Process each table and print their definition + their datas
foreach($tables as $table)
{
// Saving the table structure
fwrite($handle, "\n--\n-- Table structure for table `".$table."`\n--\n");
if (GETPOST("nobin_drop")) fwrite($handle,"DROP TABLE IF EXISTS `".$table."`;\n"); // Dropping table if exists prior to re create it
fwrite($handle,"/*!40101 SET @saved_cs_client = @@character_set_client */;\n");
fwrite($handle,"/*!40101 SET character_set_client = utf8 */;\n");
$resqldrop=$db->query('SHOW CREATE TABLE '.$table);
$row2 = $db->fetch_row($resqldrop);
if (empty($row2[1]))
{
fwrite($handle, "\n-- WARNING: Show create table ".$table." return empy string when it should not.\n");
}
else
{
fwrite($handle,$row2[1].";\n");
//fwrite($handle,"/*!40101 SET character_set_client = @saved_cs_client */;\n\n");
// Dumping the data (locking the table and disabling the keys check while doing the process)
fwrite($handle, "\n--\n-- Dumping data for table `".$table."`\n--\n");
if (!GETPOST("nobin_nolocks")) fwrite($handle, "LOCK TABLES `".$table."` WRITE;\n"); // Lock the table before inserting data (when the data will be imported back)
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` DISABLE KEYS;\n");
else fwrite($handle, "/*!40000 ALTER TABLE `".$table."` DISABLE KEYS */;\n");
$sql='SELECT * FROM '.$table;
$result = $db->query($sql);
while($row = $db->fetch_row($result))
{
// For each row of data we print a line of INSERT
fwrite($handle,'INSERT '.$delayed.$ignore.'INTO `'.$table.'` VALUES (');
$columns = count($row);
for($j=0; $j<$columns; $j++) {
// Processing each columns of the row to ensure that we correctly save the value (eg: add quotes for string - in fact we add quotes for everything, it's easier)
if ($row[$j] == null && !is_string($row[$j])) {
// IMPORTANT: if the field is NULL we set it NULL
$row[$j] = 'NULL';
} elseif(is_string($row[$j]) && $row[$j] == '') {
// if it's an empty string, we set it as an empty string
$row[$j] = "''";
} elseif(is_numeric($row[$j]) && !strcmp($row[$j], $row[$j]+0) ) { // test if it's a numeric type and the numeric version ($nb+0) == string version (eg: if we have 01, it's probably not a number but rather a string, else it would not have any leading 0)
// if it's a number, we return it as-is
// $row[$j] = $row[$j];
} else { // else for all other cases we escape the value and put quotes around
$row[$j] = addslashes($row[$j]);
$row[$j] = preg_replace("#\n#", "\\n", $row[$j]);
$row[$j] = "'".$row[$j]."'";
}
}
fwrite($handle,implode(',', $row).");\n");
}
if (GETPOST("nobin_disable_fk")) fwrite($handle, "ALTER TABLE `".$table."` ENABLE KEYS;\n"); // Enabling back the keys/index checking
if (!GETPOST("nobin_nolocks")) fwrite($handle, "UNLOCK TABLES;\n"); // Unlocking the table
fwrite($handle,"\n\n\n");
}
}
/* Backup Procedure structure*/
/*
$result = $db->query('SHOW PROCEDURE STATUS');
if ($db->num_rows($result) > 0)
{
while ($row = $db->fetch_row($result)) { $procedures[] = $row[1]; }
foreach($procedures as $proc)
{
fwrite($handle,"DELIMITER $$\n\n");
fwrite($handle,"DROP PROCEDURE IF EXISTS '$name'.'$proc'$$\n");
$resqlcreateproc=$db->query("SHOW CREATE PROCEDURE '$proc'");
$row2 = $db->fetch_row($resqlcreateproc);
fwrite($handle,"\n".$row2[2]."$$\n\n");
fwrite($handle,"DELIMITER ;\n\n");
}
}
*/
/* Backup Procedure structure*/
// Write the footer (restore the previous database settings)
$sqlfooter="\n\n";
if (GETPOST("nobin_use_transaction")) $sqlfooter .= "COMMIT;\n";
if (GETPOST("nobin_disable_fk")) $sqlfooter .= "SET FOREIGN_KEY_CHECKS=1;\n";
$sqlfooter.="\n\n-- Dump completed on ".date('Y-m-d G-i-s');
fwrite($handle, $sqlfooter);
fclose($handle);
return 1;
}

View File

@@ -99,7 +99,7 @@ $usefilter=0;
$listofsessions=listOfSessions();
$num=count($listofsessions);
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,0,'setup');
print_barre_liste($langs->trans("Sessions"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'', $num, ($num?$num:''),'setup'); // Do not show numer (0) if no session found (it means we can't know)
$savehandler=ini_get("session.save_handler");
$savepath=ini_get("session.save_path");

View File

@@ -251,7 +251,7 @@ class DolibarrApi
//$tmp=preg_replace_all('/'.$regexstring.'/', '', $sqlfilters);
$tmp=$sqlfilters;
$ok=0;
$i=0; $nb=count($tmp);
$i=0; $nb=strlen($tmp);
$counter=0;
while ($i < $nb)
{

View File

@@ -317,7 +317,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
}
$moreforfilter = '';

View File

@@ -211,8 +211,7 @@ class Facturation
$total_localtax1 = 0;
$total_localtax2 = 0;
$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
$tab_size=count($tab);
for($i=0;$i < $tab_size;$i++)

View File

@@ -41,6 +41,8 @@ if ( $_SESSION['uid'] > 0 )
$usertxt=GETPOST('user','',1);
$err=GETPOST("err");
// Instantiate hooks of thirdparty module only if not already define
$hookmanager->initHooks(array('cashdeskloginpage'));
/*
* View
@@ -51,6 +53,15 @@ $formproduct=new FormProduct($db);
$arrayofcss=array('/cashdesk/css/style.css');
top_htmlhead('','',0,0,'',$arrayofcss);
// Execute hook getLoginPageOptions (for table)
$parameters=array('entity' => GETPOST('entity','int'));
$reshook = $hookmanager->executeHooks('getLoginPageOptions',$parameters); // Note that $action and $object may have been modified by some hooks.
if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) {
$morelogincontent = $hookmanager->resArray; // (deprecated) For compatibility
} else {
$morelogincontent = $hookmanager->resPrint;
}
?>
<body>
@@ -92,6 +103,24 @@ else
<td><input name="pwdPassword" class="texte_login" type="password" value="" /></td>
</tr>
<?php
if (! empty($morelogincontent)) {
if (is_array($morelogincontent)) {
foreach ($morelogincontent as $format => $option)
{
if ($format == 'table') {
echo '<!-- Option by hook -->';
echo $option;
}
}
}
else {
echo '<!-- Option by hook -->';
echo $morelogincontent;
}
}
?>
<tr>
<td colspan="2">
&nbsp;

View File

@@ -46,8 +46,7 @@ $societe = new Societe($db);
$societe->fetch($thirdpartyid);
/** end add Ditto */
$tab=array();
$tab = $_SESSION['poscart'];
$tab = (! empty($_SESSION['poscart'])?$_SESSION['poscart']:array());
$tab_size=count($tab);
if ($tab_size <= 0) print '<div class="center">'.$langs->trans("NoArticle").'</div><br>';

View File

@@ -1043,7 +1043,7 @@ class Categorie extends CommonObject
$current_lang = $langs->getDefaultLang();
// Init $this->cats array
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent"; // Distinct reduce pb with old tables with duplicates
$sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.color, c.fk_parent, c.visible"; // Distinct reduce pb with old tables with duplicates
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie as c";
if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'";
@@ -1063,6 +1063,7 @@ class Categorie extends CommonObject
$this->cats[$obj->rowid]['label'] = ! empty($obj->label_trans) ? $obj->label_trans : $obj->label;
$this->cats[$obj->rowid]['description'] = ! empty($obj->description_trans) ? $obj->description_trans : $obj->description;
$this->cats[$obj->rowid]['color'] = $obj->color;
$this->cats[$obj->rowid]['visible'] = $obj->visible;
$i++;
}
}

View File

@@ -35,7 +35,7 @@ $langs->load("categories");
$id=GETPOST('id','int');
$ref=GETPOST('ref');
$type=GETPOST('type');
$action=GETPOST('action','aZ09');
$action=(GETPOST('action','aZ09')?GETPOST('action','aZ09'):'edit');
$confirm=GETPOST('confirm');
$cancel=GETPOST('cancel','alpha');

View File

@@ -65,8 +65,11 @@ $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css')
llxHeader('',$title,'','',0,0,$arrayofjs,$arrayofcss);
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/categories/card.php?action=create&type='.$type.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?type='.$type).'"><span class="valignmiddle">'.$langs->trans("NewCategory").'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';
$newcardbutton.= '</a>';
print load_fiche_titre($title);
print load_fiche_titre($title, $newcardbutton);
//print '<table border="0" width="100%" class="notopnoleftnoright">';
//print '<tr><td valign="top" width="30%" class="notopnoleft">';

View File

@@ -69,7 +69,24 @@ if ($id > 0)
if (isset($_FILES['userfile']) && $_FILES['userfile']['size'] > 0 && $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->id) {
$object->add_photo($upload_dir, $_FILES['userfile']);
$file = $_FILES['userfile'];
if (is_array($file['name']) && count($file['name']) > 0)
{
foreach ($file['name'] as $i => $name)
{
if(empty($file['tmp_name'][$i]) || intval($conf->global->MAIN_UPLOAD_DOC) * 1000 <= filesize($file['tmp_name'][$i]) )
{
setEventMessage($file['name'][$i] .' : '. $langs->trans(empty($file['tmp_name'][$i])? 'ErrorFailedToSaveFile' : 'MaxSizeForUploadedFiles' ) );
unset($file['name'][$i],$file['type'][$i],$file['tmp_name'][$i],$file['error'][$i],$file['size'][$i]);
}
}
}
if(!empty($file['tmp_name'])){
$object->add_photo($upload_dir, $file);
}
}
}

View File

@@ -1615,7 +1615,7 @@ if ($id > 0)
$delallowed=$user->rights->agenda->myactions->create;
print $formfile->showdocuments('agenda',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
print $formfile->showdocuments('actions',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,0,0,'','','',$object->default_lang);
print '</div><div class="fichehalfright"><div class="ficheaddleft">';

View File

@@ -1020,8 +1020,7 @@ class ActionComm extends CommonObject
$this->nb=array();
$sql = "SELECT count(a.id) as nb";
}
$sql.= " FROM (".MAIN_DB_PREFIX."actioncomm as a";
$sql.= ")";
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " WHERE 1 = 1";

View File

@@ -306,6 +306,7 @@ if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter;
if ($usergroup) $param.="&usergroup=".$usergroup;
if ($filtert) $param.="&filtert=".$filtert;
if ($socid) $param.="&socid=".$socid;
if ($showbirthday) $param.="&showbirthday=1";
@@ -1005,6 +1006,11 @@ if (! empty($hookmanager->resArray['eventarray'])) {
}
}
// Sort events
foreach($eventarray as $keyDate => &$dateeventarray)
{
usort($dateeventarray, 'sort_events_by_date');
}
$maxnbofchar=0;
@@ -1276,7 +1282,7 @@ $db->close();
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0)
{
global $user, $conf, $langs;
global $action, $filter, $filtert, $status, $actioncode; // Filters used into search form
global $action, $filter, $filtert, $status, $actioncode, $usergroup; // Filters used into search form
global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
@@ -1635,6 +1641,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
print ($status?'&status='.$status:'').($filter?'&filter='.$filter:'');
print ($filtert?'&filtert='.$filtert:'');
print ($usergroup?'&usergroup='.$usergroup:'');
print ($actioncode!=''?'&actioncode='.$actioncode:'');
print '">'.img_picto("all","1downarrow_selected.png").' ...';
print ' +'.(count($eventarray[$daykey])-$maxprint);
@@ -1698,3 +1705,22 @@ function dol_color_minus($color, $minus, $minusunit = 16)
}
return $newcolor;
}
/**
* Sort events by date
*
* @param object $a Event A
* @param object $b Event B
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
*/
function sort_events_by_date($a, $b)
{
if($a->datep != $b->datep)
{
return $a->datep - $b->datep;
}
// If both events have the same start time, longest first
return $b->datef - $a->datef;
}

View File

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

View File

@@ -181,7 +181,7 @@ if (empty($reshook))
if ($action == 'setorder_min_amount')
{
$object->fetch($id);
$object->order_min_amount=GETPOST('order_min_amount');
$object->order_min_amount=price2num(GETPOST('order_min_amount','alpha'));
$result=$object->update($object->id, $user);
if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
}
@@ -346,7 +346,7 @@ if ($object->id > 0)
print '</td><td>';
if ($action == 'editmode')
{
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?socid='.$object->id,$object->mode_reglement_id,'mode_reglement_id', 'CRDT');
}
else
{
@@ -377,38 +377,43 @@ if ($object->id > 0)
print '</tr>';
}
// Relative discounts (Discounts-Drawbacks-Rebates)
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("CustomerRelativeDiscountShort");
print '<td><td align="right">';
if ($user->rights->societe->creer && !$user->societe_id > 0)
{
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
}
print '</td></tr></table>';
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
print '</tr>';
$isCustomer = ($object->client == 1 || $object->client == 3);
// Absolute discounts (Discounts-Drawbacks-Rebates)
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding">';
print '<tr><td class="nowrap">';
print $langs->trans("CustomerAbsoluteDiscountShort");
print '<td><td align="right">';
if ($user->rights->societe->creer && !$user->societe_id > 0)
// Relative discounts (Discounts-Drawbacks-Rebates)
if ($isCustomer)
{
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans("CustomerRelativeDiscountShort");
print '<td><td align="right">';
if ($user->rights->societe->creer && !$user->societe_id > 0)
{
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.img_edit($langs->trans("Modify")).'</a>';
}
print '</td></tr></table>';
print '</td><td>'.($object->remise_percent?'<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$object->id.'">'.$object->remise_percent.'%</a>':'').'</td>';
print '</tr>';
// Absolute discounts (Discounts-Drawbacks-Rebates)
print '<tr><td class="nowrap">';
print '<table width="100%" class="nobordernopadding">';
print '<tr><td class="nowrap">';
print $langs->trans("CustomerAbsoluteDiscountShort");
print '<td><td align="right">';
if ($user->rights->societe->creer && !$user->societe_id > 0)
{
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.img_edit($langs->trans("Modify")).'</a>';
}
print '</td></tr></table>';
print '</td>';
print '<td>';
$amount_discount=$object->getAvailableDiscounts();
if ($amount_discount < 0) dol_print_error($db,$object->error);
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
//else print $langs->trans("DiscountNone");
print '</td>';
print '</tr>';
}
print '</td></tr></table>';
print '</td>';
print '<td>';
$amount_discount=$object->getAvailableDiscounts();
if ($amount_discount < 0) dol_print_error($db,$object->error);
if ($amount_discount > 0) print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?socid='.$object->id).'">'.price($amount_discount,1,$langs,1,-1,-1,$conf->currency).'</a>';
//else print $langs->trans("DiscountNone");
print '</td>';
print '</tr>';
// Max outstanding bill
if ($object->client)
@@ -423,15 +428,21 @@ if ($object->id > 0)
print '</td>';
print '</tr>';
}
print '<tr class="nowrap">';
print '<td>';
print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer);
print '</td><td>';
print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : ''));
print '</td>';
print '</tr>';
if ($object->client)
{
if (! empty($conf->commande->enabled) && ! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT))
{
print '<!-- Minimim amount for orders -->'."\n";
print '<tr class="nowrap">';
print '<td>';
print $form->editfieldkey("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer);
print '</td><td>';
print $form->editfieldval("OrderMinAmount",'order_min_amount',$object->order_min_amount,$object,$user->rights->societe->creer,$limit_field_type,($object->order_min_amount != '' ? price($object->order_min_amount) : ''));
print '</td>';
print '</tr>';
}
}
@@ -660,6 +671,8 @@ if ($object->id > 0)
*/
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$langs->load("propal");
$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht";
$sql.= ", p.tva as total_tva";
$sql.= ", p.total as total_ttc";
@@ -668,7 +681,7 @@ if ($object->id > 0)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
$sql.= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
$sql.= " AND s.rowid = ".$object->id;
$sql.= " AND p.entity = ".$conf->entity;
$sql.= " AND p.entity IN (".getEntity('propal').")";
$sql.= " ORDER BY p.datep DESC";
$resql=$db->query($sql);

View File

@@ -609,12 +609,23 @@ if (empty($reshook))
// Classify billed
else if ($action == 'classifybilled' && $usercanclose)
{
$db->begin();
$result=$object->cloture($user, 4, '');
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
// Close proposal
@@ -627,12 +638,23 @@ if (empty($reshook))
// prevent browser refresh from closing proposal several times
if ($object->statut == Propal::STATUS_VALIDATED)
{
$db->begin();
$result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note_private','none'));
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
}
}
@@ -643,12 +665,23 @@ if (empty($reshook))
// prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED)
{
$db->begin();
$result=$object->reopen($user, 1);
if ($result < 0)
{
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
if (! $error)
{
$db->commit();
}
else
{
$db->rollback();
}
}
}
@@ -718,7 +751,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -931,6 +964,7 @@ if (empty($reshook))
// Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{
$tmptxt = '(';
// Define output language
if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$outputlangs = $langs;
@@ -1085,7 +1119,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -1848,7 +1882,7 @@ if ($action == 'create')
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1,'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherProposals").'</a>)';
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{
@@ -2064,7 +2098,7 @@ if ($action == 'create')
print '</tr></table>';
print '</td><td>';
if (! empty($object->brouillon) && $action == 'editmode' && $usercancreate) {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}

View File

@@ -13,6 +13,8 @@
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -403,38 +405,40 @@ class Propal extends CommonObject
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
$pa_ht=price2num($pa_ht);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
if ($this->statut == self::STATUS_DRAFT)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1'
}
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
$pa_ht=price2num($pa_ht);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
$this->db->begin();
$product_type=$type;
@@ -1007,6 +1011,7 @@ class Propal extends CommonObject
// Add linked object (deprecated, use ->linkedObjectsIds instead)
if (! $error && $this->origin && $this->origin_id)
{
dol_syslog('Deprecated use of linked object, use ->linkedObjectsIds instead', LOG_WARNING);
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
@@ -1079,13 +1084,6 @@ class Propal extends CommonObject
}
}
// Add linked object
if (! $error && $this->origin && $this->origin_id)
{
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
// Set delivery address
if (! $error && $this->fk_delivery_address)
{
@@ -2425,16 +2423,16 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{
// Define output language
$outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS))
{
$outputlangs = new Translate("",$conf);
$newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
}
//$ret=$object->fetch($id); // Reload to get new records
$this->generateDocument($modelpdf, $outputlangs);
// Define output language
$outputlangs = $langs;
if (! empty($conf->global->MAIN_MULTILANGS))
{
$outputlangs = new Translate("",$conf);
$newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang);
$outputlangs->setDefaultLang($newlang);
}
//$ret=$object->fetch($id); // Reload to get new records
$this->generateDocument($modelpdf, $outputlangs);
}
if (! $error)
@@ -2442,7 +2440,7 @@ class Propal extends CommonObject
$this->oldcopy= clone $this;
$this->statut = $statut;
$this->date_cloture = $now;
$this->note_private = $note;
$this->note_private = $newprivatenote;
}
if (! $notrigger && empty($error))
@@ -2453,13 +2451,17 @@ class Propal extends CommonObject
// End call triggers
}
if ( ! $error )
if (! $error)
{
$this->db->commit();
return 1;
}
else
{
$this->statut = $this->oldcopy->statut;
$this->date_cloture = $this->oldcopy->date_cloture;
$this->note_private = $this->oldcopy->note_private;
$this->db->rollback();
return -1;
}
@@ -3110,7 +3112,7 @@ class Propal extends CommonObject
$this->labelstatut[3]=$langs->trans("PropalStatusNotSigned");
$this->labelstatut[4]=$langs->trans("PropalStatusBilled");
$this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort");
$this->labelstatut_short[1]=$langs->trans("Opened");
$this->labelstatut_short[1]=$langs->trans("PropalStatusValidatedShort");
$this->labelstatut_short[2]=$langs->trans("PropalStatusSignedShort");
$this->labelstatut_short[3]=$langs->trans("PropalStatusNotSignedShort");
$this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort");
@@ -4188,7 +4190,7 @@ class PropaleLigne extends CommonObjectLine
* Update DB line fields total_xxx
* Used by migration
*
* @return int <0 if ko, >0 if ok
* @return int <0 if KO, >0 if OK
*/
function update_total()
{

View File

@@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
// Load translation files required by the page
$langs->loadLangs(array('companies','propal','compta','bills','orders','products','deliveries'));
$langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories'));
$socid=GETPOST('socid','int');
@@ -490,7 +490,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
}
$i = 0;
@@ -990,7 +990,7 @@ if ($resql)
}
// Show total line
if (isset($totalarray['totalhtfield'])
if (isset($totalarray['totalhtfield'])
|| isset($totalarray['totalvatfield'])
|| isset($totalarray['totalttcfield'])
|| isset($totalarray['totalamfield'])

View File

@@ -106,7 +106,7 @@ if ($socid > 0)
$head = societe_prepare_head($object);
$isCustomer = $object->client == 1 || $object->client == 3;
$isCustomer = ($object->client == 1 || $object->client == 3);
$isSupplier = $object->fournisseur == 1;
print '<form method="POST" action="remise.php?id='.$object->id.'">';
@@ -122,7 +122,7 @@ if ($socid > 0)
print '<div class="underbanner clearboth"></div>';
if(! $isCustomer && ! $isSupplier) {
if (! $isCustomer && ! $isSupplier) {
print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>';
dol_fiche_end();
@@ -136,13 +136,13 @@ if ($socid > 0)
print '<table class="border centpercent">';
if($isCustomer) {
if ($isCustomer) {
// Customer discount
print '<tr><td class="titlefield">';
print $langs->trans("CustomerRelativeDiscount").'</td><td>'.price2num($object->remise_percent)."%</td></tr>";
}
if($isSupplier) {
if ($isSupplier) {
// Supplier discount
print '<tr><td class="titlefield">';
print $langs->trans("SupplierRelativeDiscount").'</td><td>'.price2num($object->remise_supplier_percent)."%</td></tr>";
@@ -155,21 +155,28 @@ if ($socid > 0)
print '<div class="underbanner clearboth"></div>';
if($isCustomer && ! $isSupplier) {
print '<input type="hidden" name="discount_type" value="0" />';
}
if(! $isCustomer && $isSupplier) {
print '<input type="hidden" name="discount_type" value="1" />';
}
/*if (! ($isCustomer && $isSupplier))
{
if ($isCustomer && ! $isSupplier) {
print '<input type="hidden" name="discount_type" value="0" />';
}
if (! $isCustomer && $isSupplier) {
print '<input type="hidden" name="discount_type" value="1" />';
}
}*/
print '<table class="border centpercent">';
if($isCustomer && $isSupplier) {
if ($isCustomer || $isSupplier)
{
// Discount type
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>';
print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td><td>';
if ($isCustomer) {
print '<input type="radio" name="discount_type" id="discount_type_0" checked value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
}
if ($isSupplier) {
print ' <input type="radio" name="discount_type" id="discount_type_1"'.($isCustomer?'':' checked').' value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
}
print '</td></tr>';
}

View File

@@ -1,7 +1,8 @@
<?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -127,6 +128,8 @@ if ($action == 'confirm_split' && GETPOST("confirm") == 'yes')
$db->begin();
$discount->fk_facture_source=0; // This is to delete only the require record (that we will recreate with two records) and not all family with same fk_facture_source
// This is to delete only the require record (that we will recreate with two records) and not all family with same fk_invoice_supplier_source
$discount->fk_invoice_supplier_source=0;
$res=$discount->delete($user);
$newid1=$newdiscount1->create($user);
$newid2=$newdiscount2->create($user);
@@ -254,7 +257,7 @@ if ($socid > 0)
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
if(! $isCustomer && ! $isSupplier) {
print '<p class="opacitymedium">'.$langs->trans('ThirdpartyIsNeitherCustomerNorClientSoCannotHaveDiscounts').'</p>';
@@ -266,8 +269,8 @@ if ($socid > 0)
$db->close();
exit;
}
print '<table class="border centpercent">';
if($isCustomer) { // Calcul avoirs client en cours
@@ -293,7 +296,7 @@ if ($socid > 0)
print '<tr><td class="titlefield">'.$langs->trans("CustomerAbsoluteDiscountAllUsers").'</td>';
print '<td>'.$remise_all.'&nbsp;'.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
if (! empty($user->fk_soc)) // No need to show this for external users
{
print '<tr><td>'.$langs->trans("CustomerAbsoluteDiscountMy").'</td>';
@@ -322,10 +325,10 @@ if ($socid > 0)
{
dol_print_error($db);
}
print '<tr><td class="titlefield">'.$langs->trans("SupplierAbsoluteDiscountAllUsers").'</td>';
print '<td>'.$remise_all.'&nbsp;'.$langs->trans("Currency".$conf->currency).' '.$langs->trans("HT").'</td></tr>';
if (! empty($user->fk_soc)) // No need to show this for external users
{
print '<tr><td>'.$langs->trans("SupplierAbsoluteDiscountMy").'</td>';
@@ -344,11 +347,11 @@ if ($socid > 0)
print load_fiche_titre($langs->trans("NewGlobalDiscount"),'','');
print '<div class="underbanner clearboth"></div>';
if($isCustomer && ! $isSupplier) {
print '<input type="hidden" name="discount_type" value="0" />';
}
if(! $isCustomer && $isSupplier) {
print '<input type="hidden" name="discount_type" value="1" />';
}
@@ -356,8 +359,8 @@ if ($socid > 0)
print '<table class="border" width="100%">';
if($isCustomer && $isSupplier) {
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td>';
print '<td><input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
print '<td><input type="radio" name="discount_type" id="discount_type_0" checked="checked" value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
print ' &nbsp; <input type="radio" name="discount_type" id="discount_type_1" value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
print '</td></tr>';
}
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("AmountHT").'</td>';
@@ -401,7 +404,7 @@ if ($socid > 0)
/*
* Liste remises fixes client restant en cours (= liees a aucune facture ni ligne de facture)
*/
print load_fiche_titre($langs->trans("DiscountStillRemaining"));
if($isCustomer) {
@@ -424,10 +427,11 @@ if ($socid > 0)
$sql.= " AND rc.discount_type = 0"; // Eliminate supplier discounts
$sql.= " AND (rc.fk_facture_line IS NULL AND rc.fk_facture IS NULL)";
$sql.= " ORDER BY rc.datec DESC";
$resql=$db->query($sql);
if ($resql)
{
print '<div class="div-table-responsive-no-min">';
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
@@ -439,9 +443,9 @@ if ($socid > 0)
print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>';
print '<td width="50">&nbsp;</td>';
print '</tr>';
$showconfirminfo=array();
$i = 0;
$num = $db->num_rows($resql);
if ($num > 0)
@@ -449,7 +453,7 @@ if ($socid > 0)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
@@ -502,7 +506,7 @@ if ($socid > 0)
}
else print '<td>&nbsp;</td>';
print '</tr>';
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
{
$showconfirminfo['rowid']=$obj->rowid;
@@ -517,7 +521,8 @@ if ($socid > 0)
}
$db->free($resql);
print "</table>";
print '</div>';
if (count($showconfirminfo))
{
$amount1=price2num($showconfirminfo['amount_ttc']/2,'MT');
@@ -561,10 +566,11 @@ if ($socid > 0)
$sql.= " AND rc.discount_type = 1"; // Eliminate customer discounts
$sql.= " AND (rc.fk_invoice_supplier IS NULL AND rc.fk_invoice_supplier_line IS NULL)";
$sql.= " ORDER BY rc.datec DESC";
$resql=$db->query($sql);
if ($resql)
{
print '<div class="div-table-responsive-no-min">';
print '<table width="100%" class="noborder">';
print '<tr class="liste_titre">';
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
@@ -576,9 +582,9 @@ if ($socid > 0)
print '<td width="100" align="center">'.$langs->trans("DiscountOfferedBy").'</td>';
print '<td width="50">&nbsp;</td>';
print '</tr>';
$showconfirminfo=array();
$i = 0;
$num = $db->num_rows($resql);
if ($num > 0)
@@ -586,7 +592,7 @@ if ($socid > 0)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>'.dol_print_date($db->jdate($obj->dc),'dayhour').'</td>';
if (preg_match('/\(CREDIT_NOTE\)/',$obj->description))
@@ -639,7 +645,7 @@ if ($socid > 0)
}
else print '<td>&nbsp;</td>';
print '</tr>';
if ($_GET["action"]=='split' && GETPOST('remid') == $obj->rowid)
{
$showconfirminfo['rowid']=$obj->rowid;
@@ -654,7 +660,8 @@ if ($socid > 0)
}
$db->free($resql);
print "</table>";
print '</div>';
if (count($showconfirminfo))
{
$amount1=price2num($showconfirminfo['amount_ttc']/2,'MT');
@@ -673,19 +680,19 @@ if ($socid > 0)
dol_print_error($db);
}
if($isCustomer) {
if ($isCustomer) {
print '</div>'; // class="ficheaddleft"
print '</div>'; // class="fichehalfright"
print '</div>'; // class="fichecenter"
}
}
print '<br>';
print '<div class="clearboth"></div><br>';
/*
* List discount consumed (=liees a une ligne de facture ou facture)
*/
print load_fiche_titre($langs->trans("DiscountAlreadyCounted"));
if($isCustomer) {
@@ -730,12 +737,13 @@ if ($socid > 0)
$sql2.= " AND rc.fk_user = u.rowid";
$sql2.= " AND rc.discount_type = 0"; // Eliminate supplier discounts
$sql2.= " ORDER BY dc DESC";
$resql=$db->query($sql);
$resql2=null;
if ($resql) $resql2=$db->query($sql2);
if ($resql2)
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
@@ -747,7 +755,7 @@ if ($socid > 0)
print '<td width="100" align="center">'.$langs->trans("Author").'</td>';
print '<td width="50">&nbsp;</td>';
print '</tr>';
$tab_sqlobj=array();
$tab_sqlobjOrder=array();
$num = $db->num_rows($resql);
@@ -761,7 +769,7 @@ if ($socid > 0)
}
}
$db->free($resql);
$num = $db->num_rows($resql2);
for ($i = 0;$i < $num;$i++)
{
@@ -771,7 +779,7 @@ if ($socid > 0)
}
$db->free($resql2);
array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj);
$num = count($tab_sqlobj);
if ($num > 0)
{
@@ -830,8 +838,9 @@ if ($socid > 0)
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table>";
print '</div>';
}
else
{
@@ -882,12 +891,13 @@ if ($socid > 0)
$sql2.= " AND rc.fk_user = u.rowid";
$sql2.= " AND rc.discount_type = 1"; // Eliminate customer discounts
$sql2.= " ORDER BY dc DESC";
$resql=$db->query($sql);
$resql2=null;
if ($resql) $resql2=$db->query($sql2);
if ($resql2)
{
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="widthdate">'.$langs->trans("Date").'</td>'; // Need 120+ for format with AM/PM
@@ -899,7 +909,7 @@ if ($socid > 0)
print '<td width="100" align="center">'.$langs->trans("Author").'</td>';
print '<td width="50">&nbsp;</td>';
print '</tr>';
$tab_sqlobj=array();
$tab_sqlobjOrder=array();
$num = $db->num_rows($resql);
@@ -913,7 +923,7 @@ if ($socid > 0)
}
}
$db->free($resql);
$num = $db->num_rows($resql2);
for ($i = 0;$i < $num;$i++)
{
@@ -923,7 +933,7 @@ if ($socid > 0)
}
$db->free($resql2);
array_multisort($tab_sqlobjOrder,SORT_DESC,$tab_sqlobj);
$num = count($tab_sqlobj);
if ($num > 0)
{
@@ -982,8 +992,9 @@ if ($socid > 0)
{
print '<tr><td colspan="8" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
}
print "</table>";
print '</div>';
}
else
{

View File

@@ -662,7 +662,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -679,7 +679,7 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '') && (! ($price_ht_devise >= 0) || $price_ht_devise == '')) // Unit price can be 0 but not ''
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') // Unit price can be 0 but not ''. Also price can be negative for order.
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
@@ -1023,7 +1023,7 @@ if (empty($reshook))
// Extrafields Lines
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
// Unset extrafield POST Data
if (is_array($extralabelsline)) {
foreach ($extralabelsline as $key => $value) {
@@ -1987,7 +1987,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->commande->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherOrders").'</a>)';
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{
@@ -2190,7 +2190,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '</tr></table>';
print '</td><td>';
if ($action == 'editmode') {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id');
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT');
} else {
$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none');
}
@@ -2387,7 +2387,7 @@ if ($action == 'create' && $user->rights->commande->creer)
// Total HT
$alert = '';
if($object->total_ht < $object->thirdparty->order_min_amount) {
if (! empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) {
$alert = ' ' . img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
}
print '<tr><td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';

View File

@@ -9,8 +9,8 @@
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -85,6 +85,9 @@ class Commande extends CommonOrder
*/
public $billed; // billed or not
/**
* @var int Draft Status of the order
*/
public $brouillon;
public $cond_reglement_code;
@@ -233,7 +236,7 @@ class Commande extends CommonOrder
$mybool|=@include_once $dir.$file;
}
if (! $mybool)
if ($mybool === false)
{
dol_print_error('',"Failed to include file ".$file);
return '';
@@ -407,6 +410,7 @@ class Commande extends CommonOrder
{
$this->ref = $num;
$this->statut = self::STATUS_VALIDATED;
$this->brouillon = 0;
}
if (! $error)
@@ -1263,44 +1267,46 @@ class Commande extends CommonOrder
$logtext.= ", date_end=$date_end, type=$type special_code=$special_code, fk_unit=$fk_unit, origin=$origin, origin_id=$origin_id, pu_ht_devise=$pu_ht_devise";
dol_syslog(get_class($this).$logtext, LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
if ($this->statut == self::STATUS_DRAFT)
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0;
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($this->fk_multicurrency)) $this->fk_multicurrency=0;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
$label=trim($label);
$desc=trim($desc);
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1'
}
$txlocaltax1 = price2num($txlocaltax1);
$txlocaltax2 = price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
$label=trim($label);
$desc=trim($desc);
// Check parameters
if ($type < 0) return -1;
// Check parameters
if ($type < 0) return -1;
if ($this->statut == self::STATUS_DRAFT)
{
$this->db->begin();
$product_type=$type;
@@ -1877,6 +1883,9 @@ class Commande extends CommonOrder
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
$line->fetch_optionals();
$this->lines[$i] = $line;
$i++;
@@ -4253,9 +4262,10 @@ class OrderLine extends CommonOrderLine
}
/**
* Update totals of order into database
* Update DB line fields total_xxx
* Used by migration
*
* @return int <0 if ko, >0 if ok
* @return int <0 if KO, >0 if OK
*/
function update_total()
{

View File

@@ -467,6 +467,8 @@ if ($resql)
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="viewstatut" value="'.$viewstatut.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, $newcardbutton, '', $limit);
@@ -529,7 +531,7 @@ if ($resql)
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
}
$moreforfilter='';

View File

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

View File

@@ -43,7 +43,7 @@ class Account extends CommonObject
/**
* @var int Use id instead of rowid
* @deprecated
* @see id
* @see $id
*/
public $rowid;
@@ -1159,8 +1159,7 @@ class Account extends CommonObject
return -1;
}
return $solde;
return price2num($solde, 'MU');
}
/**
@@ -1430,7 +1429,7 @@ class Account extends CommonObject
{
$country_code=$this->getCountryCode();
if (in_array($country_code,array('CH','FR','ES','GA','IT','NC'))) return 1; // France, Spain, Gabon, ...
if (in_array($country_code,array('FR','ES','GA','IT','NC'))) return 1; // France, Spain, Gabon, ... - Not valid for CH
if (in_array($country_code,array('AU','BE','CA','DE','DK','GR','GB','ID','IE','IR','KR','NL','NZ','UK','US'))) return 2; // Australia, England...
return 0;
}

View File

@@ -257,7 +257,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($sall)
{
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $all) . join(', ',$fieldstosearchall).'</div>';
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'</div>';
}
$moreforfilter='';

View File

@@ -455,7 +455,7 @@ while($j<$numlt)
// Payment Salary
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
{
if (! $mode || $mode != 'sconly')
{

View File

@@ -92,11 +92,6 @@ $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') :
$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
// Security check
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
if ($user->societe_id) $socid = $user->societe_id;
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid);
// Nombre de ligne pour choix de produit/service predefinis
$NBLINES = 4;
@@ -117,6 +112,12 @@ $permissionnote = $user->rights->facture->creer; // Used by the include of actio
$permissiondellink=$user->rights->facture->creer; // Used by the include of actions_dellink.inc.php
$permissiontoedit = $user->rights->facture->creer; // Used by the include of actions_lineupdonw.inc.php
// Security check
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
if ($user->societe_id) $socid = $user->societe_id;
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, null, $isdraft);
/*
* Actions
@@ -177,7 +178,7 @@ if (empty($reshook))
}
// Delete invoice
else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->supprimer) {
else if ($action == 'confirm_delete' && $confirm == 'yes') {
$result = $object->fetch($id);
$object->fetch_thirdparty();
@@ -190,7 +191,10 @@ if (empty($reshook))
$qualified_for_stock_change = $object->hasProductsOrServices(1);
}
if ($object->is_erasable())
$isErasable=$object->is_erasable();
if (($user->rights->facture->supprimer && $isErasable > 0)
|| ($user->rights->facture->creer && $isErasable == 1))
{
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
@@ -513,7 +517,7 @@ if (empty($reshook))
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == - 1) {
$error ++;
$error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = '';
}
@@ -573,7 +577,7 @@ if (empty($reshook))
if ($object->type != Facture::TYPE_DEPOSIT && ! empty($conf->global->STOCK_CALCULATE_ON_BILL) && $qualified_for_stock_change)
{
if (! $idwarehouse || $idwarehouse == - 1) {
$error ++;
$error++;
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = '';
}
@@ -684,6 +688,7 @@ if (empty($reshook))
$db->begin();
$amount_ht = $amount_tva = $amount_ttc = array();
$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
// Loop on each vat rate
$i = 0;
@@ -694,7 +699,10 @@ if (empty($reshook))
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;
$amount_ttc[$line->tva_tx] += $line->total_ttc;
$i ++;
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
$i++;
}
}
@@ -718,20 +726,31 @@ if (empty($reshook))
{
// If we're on a standard invoice, we have to get excess received to create a discount in TTC without VAT
// Total payments
$sql = 'SELECT SUM(pf.amount) as total_paiements';
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf, '.MAIN_DB_PREFIX.'paiement as p';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as c ON p.fk_paiement = c.id';
$sql.= ' WHERE pf.fk_facture = '.$object->id;
$sql.= ' AND pf.fk_paiement = p.rowid';
$sql.= ' AND p.entity IN (' . getEntity('facture').')';
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
$res = $db->fetch_object($resql);
$total_paiements = $res->total_paiements;
$discount->amount_ht = $discount->amount_ttc = $total_paiements - $object->total_ttc;
// Total credit note and deposit
$total_creditnote_and_deposit = 0;
$sql = "SELECT re.rowid, re.amount_ht, re.amount_tva, re.amount_ttc,";
$sql .= " re.description, re.fk_facture_source";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe_remise_except as re";
$sql .= " WHERE fk_facture = " . $object->id;
$resql = $db->query($sql);
if (!empty($resql)) {
while ($obj = $db->fetch_object($resql)) $total_creditnote_and_deposit += $obj->amount_ttc;
} else dol_print_error($db);
$discount->amount_ht = $discount->amount_ttc = $total_paiements + $total_creditnote_and_deposit - $object->total_ttc;
$discount->amount_tva = 0;
$discount->tva_tx = 0;
@@ -749,6 +768,9 @@ if (empty($reshook))
$discount->amount_ht = abs($amount_ht[$tva_tx]);
$discount->amount_tva = abs($amount_tva[$tva_tx]);
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
$discount->tva_tx = abs($tva_tx);
$result = $discount->create($user);
@@ -832,7 +854,7 @@ if (empty($reshook))
}
if (! ($_POST['fac_replacement'] > 0)) {
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors');
}
@@ -878,14 +900,14 @@ if (empty($reshook))
$sourceinvoice = GETPOST('fac_avoir');
if (! ($sourceinvoice > 0) && empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE))
{
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CorrectInvoice")), null, 'errors');
}
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($dateinvoice))
{
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->trans("Date")), null, 'errors');
}
@@ -953,6 +975,8 @@ if (empty($reshook))
if($facture_source->type == Facture::TYPE_SITUATION)
{
$source_fk_prev_id = $line->fk_prev_id; // temporary storing situation invoice fk_prev_id
$line->fk_prev_id = $line->id; // Credit note line need to be linked to the situation invoice it is create from
if(!empty($facture_source->tab_previous_situation_invoice))
{
@@ -976,7 +1000,7 @@ if (empty($reshook))
$maxPrevSituationPercent = 0;
foreach($facture_source->tab_previous_situation_invoice[$lineIndex]->lines as $prevLine)
{
if($prevLine->id == $line->fk_prev_id)
if($prevLine->id == $source_fk_prev_id)
{
$maxPrevSituationPercent = max($maxPrevSituationPercent,$prevLine->situation_percent);
@@ -1109,7 +1133,7 @@ if (empty($reshook))
{
if (GETPOST('socid', 'int') < 1)
{
$error ++;
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), null, 'errors');
}
@@ -1266,28 +1290,29 @@ if (empty($reshook))
$qualified=1;
if (empty($lines[$i]->qty)) $qualified=0; // We discard qty=0, it is an option
if (! empty($lines[$i]->special_code)) $qualified=0; // We discard special_code (frais port, ecotaxe, option, ...)
if ($qualified) $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
if ($qualified){
$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
$tva_tx = $lines[$i]->tva_tx;
$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100;
}
}
if ($totalamount != 0) {
if ($numlines > 0) $numlines = $numlines-1;
$tva_tx = $lines[$numlines]->tva_tx;
if (! empty($lines[$numlines]->vat_src_code) && ! preg_match('/\(/', $tva_tx)) $tva_tx .= ' ('.$lines[$numlines]->vat_src_code.')';
$amountdeposit[$tva_tx] = ($totalamount * $valuedeposit) / 100;
} else {
if($totalamount == 0) {
$amountdeposit[0] = 0;
}
} else {
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++;
$error++;
}
}
$amount_ttc_diff = $amountdeposit[0];
}
foreach ($amountdeposit as $tva => $amount)
{
if (empty($amount)) continue;
$arraylist = array('amount' => 'FixAmount','variable' => 'VarAmount');
$descline = $langs->trans('Deposit');
//$descline.= ' - '.$langs->trans($arraylist[$typeamount]);
@@ -1296,6 +1321,7 @@ if (empty($reshook))
} elseif ($typeamount=='variable') {
$descline.= ' ('. $valuedeposit.'%)';
}
$descline.= ' - '.$srcobject->ref;
$result = $object->addline(
$descline,
@@ -1352,6 +1378,8 @@ if (empty($reshook))
{
// Don't add lines with qty 0 when coming from a shipment including all order lines
if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue;
// Don't add closed lines when coming from a contract
if($srcobject->element == 'contrat' && $lines[$i]->statut == 5) continue;
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
@@ -1373,7 +1401,7 @@ if (empty($reshook))
$result = $object->insert_discount($discountid); // This include link_to_invoice
} else {
setEventMessages($discount->error, $discount->errors, 'errors');
$error ++;
$error++;
break;
}
} else {
@@ -1429,7 +1457,7 @@ if (empty($reshook))
$lineid = $result;
} else {
$lineid = 0;
$error ++;
$error++;
break;
}
@@ -1441,7 +1469,7 @@ if (empty($reshook))
}
} else {
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++;
$error++;
}
}
@@ -1509,14 +1537,16 @@ if (empty($reshook))
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture)) {
$error++;
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("Date")) . '</div>';
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("Date"));
setEventMessages($mesg, null, 'errors');
}
$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);
if (!($_POST['situations'] > 0)) {
$error++;
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation")) . '</div>';
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation"));
setEventMessages($mesg, null, 'errors');
}
if (!$error) {
@@ -1533,7 +1563,9 @@ if (empty($reshook))
{
$line->origin = $object->origin;
$line->origin_id = $line->id;
$line->fk_prev_id = $line->id;
$line->fetch_optionals($line->id);
$line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
if ($line->fk_remise_except)
@@ -1654,7 +1686,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -1665,37 +1697,46 @@ if (empty($reshook))
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
$error++;
}
if (!$prod_entry_mode)
{
if (GETPOST('type') < 0 && ! GETPOST('search_idprod'))
{
setEventMessages($langs->trans('ErrorChooseBetweenFreeEntryOrPredefinedProduct'), null, 'errors');
$error ++;
$error++;
}
}
if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error ++;
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
if (($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error ++;
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
}
if ($qty == '') {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++;
$error++;
}
if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error ++;
$error++;
}
if ($qty < 0) {
$langs->load("errors");
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++;
$error++;
}
if (!$error && !empty($conf->variants->enabled) && $prod_entry_mode != 'free') {
@@ -1707,7 +1748,7 @@ if (empty($reshook))
$idprod = $res->fk_product_child;
} else {
setEventMessage($langs->trans('ErrorProductCombinationNotFound'), 'errors');
$error ++;
$error++;
}
}
}
@@ -2052,7 +2093,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -2113,7 +2154,7 @@ if (empty($reshook))
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error ++;
$error++;
}
} else {
$type = GETPOST('type');
@@ -2122,14 +2163,29 @@ if (empty($reshook))
// Check parameters
if (GETPOST('type') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error ++;
$error++;
}
}
if ($qty < 0) {
$langs->load("errors");
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++;
$error++;
}
if ((empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') && $object->type != Facture::TYPE_CREDIT_NOTE) // Unit price can be 0 but not ''
{
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
}
// Update line
if (! $error) {
@@ -2216,11 +2272,13 @@ if (empty($reshook))
if (!$object->fetch($id) > 0) dol_print_error($db);
if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
{
$all_progress = GETPOST('all_progress', 'int');
foreach ($object->lines as $line)
{
$percent = $line->get_prev_progress($object->id);
if (GETPOST('all_progress') < $percent) {
$mesg = '<div class="warning">' . $langs->trans("CantBeLessThanMinPercent") . '</div>';
if (floatval($all_progress) < floatval($percent)) {
$mesg = $langs->trans("Line") . ' ' . $i . ' '. $line->ref .' : ' . $langs->trans("CantBeLessThanMinPercent");
setEventMessages($mesg, null, 'warnings');
$result = -1;
} else
$object->update_percent($line, $_POST['all_progress']);
@@ -3223,8 +3281,7 @@ if ($action == 'create')
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1);
// We check if Origin document (id and type is known) has already at least one invoice attached to it
$objectsrc->fetchObjectLinked($originid,$origin,'','facture');
$cntinvoice=count($objectsrc->linkedObjects['facture']);
if ($cntinvoice>=1)
if (is_array($objectsrc->linkedObjects['facture']) && count($objectsrc->linkedObjects['facture']) >= 1)
{
setEventMessages('WarningBillExist', null, 'warnings');
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
@@ -3619,7 +3676,7 @@ else if ($id > 0 || ! empty($ref))
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->facture->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1,'customer');
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'">'.$langs->trans("OtherBills").'</a>)';
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{
@@ -4501,7 +4558,7 @@ else if ($id > 0 || ! empty($ref))
$ret = $object->printObjectLines($action, $mysoc, $soc, $lineid, 1);
// Form to add new line
if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline' && ($object->is_first() || !$object->situation_cycle_ref))
if ($object->statut == 0 && $user->rights->facture->creer && $action != 'valid' && $action != 'editline')
{
if ($action != 'editline' && $action != 'selectlines')
{
@@ -4778,9 +4835,9 @@ else if ($id > 0 || ! empty($ref))
}
// Delete
if ($user->rights->facture->supprimer)
$isErasable = $object->is_erasable();
if ($user->rights->facture->supprimer || ($user->rights->facture->creer && $isErasable == 1)) // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
{
$isErasable = $object->is_erasable();
//var_dump($isErasable);
if ($isErasable == -4) {
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("DisabledBecausePayments") . '">' . $langs->trans('Delete') . '</a></div>';

View File

@@ -206,7 +206,7 @@ class Facture extends CommonInvoice
* If paid partially, $this->close_code can be:
* - CLOSECODE_DISCOUNTVAT
* - CLOSECODE_BADDEBT
* If paid completelly, this->close_code will be null
* If paid completely, this->close_code will be null
*/
const STATUS_CLOSED = 2;
@@ -1177,6 +1177,10 @@ class Facture extends CommonInvoice
if ($user->rights->facture->lire) {
$label = '<u>' . $langs->trans("ShowInvoice") . '</u>';
if ($this->type == self::TYPE_REPLACEMENT) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceReplace") . '</u>';
if ($this->type == self::TYPE_CREDIT_NOTE) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceAvoir") . '</u>';
if ($this->type == self::TYPE_DEPOSIT) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceDeposit") . '</u>';
if ($this->type == self::TYPE_SITUATION) $label='<u>' . $langs->transnoentitiesnoconv("ShowInvoiceSituation") . '</u>';
if (! empty($this->ref))
$label .= '<br><b>'.$langs->trans('Ref') . ':</b> ' . $this->ref;
if (! empty($this->ref_client))
@@ -1185,16 +1189,12 @@ class Facture extends CommonInvoice
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax1))
$label.= '<br><b>' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax2))
if (! empty($this->total_localtax1) && $this->total_localtax1 != 0) // We keep test != 0 because $this->total_localtax1 can be '0.00000000'
$label.= '<br><b>eee' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax2) && $this->total_localtax2 != 0)
$label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
if ($this->type == self::TYPE_REPLACEMENT) $label=$langs->transnoentitiesnoconv("ShowInvoiceReplace").': '.$this->ref;
if ($this->type == self::TYPE_CREDIT_NOTE) $label=$langs->transnoentitiesnoconv("ShowInvoiceAvoir").': '.$this->ref;
if ($this->type == self::TYPE_DEPOSIT) $label=$langs->transnoentitiesnoconv("ShowInvoiceDeposit").': '.$this->ref;
if ($this->type == self::TYPE_SITUATION) $label=$langs->transnoentitiesnoconv("ShowInvoiceSituation").': '.$this->ref;
if ($moretitle) $label.=' - '.$moretitle;
}
@@ -1379,7 +1379,7 @@ class Facture extends CommonInvoice
}
else
{
$this->error='Bill with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found';
$this->error='Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found';
dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR);
return 0;
}
@@ -1485,7 +1485,7 @@ class Facture extends CommonInvoice
$line->multicurrency_total_tva = $objp->multicurrency_total_tva;
$line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
// TODO Fetch optional like done in fetch line of facture_rec ?
$line->fetch_optionals();
$this->lines[$i] = $line;
@@ -1605,7 +1605,7 @@ class Facture extends CommonInvoice
$sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").",";
$sql.= " situation_cycle_ref=".(empty($this->situation_cycle_ref)?"null":$this->db->escape($this->situation_cycle_ref)).",";
$sql.= " situation_counter=".(empty($this->situation_counter)?"null":$this->db->escape($this->situation_counter)).",";
$sql.= " situation_final=".(empty($this->situation_counter)?"0":$this->db->escape($this->situation_counter));
$sql.= " situation_final=".(empty($this->situation_final)?"0":$this->db->escape($this->situation_final));
$sql.= " WHERE rowid=".$this->id;
$this->db->begin();
@@ -1709,9 +1709,9 @@ class Facture extends CommonInvoice
$facligne->total_ttc = -$remise->amount_ttc;
$facligne->multicurrency_subprice = -$remise->multicurrency_subprice;
$facligne->multicurrency_total_ht = -$remise->multicurrency_total_ht;
$facligne->multicurrency_total_tva = -$remise->multicurrency_total_tva;
$facligne->multicurrency_total_ttc = -$remise->multicurrency_total_ttc;
$facligne->multicurrency_total_ht = -$remise->multicurrency_amount_ht;
$facligne->multicurrency_total_tva = -$remise->multicurrency_amount_tva;
$facligne->multicurrency_total_ttc = -$remise->multicurrency_amount_ttc;
$lineid=$facligne->insert();
if ($lineid > 0)
@@ -2370,7 +2370,7 @@ class Facture extends CommonInvoice
}
}
// Set new ref and define current statut
// Set new ref and define current status
if (! $error)
{
$this->ref = $num;
@@ -2590,55 +2590,47 @@ class Facture extends CommonInvoice
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::addline id=$this->id,desc=$desc,pu_ht=$pu_ht,qty=$qty,txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product,remise_percent=$remise_percent,date_start=$date_start,date_end=$date_end,ventil=$ventil,info_bits=$info_bits,fk_remise_except=$fk_remise_except,price_base_type=$price_base_type,pu_ttc=$pu_ttc,type=$type, fk_unit=$fk_unit", LOG_DEBUG);
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($ventil)) $ventil=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($fk_prev_id)) $fk_prev_id = 'null';
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
if (! empty($this->brouillon))
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
// Clean parameters
if (empty($remise_percent)) $remise_percent=0;
if (empty($qty)) $qty=0;
if (empty($info_bits)) $info_bits=0;
if (empty($rang)) $rang=0;
if (empty($ventil)) $ventil=0;
if (empty($txtva)) $txtva=0;
if (empty($txlocaltax1)) $txlocaltax1=0;
if (empty($txlocaltax2)) $txlocaltax2=0;
if (empty($fk_parent_line) || $fk_parent_line < 0) $fk_parent_line=0;
if (empty($fk_prev_id)) $fk_prev_id = 'null';
if (! isset($situation_percent) || $situation_percent > 100 || (string) $situation_percent == '') $situation_percent = 100;
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
if ($price_base_type=='HT')
{
$pu=$pu_ht;
}
else
{
$pu=$pu_ttc;
}
// Check parameters
if ($type < 0) return -1;
$this->db->begin();
$product_type=$type;
@@ -2656,6 +2648,16 @@ class Facture extends CommonInvoice
}
}
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
@@ -3742,7 +3744,7 @@ class Facture extends CommonInvoice
$response = new WorkboardResponse();
$response->warning_delay=$conf->facture->client->warning_delay/60/60/24;
$response->label=$langs->trans("CustomerBillsUnpaid");
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=accountancy&leftmenu=customers_bills';
$response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=billing&leftmenu=customers_bills';
$response->img=img_object('',"bill");
$generic_facture = new Facture($this->db);
@@ -4784,8 +4786,8 @@ class FactureLigne extends CommonInvoiceLine
}
/**
* Mise a jour en base des champs total_xxx de ligne de facture
* TODO What is goal of this method ?
* Update DB line fields total_xxx
* Used by migration
*
* @return int <0 if KO, >0 if OK
*/
@@ -4828,14 +4830,15 @@ class FactureLigne extends CommonInvoiceLine
* Warning: If invoice is a replacement invoice, this->fk_prev_id is id of the replaced line.
*
* @param int $invoiceid Invoice id
* @param bool $include_credit_note Include credit note or not
* @return int >= 0
*/
function get_prev_progress($invoiceid)
function get_prev_progress($invoiceid, $include_credit_note=true)
{
if (is_null($this->fk_prev_id) || empty($this->fk_prev_id) || $this->fk_prev_id == "") {
return 0;
} else {
// If invoice is a not a situation invoice, this->fk_prev_id is used for something else
// If invoice is not a situation invoice, this->fk_prev_id is used for something else
$tmpinvoice=new Facture($this->db);
$tmpinvoice->fetch($invoiceid);
if ($tmpinvoice->type != Facture::TYPE_SITUATION) return 0;
@@ -4844,7 +4847,26 @@ class FactureLigne extends CommonInvoiceLine
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
return floatval($res['situation_percent']);
$returnPercent = floatval($res['situation_percent']);
if($include_credit_note) {
$sql = 'SELECT fd.situation_percent FROM ' . MAIN_DB_PREFIX . 'facturedet fd';
$sql.= ' JOIN ' . MAIN_DB_PREFIX . 'facture f ON (f.rowid = fd.fk_facture) ';
$sql.= ' WHERE fd.fk_prev_id =' . $this->fk_prev_id;
$sql.= ' AND f.situation_cycle_ref = '.$tmpinvoice->situation_cycle_ref; // Prevent cycle outed
$sql.= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
$res = $this->db->query($sql);
if($res) {
while($obj = $this->db->fetch_object($res)) {
$returnPercent = $returnPercent + floatval($obj->situation_percent);
}
}
}
return $returnPercent;
} else {
$this->error = $this->db->error();
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);

View File

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

View File

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

View File

@@ -453,7 +453,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline))
{
@@ -776,7 +776,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line);
$objectline = new FactureLigneRec($db);
if ($objectline->fetch(GETPOST('lineid')))

View File

@@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
// Load translation files required by the page
$langs->loadLangs(array('bills', 'companies', 'products'));
$langs->loadLangs(array('bills', 'companies', 'products', 'categories'));
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
$projectid=(GETPOST('projectid')?GETPOST('projectid','int'):0);
@@ -464,7 +464,7 @@ if ($search_month > 0)
if ($search_year > 0 && empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
else if ($search_year > 0 && ! empty($search_day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $serch_year))."'";
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$search_month."'";
}
@@ -509,8 +509,9 @@ if (! $sall)
$sql.= ' typent.code,';
$sql.= ' state.code_departement, state.nom,';
$sql.= ' country.code,';
$sql.= " p.rowid, p.ref";
$sql.= " p.rowid, p.ref, p.title";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');
@@ -574,14 +575,14 @@ if ($resql)
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user);
if ($search_product_category > 0) $param.='$search_product_category=' .urlencode($search_product_category);
if ($search_product_category > 0) $param.='&search_product_category=' .urlencode($search_product_category);
if ($search_montant_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat);
if ($search_montant_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2);
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode);
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($show_files) $param.='&show_files='.urlencode($show_files);
if ($option) $param.="&search_option=".urlencode($option);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
@@ -908,6 +909,7 @@ if ($resql)
print "</tr>\n";
$projectstatic=new Project($db);
$discount = new DiscountAbsolute($db);
if ($num > 0)
{
@@ -922,6 +924,9 @@ if ($resql)
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
$facturestatic->statut=$obj->fk_statut;
$facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->paye=$obj->paye;
$facturestatic->fk_soc=$obj->fk_soc;
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
$facturestatic->note_public=$obj->note_public;
$facturestatic->note_private=$obj->note_private;
@@ -941,7 +946,12 @@ if ($resql)
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay;
$remaintopay = $facturestatic->total_ttc - $totalpay;
if ($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) {
$remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = $facturestatic->total_ttc - $remaintopay;
}
print '<tr class="oddeven">';
if (! empty($arrayfields['f.facnumber']['checked']))

View File

@@ -120,7 +120,7 @@ function pt($db, $sql, $date)
if ($obj->mode == 'claimed' && ! empty($previousmode))
{
print '<tr class="oddeven">';
print '<td class="nowrap">'.$obj->dm."</td>\n";
print '<td class="nowrap">'.$previousmonth."</td>\n";
print '<td class="nowrap" align="right">'.price($amountclaimed)."</td>\n";
print '<td class="nowrap" align="right">'.price($amountpaid)."</td>\n";
print "</tr>\n";
@@ -270,7 +270,7 @@ $mend = $tmp['mon'];
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
$i=0; $mcursor=0;
while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
{
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
if ($m == 13) $y++;
@@ -535,7 +535,7 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu
if ($i > 2)
{
print '<tr class="liste_total">';
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll,'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye,'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotal,'MT')).'</td>';

View File

@@ -250,11 +250,14 @@ if (empty($reshook))
$paiement->amounts = $amounts; // Array with all payments dispatching with invoice id
$paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching
$paiement->paiementid = dol_getIdFromCode($db,GETPOST('paiementcode'),'c_paiement','code','id',1);
$paiement->num_paiement = GETPOST('num_paiement');
$paiement->note = GETPOST('comment');
$paiement->num_paiement = GETPOST('num_paiement', 'alpha');
$paiement->note = GETPOST('comment', 'alpha');
if (! $error)
{
// Create payment and update this->multicurrency_amounts if this->amounts filled or
// this->amounts if this->multicurrency_amounts filled.
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0)); // This include closing invoices and regenerating documents
if ($paiement_id < 0)
{
@@ -279,7 +282,7 @@ if (empty($reshook))
{
$db->commit();
// If payment dispatching on more than one invoice, we keep on summary page, otherwise jump on invoice card
// If payment dispatching on more than one invoice, we stay on summary page, otherwise jump on invoice card
$invoiceid=0;
foreach ($paiement->amounts as $key => $amount)
{
@@ -649,12 +652,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print '</td>';
// Multicurrency Price
// Multicurrency remain to pay
print '<td align="right">';
if ($objp->multicurrency_code && $objp->multicurrency_code != $conf->currency) print price($sign * $multicurrency_remaintopay);
print '</td>';
print '<td align="right">';
print '<td class="right nowraponall">';
// Add remind multicurrency amount
$namef = 'multicurrency_amount_'.$objp->facid;
@@ -666,12 +669,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
if (!empty($conf->use_javascript_ajax))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $multicurrency_remaintopay)."'");
print '<input type="text" class="maxwidth75 multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
print '<input type=hidden class="multicurrency_remain" name="'.$nameRemain.'" value="'.$multicurrency_remaintopay.'">';
print '<input type="text" size="8" class="multicurrency_amount" name="'.$namef.'" value="'.$_POST[$namef].'">';
}
else
{
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
print '<input type="text" class="maxwidth75" name="'.$namef.'_disabled" value="'.$_POST[$namef].'" disabled>';
print '<input type="hidden" name="'.$namef.'" value="'.$_POST[$namef].'">';
}
}
@@ -692,7 +695,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
//$test= price(price2num($objp->total_ttc - $paiement - $creditnotes - $deposits));
// Amount
print '<td align="right">';
print '<td class="right nowraponall">';
// Add remind amount
$namef = 'amount_'.$objp->facid;
@@ -702,12 +705,12 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
if (!empty($conf->use_javascript_ajax))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
print '<input type="text" class="maxwidth75 amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
print '<input type="hidden" class="remain" name="'.$nameRemain.'" value="'.$remaintopay.'">';
print '<input type="text" size="8" class="amount" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
}
else
{
print '<input type="text" size="8" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
print '<input type="text" class="maxwidth75" name="'.$namef.'_disabled" value="'.dol_escape_htmltag(GETPOST($namef)).'" disabled>';
print '<input type="hidden" name="'.$namef.'" value="'.dol_escape_htmltag(GETPOST($namef)).'">';
}
print "</td>";

View File

@@ -91,7 +91,7 @@ $max=10;
$sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,";
$sql.= " bc.statut, bc.nbcheque,";
$sql.= " ba.ref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
$sql.= " ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,";
$sql.= " aj.code";
$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal";
@@ -120,7 +120,7 @@ if ($resql)
$checkdepositstatic->statut=$objp->statut;
$accountstatic->id=$objp->bid;
$accountstatic->ref=$objp->ref;
$accountstatic->ref=$objp->bref;
$accountstatic->label=$objp->label;
$accountstatic->number=$objp->number;
$accountstatic->currency_code=$objp->currency_code;

View File

@@ -292,6 +292,7 @@ class Paiement extends CommonObject
if ($invoice->type == Facture::TYPE_DEPOSIT)
{
$amount_ht = $amount_tva = $amount_ttc = array();
$multicurrency_amount_ht = $multicurrency_amount_tva = $multicurrency_amount_ttc = array();
// Insert one discount by VAT rate category
$discount = new DiscountAbsolute($this->db);
@@ -310,6 +311,9 @@ class Paiement extends CommonObject
$amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva;
$amount_ttc[$line->tva_tx] += $line->total_ttc;
$multicurrency_amount_ht[$line->tva_tx] += $line->multicurrency_total_ht;
$multicurrency_amount_tva[$line->tva_tx] += $line->multicurrency_total_tva;
$multicurrency_amount_ttc[$line->tva_tx] += $line->multicurrency_total_ttc;
$i++;
}
}
@@ -318,6 +322,9 @@ class Paiement extends CommonObject
$discount->amount_ht = abs($amount_ht[$tva_tx]);
$discount->amount_tva = abs($amount_tva[$tva_tx]);
$discount->amount_ttc = abs($amount_ttc[$tva_tx]);
$discount->multicurrency_amount_ht = abs($multicurrency_amount_ht[$tva_tx]);
$discount->multicurrency_amount_tva = abs($multicurrency_amount_tva[$tva_tx]);
$discount->multicurrency_amount_ttc = abs($multicurrency_amount_ttc[$tva_tx]);
$discount->tva_tx = abs($tva_tx);
$result = $discount->create($user);
@@ -995,7 +1002,7 @@ class Paiement extends CommonObject
/**
* get the right way of payment
*
* @return string 'dolibarr' if standard comportment or paid in dolibarr currency, 'customer' if payment received from multicurrency inputs
* @return string 'dolibarr' if standard comportment or paid in main currency, 'customer' if payment received from multicurrency inputs
*/
function getWay()
{

View File

@@ -39,7 +39,7 @@ $action=GETPOST('action','aZ09');
// Security check
$socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', '', '', 'payment');
$result = restrictedArea($user, 'salaries', '', '', '');
$object = new PaymentSalary($db);

View File

@@ -44,8 +44,9 @@ $action = GETPOST('action','alpha');
$confirm = GETPOST('confirm','alpha');
// Security check
$socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', $id, '');
$result = restrictedArea($user, 'salaries', '', '', '');
// Get parameters

View File

@@ -148,7 +148,7 @@ if ($result)
if ($optioncss != '') $param.='&amp;optioncss='.$optioncss;
$newcardbutton='';
if ($user->rights->salaries->payment->write)
if (! empty($user->rights->salaries->write))
{
$newcardbutton='<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/salaries/card.php?action=create"><span class="valignmiddle">'.$langs->trans('NewSalaryPayment').'</span>';
$newcardbutton.= '<span class="fa fa-plus-circle valignmiddle"></span>';

View File

@@ -41,18 +41,6 @@ $socid = GETPOST("socid","int");
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'salaries', '', '', '');
// Other security check
$childids = $user->getAllChildIds();
$childids[]=$user->id;
if ($userid > 0)
{
if (empty($user->rights->salaries->payment->readall) && ! in_array($userid, $childids))
{
accessforbidden();
exit;
}
}
$nowyear=strftime("%Y", dol_now());
$year = GETPOST('year')>0?GETPOST('year'):$nowyear;
//$startyear=$year-2;
@@ -77,11 +65,6 @@ print load_fiche_titre($title, $mesg);
dol_mkdir($dir);
$useridtofilter=$userid; // Filter from parameters
if (empty($useridtofilter))
{
$useridtofilter=$childids;
if (! empty($user->rights->salaries->payment->readall)) $useridtofilter=0;
}
$stats = new SalariesStats($db, $socid, $useridtofilter);

View File

@@ -288,10 +288,12 @@ class ChargeSociales extends CommonObject
* Met a jour une charge sociale
*
* @param User $user Utilisateur qui modifie
* @param int $notrigger 0=launch triggers after, 1=disable triggers
* @return int <0 si erreur, >0 si ok
*/
function update($user)
function update($user,$notrigger=0)
{
$error=0;
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."chargesociales";
@@ -305,17 +307,40 @@ class ChargeSociales extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
if (! $resql) {
$error++; $this->errors[]="Error ".$this->db->lasterror();
}
if (! $error)
{
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('SOCIALCHARGES_MODIFY',$user);
if ($result < 0) $error++;
// End call triggers
}
}
// Commit or rollback
if ($error)
{
foreach($this->errors as $errmsg)
{
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
$this->error.=($this->error?', '.$errmsg:$errmsg);
}
$this->db->rollback();
return -1*$error;
}
else
{
$this->db->commit();
return 1;
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -1;
}
}
/**

View File

@@ -397,7 +397,7 @@ while($j<$numlt)
// Payment Salary
if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
{
if (! $mode || $mode != 'sconly')
{

View File

@@ -372,161 +372,156 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$subtot_coll_total_ht = 0;
$subtot_coll_vat = 0;
if (is_array($x_both[$thirdparty_id]['coll']['detail']))
{
if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['coll']['totalht'] > $min)) {
// VAT Rate
print "<tr>";
print '<td class="tax_rate">';
if (is_numeric($thirdparty_id))
{
$company_static->fetch($thirdparty_id);
print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1);
}
else
{
$tmpid = preg_replace('/userid_/','',$thirdparty_id);
$user_static->fetch($tmpid);
print $langs->trans("User").': '.$user_static->getNomUrl(1);
}
print '</td><td colspan="'.($span+1).'"></td>';
print '</tr>'."\n";
if (is_array($x_both[$thirdparty_id]['coll']['detail'])) {
foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) {
// Define type
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
$type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']);
// Try to enhance type detection using date_start and date_end for free lines where type
// was not saved.
if (!empty($fields['ddate_start'])) {
$type=1;
}
if (!empty($fields['ddate_end'])) {
$type=1;
// VAT Rate
print "<tr>";
print '<td class="tax_rate">';
if (is_numeric($thirdparty_id)) {
$company_static->fetch($thirdparty_id);
print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1);
} else {
$tmpid = preg_replace('/userid_/', '', $thirdparty_id);
$user_static->fetch($tmpid);
print $langs->trans("User") . ': ' . $user_static->getNomUrl(1);
}
print '</td><td colspan="' . ($span + 1) . '"></td>';
print '</tr>' . "\n";
print '<tr class="oddeven">';
// Ref
print '<td class="nowrap" align="left">'.$fields['link'].'</td>';
// Invoice date
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
// Payment date
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
else print '<td></td>';
// Rate
print '<td align="right">' . $fields['drate'] . '</td>';
// Description
print '<td align="left">';
if ($fields['pid'])
{
$product_static->id=$fields['pid'];
$product_static->ref=$fields['pref'];
$product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered
print $product_static->getNomUrl(1);
if (dol_string_nohtmltag($fields['descr'])) {
print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
foreach ($x_both[$thirdparty_id]['coll']['detail'] as $index => $fields) {
// Define type
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
$type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
// Try to enhance type detection using date_start and date_end for free lines where type
// was not saved.
if (!empty($fields['ddate_start'])) {
$type = 1;
}
}
else
{
if ($type) {
$text = img_object($langs->trans('Service'),'service');
if (!empty($fields['ddate_end'])) {
$type = 1;
}
print '<tr class="oddeven">';
// Ref
print '<td class="nowrap" align="left">' . $fields['link'] . '</td>';
// Invoice date
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
// Payment date
if ($conf->global->TAX_MODE_SELL_PRODUCT == 'payment' || $conf->global->TAX_MODE_SELL_SERVICE == 'payment') {
print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
} else {
$text = img_object($langs->trans('Product'),'product');
print '<td></td>';
}
if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) {
if ($reg[1]=='DEPOSIT') {
$fields['descr']=$langs->transnoentitiesnoconv('Deposit');
} elseif ($reg[1]=='CREDIT_NOTE') {
$fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
// Rate
print '<td align="right">' . $fields['drate'] . '</td>';
// Description
print '<td align="left">';
if ($fields['pid']) {
$product_static->id = $fields['pid'];
$product_static->ref = $fields['pref'];
$product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
print $product_static->getNomUrl(1);
if (dol_string_nohtmltag($fields['descr'])) {
print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
}
} else {
if ($type) {
$text = img_object($langs->trans('Service'), 'service');
} else {
$fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
$text = img_object($langs->trans('Product'), 'product');
}
}
print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
if ($reg[1] == 'DEPOSIT') {
$fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
} elseif ($reg[1] == 'CREDIT_NOTE') {
$fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
} else {
$fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
}
}
print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
// Show range
print_date_range($fields['ddate_start'],$fields['ddate_end']);
}
print '</td>';
// Total HT
if ($modetax != 1)
{
print '<td class="nowrap" align="right">';
print price($fields['totalht']);
if (price2num($fields['ftotal_ttc']))
{
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
$ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
//print ' ('.round($ratiolineinvoice*100,2).'%)';
// Show range
print_date_range($fields['ddate_start'], $fields['ddate_end']);
}
print '</td>';
}
// Payment
$ratiopaymentinvoice=1;
if ($modetax != 1)
{
// Total HT
if ($modetax != 1) {
print '<td class="nowrap" align="right">';
print price($fields['totalht']);
if (price2num($fields['ftotal_ttc'])) {
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
$ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
//print ' ('.round($ratiolineinvoice*100,2).'%)';
}
print '</td>';
}
// Payment
$ratiopaymentinvoice = 1;
if ($modetax != 1) {
print '<td class="nowrap" align="right">';
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
$payment_static->id = $fields['payment_id'];
print $payment_static->getNomUrl(2);
}
if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
|| ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice')) {
print $langs->trans("NA");
} else {
if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
$ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
}
print price(price2num($fields['payment_amount'], 'MT'));
if (isset($fields['payment_amount'])) {
print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
}
}
print '</td>';
}
// Total collected
print '<td class="nowrap" align="right">';
//print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
if ($fields['payment_amount'] && $fields['ftotal_ttc'])
{
$payment_static->id=$fields['payment_id'];
print $payment_static->getNomUrl(2);
}
if (($type == 0 && $conf->global->TAX_MODE_SELL_PRODUCT == 'invoice')
|| ($type == 1 && $conf->global->TAX_MODE_SELL_SERVICE == 'invoice'))
{
print $langs->trans("NA");
} else {
if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
$ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
}
print price(price2num($fields['payment_amount'],'MT'));
if (isset($fields['payment_amount'])) {
print ' ('.round($ratiopaymentinvoice*100,2).'%)';
}
}
$temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
print price(price2num($temp_ht, 'MT'), 1);
print '</td>';
// VAT
print '<td class="nowrap" align="right">';
$temp_vat = $fields['vat'] * $ratiopaymentinvoice;
print price(price2num($temp_vat, 'MT'), 1);
//print price($fields['vat']);
print '</td>';
print '</tr>';
$subtot_coll_total_ht += $temp_ht;
$subtot_coll_vat += $temp_vat;
$x_coll_sum += $temp_vat;
}
// Total collected
print '<td class="nowrap" align="right">';
$temp_ht=$fields['totalht']*$ratiopaymentinvoice;
print price(price2num($temp_ht,'MT'),1);
print '</td>';
// VAT
print '<td class="nowrap" align="right">';
$temp_vat=$fields['vat']*$ratiopaymentinvoice;
print price(price2num($temp_vat,'MT'),1);
//print price($fields['vat']);
print '</td>';
print '</tr>';
$subtot_coll_total_ht += $temp_ht;
$subtot_coll_vat += $temp_vat;
$x_coll_sum += $temp_vat;
}
// Total customers for this vat rate
print '<tr class="liste_total">';
print '<td colspan="4"></td>';
print '<td align="right">' . $langs->trans("Total") . ':</td>';
if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
}
print '<td align="right">' . price(price2num($subtot_coll_total_ht, 'MT')) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($subtot_coll_vat, 'MT')) . '</td>';
print '</tr>';
}
// Total customers for this vat rate
print '<tr class="liste_total">';
print '<td colspan="4"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>';
if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
}
print '<td align="right">'.price(price2num($subtot_coll_total_ht,'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtot_coll_vat,'MT')).'</td>';
print '</tr>';
}
if (count($x_coll) == 0) // Show a total ine if nothing shown
@@ -567,161 +562,153 @@ if (! is_array($x_coll) || ! is_array($x_paye))
$subtot_paye_total_ht = 0;
$subtot_paye_vat = 0;
if (is_array($x_both[$thirdparty_id]['paye']['detail']))
{
print "<tr>";
print '<td class="tax_rate">';
if (is_numeric($thirdparty_id))
{
$company_static->fetch($thirdparty_id);
print $langs->trans("ThirdParty").': '.$company_static->getNomUrl(1);
}
else
{
$tmpid = preg_replace('/userid_/','',$thirdparty_id);
$user_static->fetch($tmpid);
print $langs->trans("User").': '.$user_static->getNomUrl(1);
}
print '<td colspan="'.($span+1).'"></td>';
print '</tr>'."\n";
if ($min == 0 || ($min > 0 && $x_both[$thirdparty_id]['paye']['totalht'] > $min)) {
foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index=>$fields) {
// Define type
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
$type=(isset($fields['dtype'])?$fields['dtype']:$fields['ptype']);
// Try to enhance type detection using date_start and date_end for free lines where type
// was not saved.
if (!empty($fields['ddate_start'])) {
$type=1;
}
if (!empty($fields['ddate_end'])) {
$type=1;
if (is_array($x_both[$thirdparty_id]['paye']['detail'])) {
print "<tr>";
print '<td class="tax_rate">';
if (is_numeric($thirdparty_id)) {
$company_static->fetch($thirdparty_id);
print $langs->trans("ThirdParty") . ': ' . $company_static->getNomUrl(1);
} else {
$tmpid = preg_replace('/userid_/', '', $thirdparty_id);
$user_static->fetch($tmpid);
print $langs->trans("User") . ': ' . $user_static->getNomUrl(1);
}
print '<td colspan="' . ($span + 1) . '"></td>';
print '</tr>' . "\n";
print '<tr class="oddeven">';
// Ref
print '<td class="nowrap" align="left">'.$fields['link'].'</td>';
// Invoice date
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
// Payment date
if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
else print '<td></td>';
// Company name
print '<td align="left">' . $fields['company_link'] . '</td>';
// Description
print '<td align="left">';
if ($fields['pid'])
{
$product_static->id=$fields['pid'];
$product_static->ref=$fields['pref'];
$product_static->type=$fields['dtype']; // We force with the type of line to have type how line is registered
print $product_static->getNomUrl(1);
if (dol_string_nohtmltag($fields['descr'])) {
print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
foreach ($x_both[$thirdparty_id]['paye']['detail'] as $index => $fields) {
// Define type
// We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
$type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
// Try to enhance type detection using date_start and date_end for free lines where type
// was not saved.
if (!empty($fields['ddate_start'])) {
$type = 1;
}
}
else
{
if ($type) {
$text = img_object($langs->trans('Service'),'service');
if (!empty($fields['ddate_end'])) {
$type = 1;
}
print '<tr class="oddeven">';
// Ref
print '<td class="nowrap" align="left">' . $fields['link'] . '</td>';
// Invoice date
print '<td align="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
// Payment date
if ($conf->global->TAX_MODE_BUY_PRODUCT == 'payment' || $conf->global->TAX_MODE_BUY_SERVICE == 'payment') {
print '<td align="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
} else {
$text = img_object($langs->trans('Product'),'product');
print '<td></td>';
}
if (preg_match('/^\((.*)\)$/',$fields['descr'],$reg)) {
if ($reg[1]=='DEPOSIT') {
$fields['descr']=$langs->transnoentitiesnoconv('Deposit');
} elseif ($reg[1]=='CREDIT_NOTE') {
$fields['descr']=$langs->transnoentitiesnoconv('CreditNote');
// Company name
print '<td align="left">' . $fields['company_link'] . '</td>';
// Description
print '<td align="left">';
if ($fields['pid']) {
$product_static->id = $fields['pid'];
$product_static->ref = $fields['pref'];
$product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
print $product_static->getNomUrl(1);
if (dol_string_nohtmltag($fields['descr'])) {
print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
}
} else {
if ($type) {
$text = img_object($langs->trans('Service'), 'service');
} else {
$fields['descr']=$langs->transnoentitiesnoconv($reg[1]);
$text = img_object($langs->trans('Product'), 'product');
}
}
print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']),24);
if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) {
if ($reg[1] == 'DEPOSIT') {
$fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
} elseif ($reg[1] == 'CREDIT_NOTE') {
$fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
} else {
$fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
}
}
print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
// Show range
print_date_range($fields['ddate_start'],$fields['ddate_end']);
}
print '</td>';
// Total HT
if ($modetax != 1)
{
print '<td class="nowrap" align="right">';
print price($fields['totalht']);
if (price2num($fields['ftotal_ttc']))
{
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
$ratiolineinvoice=($fields['dtotal_ttc']/$fields['ftotal_ttc']);
//print ' ('.round($ratiolineinvoice*100,2).'%)';
// Show range
print_date_range($fields['ddate_start'], $fields['ddate_end']);
}
print '</td>';
}
// Payment
$ratiopaymentinvoice=1;
if ($modetax != 1)
{
// Total HT
if ($modetax != 1) {
print '<td class="nowrap" align="right">';
print price($fields['totalht']);
if (price2num($fields['ftotal_ttc'])) {
//print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
$ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
//print ' ('.round($ratiolineinvoice*100,2).'%)';
}
print '</td>';
}
// Payment
$ratiopaymentinvoice = 1;
if ($modetax != 1) {
print '<td class="nowrap" align="right">';
if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
$paymentfourn_static->id = $fields['payment_id'];
print $paymentfourn_static->getNomUrl(2);
}
if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice')
|| ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice')) {
print $langs->trans("NA");
} else {
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
$ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
}
print price(price2num($fields['payment_amount'], 'MT'));
if (isset($fields['payment_amount'])) {
print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
}
}
print '</td>';
}
// VAT paid
print '<td class="nowrap" align="right">';
if ($fields['payment_amount'] && $fields['ftotal_ttc'])
{
$paymentfourn_static->id=$fields['payment_id'];
print $paymentfourn_static->getNomUrl(2);
}
if (($type == 0 && $conf->global->TAX_MODE_BUY_PRODUCT == 'invoice')
|| ($type == 1 && $conf->global->TAX_MODE_BUY_SERVICE == 'invoice'))
{
print $langs->trans("NA");
}
else
{
if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
$ratiopaymentinvoice=($fields['payment_amount']/$fields['ftotal_ttc']);
}
print price(price2num($fields['payment_amount'],'MT'));
if (isset($fields['payment_amount'])) {
print ' ('.round($ratiopaymentinvoice*100,2).'%)';
}
}
$temp_ht = $fields['totalht'] * $ratiopaymentinvoice;
print price(price2num($temp_ht, 'MT'), 1);
print '</td>';
// VAT
print '<td class="nowrap" align="right">';
$temp_vat = $fields['vat'] * $ratiopaymentinvoice;
print price(price2num($temp_vat, 'MT'), 1);
//print price($fields['vat']);
print '</td>';
print '</tr>';
$subtot_paye_total_ht += $temp_ht;
$subtot_paye_vat += $temp_vat;
$x_paye_sum += $temp_vat;
}
// VAT paid
print '<td class="nowrap" align="right">';
$temp_ht=$fields['totalht']*$ratiopaymentinvoice;
print price(price2num($temp_ht,'MT'),1);
print '</td>';
// VAT
print '<td class="nowrap" align="right">';
$temp_vat=$fields['vat']*$ratiopaymentinvoice;
print price(price2num($temp_vat,'MT'),1);
//print price($fields['vat']);
print '</td>';
print '</tr>';
$subtot_paye_total_ht += $temp_ht;
$subtot_paye_vat += $temp_vat;
$x_paye_sum += $temp_vat;
}
// Total suppliers for this vat rate
print '<tr class="liste_total">';
print '<td colspan="4"></td>';
print '<td align="right">' . $langs->trans("Total") . ':</td>';
if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
}
print '<td align="right">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</td>';
print '<td class="nowrap" align="right">' . price(price2num($subtot_paye_vat, 'MT')) . '</td>';
print '</tr>';
}
// Total suppliers for this vat rate
print '<tr class="liste_total">';
print '<td colspan="4"></td>';
print '<td align="right">'.$langs->trans("Total").':</td>';
if ($modetax != 1) {
print '<td class="nowrap" align="right">&nbsp;</td>';
print '<td align="right">&nbsp;</td>';
}
print '<td align="right">'.price(price2num($subtot_paye_total_ht,'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtot_paye_vat,'MT')).'</td>';
print '</tr>';
}
if (count($x_paye) == 0) { // Show a total line if nothing shown

View File

@@ -256,7 +256,8 @@ $mend = $tmp['mon'];
//var_dump($m);
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
$i=0; $mcursor=0;
while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mcursor is to avoid too large loop
{
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
if ($m == 13) $y++;
@@ -503,7 +504,7 @@ while ((($y < $yend) || ($y == $yend && $m < $mend)) && $mcursor < 1000) // $mcu
if ($i > 2)
{
print '<tr class="liste_total">';
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalcoll,'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotalpaye,'MT')).'</td>';
print '<td class="nowrap" align="right">'.price(price2num($subtotal,'MT')).'</td>';
@@ -561,12 +562,11 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
print load_fiche_titre($langs->trans("VATBalance"), '', ''); // need to add translation
$sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm";
$sql1 = "SELECT SUM(amount) as mm";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f";
$sql1 .= " WHERE f.entity = " . $conf->entity;
$sql1 .= " AND f.datev >= '" . $db->idate($date_start) . "'";
$sql1 .= " AND f.datev <= '" . $db->idate($date_end) . "'";
$sql1 .= " GROUP BY dm ORDER BY dm ASC";
$result = $db->query($sql1);
if ($result) {

View File

@@ -856,6 +856,7 @@ class Contact extends CommonObject
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.=" WHERE ec.fk_c_type_contact = tc.rowid";
$sql.=" AND fk_socpeople = ". $this->id;
$sql.=" AND tc.source = 'external'";
$sql.=" GROUP BY tc.element";
dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG);
@@ -1050,9 +1051,9 @@ class Contact extends CommonObject
function getNbOfEMailings()
{
$sql = "SELECT count(mc.email) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
$sql.= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."mailing as m";
$sql.= " WHERE mc.fk_mailing=m.rowid AND mc.email = '".$this->db->escape($this->email)."' ";
$sql.= " AND m.entity IN (".getEntity($this->element).") AND mc.statut NOT IN (-1,0)"; // -1 error, 0 not sent, 1 sent with success
$resql=$this->db->query($sql);
if ($resql)

View File

@@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "suppliers"));
$langs->loadLangs(array("companies", "suppliers", "categories"));
$action=GETPOST('action','alpha');
$massaction=GETPOST('massaction','alpha');
@@ -154,7 +154,7 @@ $arrayfields=array(
'p.phone'=>array('label'=>"Phone", 'checked'=>1),
'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0),
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
'p.fax'=>array('label'=>"Fax", 'checked'=>1),
'p.fax'=>array('label'=>"Fax", 'checked'=>0),
'p.email'=>array('label'=>"EMail", 'checked'=>1),
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),
@@ -307,12 +307,14 @@ if ($search_societe) $sql.= natural_search('s.nom', $search_socie
if ($search_country) $sql .= " AND p.fk_pays IN (".$search_country.')';
if (strlen($search_poste)) $sql.= natural_search('p.poste', $search_poste);
if (strlen($search_phone_perso)) $sql.= natural_search('p.phone_perso', $search_phone_perso);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone);
if (strlen($search_phone_pro)) $sql.= natural_search('p.phone', $search_phone_pro);
if (strlen($search_phone_mobile)) $sql.= natural_search('p.phone_mobile', $search_phone_mobile);
if (strlen($search_fax)) $sql.= natural_search('p.fax', $search_fax);
if (strlen($search_skype)) $sql.= natural_search('p.skype', $search_skype);
if (strlen($search_email)) $sql.= natural_search('p.email', $search_email);
if (strlen($search_zip)) $sql.= natural_search("p.zip",$search_zip);
if (strlen($search_town)) $sql.= natural_search("p.town",$search_town);
if ($search_status != '' && $search_status >= 0) $sql.= " AND p.statut = ".$db->escape($search_status);
if ($search_import_key) $sql.= natural_search("p.import_key",$search_import_key);
if ($type == "o") // filtre sur type
@@ -732,7 +734,7 @@ while ($i < min($num,$limit))
// Job position
if (! empty($arrayfields['p.poste']['checked']))
{
print '<td>'.dol_trunc($obj->poste,20).'</td>';
print '<td class="tdoverflowmax100">'.$obj->poste.'</td>';
if (! $i) $totalarray['nbfield']++;
}
// Zip

View File

@@ -456,7 +456,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($object->table_element_line);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
// Unset extrafield
if (is_array($extralabelsline)) {
// Get extra fields
@@ -737,7 +737,7 @@ if (empty($reshook))
// Extrafields
$extrafieldsline = new ExtraFields($db);
$extralabelsline = $extrafieldsline->fetch_name_optionals_label($objectline->table_element);
$array_options = $extrafieldsline->getOptionalsFromPost($extralabelsline, $predef);
$array_options = $extrafieldsline->getOptionalsFromPost($object->table_element_line, $predef);
$objectline->array_options=$array_options;
// TODO verifier price_min si fk_product et multiprix
@@ -1421,6 +1421,7 @@ else
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
// Project
if (! empty($conf->projet->enabled))
{

View File

@@ -8,8 +8,8 @@
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2015-2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -892,6 +892,7 @@ class Contrat extends CommonObject
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
$sql.= ")";
$resql=$this->db->query($sql);
if ($resql)
{
$error=0;
@@ -908,9 +909,8 @@ class Contrat extends CommonObject
if ($result > 0)
{
$modCodeContract = new $module();
if (!empty($modCodeContract->code_auto)) {
// Mise a jour ref
if (! empty($modCodeContract->code_auto)) {
// Force the ref to a draft value if numbering module is an automatic numbering
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql))
{
@@ -919,9 +919,6 @@ class Contrat extends CommonObject
$this->ref="(PROV".$this->id.")";
}
}
} else {
$error++;
$this->error='Failed to get PROV number';
}
}
@@ -1361,7 +1358,9 @@ class Contrat extends CommonObject
$pu_ht=price2num($pu_ht);
$pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht);
$txtva=price2num($txtva);
if (!preg_match('/\((.*)\)/', $txtva)) {
$txtva = price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
}
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
$remise_percent=price2num($remise_percent);
@@ -1386,21 +1385,21 @@ class Contrat extends CommonObject
// Check parameters
if (empty($remise_percent)) $remise_percent=0;
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
// Calcul du total TTC et de la TVA pour la ligne a partir de
// qty, pu, remise_percent et txtva
// TRES IMPORTANT: C'est au moment de l'insertion ligne qu'on doit stocker
// la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
$localtaxes_type=getLocalTaxesFromRate($txtva, 0, $this->societe, $mysoc);
// Clean vat code
$vat_src_code='';
if (preg_match('/\((.*)\)/', $txtva, $reg))
{
$vat_src_code = $reg[1];
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
}
$tabprice=calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, 1,$mysoc, $localtaxes_type);
$total_ht = $tabprice[0];
$total_tva = $tabprice[1];

View File

@@ -3,7 +3,7 @@
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
@@ -45,14 +45,14 @@ $confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contractlist'; // To manage different context of search
$search_name=GETPOST('search_name');
$search_email=GETPOST('search_email');
$search_name=GETPOST('search_name', 'alpha');
$search_email=GETPOST('search_email', 'alpha');
$search_town=GETPOST('search_town','alpha');
$search_zip=GETPOST('search_zip','alpha');
$search_state=trim(GETPOST("search_state"));
$search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_contract=GETPOST('search_contract');
$search_contract=GETPOST('search_contract','alpha');
$search_ref_customer=GETPOST('search_ref_customer','alpha');
$search_ref_supplier=GETPOST('search_ref_supplier','alpha');
$sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
@@ -107,7 +107,6 @@ $fieldstosearchall = array(
'c.ref_customer'=>'RefCustomer',
'c.ref_supplier'=>'RefSupplier',
's.nom'=>"ThirdParty",
'cd.description'=>'Description',
'c.note_public'=>'NotePublic',
);
if (empty($user->socid)) $fieldstosearchall["c.note_private"]="NotePrivate";
@@ -252,7 +251,7 @@ else if ($year > 0)
$sql.= " AND c.date_contrat BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
}
if ($search_name) $sql .= natural_search('s.nom', $search_name);
if ($search_email) $sql .= natural_search('s.email', $search_name);
if ($search_email) $sql .= natural_search('s.email', $search_email);
if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);

View File

@@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,9 +47,9 @@ if (! $sortorder) $sortorder="ASC";
$mode = GETPOST("mode");
$filter=GETPOST("filter");
$search_name=GETPOST("search_name");
$search_contract=GETPOST("search_contract");
$search_service=GETPOST("search_service");
$search_name=GETPOST("search_name", 'alpha');
$search_contract=GETPOST("search_contract", 'alpha');
$search_service=GETPOST("search_service", 'alpha');
$search_status=GETPOST("search_status","alpha");
$statut=GETPOST('statut')?GETPOST('statut'):1;
$search_product_category=GETPOST('search_product_category','int');

View File

@@ -2,6 +2,7 @@
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -93,7 +94,7 @@ if (! $error && $massaction == 'confirm_presend')
}
// Check mandatory parameters
if (empty($user->email))
if (GETPOST('fromtype','alpha') === 'user' && empty($user->email))
{
$error++;
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
@@ -215,7 +216,7 @@ if (! $error && $massaction == 'confirm_presend')
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyOrderNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
continue;
}
if ($objectclass == 'Facture' && $objectobj->statut != Facture::STATUS_VALIDATED)
if ($objectclass == 'Facture' && $objectobj->statut == Facture::STATUS_DRAFT)
{
$langs->load("errors");
$nbignored++;
@@ -333,12 +334,16 @@ if (! $error && $massaction == 'confirm_presend')
if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO));
if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO));
// $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty
// $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet)
$oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0);
$looparray=array();
if (! $oneemailperrecipient)
{
$looparray = $listofqualifiedobj;
foreach ($looparray as $key => $objecttmp)
{
$looparray[$key]->thirdparty = $thirdparty;
}
}
else
{
@@ -348,7 +353,7 @@ if (! $error && $massaction == 'confirm_presend')
}
//var_dump($looparray);exit;
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record
foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per record
{
// Make substitution in email content
$substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp);
@@ -512,6 +517,8 @@ if ($massaction == 'confirm_createbills')
$objecttmp = new Facture($db);
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) $objecttmp = $TFactThird[$cmd->socid]; // If option "one bill per third" is set, we use already created order.
else {
// Load extrafields of order
$cmd->fetch_optionals();
$objecttmp->socid = $cmd->socid;
$objecttmp->type = Facture::TYPE_STANDARD;
@@ -529,6 +536,8 @@ if ($massaction == 'confirm_createbills')
$objecttmp->origin = 'commande';
$objecttmp->origin_id = $id_order;
$objecttmp->array_options = $cmd->array_options; // Copy extrafields
$res = $objecttmp->create($user);
if($res > 0) $nb_bills_created++;
@@ -568,6 +577,12 @@ if ($massaction == 'confirm_createbills')
for ($i=0;$i<$num;$i++)
{
$desc=($lines[$i]->desc?$lines[$i]->desc:$lines[$i]->libelle);
// If we build one invoice for several order, we must put the invoice of order on the line
if (! empty($createbills_onebythird))
{
$desc=dol_concatdesc($desc, $langs->trans("Order").' '.$cmd->ref.' - '.dol_print_date($cmd->date, 'day', $langs));
}
if ($lines[$i]->subprice < 0)
{
// Negative line, we create a discount line
@@ -678,6 +693,7 @@ if ($massaction == 'confirm_createbills')
if (! $error && $validate_invoices)
{
$massaction = $action = 'builddoc';
foreach($TAllFact as &$objecttmp)
{
$result = $objecttmp->validate($user);
@@ -689,12 +705,18 @@ if ($massaction == 'confirm_createbills')
}
$id = $objecttmp->id; // For builddoc action
$object = $objecttmp;
// Builddoc
$donotredirect = 1;
$upload_dir = $conf->facture->dir_output;
$permissioncreate=$user->rights->facture->creer;
// Call action to build doc
$savobject = $object;
$object = $objecttmp;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
$object = $savobject;
}
$massaction = $action = 'confirm_createbills';
@@ -1097,6 +1119,18 @@ if (! $error && ($massaction == 'delete' || ($action == 'delete' && $confirm ==
continue;
}
if ($objectclass == "Task" && $objecttmp->hasChildren() > 0)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET fk_task_parent = 0 WHERE fk_task_parent = ".$objecttmp->id;
$res = $db->query($sql);
if (!$res)
{
setEventMessage('ErrorRecordParentingNotModified', 'errors');
$error++;
}
}
if (in_array($objecttmp->element, array('societe', 'member'))) $result = $objecttmp->delete($objecttmp->id, $user, 1);
else $result = $objecttmp->delete($user);

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
*
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@@ -42,7 +43,7 @@ if (GETPOST('addfile','alpha'))
$vardir=$conf->user->dir_output."/".$user->id;
$upload_dir_tmp = $vardir.'/temp'; // TODO Add $keytoavoidconflict in upload_dir path
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid);
dol_add_file_process($upload_dir_tmp, 0, 0, 'addedfile', '', null, $trackid, 0);
$action='presend';
}

View File

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

View File

@@ -53,6 +53,12 @@ $search_boxvalue=GETPOST('q', 'none');
$arrayresult=array();
// Define $searchform
if (! empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire)
{
$arrayresult['searchintomember']=array('position'=>8, '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'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):''));
}
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'.($search_boxvalue?'?sall='.urlencode($search_boxvalue):''));
@@ -63,11 +69,6 @@ if (! empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CON
$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'.($search_boxvalue?'?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'.($search_boxvalue?'?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))
{

View File

@@ -85,8 +85,7 @@ class box_actions extends ModeleBoxes
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
$sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm AS ta, ".MAIN_DB_PREFIX."actioncomm AS a";
if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " WHERE a.fk_action = ta.id";

View File

@@ -72,9 +72,11 @@ class box_factures extends ModeleBoxes
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$facturestatic=new Facture($db);
$facturestatic = new Facture($db);
$societestatic = new Societe($db);
$langs->load("bills");
$text = $langs->trans("BoxTitleLast".($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE?"":"Modified")."CustomerBills",$max);
$this->info_box_head = array(
'text' => $text,
@@ -88,9 +90,7 @@ class box_factures extends ModeleBoxes
$sql.= ", f.total_ttc";
$sql.= ", f.datef as df";
$sql.= ", f.paye, f.fk_statut, f.datec, f.tms";
$sql.= ", s.nom as name";
$sql.= ", s.rowid as socid";
$sql.= ", s.code_client";
$sql.= ", s.rowid as socid, s.nom as name, s.code_client, s.email, s.tva_intra, s.code_compta, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
$sql.= ", f.date_lim_reglement as datelimite";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -117,6 +117,7 @@ class box_factures extends ModeleBoxes
$datelimite = $db->jdate($objp->datelimite);
$date = $db->jdate($objp->df);
$datem = $db->jdate($objp->tms);
$facturestatic->id = $objp->facid;
$facturestatic->ref = $objp->facnumber;
$facturestatic->type = $objp->type;
@@ -129,7 +130,14 @@ class box_factures extends ModeleBoxes
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
$societestatic->tva_intra = $objp->tva_intra;
$societestatic->email = $objp->email;
$societestatic->idprof1 = $objp->idprof1;
$societestatic->idprof2 = $objp->idprof2;
$societestatic->idprof3 = $objp->idprof3;
$societestatic->idprof4 = $objp->idprof4;
$societestatic->idprof5 = $objp->idprof5;
$societestatic->idprof6 = $objp->idprof6;
$late = '';
if ($facturestatic->hasDelay()) {

View File

@@ -82,7 +82,7 @@ class box_factures_imp extends ModeleBoxes
if ($user->rights->facture->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid,";
$sql = "SELECT s.nom as name, s.rowid as socid, s.email,";
$sql.= " s.code_client,";
$sql.= " s.logo,";
$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
@@ -130,9 +130,11 @@ class box_factures_imp extends ModeleBoxes
$facturestatic->total_ttc = $objp->total_ttc;
$facturestatic->statut = $objp->fk_statut;
$facturestatic->date_lim_reglement = $db->jdate($objp->datelimite);
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->client = 1;
$societestatic->email = $objp->email;
$societestatic->code_client = $objp->code_client;
$societestatic->logo = $objp->logo;

View File

@@ -385,13 +385,17 @@ class CMailFile
// TODO if (! empty($moreinheader)) ...
// Give the message a subject
$this->message->setSubject($this->encodetorfc2822($subject));
try {
$result = $this->message->setSubject($subject);
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
// Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (! empty($from)) {
try {
$this->message->setFrom($this->getArrayAddress($from));
$result = $this->message->setFrom($this->getArrayAddress($from));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
@@ -400,7 +404,7 @@ class CMailFile
// Set the To addresses with an associative array
if (! empty($to)) {
try {
$this->message->setTo($this->getArrayAddress($to));
$result = $this->message->setTo($this->getArrayAddress($to));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
@@ -408,13 +412,17 @@ class CMailFile
if (! empty($replyto)) {
try {
$this->message->SetReplyTo($this->getArrayAddress($replyto));
$result = $this->message->SetReplyTo($this->getArrayAddress($replyto));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
}
$this->message->setCharSet($conf->file->character_set_client);
try {
$result = $this->message->setCharSet($conf->file->character_set_client);
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
if (! empty($this->html))
{
@@ -463,7 +471,7 @@ class CMailFile
if (! empty($addr_cc)) $this->message->setCc($this->getArrayAddress($addr_cc));
if (! empty($addr_bcc)) $this->message->setBcc($this->getArrayAddress($addr_bcc));
//if (! empty($errors_to)) $this->message->setErrorsTo($this->getArrayAddress($errors_to);
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
if (isset($deliveryreceipt) && $deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($from));
}
else
{

View File

@@ -223,10 +223,10 @@ abstract class CommonDocGenerator
/**
* Define array with couple subtitution key => subtitution value
*
* @param Contact $object contact
* @param Contact $object contact
* @param Translate $outputlangs object for output
* @param array_key $array_key Name of the key for return array
* @return array of substitution key->code
* @param array $array_key Name of the key for return array
* @return array Array of substitution key->code
*/
function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') {
global $conf;
@@ -340,6 +340,8 @@ abstract class CommonDocGenerator
global $conf;
$sumpayed=$sumdeposit=$sumcreditnote='';
$already_payed_all=0;
$remain_to_pay=0;
if ($object->element == 'facture')
{
$invoice_source=new Facture($this->db);
@@ -350,6 +352,8 @@ abstract class CommonDocGenerator
$sumpayed = $object->getSommePaiement();
$sumdeposit = $object->getSumDepositsUsed();
$sumcreditnote = $object->getSumCreditNotesUsed();
$already_payed_all=$sumpayed + $sumdeposit + $sumcreditnote;
$remain_to_pay=$sumpayed - $sumdeposit - $sumcreditnote;
}
$date = ($object->element == 'contrat' ? $object->date_contrat : $object->date);
@@ -411,12 +415,12 @@ abstract class CommonDocGenerator
$array_key.'_already_creditnote_locale'=>price($sumcreditnote, 0, $outputlangs),
$array_key.'_already_creditnote'=>price2num($sumcreditnote),
$array_key.'_already_payed_all_locale'=>price(price2num($sumpayed + $sumdeposit + $sumcreditnote, 'MT'), 0, $outputlangs),
$array_key.'_already_payed_all'=> price2num(($sumpayed + $sumdeposit + $sumcreditnote), 'MT'),
$array_key.'_already_payed_all_locale'=>price(price2num($already_payed_all, 'MT'), 0, $outputlangs),
$array_key.'_already_payed_all'=> price2num($already_payed_all, 'MT'),
// Remain to pay with all know infrmation (except open direct debit requests)
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT'), 0, $outputlangs),
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $sumpayed - $sumdeposit - $sumcreditnote, 'MT')
$array_key.'_remain_to_pay_locale'=>price(price2num($object->total_ttc - $remain_to_pay, 'MT'), 0, $outputlangs),
$array_key.'_remain_to_pay'=>price2num($object->total_ttc - $remain_to_pay, 'MT')
);
if (method_exists($object, 'getTotalDiscount')) {
@@ -552,9 +556,9 @@ abstract class CommonDocGenerator
/**
* Define array with couple substitution key => substitution value
*
* @param Expedition $object Main object to use as data source
* @param Expedition $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output
* @param array_key $array_key Name of the key for return array
* @param array $array_key Name of the key for return array
* @return array Array of substitution
*/
function get_substitutionarray_shipment($object,$outputlangs,$array_key='object')
@@ -746,7 +750,7 @@ abstract class CommonDocGenerator
/**
* Rect pdf
*
* @param PDF $pdf Object PDF
* @param TCPDF $pdf Object PDF
* @param float $x Abscissa of first point
* @param float $y Ordinate of first point
* @param float $l ??

View File

@@ -328,12 +328,13 @@ abstract class CommonInvoice extends CommonObject
/**
* Return if an invoice can be deleted
* Rule is:
* If invoice is draft and has a temporary ref -> yes
* If invoice is draft and has a temporary ref -> yes (1)
* If hidden option INVOICE_CAN_NEVER_BE_REMOVED is on -> no (0)
* If invoice is dispatched in bookkeeping -> no (-1)
* If invoice has a definitive ref, is not last and INVOICE_CAN_ALWAYS_BE_REMOVED off -> no (-2)
* If invoice not last in a cycle -> no (-3)
* If there is payment -> no (-4)
* Otherwise -> yes (2)
*
* @return int <=0 if no, >0 if yes
*/
@@ -381,7 +382,7 @@ abstract class CommonInvoice extends CommonObject
// Test if there is at least one payment. If yes, refuse to delete.
if (empty($conf->global->INVOICE_CAN_ALWAYS_BE_REMOVED) && $this->getSommePaiement() > 0) return -4;
return 1;
return 2;
}
/**

View File

@@ -1151,8 +1151,8 @@ abstract class CommonObject
$sql.= " ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE ec.element_id = ".$id;
$sql.= " AND ec.fk_socpeople = c.rowid";
if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")";
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('socpeople').")";
if ($source == 'internal') $sql.= " AND c.entity IN (".getEntity('user').")";
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe').")";
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
$sql.= " AND tc.element = '".$element."'";
$sql.= " AND tc.source = '".$source."'";
@@ -1778,7 +1778,7 @@ abstract class CommonObject
$this->multicurrency_code = $code;
list($fk_multicurrency, $rate) = MultiCurrency::getIdAndTxFromCode($this->db, $code);
if ($rate) $this->setMulticurrencyRate($rate);
if ($rate) $this->setMulticurrencyRate($rate,2);
return 1;
}
@@ -2848,6 +2848,7 @@ abstract class CommonObject
// Special case
if ($origin == 'order') $origin='commande';
if ($origin == 'invoice') $origin='facture';
if ($origin == 'invoice_template') $origin='facturerec';
$this->db->begin();
@@ -4726,6 +4727,7 @@ abstract class CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
$this->array_options = array();
$numrows=$this->db->num_rows($resql);
if ($numrows)
{
@@ -4846,11 +4848,15 @@ abstract class CommonObject
if ($this->array_options[$key] === '') $mandatorypb=true;
if ($mandatorypb)
{
dol_syslog($this->error);
$this->errors[]=$langs->trans('ErrorFieldRequired', $attributeLabel);
return -1;
}
}
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
switch ($attributeType)
{
case 'int':
@@ -4864,6 +4870,21 @@ abstract class CommonObject
$new_array_options[$key] = null;
}
break;
case 'double':
$value = price2num($value);
if (!is_numeric($value) && $value!='')
{
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1;
}
elseif ($value=='')
{
$new_array_options[$key] = null;
}
//dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG);
$new_array_options[$key] = $value;
break;
/*case 'select': // Not required, we chosed value='0' for undefined values
if ($value=='-1')
{
@@ -4911,8 +4932,6 @@ abstract class CommonObject
$new_array_options[$key] = price2num($this->array_options[$key]);
break;
case 'date':
$new_array_options[$key] = $this->db->idate($this->array_options[$key]);
break;
case 'datetime':
// If data is a string instead of a timestamp, we convert it
if (! is_int($this->array_options[$key])) {
@@ -4960,8 +4979,9 @@ abstract class CommonObject
$table_element = $this->table_element;
if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
dol_syslog(get_class($this)."::insertExtraFields delete then insert", LOG_DEBUG);
$sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id;
dol_syslog(get_class($this)."::insertExtraFields delete", LOG_DEBUG);
$this->db->query($sql_del);
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$table_element."_extrafields (fk_object";
@@ -4972,6 +4992,17 @@ abstract class CommonObject
if ($extrafields->attributes[$this->table_element]['type'][$attributeKey] != 'separate') // Only for other type than separator
$sql.=",".$attributeKey;
}
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
{
foreach($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
{
if (! isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
$sql.=",".$tmpkey;
}
}
}
$sql .= ") VALUES (".$this->id;
foreach($new_array_options as $key => $value)
@@ -4990,10 +5021,23 @@ abstract class CommonObject
}
}
}
// We must insert a default value for fields for other entities that are mandatory to avoid not null error
if (is_array($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities']))
{
foreach($extrafields->attributes[$this->table_element]['mandatoryfieldsofotherentities'] as $tmpkey => $tmpval)
{
if (! isset($extrafields->attributes[$this->table_element]['type'][$tmpkey])) // If field not already added previously
{
if (in_array($tmpval, array('int', 'double'))) $sql.=", 0";
else $sql.=", ''";
}
}
}
$sql.=")";
dol_syslog(get_class($this)."::insertExtraFields insert", LOG_DEBUG);
$resql = $this->db->query($sql);
if (! $resql)
{
$this->error=$this->db->lasterror();
@@ -5033,7 +5077,7 @@ abstract class CommonObject
* @return int -1=error, O=did nothing, 1=OK
* @see setValueFrom, insertExtraFields
*/
function updateExtraField($key, $trigger, $userused)
function updateExtraField($key, $trigger=null, $userused=null)
{
global $conf,$langs,$user;
@@ -5058,6 +5102,9 @@ abstract class CommonObject
$attributeParam = $extrafields->attributes[$this->table_element]['param'][$key];
$attributeRequired = $extrafields->attributes[$this->table_element]['required'][$key];
//dol_syslog("attributeLabel=".$attributeLabel, LOG_DEBUG);
//dol_syslog("attributeType=".$attributeType, LOG_DEBUG);
switch ($attributeType)
{
case 'int':
@@ -5071,6 +5118,21 @@ abstract class CommonObject
$this->array_options["options_".$key] = null;
}
break;
case 'double':
$value = price2num($value);
if (!is_numeric($value) && $value!='')
{
dol_syslog($langs->trans("ExtraFieldHasWrongValue")." sur ".$attributeLabel."(".$value."is not '".$attributeType."')", LOG_DEBUG);
$this->errors[]=$langs->trans("ExtraFieldHasWrongValue", $attributeLabel);
return -1;
}
elseif ($value=='')
{
$this->array_options["options_".$key] = null;
}
//dol_syslog("double value"." sur ".$attributeLabel."(".$value." is '".$attributeType."')", LOG_DEBUG);
$this->array_options["options_".$key] = $value;
break;
/*case 'select': // Not required, we chosed value='0' for undefined values
if ($value=='-1')
{
@@ -6114,6 +6176,11 @@ abstract class CommonObject
$e = 0;
foreach($extrafields->attributes[$this->table_element]['label'] as $key=>$label)
{
if (isset($extrafields->attributes[$this->table_element]['list'][$key])
&& empty($extrafields->attributes[$this->table_element]['list'][$key]) && $mode == 'view'){
continue;
}
$enabled = 1;
if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key]))
{

View File

@@ -44,7 +44,7 @@ class Conf
//! To store if javascript/ajax is enabked
public $use_javascript_ajax;
//! Used to store current currency
//! Used to store current currency (ISO code like 'USD', 'EUR', ...)
public $currency;
//! Used to store current css (from theme)
public $theme; // Contains current theme ("eldy", "auguria", ...)
@@ -519,6 +519,9 @@ class Conf
// By default, we open card if one found
if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1;
// By default, we show state code in combo list
if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1;
// Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal"
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list

View File

@@ -33,10 +33,14 @@ class DiscountAbsolute
public $id; // Id discount
public $fk_soc;
public $discount_type; // 0 => customer discount, 1 => supplier discount
public $amount_ht; //
public $discount_type; // 0 => customer discount, 1 => supplier discount
public $amount_ht; //
public $amount_tva; //
public $amount_ttc; //
public $multicurrency_amount_ht;
public $multicurrency_amount_tva;
public $multicurrency_amount_ttc;
public $tva_tx; // Vat rate
public $fk_user; // Id utilisateur qui accorde la remise
public $description; // Description libre
@@ -108,7 +112,7 @@ class DiscountAbsolute
$this->amount_tva = $obj->amount_tva;
$this->amount_ttc = $obj->amount_ttc;
$this->multicurrency_amount_ht = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_ht = $this->multicurrency_subprice = $obj->multicurrency_amount_ht;
$this->multicurrency_amount_tva = $obj->multicurrency_amount_tva;
$this->multicurrency_amount_ttc = $obj->multicurrency_amount_ttc;
@@ -156,8 +160,17 @@ class DiscountAbsolute
$this->amount_ht=price2num($this->amount_ht);
$this->amount_tva=price2num($this->amount_tva);
$this->amount_ttc=price2num($this->amount_ttc);
$this->tva_tx=price2num($this->tva_tx);
$this->multicurrency_amount_ht=price2num($this->multicurrency_amount_ht);
$this->multicurrency_amount_tva=price2num($this->multicurrency_amount_tva);
$this->multicurrency_amount_ttc=price2num($this->multicurrency_amount_ttc);
if (empty($this->multicurrency_amount_ht)) $this->multicurrency_amount_ht=0;
if (empty($this->multicurrency_amount_tva)) $this->multicurrency_amount_tva=0;
if (empty($this->multicurrency_amount_ttc)) $this->multicurrency_amount_ttc=0;
// Check parameters
if (empty($this->description))
{
@@ -170,10 +183,12 @@ class DiscountAbsolute
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_remise_except";
$sql.= " (entity, datec, fk_soc, discount_type, fk_user, description,";
$sql.= " amount_ht, amount_tva, amount_ttc, tva_tx,";
$sql.= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,";
$sql.= " fk_facture_source, fk_invoice_supplier_source";
$sql.= ")";
$sql.= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec!=''?$this->datec:dol_now())."', ".$this->fk_soc.", ".(empty($this->discount_type)?0:intval($this->discount_type)).", ".$user->id.", '".$this->db->escape($this->description)."',";
$sql.= " ".$this->amount_ht.", ".$this->amount_tva.", ".$this->amount_ttc.", ".$this->tva_tx.",";
$sql.= " ".$this->multicurrency_amount_ht.", ".$this->multicurrency_amount_tva.", ".$this->multicurrency_amount_ttc.", ";
$sql.= " ".($this->fk_facture_source ? "'".$this->db->escape($this->fk_facture_source)."'":"null").",";
$sql.= " ".($this->fk_invoice_supplier_source ? "'".$this->db->escape($this->fk_invoice_supplier_source)."'":"null");
$sql.= ")";

View File

@@ -924,7 +924,7 @@ class DolGraph
var percent=Math.round(series.percent);
var number=series.data[0][1];
return \'';
$this->stringtoshow.='<div style="font-size:8pt;text-align:center;padding:2px;color:black;">';
$this->stringtoshow.='<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
if ($urltemp) $this->stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
$this->stringtoshow.='\'+';
$this->stringtoshow.=($showlegend?'':'label+\' \'+'); // Hide label if already shown in legend
@@ -932,7 +932,7 @@ class DolGraph
$this->stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':'');
$this->stringtoshow.='\'';
if ($urltemp) $this->stringtoshow.='</a>';
$this->stringtoshow.='</div>\';
$this->stringtoshow.='</span>\';
},
background: {
opacity: 0.0,

View File

@@ -112,6 +112,7 @@ class Events // extends CommonObject
// Clean parameters
$this->description=trim($this->description);
if (empty($this->user_agent) && !empty($_SERVER['HTTP_USER_AGENT'])) $this->user_agent=$_SERVER['HTTP_USER_AGENT'];
// Check parameters
if (empty($this->description)) { $this->error='ErrorBadValueForParameterCreateEventDesc'; return -1; }
@@ -128,8 +129,8 @@ class Events // extends CommonObject
$sql.= ") VALUES (";
$sql.= " '".$this->db->escape($this->type)."',";
$sql.= " ".$conf->entity.",";
$sql.= " '".$this->db->escape($_SERVER['REMOTE_ADDR'])."',";
$sql.= " ".($_SERVER['HTTP_USER_AGENT']?"'".$this->db->escape(dol_trunc($_SERVER['HTTP_USER_AGENT'],250))."'":'NULL').",";
$sql.= " '".$this->db->escape(getUserRemoteIP())."',";
$sql.= " ".($this->user_agent ? "'".$this->db->escape(dol_trunc($this->user_agent,250))."'" : 'NULL').",";
$sql.= " '".$this->db->idate($this->dateevent)."',";
$sql.= " ".($user->id?"'".$this->db->escape($user->id)."'":'NULL').",";
$sql.= " '".$this->db->escape(dol_trunc($this->description,250))."'";

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