Compare commits

...

792 Commits
7.0.1 ... 7.0.4

Author SHA1 Message Date
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
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
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
Frédéric FRANCE
c3f07dd2e0 define $code for all execution paths 2018-10-09 19:28:52 +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
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
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
67e7736eb2 Merge pull request #9698 from Dolibarr/atm-maxime-patch-1
Fix request on project overview
2018-10-09 12:40:51 +02: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
Maxime Kohlhaas
320ca3db67 Fix request on project overview
Fixes #9220
2018-10-06 22:53:28 +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
a97dafc1f2 Merge pull request #9688 from atm-florian/7.0_fix9161
7.0 fix9161
2018-10-06 12:40:42 +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
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
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
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
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
atm-ph
bfaf25ca2a Fix wrong value for module part and return access denied 2018-10-04 16:55:16 +02:00
atm-ph
58d1ac427e Fix missing hook on sellsjournal 2018-10-04 10:57:22 +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
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
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
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
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
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
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
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
Frédéric FRANCE
d15c52db3b Update rssparser.class.php 2018-09-25 08:16:05 +02:00
gauthier
fc7c0ce521 FIX : need to filter on current entity on replenish 2018-09-24 16:23:44 +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
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
gauthier
7b46bedce6 NEW : hidden configuration 2018-09-21 14:35:36 +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
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
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
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
9c4f582f5c Merge 2018-09-16 12:52:11 +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
ias-ceo
fece67b629 use correct resultset 2018-09-12 19:00:19 +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
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
fd93a22dca Fix missing field 2018-09-12 16:45:12 +02:00
atm-quentin
c42f39cc34 FIX character making error on list 2018-09-12 14:44:08 +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
atm-ph
40c79cb7cd Fix classname liencolht to linecolht 2018-09-11 17:56:11 +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
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
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
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
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
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
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
f216da78d5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	.travis.yml
2018-09-02 15:27:03 +02:00
Laurent Destailleur
e0b272941f Fix mariadb 2018-09-02 15:25:27 +02:00
Laurent Destailleur
ebba0b9e67 phpunit 6.1 compatibility 2018-09-02 15:24:29 +02:00
Laurent Destailleur
0b34acae7c Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-02 15:22:56 +02:00
Laurent Destailleur
42cb2b07db Only min and max version 2018-09-02 15:22:49 +02:00
Laurent Destailleur
a7dfc88b59 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	test/phpunit/CoreTest.php
2018-09-02 15:21:21 +02:00
Laurent Destailleur
bd3647a9d7 Prepare phpunit 6.1 compatibility 2018-09-02 14:23:52 +02:00
Laurent Destailleur
b9c95a5a5c Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-09-02 14:19:43 +02:00
Laurent Destailleur
5bab9d59b2 Fix var_dump 2018-09-02 14:19:23 +02:00
Laurent Destailleur
df721a5fbc Only min and max php version 2018-09-02 14:18:04 +02:00
Laurent Destailleur
37fb70d983 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-09-02 14:15:32 +02:00
Laurent Destailleur
02bedc49d3 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts:
	test/phpunit/PricesTest.php
	test/phpunit/RestAPIUserTest.php
	test/phpunit/WebservicesInvoicesTest.php
2018-09-02 14:15:17 +02:00
Laurent Destailleur
e41b55af13 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0 2018-09-02 14:10:28 +02:00
Laurent Destailleur
a69c3caf2c Prepare compatibility with phpunit 6.1 2018-09-02 14:10:06 +02:00
Laurent Destailleur
53caac13a9 Test phpunit 2018-09-02 13:57:51 +02:00
Laurent Destailleur
fe7a0c894f Merge pull request #9368 from atm-ph/fix_7.0_search_company_by_code
Fix search company by code
2018-09-01 14:42:32 +02:00
Laurent Destailleur
945e925399 Update html.form.class.php 2018-09-01 14:41:44 +02:00
Laurent Destailleur
677d7dd0fb Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-09-01 14:09:20 +02:00
Laurent Destailleur
123a66dc2a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/product/class/product.class.php
2018-09-01 14:09:00 +02:00
Laurent Destailleur
b6f4b1dff7 Merge pull request #9363 from frederic34/patch-21
Update modSociete.class.php
2018-09-01 13:31:23 +02:00
Laurent Destailleur
bb444c80d0 Merge pull request #9360 from frederic34/patch-18
Update ldap.php
2018-09-01 13:28:16 +02:00
Laurent Destailleur
1eeb567e67 Merge pull request #9359 from frederic34/patch-17
Update card.php
2018-09-01 13:27:49 +02:00
Josep Lluís
bfaf7ae473 Fix: undefined rights_class on modules
When a module has the permission variable rights_class undefined, on unactivate the module are deleted all rows in cronjobs and menu tables with module=''.
2018-09-01 12:44:16 +02:00
Laurent Destailleur
179feebd80 Merge pull request #9347 from atm-greg/fix_getLabelOfUnit
remove useless db begin
2018-09-01 12:34:43 +02:00
Laurent Destailleur
160a35f63f Merge pull request #9335 from frederic34/patch-11
Update blockedlog.lang
2018-09-01 12:19:36 +02:00
Laurent Destailleur
81c4e6a764 FIX Force stripe api version to avoid trouble if we update stripe api
Conflicts:
	htdocs/stripe/config.php
2018-09-01 12:03:44 +02:00
atm-ph
102b698c76 Fix search company by code 2018-08-31 11:38:45 +02:00
Laurent Destailleur
07d5bd143a Fix entity 2018-08-31 11:26:53 +02:00
Frédéric FRANCE
2eade6ea68 Update modSociete.class.php 2018-08-30 23:22:06 +02:00
Frédéric FRANCE
f61450ffa8 Update ldap.php 2018-08-30 23:04:32 +02:00
Frédéric FRANCE
9c44f80746 Update card.php 2018-08-30 23:03:03 +02:00
atm-greg
f8fef61075 remove useless db begin 2018-08-30 09:19:44 +02:00
Frédéric FRANCE
285e231ea1 Update blockedlog.lang 2018-08-29 23:08:13 +02:00
Laurent Destailleur
46fe19bed5 Code comment 2018-08-29 18:56:57 +02:00
Laurent Destailleur
0c11007e34 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	README.md
	htdocs/comm/propal/card.php
2018-08-29 18:53:39 +02:00
Laurent Destailleur
e317b0847a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	README.md
2018-08-29 18:50:00 +02:00
Laurent Destailleur
7af083f1ec Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-08-29 18:49:08 +02:00
Laurent Destailleur
34ceec7067 FIX #9328 2018-08-29 18:40:12 +02:00
Laurent Destailleur
428354303c FIX #9328 2018-08-29 18:29:42 +02:00
Laurent Destailleur
275b9a9960 Merge pull request #9325 from frederic34/patch-12
Fix allow barcode with special char
2018-08-29 18:01:15 +02:00
Laurent Destailleur
46a24ff28f Merge pull request #9321 from atm-gauthier/6.0_fix_default_bank_on_create_propal
FIX : $fk_account is always empty, must be $soc->fk_account
2018-08-29 17:56:36 +02:00
Laurent Destailleur
4d8424f9eb Merge pull request #9314 from frederic34/patch-10
Build Badge for 7.0
2018-08-29 17:50:10 +02:00
Laurent Destailleur
cb24fa0f08 Merge pull request #9310 from frederic34/patch-9
Build Badge for 6.0
2018-08-29 17:50:04 +02:00
Frédéric FRANCE
24be0b7305 Update viewimage.php
code may have rich content (qrcode, datamatrix,...)
2018-08-29 13:08:52 +02:00
gauthier
61a57e619f FIX : $fk_account is always empty, must be $soc->fk_account 2018-08-28 16:54:04 +02:00
Frédéric FRANCE
055b7392d0 Build Badge for 7.0 2018-08-28 10:07:09 +02:00
Frédéric FRANCE
53e476483c Build Badge for 6.0 2018-08-28 09:38:24 +02:00
Laurent Destailleur
32ef9695a7 Merge pull request #9282 from frederic34/patch-19
Update card.php
2018-08-28 02:28:35 +02:00
Laurent Destailleur
7462a1ae1d Update card.php 2018-08-28 02:27:56 +02:00
Laurent Destailleur
4369be7b39 Merge pull request #9284 from frederic34/patch-20
Update commondocgenerator.class.php
2018-08-28 02:11:50 +02:00
Laurent Destailleur
d90eed3098 Merge pull request #9291 from frederic34/patch-23
typo
2018-08-28 01:55:44 +02:00
Laurent Destailleur
b96082a577 Merge pull request #9274 from frederic34/patch-17
Build badge for 5.0
2018-08-28 01:38:06 +02:00
Laurent Destailleur
1f807b9216 Merge pull request #9305 from atm-gauthier/7.0_fix_altertable_charges
FIX : table llx_chargessociales doesn't exists
2018-08-28 01:37:31 +02:00
Norbert Penel
f9c1dd8edd There is a begin transaction without rollback
In this Select, there is no need of this Begin Transaction on my understanding.
Don't know why this line code is here for.
2018-08-28 01:32:55 +02:00
Laurent Destailleur
0d91aff32c Merge pull request #9304 from atm-ph/fix_attributes_missing_for_api
Fix datec and tms missing in fetch method for API
2018-08-28 01:30:56 +02:00
gauthier
79aa390fe8 FIX : table llx_chargessociales doesn't exists 2018-08-27 15:07:19 +02:00
atm-ph
d9beb3f882 Fix tms missing in fetch propal 2018-08-27 10:19:07 +02:00
atm-quentin
ec9eeb5201 FIX check !empty exclude select element 2018-08-27 10:17:18 +02:00
atm-ph
eb4e42bc40 Fix datec and tms missing in fetch method for API 2018-08-26 18:08:10 +02:00
Frédéric FRANCE
85ae8f3901 Update card.php 2018-08-24 09:29:17 +02:00
Laurent Destailleur
62b2981e42 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-08-23 19:47:31 +02:00
Laurent Destailleur
61ced8220b Fix sample doc 2018-08-23 17:49:14 +02:00
Frédéric FRANCE
343e6ce8b3 typo 2018-08-23 14:34:27 +02:00
Frédéric FRANCE
96f16b7497 Update commondocgenerator.class.php 2018-08-22 17:29:05 +02:00
Frédéric FRANCE
0334409d18 Update card.php 2018-08-22 13:43:30 +02:00
Laurent Destailleur
c7a241a5db FIX Get templates in a forced language
Conflicts:
	htdocs/core/class/html.formmail.class.php
2018-08-22 13:22:49 +02:00
Frédéric FRANCE
b1a3238c94 Build badge for 5.0 2018-08-21 14:22:29 +02:00
Laurent Destailleur
4fdd521d61 Merge pull request #8671 from ATM-Nicolas/fix_comments_on_tasks
FIX : Fetch task will now fetch comments
2018-08-21 13:36:20 +02:00
Laurent Destailleur
009424cd67 Merge pull request #9226 from atm-greg/Fix_project_delete_tasks
Fix project delete tasks
2018-08-21 13:11:00 +02:00
Laurent Destailleur
91bfa4be6c Update project.class.php 2018-08-21 13:10:20 +02:00
Laurent Destailleur
3523c2b3d2 Update project.class.php 2018-08-21 13:09:06 +02:00
Laurent Destailleur
58b668e74f Merge pull request #9256 from c3do/patch-2
Fix : Erreur de syntaxe ( + au lieu de . )
2018-08-21 12:48:58 +02:00
Laurent Destailleur
e03d7eba8c Merge pull request #9254 from frederic34/patch-17
Build Badge by branch
2018-08-21 12:48:23 +02:00
Cédric
fe6779c223 Erreur de syntaxe ( + au lieu de . ) 2018-08-16 17:20:38 +02:00
Frédéric FRANCE
2aa0956f15 Update README.md 2018-08-16 16:08:04 +02:00
Frédéric FRANCE
bb09bcece4 Update README.md 2018-08-16 16:03:56 +02:00
Laurent Destailleur
0c654bd452 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-08-16 14:47:56 +02:00
Laurent Destailleur
e88b68f131 Merge pull request #9246 from atm-florian/6.0
fix : ODT project substitution
2018-08-16 00:33:04 +02:00
florian HENRY
20309665e6 fix : ODT project substitution 2018-08-14 10:45:08 +02:00
atm-greg
ba6f7d4b0a fix infinite loop 2018-08-14 09:32:43 +02:00
Laurent Destailleur
7cd24c389d Fix firstname/lastname 2018-08-13 01:21:23 +02:00
Laurent Destailleur
21555a7435 Fix firstname/lastname 2018-08-13 01:10:51 +02:00
Laurent Destailleur
2d571acc03 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/commande/list.php
2018-08-12 19:25:44 +02:00
Laurent Destailleur
30b4d88428 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/facture/list.php
	htdocs/product/reassort.php
	htdocs/societe/list.php
2018-08-12 19:23:45 +02:00
Laurent Destailleur
61a5be6e2a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-08-12 19:19:21 +02:00
Laurent Destailleur
234b0d3120 Merge pull request #9230 from ATM-Nicolas/fix_withdraw_pagination
FIX : Pagination on withdraw request list
2018-08-12 19:18:57 +02:00
Laurent Destailleur
b81b6b651f Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-08-12 19:17:26 +02:00
Laurent Destailleur
be7a764de7 Merge pull request #9202 from atm-florian/7.0
fix bad use of test_sql_and_script_inject return int not value tested
2018-08-12 18:24:54 +02:00
Laurent Destailleur
7f797668c9 Merge pull request #9186 from atm-florian/6.0
fix : odt project and task extrafields management
2018-08-12 18:15:02 +02:00
Laurent Destailleur
56d8935976 Merge pull request #9181 from ATM-Nicolas/fix_dolGetFirstLastname
FIX : Wrong position of firstname lastname
2018-08-12 18:11:36 +02:00
Laurent Destailleur
6954ab00f9 Update functions.lib.php 2018-08-12 18:11:27 +02:00
Laurent Destailleur
9124d5c6a5 Merge pull request #9231 from atm-gauthier/7.0_fix_notice
FIX : global $mysoc missing (to avoid php notice on lines 279, 280 & 281
2018-08-12 17:36:39 +02:00
gauthier
391230babc FIX : global $mysoc missing (to avoid php notice on lines 279, 280 & 281) 2018-08-10 15:39:49 +02:00
ATM-Nicolas
d8d54d246c FIX : Pagination on withdraw request list 2018-08-10 15:05:21 +02:00
florian HENRY
06189f8153 Merge branch '6.0' into 6.0_fhe 2018-08-09 18:31:59 +02:00
florian HENRY
9024ed9e61 Merge branch '7.0' into 7.0_fhe 2018-08-09 17:47:21 +02:00
atm-greg
3d84adbd76 fix recurcivity 2018-08-09 12:21:48 +02:00
atm-greg
4e16f64af0 Fix project::delete to delete children tasks before parent tasks 2018-08-09 12:13:06 +02:00
Laurent Destailleur
de1386c83c Merge branch '7.0' of github.com:Dolibarr/dolibarr into 7.0 2018-08-08 16:49:09 +02:00
Juanjo Menent
e2499392a9 Merge pull request #9215 from fmarcet/7.0
Fix: Bad position when document have incoterms/notes
2018-08-08 11:10:47 +02:00
Juanjo Menent
b840152bcd Merge pull request #9217 from ATM-Nicolas/fix_undefined_index_notnull
FIX : PHP warning, undefined index notnull
2018-08-08 11:10:17 +02:00
Juanjo Menent
9f09c97eb9 Merge pull request #9198 from OPEN-DSI/fix_cmd_list
FIX : Search on Ref project on order list
2018-08-08 10:56:57 +02:00
Ferran Marcet
5ce31f65a4 Fix: Bad position when document have incoterms/notes 2018-08-07 11:40:11 +02:00
ATM-Nicolas
5b15e688af FIX : PHP warning, undefined index notnull 2018-08-07 09:38:18 +02:00
florian HENRY
74d05da149 fix : display if error 2018-08-06 11:28:34 +02:00
florian HENRY
0d85eb52c5 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0 2018-08-03 17:10:26 +02:00
florian HENRY
615ed11534 fix bad use of test_sql_and_script_inject return int not value tested 2018-08-03 17:09:58 +02:00
atm-quentin
09dfcc6016 FIX exclude element of the select 2018-08-03 14:54:21 +02:00
Philippe
61e1f0508d FIX : Search on Ref project on order list 2018-08-03 11:08:09 +02:00
ATM-Nicolas
70adfb135d FIX : Missing behavior 2018-08-03 09:51:29 +02:00
Laurent Destailleur
6010d9de4b Merge pull request #9158 from atm-gauthier/7.0_missing_hook
FIX : missing hook to edit sql
2018-08-02 18:36:25 +02:00
Laurent Destailleur
17ed19503c Code comment 2018-08-02 17:51:04 +02:00
Laurent Destailleur
e85ec19018 Merge pull request #9093 from atm-gauthier/FIX_filters
FIX : page must always be 0 when we search
2018-08-02 17:48:35 +02:00
Laurent Destailleur
b5a0e14ffe Merge pull request #9185 from atm-john/fix_situation_total_calcul
Important: fix situation line's total
2018-08-02 17:45:44 +02:00
Laurent Destailleur
d84bacad00 Merge pull request #9196 from ATM-Nicolas/fix_wrong_variable_and_trigger_name
FIX : Wrong variable and trigger name
2018-08-02 17:43:16 +02:00
ATM-Nicolas
f3090e4819 FIX : Wrong variable and trigger name 2018-08-02 16:05:54 +02:00
Juanjo Menent
5b3c6de06c Merge pull request #9184 from atm-gauthier/7.0_fix_extrafieldkey
FIX : extrafieldkey
2018-08-02 11:24:19 +02:00
Juanjo Menent
1fbbaf2895 Merge pull request #9180 from atm-florian/7.0
FIX: keep context filter on contact list on change column displayed
2018-08-02 11:20:25 +02:00
Juanjo Menent
ce49230d71 Merge pull request #9177 from ATM-Nicolas/fix_preselect_project
FIX : Keep same project when creating shipping from order
2018-08-02 11:18:39 +02:00
Juanjo Menent
98dada47de Merge pull request #9174 from tarrsalah/fix-soc-filter-on-supplier-invoices
FIX filter supplier invoice list by societe name.
2018-08-02 11:12:01 +02:00
Juanjo Menent
2cf51fbdf1 Merge pull request #9173 from frederic34/patch-22
fix #8820
2018-08-02 11:08:47 +02:00
Juanjo Menent
2206eb98d1 Merge pull request #9191 from Dolibarr/revert-9147-7.0_price
Revert "FIX multicompany compatibility !"
2018-08-02 10:46:20 +02:00
Juanjo Menent
99f29a9764 Revert "FIX multicompany compatibility !" 2018-08-02 10:45:15 +02:00
Juanjo Menent
e6f416e745 Merge pull request #9147 from hregis/7.0_price
FIX multicompany compatibility !
2018-08-02 10:45:01 +02:00
florian HENRY
ceb85cfa45 fix : odt project and task extrafields management 2018-07-31 17:29:08 +02:00
gauthier
cadf931e8d FIX : extrafieldkey 2018-07-31 15:02:51 +02:00
John BOTELLA
4ddca02bb9 fix situation line's total 2018-07-31 14:58:33 +02:00
ATM-Nicolas
b9a44fc76b FIX : Wrong position of firstname lastname 2018-07-31 12:15:18 +02:00
florian HENRY
5d19361782 fix: keep context filter on contact list on change column displayed 2018-07-31 11:39:54 +02:00
ATM-Nicolas
1536bbc65e FIX : Keep same project when creating shipping from order 2018-07-30 15:16:53 +02:00
tarrsalah
8278a9fa52 FIX filter supplier invoice list by societe name. 2018-07-29 13:18:05 +01:00
Frédéric FRANCE
7dada7ae8e fix #8820 2018-07-29 09:15:42 +02:00
Laurent Destailleur
894f484de8 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-27 12:34:02 +02:00
Laurent Destailleur
83ae27d122 FIX Deletion of files in migration 2018-07-27 12:33:36 +02:00
gauthier
c95d6271a9 FIX : missing hook to edit sql 2018-07-25 11:15:13 +02:00
Laurent Destailleur
cfb0f2df05 Merge pull request #9149 from OPEN-DSI/fix_propal_list
FIX search on ref project on propal list
2018-07-24 21:42:02 +02:00
Philippe
d7f58d0087 FIX search on ref project on propal list 2018-07-24 20:28:49 +02:00
Laurent Destailleur
927727edf3 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-24 19:22:12 +02:00
Laurent Destailleur
20f178fdfe Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/comm/action/index.php
	htdocs/core/lib/functions.lib.php
2018-07-24 19:22:00 +02:00
Regis Houssin
b7dfc99882 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_price 2018-07-24 18:58:23 +02:00
Laurent Destailleur
f50aa03187 Merge pull request #9112 from atm-gauthier/FIX_multientity_replenish
FIX: stock replenish with multientity
2018-07-24 18:10:00 +02:00
Laurent Destailleur
e9eb8da61b Update replenish.php 2018-07-24 18:09:50 +02:00
Laurent Destailleur
c7f54439ff Merge pull request #9145 from frederic34/patch-12
use defaut currency for supplier order
2018-07-24 17:32:11 +02:00
Regis Houssin
835cb04631 FIX remove rowid for multicompany compatibility 2018-07-24 17:07:08 +02:00
Frédéric FRANCE
bde30b85ad use defaut currency for supplier order 2018-07-24 17:06:12 +02:00
Laurent Destailleur
3bdf7d411d Merge pull request #9125 from atm-john/fix_php7_warning_mysql
Fix: Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NU…
2018-07-24 16:56:10 +02:00
Laurent Destailleur
8866b8eb1d Merge pull request #9133 from frederic34/patch-12
__NEXT_MONTH __PREVIOUS_MONTH give day instead month
2018-07-24 16:54:04 +02:00
Laurent Destailleur
e4705669ba Merge pull request #9136 from frederic34/patch-17
remove % in supplier order pdf
2018-07-24 16:51:58 +02:00
Regis Houssin
d4920521b5 FIX multicompany compatibility ! 2018-07-24 15:44:21 +02:00
Frédéric FRANCE
4341e367d2 remove % in supplier order pdf 2018-07-23 10:30:28 +02:00
Frédéric FRANCE
d582f72bd9 __NEXT_MONTH __PREVIOUS_MONTH give day instead month 2018-07-22 17:27:02 +02:00
Laurent Destailleur
a1180f79bd Fix missing customer code and ref customer 2018-07-21 12:56:18 +02:00
John BOTELLA
1e986bc39a Fix: Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) 2018-07-20 11:51:01 +02:00
Laurent Destailleur
7fcec5f6c3 Fix duplicate tab "contact" on thirdparty 2018-07-17 13:54:13 +02:00
Laurent Destailleur
45a45b0dec NEW Can enable a module, even external module, from command line
Conflicts:
	htdocs/install/upgrade2.php
2018-07-16 15:35:00 +02:00
gauthier
33aa373362 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 2018-07-16 15:27:37 +02:00
Laurent Destailleur
e92052353d Merge pull request #9026 from inoveaconseil/FixExtrafieldResource
Fix extrafields resource
2018-07-15 20:13:24 +02:00
Laurent Destailleur
b690306b70 Merge pull request #9027 from hregis/7.0_price
Fix: avoid a non numeric value !!
2018-07-15 20:11:50 +02:00
Laurent Destailleur
cb0553c3bf Merge pull request #9094 from atm-ph/fix_7.0_getrights
Fix user rights overrided by user group rights
2018-07-15 19:58:00 +02:00
atm-ph
0c252d9778 Fix user rights overrided by user group rights 2018-07-11 18:09:29 +02:00
gauthier
80ff7fa86f FIX : case when we valid form with keyboard 2018-07-11 15:18:30 +02:00
gauthier
103c7e6d06 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) 2018-07-11 09:51:36 +02:00
Regis Houssin
f52187e829 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0_price 2018-07-11 08:22:13 +02:00
Laurent Destailleur
aeb5f5e4f3 Fix phpcs 2018-07-10 13:56:03 +02:00
Laurent Destailleur
bda142d82d Update commande.class.php 2018-07-10 11:10:55 +02:00
Laurent Destailleur
c0d6aee040 Update propal.class.php 2018-07-10 11:10:01 +02:00
Laurent Destailleur
ed3023f7d9 Update propal.class.php 2018-07-10 11:09:08 +02:00
Laurent Destailleur
dc7fcc009b Update propal.class.php 2018-07-10 10:56:45 +02:00
Laurent Destailleur
8e0a663b7c Code comment 2018-07-10 10:53:59 +02:00
Laurent Destailleur
97b1589fb5 Merge pull request #9082 from ATM-Marc/FIX_5.0_propal_projectFromOrigin
FIX: propal: correctly preset project when creating with origin/originid
2018-07-10 10:42:10 +02:00
Marc de Lima Lucio
2ba7c07574 FIX: propal: correctly preset project when creating with origin/originid 2018-07-09 17:34:31 +02:00
Laurent Destailleur
2f668ccc79 Merge pull request #9076 from atm-john/fix_count_parameter_6.0
Fix count(): Parameter must be an array or an object that implements …
2018-07-09 17:34:10 +02:00
Laurent Destailleur
8184eff66c Fix for #9079 2018-07-09 15:25:14 +02:00
Laurent Destailleur
c33aaa076d FIX #8984 button create expense report 2018-07-09 14:35:22 +02:00
Laurent Destailleur
e427496ddf FIX Injection 2018-07-09 14:13:01 +02:00
John BOTELLA
1daba56bbc Fix count(): Parameter must be an array or an object that implements Countable 2018-07-09 10:05:53 +02:00
Laurent Destailleur
2a676b414a Merge pull request #9024 from atm-maxime/fix_link_create_event
Fix link to create event had no socid if from thirdparty card
2018-07-06 14:26:38 +02:00
Laurent Destailleur
2113965b57 Update html.formactions.class.php 2018-07-06 14:26:21 +02:00
Laurent Destailleur
2cdd9adc6e Merge pull request #9023 from atm-maxime/fix_stocklist
Fix filters not saved when ordering
2018-07-06 14:23:10 +02:00
Laurent Destailleur
3b8ecb18ab Merge pull request #9044 from hregis/7.0_loan
Fix: missing "paid" field
2018-07-06 13:03:37 +02:00
Laurent Destailleur
0587e73272 FIX Pagination on related item pages 2018-07-05 15:53:28 +02:00
Inovea Conseil
d53f03b596 Update after comment 2018-07-05 09:14:36 +02:00
Regis Houssin
875cee84c7 Fix: missing "paid" field 2018-07-03 13:47:53 +02:00
Laurent Destailleur
0138b0e0b7 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/html.form.class.php
2018-07-03 10:01:30 +02:00
Laurent Destailleur
f9fa19e7ae Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-02 12:26:45 +02:00
Laurent Destailleur
9c5d34fc5f Fix translation 2018-07-02 12:26:32 +02:00
Laurent Destailleur
af21222c30 Fix translation 2018-07-02 11:47:04 +02:00
Laurent Destailleur
e8b97b0be4 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-07-02 11:33:49 +02:00
Laurent Destailleur
11021353da Fix text in payment area of crabe pdf 2018-07-02 11:33:33 +02:00
Regis Houssin
4925624ed9 Fix: avoid NULL value when "subprice" is 0 2018-06-30 10:38:30 +02:00
Regis Houssin
964f11491f Revert "Fix: avoid a non numeric value !!"
This reverts commit 2824afa75c.
2018-06-30 10:26:50 +02:00
Laurent Destailleur
bc632c9ab7 Merge pull request #9019 from atm-gauthier/6.0_fix_getentity
FIX : getEntity project and not projet
2018-06-30 01:15:23 +02:00
Laurent Destailleur
03306fa56e Merge pull request #9022 from atm-maxime/7.0
Fix : division by 0 on homepage if nothing to do
2018-06-29 19:58:48 +02:00
Laurent Destailleur
a6c6bbe16d Merge pull request #9029 from hregis/6.0_multicompany
Fix: broken feature with edit in place
2018-06-29 19:40:17 +02:00
Laurent Destailleur
3f2b3c0840 FIX #9032 2018-06-29 19:38:12 +02:00
Laurent Destailleur
1c7cd19c1d Merge pull request #9033 from hregis/6.0_bug3
Fix: #9032 Vulnerability
2018-06-29 19:26:12 +02:00
Laurent Destailleur
c4143763be Update step1.php 2018-06-29 19:23:17 +02:00
Laurent Destailleur
932ff0be18 Trans 2018-06-29 19:16:29 +02:00
Laurent Destailleur
ca8144c5ea Fix error message 2018-06-29 19:08:35 +02:00
Laurent Destailleur
2175a012e1 Fix lang 2018-06-29 18:23:59 +02:00
Regis Houssin
41709f07d0 Fix: #9032 Vulnerability 2018-06-29 18:18:10 +02:00
Regis Houssin
2d13b5b59d Fix: broken feature with edit in place 2018-06-29 15:57:34 +02:00
Regis Houssin
2824afa75c Fix: avoid a non numeric value !! 2018-06-29 11:25:30 +02:00
Inovea Conseil
c4513a755d Fix extrafields resource 2018-06-28 16:39:37 +02:00
Maxime Kohlhaas
5756955d55 Fix link to create event had no socid if from thirdparty card 2018-06-28 14:27:59 +02:00
Maxime Kohlhaas
3babdb9798 Fix filters not saved when ordering 2018-06-28 13:45:30 +02:00
Maxime Kohlhaas
7ebf54fbea Fix : division by 0 on homepage if nothing to do 2018-06-28 12:54:19 +02:00
Laurent Destailleur
da138db528 FIX combo into popup become crazy with IE10
Conflicts:
	htdocs/asset/card.php
	htdocs/modulebuilder/template/myobject_card.php
2018-06-28 12:16:12 +02:00
Laurent Destailleur
ed2ec78332 FIX combo of stock in popup are crazy in IE 2018-06-28 12:11:00 +02:00
gauthier
d8ca9f2947 FIX : we must see number of all shared projects 2018-06-27 17:26:04 +02:00
gauthier
86a58def3b FIX : getEntity project and not projet 2018-06-27 17:13:50 +02:00
Laurent Destailleur
aa37786596 Fix migration errors reported by Softaculous 2018-06-26 11:51:49 +02:00
Laurent Destailleur
7f8570f720 Fix lang loading 2018-06-26 00:48:43 +02:00
Laurent Destailleur
52eddbf809 Sync transifex 2018-06-26 00:29:50 +02:00
Laurent Destailleur
9f77ea0ece Code comment 2018-06-25 17:05:15 +02:00
Laurent Destailleur
9b46ae50f0 Fix left join on expensereport lines 2018-06-25 16:25:37 +02:00
Laurent Destailleur
36402c22ee FIX SQL Injections reported by mu shcor (ADLab of Venustech) 2018-06-25 14:06:09 +02:00
Laurent Destailleur
d9fc1e0b5d Fix param to avoid to create holiday or expense report in wrong entity. 2018-06-25 10:09:01 +02:00
Laurent Destailleur
97976fbb43 Fix type of parameter must be string 2018-06-25 09:19:45 +02:00
Laurent Destailleur
bc71685258 Fix migration error 2018-06-25 08:30:37 +02:00
Laurent Destailleur
16f940b637 Prepare 7.0.4 2018-06-23 14:55:33 +02:00
Laurent Destailleur
edec89ef1e Prepare 7.0.3 2018-06-23 12:44:30 +02:00
Laurent Destailleur
ca04ffe420 Load lang 2018-06-22 17:07:49 +02:00
Laurent Destailleur
d458b383ad Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-22 15:29:44 +02:00
Laurent Destailleur
533c19cc2c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/accountancy/customer/list.php
	htdocs/core/lib/functions.lib.php
2018-06-22 15:29:26 +02:00
Laurent Destailleur
8414ceaddb Merge pull request #9000 from ATM-Marc/FIX_7.0_propal_contact_SHIPPING
FIX: proposal: missing contact type translation key
2018-06-22 15:16:56 +02:00
Laurent Destailleur
bd7277431f Merge pull request #8986 from atm-greg/fix_desired_stock
FIX bad result on fetch ProductStockEntrepot
2018-06-22 15:01:19 +02:00
Laurent Destailleur
dab264c641 Merge pull request #8994 from hregis/6.0_multicompany
Fix: to avoid deleting line breaks
2018-06-22 15:00:26 +02:00
Laurent Destailleur
cfc8e8b0ef Merge pull request #8972 from fmarcet/7.0
FIX Avoid converting into reduction twice and draft invoice
2018-06-22 14:35:26 +02:00
Laurent Destailleur
5bee324578 Update paiement.class.php 2018-06-22 14:34:59 +02:00
Laurent Destailleur
2d89d9634b Fix search on extrafields 2018-06-20 23:16:06 +02:00
Laurent Destailleur
714057d435 Fix stats on project. Must use assignement on project as filter. 2018-06-20 21:31:37 +02:00
Laurent Destailleur
9f2437fa04 Fix missing field 2018-06-20 17:59:01 +02:00
Marc de Lima Lucio
2fab4d7f76 FIX: proposal: missing contact type translation key 2018-06-20 14:56:24 +02:00
Regis Houssin
8fc2f7441c Fix: to avoid deleting line breaks 2018-06-20 09:06:16 +02:00
bgenere
403116898f Fix cherry-pick 2018-06-19 18:25:52 +02:00
atm-greg
df056980b5 fix bad result on fetch ProductStockEntrepot 2018-06-19 10:46:07 +02:00
Laurent Destailleur
31067b6250 FIX picto for type in product link in accountany list is wrong 2018-06-18 14:43:32 +02:00
Laurent Destailleur
ce5514bd68 Fix sql begin at wrong place 2018-06-18 14:37:16 +02:00
Laurent Destailleur
5d6d43d539 Merge pull request #8964 from atm-gauthier/6.0_accounting_entity
FIX : need to filter on aa.entity for same accounting accounts available in several entities
2018-06-18 14:30:55 +02:00
Laurent Destailleur
16fee19b6f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-18 13:20:11 +02:00
Laurent Destailleur
102f9aa84f FIX Problems in accountancy module when using multicompany module. 2018-06-18 13:19:46 +02:00
gauthier
fed61930d5 FIX : clause must not be there 2018-06-18 11:37:15 +02:00
Laurent Destailleur
8c6f311aa6 Merge pull request #8974 from atm-ph/fix_7.0_addMoreActionsButtons_on_usercard
Fix missing hook on usercard (addMoreActionsButtons)
2018-06-18 11:18:12 +02:00
Laurent Destailleur
9cfc4a8d28 Merge pull request #8971 from atm-ph/fix_7.0_hook_getnomurltooltip
Fix can't add an attribute simply
2018-06-18 11:13:29 +02:00
Laurent Destailleur
95ee3325fc Part of fix of #8972 2018-06-18 11:11:07 +02:00
Laurent Destailleur
3c55e50bac Merge pull request #8966 from hregis/7.0_bug6
Fix: MEMBER_MODIFY trigger not called if i change only extrafields
2018-06-18 10:53:35 +02:00
Laurent Destailleur
95dfa1f7aa Merge pull request #8973 from altatof/FIX_HTML_DETECTION
Fix <br/> detection
2018-06-18 10:42:02 +02:00
Laurent Destailleur
63fb82931c Update functions.lib.php 2018-06-18 10:41:11 +02:00
atm-ph
3c80ce501b Fix missing hook on usercard (addMoreActionsButtons) 2018-06-15 16:05:50 +02:00
altatof
5d6cd381b9 Fix <br/> detection 2018-06-15 15:59:14 +02:00
Ferran Marcet
a21e138c70 Fix: Avoid converting into reduction twice and draft invoice 2018-06-15 11:19:04 +02:00
atm-ph
cb3704b67e Fix can't add an attribute simply 2018-06-15 11:02:46 +02:00
Regis Houssin
f9a86ba43f Fix: MEMBER_MODIFY trigger not called if i change only extrafields 2018-06-14 14:01:05 +02:00
Laurent Destailleur
e18a5d148c Merge pull request #8962 from ATM-Marc/FIX_7.0_supplierorder_reffourn
FIX: supplier order: product supplier ref not saved on addline
2018-06-14 12:00:36 +02:00
gauthier
e9d65ea751 FIX : need to filter on aa.entity for same accounting accounts available in several entities 2018-06-14 11:56:22 +02:00
Marc de Lima Lucio
1dec4c4320 FIX: supplier order: product supplier ref not saved on addline 2018-06-14 10:37:40 +02:00
Laurent Destailleur
4c2af6fc70 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/comm/propal/class/propal.class.php
	htdocs/core/class/html.form.class.php
2018-06-13 23:04:08 +02:00
Laurent Destailleur
09c92b7cc8 Merge pull request #8936 from atm-gauthier/6.0_fix_dont_remove_all_fourn_rights
FIX : If we enable 3 steps for supplier order approbation, we must no…
2018-06-13 21:36:01 +02:00
Laurent Destailleur
c586f2ecf7 Merge pull request #8957 from altatof/FIX_TOTAL_HT_DEVISE
FIX : pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
2018-06-13 21:20:42 +02:00
Laurent Destailleur
b5cd722eb1 Merge pull request #8917 from atm-gauthier/6.0_fix_apply_reduc
FIX : sometimes amounts are identical but php find them different.
2018-06-13 20:34:59 +02:00
Laurent Destailleur
76ee88f0b1 Merge pull request #8951 from fappels/7.0_fix_ErrorProductAlreadyExists
Fix Wrong error for duplicate ref if barcode enabled but not set.
2018-06-13 20:19:55 +02:00
Laurent Destailleur
eabb3e9cd3 Merge pull request #8930 from hregis/7.0_non-numeric
FIX wrong var name $search_month_lim
2018-06-13 20:09:13 +02:00
Laurent Destailleur
5fcfad5966 Merge pull request #8918 from atm-gauthier/6.0_fix_entity_select_prod_fourn_prices
FIX : entity test must be on product_fourn_price table and not product table
2018-06-13 20:08:25 +02:00
Laurent Destailleur
3f7f77ce95 Merge pull request #8923 from atm-florian/7.0
fix error display
2018-06-13 20:02:45 +02:00
Laurent Destailleur
fdc90da408 Update card.php 2018-06-13 20:02:38 +02:00
Laurent Destailleur
4c1bb9d28f Merge pull request #8948 from glu000/7.0
Fix #8946
2018-06-13 20:01:29 +02:00
Laurent Destailleur
f07408c6c3 Merge pull request #8929 from ATM-Marc/FIX_7.0_extrafields_intervention
FIX: intervention: extrafield error when calling insertExtrafields
2018-06-13 20:00:48 +02:00
altatof
d42f00bca9 FIX : pu_ht_devise was not converted to numeric so decimals were lost
when clculating total_ht_devise
2018-06-13 16:35:52 +02:00
fappels
a86c90fed1 Fix Wrong error for duplicate ref if barcode enabled but not set. 2018-06-12 16:38:42 +02:00
Günter Lukas
fcbf50467e Update user.class.php 2018-06-12 09:52:55 +02:00
Laurent Destailleur
31eeaf9914 Trans 2018-06-09 13:46:42 +02:00
gauthier
baf9d4a806 FIX : If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def. 2018-06-08 17:11:59 +02:00
Regis Houssin
7ce2ebf1a9 Fix: wrong var name 2018-06-07 16:25:47 +02:00
Marc de Lima Lucio
d69fae72c7 FIX: intervention: extrafield regression in commit b5f37301a5 2018-06-07 15:17:22 +02:00
florian HENRY
75305e095d Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0 2018-06-05 20:39:53 +02:00
florian HENRY
8031ef49f2 fix error return 2018-06-05 20:38:55 +02:00
Laurent Destailleur
8400614c3d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-05 18:22:47 +02:00
Laurent Destailleur
426eb178f2 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-06-05 18:22:28 +02:00
Laurent Destailleur
8785d69548 Do not load database handler 2018-06-05 18:21:56 +02:00
Laurent Destailleur
30b04c0d3d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/files.lib.php
2018-06-05 18:16:32 +02:00
Laurent Destailleur
4c21ad4e4e FIX: dol_delete_file must work in a context without db handler loaded
Conflicts:
	htdocs/core/lib/files.lib.php
2018-06-05 18:12:14 +02:00
Laurent Destailleur
9c32e49bd3 FIX: dol_delete_file must work in a context without db handler loaded 2018-06-05 18:05:33 +02:00
gauthier
45ecb0258b FIX : entity test must be on product_fourn_price table and not product table 2018-06-05 12:41:38 +02:00
gauthier
77e7932671 FIX : sometimes amounts are identical but php find them different. 2018-06-05 11:33:58 +02:00
Laurent Destailleur
3368e35502 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-06-04 14:09:34 +02:00
Laurent Destailleur
de2ffa1122 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/comm/action/listactions.php
2018-06-04 14:09:17 +02:00
Laurent Destailleur
840330deea Merge pull request #8905 from atm-greg/Add_supplier_proposals_in_suppliers_linkedObjects
Add supplier proposal in linkedObjects type select of the suppliers
2018-06-04 13:46:36 +02:00
Laurent Destailleur
7eaa2011ba Merge pull request #8900 from atm-florian/6.0_fixagenda
fix: when agenda is filterd with "todo" event, do not display "not applicable" event
2018-06-04 13:39:23 +02:00
atm-greg
0785029fe0 Add supplier proposal in linkedObjects type select of the suppliers 2018-05-31 10:46:50 +02:00
florian HENRY
b996237142 fix: when agenda is filterd with "todo" event, do not display "not
applicable" event
2018-05-30 13:37:17 +02:00
Laurent Destailleur
0412264418 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
2018-05-30 12:05:54 +02:00
Laurent Destailleur
60321aabd8 Fix regression 2018-05-30 11:59:23 +02:00
Laurent Destailleur
3733169120 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/recap-compta.php
	htdocs/fourn/class/fournisseur.commande.class.php
2018-05-30 11:09:53 +02:00
Laurent Destailleur
2df2071bae Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-30 11:05:12 +02:00
Laurent Destailleur
02da9b6992 FIX #8893 to get formatted price as substitution vars 2018-05-30 11:04:44 +02:00
Laurent Destailleur
28646a6b50 Merge pull request #8892 from ATM-Nicolas/fix_bad_email_substitution_key
FIX : Bad substitution key used for default send proposal email
2018-05-30 10:57:31 +02:00
Laurent Destailleur
7590df85e6 Merge pull request #8887 from atm-florian/6.0
add hook on balence pages
2018-05-30 10:47:59 +02:00
Laurent Destailleur
aa59c380ad Merge pull request #8886 from ATM-Nicolas/fix_supplier_order
FIX : Keep supplier proposal price for supplier order
2018-05-30 10:45:37 +02:00
Laurent Destailleur
e57ceab5de Update fournisseur.commande.class.php 2018-05-30 10:45:06 +02:00
ATM-Nicolas
48a315f6cd FIX : Bad substitution key used for default send proposal email 2018-05-30 10:14:34 +02:00
florian HENRY
b65b545e0f add hook on balence pages 2018-05-29 16:29:14 +02:00
Laurent Destailleur
b846f0f84c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-29 12:42:33 +02:00
Laurent Destailleur
2e2cc55350 Backport fix of file checker generation 2018-05-29 12:15:28 +02:00
Laurent Destailleur
95e3c5a4b1 Backport fix of file list check generation 2018-05-29 12:13:58 +02:00
ATM-Nicolas
6b0b975ffd FIX : Keep supplier proposal price for supplier order 2018-05-29 11:21:30 +02:00
Laurent Destailleur
86ec2b8c20 Merge pull request #8883 from ATM-Marc/FIX_7.0_commande_list
FIX: missing parenthesis
2018-05-29 10:58:52 +02:00
Laurent Destailleur
fe2795d7f9 Merge pull request #8867 from ptibogxiv/patch-28
Fix error in list.php
2018-05-29 10:45:13 +02:00
Laurent Destailleur
7b824e3c48 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-29 10:13:48 +02:00
Laurent Destailleur
7eea70ebc8 FIX #8858 #8860 Backport better compatibility fix 2018-05-29 10:13:34 +02:00
Laurent Destailleur
21dab0d8ee Merge pull request #8866 from frederic34/patch-12
Fix Travis for 7.0
2018-05-29 10:04:38 +02:00
Marc de Lima Lucio
ea9e833ab8 FIX: missing parenthesis 2018-05-28 15:03:24 +02:00
ptibogxiv
d032b6ecfb Fix error in list.php 2018-05-26 09:51:56 +02:00
Frédéric FRANCE
091fb81368 Update list.php 2018-05-26 09:49:13 +02:00
Laurent Destailleur
bf81b755f9 Fix state code for payment from indonesia 2018-05-25 16:21:13 +02:00
Laurent Destailleur
37dcfe4a46 FIX button to pay still visible when amount null used 2018-05-25 16:00:23 +02:00
Laurent Destailleur
943d1dce2e Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-25 13:15:38 +02:00
Laurent Destailleur
8a64ee2297 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/commande/list.php
	htdocs/compta/facture/card.php
	htdocs/compta/facture/list.php
	htdocs/expedition/class/expedition.class.php
	htdocs/expedition/list.php
	htdocs/societe/card.php
2018-05-25 13:14:58 +02:00
Laurent Destailleur
1a1f0fbc62 Merge pull request #8839 from ATM-Nicolas/fix_shipping_fetch
FIX : Fetch shipping will now fetch project id
2018-05-25 11:46:06 +02:00
Laurent Destailleur
131ddd6984 Merge pull request #8827 from ATM-Marc/FIX_shipment_fk_project
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
2018-05-25 11:12:39 +02:00
Laurent Destailleur
b25c7e44d3 Merge pull request #8816 from atm-gauthier/6.0_fix_test_before_delete_invoice
FIX : test is_erasable() must be done before call function delete()
2018-05-25 11:05:20 +02:00
Laurent Destailleur
0a581e48d4 Update card.php 2018-05-25 11:04:04 +02:00
Laurent Destailleur
04586fab66 Merge pull request #8824 from ggg44473/7.0
Fix sql error accounting account
2018-05-25 10:41:16 +02:00
Laurent Destailleur
545133960e Merge pull request #8849 from atm-quentin/FIX_missing_filters_during_ordering
FIX missing filters during reordering
2018-05-25 10:15:20 +02:00
Laurent Destailleur
3816b18c27 Merge pull request #8856 from glu000/7.0
FIX: It's not possible to remove a contact which is assigned to an event #8852
2018-05-25 10:14:19 +02:00
Günter Lukas
1b237a75b9 Update card.php 2018-05-24 13:31:23 +02:00
atm-quentin
eb224e43a5 FIX missing filters during ordering 2018-05-24 10:41:24 +02:00
Laurent Destailleur
4967c678b8 Fix translation 2018-05-23 18:05:19 +02:00
Laurent Destailleur
3a06918b16 FIX Missing extrafields in export of stock or products 2018-05-23 18:00:27 +02:00
Laurent Destailleur
d1d8494666 FIX Missing extrafields in export 2018-05-23 17:48:18 +02:00
ATM-Nicolas
734ecbc9b5 FIX : Fetch shipping will now fetch project id 2018-05-23 09:47:29 +02:00
Laurent Destailleur
2a579b707a FIX javascript showempty error
FIX Contact tab not visible when using canvas
2018-05-22 19:43:28 +02:00
Laurent Destailleur
be21405d21 Fix missing error message 2018-05-22 19:24:56 +02:00
ATM-Nicolas
a455f60c42 FIX : Add calls to fetchComments function 2018-05-22 16:07:32 +02:00
ATM-Nicolas
d875553648 FIX : Remove fetchComments from project and task fetch function 2018-05-22 16:03:03 +02:00
ATM-Nicolas
f46d514586 Merge branch '7.0' of github.com:Dolibarr/dolibarr into fix_comments_on_tasks 2018-05-22 15:12:24 +02:00
Laurent Destailleur
7fce02e72e Fix phpunit test name 2018-05-21 23:43:26 +02:00
Laurent Destailleur
8951c4a7a5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-21 23:36:47 +02:00
Laurent Destailleur
afa57fd66d Fix syntax error 2018-05-21 23:33:20 +02:00
Laurent Destailleur
69141c9493 Fix PSR True->true and GETPOST file name for local checksum check 2018-05-21 22:24:27 +02:00
Laurent Destailleur
e5561ecdfb Remove useless files 2018-05-21 22:14:15 +02:00
Marc de Lima Lucio
c9222adf6d FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods 2018-05-21 16:22:06 +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
Sean Wang
8e397b772f Fix sql error 2018-05-21 14:19:41 +08:00
gauthier
4c3f9d6d5e FIX : test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url 2018-05-18 15:20:16 +02:00
BENKE Charlene
24d353c9a7 inversion of dateo and datee 2018-05-18 12:24:44 +02:00
Laurent Destailleur
7de812d2ed Merge pull request #8793 from atm-john/Fix_situation_discount_used
Fix creating next situation invoice if a discount was allready apply
2018-05-18 12:18:58 +02:00
Laurent Destailleur
b5f37b2876 Merge pull request #8811 from fappels/7.0_fix_product_vat_update_errorhandling
Fix product vat update error handling
2018-05-18 12:00:03 +02:00
Laurent Destailleur
508f6c1a89 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-18 11:53:09 +02:00
Laurent Destailleur
6d0306f75a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/class/html.formfile.class.php
2018-05-18 11:52:48 +02:00
Laurent Destailleur
5f8346f854 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-05-18 11:48:30 +02:00
Laurent Destailleur
492b1e7169 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-05-18 11:48:08 +02:00
Laurent Destailleur
75f5cdbc0f Merge pull request #8810 from simnandez/7.0
Fix: extrafiels is not passing orders to invoice
2018-05-18 11:47:44 +02:00
Laurent Destailleur
f2cfb928e8 Merge pull request #8809 from simnandez/5.0
Fix: extrafiels is not passing orders to invoice
2018-05-18 11:47:27 +02:00
Laurent Destailleur
24281028b7 Merge pull request #8807 from inoveaconseil/patch-2
Fix missing params for commonGenerateDocument
2018-05-18 11:43:11 +02:00
Laurent Destailleur
fa7f81c828 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-18 11:38:26 +02:00
Laurent Destailleur
a450f99e8a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/filefunc.inc.php
2018-05-18 11:38:11 +02:00
Laurent Destailleur
162d271884 Merge pull request #8803 from atm-alexis/7.0_fix_task_contact_card_withoutproject
FIX 7.0 task contact card without withproject parameters
2018-05-18 11:29:11 +02:00
Laurent Destailleur
71f8971a8e Merge pull request #8794 from ATM-Nicolas/fix_select_user
FIX : Select user on add time spent form
2018-05-18 11:27:05 +02:00
Laurent Destailleur
078ea2ce9b Merge pull request #8790 from aspangaro/7.0-f1
Fix : Double WHERE on admin/journal_list.php
2018-05-18 11:20:05 +02:00
Laurent Destailleur
2e9f5d1c94 Merge pull request #8798 from atm-florian/6.0
fix SQL and add hook
2018-05-18 11:18:10 +02:00
Laurent Destailleur
79bbeb05ae Add missing phpunit tests 2018-05-18 11:17:33 +02:00
Laurent Destailleur
e2369dea29 FIX #8722 2018-05-18 11:17:21 +02:00
John
3dd11e1eaf Fix discount id 2018-05-18 11:02:04 +02:00
Laurent Destailleur
80bce6b62d Add phpunit for accountingaccount 2018-05-18 09:25:59 +02:00
Juanjo Menent
dd259043cd Fix: Cashdesk does not apply multi-price or price per customer 2018-05-18 09:20:18 +02:00
Laurent Destailleur
26e10caa7d FIX #8813 2018-05-18 09:15:18 +02:00
fappels
90d2ccc79c Fix product vat update error handling
Product vat update does not show update error if update result negative.
2018-05-17 21:29:15 +02:00
Juanjo Menent
0aa8c6f498 Fix: extrafiels is not passing orders to invoice 2018-05-17 19:05:25 +02:00
Juanjo Menent
dc7a1610e7 Fix: extrafiels is not passing orders to invoice 2018-05-17 18:56:01 +02:00
Inovea Conseil
5804d1d4a3 Fix missing params for commonGenerateDocument
ADD param moreparams for compatibility with commonGenerateDocument
2018-05-17 10:16:44 +02:00
alexis Algoud
5c727c077b fix task contact card without withproject parameters 2018-05-16 16:34:19 +02:00
florian HENRY
630e38072b fix SQL and add hook 2018-05-15 17:02:54 +02:00
Alexandre SPANGARO
88bc2dd416 Correct insert 2018-05-14 20:59:38 +02:00
Laurent Destailleur
a46362a71f Prepare 7.0.3 2018-05-14 15:17:10 +02:00
Laurent Destailleur
c8e758411d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-14 15:16:33 +02:00
Laurent Destailleur
9552a914d8 FIX link for projets not linked to a thirdparties 2018-05-14 15:16:19 +02:00
ATM-Nicolas
ca09fddfb3 FIX : Select user on add time spent form 2018-05-14 15:16:07 +02:00
John
b42c87256c Fix_situation_discount_used 2018-05-14 14:55:33 +02:00
Alexandre SPANGARO
2f1ac6fad8 Fix : Double WHERE on admin/journal_list.php 2018-05-13 20:35:07 +02:00
Laurent Destailleur
e1585a4d68 Merge pull request #8763 from fmarcet/7.0
Fix: Bug on invoice status list on left menu
2018-05-10 11:54:34 +02:00
Laurent Destailleur
842c6168a2 FIX #8762 2018-05-10 11:50:35 +02:00
Ferran Marcet
d1fd39936c Fix: Bug on invoice status list on left menu 2018-05-08 09:04:04 +02:00
Laurent Destailleur
20c50e809d Start 6.0.8 2018-05-06 10:43:40 +02:00
Laurent Destailleur
f15da0b980 Fix chart of account initial data for syscohada 2018-05-05 22:15:19 +02:00
Laurent Destailleur
4f0e053463 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	ChangeLog
2018-05-05 21:58:17 +02:00
Laurent Destailleur
19008531bb Fix packager 2018-05-05 21:56:34 +02:00
Laurent Destailleur
f76df85aec compatibility with ubuntu 14.04 2018-05-05 21:53:02 +02:00
Laurent Destailleur
d4d4f8cc83 Prepare 7.0.2 2018-05-05 20:29:06 +02:00
Laurent Destailleur
b958311819 Prepare 6.0.7 2018-05-05 20:25:06 +02:00
Laurent Destailleur
9c68b81f59 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/accountancy/admin/account.php
	htdocs/projet/class/task.class.php
2018-05-05 14:34:54 +02:00
Laurent Destailleur
8b4b786969 Merge pull request #8730 from atm-arnaud/FIX_project_list_label
FIX label in getnomurl projectlist
2018-05-05 13:26:11 +02:00
Laurent Destailleur
44cb60e61d Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-05 13:25:00 +02:00
Laurent Destailleur
f6ca1eb624 Fix permission name 2018-05-05 13:24:46 +02:00
Laurent Destailleur
352676cd16 Merge pull request #8725 from fappels/Fix_7.0_ProductCombbination
FIX delete all product variants of a parent product
2018-05-05 13:14:55 +02:00
Laurent Destailleur
2f79a12c6b Merge pull request #8720 from atm-florian/6.0_pjAndTskCounter
fix project and task visibility same as list
2018-05-05 13:13:25 +02:00
Laurent Destailleur
8d52c4f919 Merge pull request #8721 from atm-florian/6.0_fixtaskid
fix taskid
2018-05-05 13:13:04 +02:00
Laurent Destailleur
7bb9615cff Merge pull request #8702 from atm-florian/6.0
fix accountancy multientity
2018-05-05 12:53:36 +02:00
Laurent Destailleur
08cf034e2f FIX to allow IRPF not null even if main VAT is null.
From https://www.javierrguez.com/problema-facturas-irpf-sin-iva-dolibarr/
2018-05-03 13:39:44 +02:00
atm-arnaud
6245f25deb FIX label in getnomurl projectlist 2018-05-03 11:47:31 +02:00
fappels
db76fd7895 Fix delete all product variants of a parent product
User object missing
2018-05-02 22:33:23 +02:00
florian HENRY
46e94af594 fix taskid 2018-05-02 19:46:04 +02:00
florian HENRY
3657857d21 fix project and task visibility same as list 2018-05-02 19:29:18 +02:00
Laurent Destailleur
f3003fa542 Merge pull request #8713 from atm-greg/Fix_supplierinvoice_line_Rank_handling
FIX addline on invoice supplier manage rank on its own if not provided
2018-05-02 18:24:17 +02:00
atm-greg
942e2f40bf addline manage rank on its own if not provided 2018-05-02 17:07:27 +02:00
florian HENRY
886ad9d4b6 check eldy message 2018-05-02 08:45:18 +02:00
florian HENRY
f2b1aa00b9 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr.git into 6.0 2018-05-02 08:40:52 +02:00
Laurent Destailleur
3340598cf8 FIX Projet is not prefilled when created from overwiew page 2018-05-01 14:15:11 +02:00
Laurent Destailleur
171414bed6 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-01 12:51:08 +02:00
Laurent Destailleur
aa958459b7 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-05-01 12:50:54 +02:00
Laurent Destailleur
5c024ceb54 Merge 2018-05-01 12:49:21 +02:00
florian HENRY
b5d7206519 fix 6.0 accountancy multientity 2018-05-01 12:02:33 +02:00
Laurent Destailleur
82708705c7 Merge pull request #8701 from Dolibarr/revert-8354-5.0_multicurrency_objectline_print
Revert "No display object line curreny if not necessary"
2018-05-01 11:17:59 +02:00
Laurent Destailleur
d975dd507b Revert "No display object line curreny if not necessary" 2018-05-01 11:17:47 +02:00
Laurent Destailleur
b1f1ddc6d0 Merge pull request #8354 from tuxgasy/5.0_multicurrency_objectline_print
No display object line curreny if not necessary
2018-05-01 11:15:31 +02:00
Laurent Destailleur
4eb4cf6506 Merge pull request #8693 from Librethic/fix-api-product-check-perm
FIX : missing english name for object
2018-05-01 10:19:27 +02:00
Laurent Destailleur
ab85fa8721 Backport EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS to solve blocking
situation.
2018-04-30 17:45:34 +02:00
Laurent Destailleur
e79c907ae0 Fix edit of capital 2018-04-30 11:01:33 +02:00
Laurent Destailleur
9a345e99ef Fix syntax error 2018-04-29 20:14:57 +02:00
jfefe
7cedf55c27 FIX : missing english name for object
'product' is used by API to check perms and return a 401 error even if user has correct
permissions
2018-04-27 20:54:48 +02:00
Laurent Destailleur
3b473943dc Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-27 12:44:07 +02:00
Laurent Destailleur
a80621471c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
	htdocs/fourn/commande/card.php
2018-04-27 12:42:18 +02:00
Laurent Destailleur
e5df7e206b Merge pull request #8224 from atm-ph/fix_6.0_supplier_order_from_supplier_proposal
Fix wrong price on supplier order line
2018-04-27 12:20:49 +02:00
Laurent Destailleur
d179cafa9c Update fournisseur.commande.class.php 2018-04-27 12:19:32 +02:00
Laurent Destailleur
ecd84f6c45 Update fournisseur.commande.class.php 2018-04-27 12:18:45 +02:00
Laurent Destailleur
4c87cbf644 Update card.php 2018-04-27 12:14:51 +02:00
Laurent Destailleur
e18190565c Merge pull request #8683 from ATM-Marc/FIX_export_actioncomm
FIX: actioncomm export: type filtering not working
2018-04-27 11:38:59 +02:00
Laurent Destailleur
8f60bd35a5 Merge pull request #8676 from atm-florian/7.0
fix commonobject double style
2018-04-27 10:14:13 +02:00
Laurent Destailleur
3faeb08b78 Merge pull request #8672 from ATM-Nicolas/fix_action_contact
FIX : Related contact printed in societe agenda
2018-04-27 10:00:18 +02:00
Laurent Destailleur
e2b936e2d8 Merge pull request #8666 from frederic34/patch-2
Update api_products.class.php
2018-04-27 09:45:40 +02:00
Laurent Destailleur
761d2b3667 FIX Not approved holidays must not be visible into timesheet 2018-04-26 17:44:36 +02:00
Marc de Lima Lucio
c044d9ab58 FIX: actioncomm export: type filtering not working 2018-04-25 16:20:09 +02:00
Laurent Destailleur
83b762b681 FIX CVE-2018-9019 2018-04-25 16:01:06 +02:00
florian HENRY
70961bd075 fix perms 2018-04-24 12:46:16 +02:00
florian HENRY
67329b8805 fix commonobject double style 2018-04-24 12:33:07 +02:00
ATM-Nicolas
736c56705b FIX : Related contact printed in societe agenda 2018-04-24 10:02:26 +02:00
ATM-Nicolas
3d179fb7d3 FIX : Fetch function will fetch comments 2018-04-24 09:17:03 +02:00
Laurent Destailleur
fdb3a11f34 FIX extrafields price and double were lost during a failed post. 2018-04-23 22:56:40 +02:00
Laurent Destailleur
0a5e606937 FIX extrafields price and double were lost during a failed post. 2018-04-23 22:53:57 +02:00
Laurent Destailleur
f95e5078c1 FIX Can't edit option PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY 2018-04-23 21:33:49 +02:00
Frédéric FRANCE
657fa48c3f Update api_products.class.php 2018-04-23 15:31:55 +02:00
Laurent Destailleur
315d5bad39 FIX Error in ContractLigne not return to Contract 2018-04-23 15:07:50 +02:00
Laurent Destailleur
77d9ff033a FIX cron script disabled if module disabled 2018-04-23 15:07:27 +02:00
Laurent Destailleur
e834eff049 FIX #8650 2018-04-22 20:03:24 +02:00
Laurent Destailleur
6b90558b7a FIX File name not visible in email preview 2018-04-20 11:20:56 +02:00
Laurent Destailleur
7a703e149f Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-20 01:39:48 +02:00
Laurent Destailleur
c6a53ca25d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/supplier_proposal/card.php
2018-04-20 01:39:26 +02:00
Laurent Destailleur
54154343b2 Merge pull request #8643 from ATM-Marc/FIX_7.0_commonobject_default
FIX: CommonObject: don't require 'notnull' field if 'default' set
2018-04-20 01:28:00 +02:00
Laurent Destailleur
e1585ef7e3 Merge pull request #8640 from atm-florian/6.0
fix : use template at the goos place for generate doc for supplier
2018-04-20 01:23:44 +02:00
Laurent Destailleur
15aeffee7d Merge pull request #8638 from ATM-Marc/FIX_showOutputField_empty_date
FIX: don't print empty date in CommonObject::showOutputField
2018-04-20 01:20:45 +02:00
Laurent Destailleur
b1ea34f4e7 FIX DOL_AUTOSET_COOKIE was not correctly setting value of cookie 2018-04-19 13:54:43 +02:00
Marc de Lima Lucio
893ce55852 FIX: commonobject: don't require notnull field if default set 2018-04-19 10:29:48 +02:00
florian HENRY
882863ab48 fix : define in conf dir_output for suipplier_proposal modules 2018-04-18 16:21:20 +02:00
florian HENRY
bf27ca1b11 fix : use template at the goos place for generate doc for supplier
propoal
2018-04-18 16:00:37 +02:00
Laurent Destailleur
1dc466e1fb FIX CVE-2018-10095 2018-04-18 12:32:19 +02:00
Laurent Destailleur
7ade4e37f2 FIX CVE-2018-10094 2018-04-18 12:23:49 +02:00
Laurent Destailleur
6b3e5e2085 FIX sanitize setup params 2018-04-18 12:19:23 +02:00
Laurent Destailleur
5d121b2d3a FIX CVE-2018-10092 2018-04-18 11:58:36 +02:00
Laurent Destailleur
fb3cae9ad3 Fix translation of country for GB 2018-04-18 11:36:44 +02:00
Marc de Lima Lucio
e88830820a FIX: dont print empty date in CommonObject::showOutputField 2018-04-18 11:13:18 +02:00
Laurent Destailleur
b39755f7b9 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-18 00:16:14 +02:00
Laurent Destailleur
013f95f54b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-18 00:02:51 +02:00
Laurent Destailleur
e4635c9401 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-18 00:01:40 +02:00
Laurent Destailleur
c7789d2038 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-18 00:01:06 +02:00
Laurent Destailleur
d8138b1ded Merge pull request #8626 from hregis/7.0_bug6
Fix: missing drop constraint with postgresql
2018-04-17 18:53:09 +02:00
Laurent Destailleur
11897976c3 Merge pull request #8625 from hregis/6.0_multicompany
Fix: missing drop index with postgresql
2018-04-17 18:52:45 +02:00
Laurent Destailleur
1870598734 Merge pull request #8627 from hregis/5.0_bug
Fix: syntax error for postgresql > 9.1
2018-04-17 18:51:55 +02:00
Regis Houssin
9a210c1a91 Fix: syntax error for postgresql > 9.1 2018-04-17 17:33:40 +02:00
Regis Houssin
d89086cb7a Fix: missing drop constraint with postgresql 2018-04-17 17:25:54 +02:00
Regis Houssin
dd835c4868 Fix: missing drop index with postgresql 2018-04-17 17:18:59 +02:00
Laurent Destailleur
e7281238a9 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-17 16:17:25 +02:00
Laurent Destailleur
eb3b351e83 Transifex sync 2018-04-17 16:17:07 +02:00
Laurent Destailleur
5eaa3bee83 Merge pull request #8617 from simnandez/7.0
FIX zip not filter
2018-04-17 16:09:01 +02:00
Juanjo Menent
9ae28d2bc2 Fix: zip not filter 2018-04-17 10:43:25 +02:00
Laurent Destailleur
bcecc25401 Merge pull request #8606 from atm-greg/Add_hooks_on_supplier_docs
add hooks on supplier documents
2018-04-17 09:43:51 +02:00
Laurent Destailleur
27a8476117 FIX remove var_dump 2018-04-16 17:02:54 +02:00
Laurent Destailleur
622042e9b2 FIX Max nb of generation of recurring invoice should not show warning 2018-04-16 15:05:35 +02:00
Laurent Destailleur
50d86a7cfd Fix accounting area when advanced accounting module not enabled 2018-04-16 14:25:39 +02:00
Laurent Destailleur
f1ad3912e7 Fix multicompany compatibility for recurring invoice generation 2018-04-16 14:18:38 +02:00
Laurent Destailleur
14ed19265c FIX environment shown on cron card 2018-04-16 13:53:59 +02:00
Laurent Destailleur
f05cc8b310 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-16 11:20:44 +02:00
Laurent Destailleur
0d26bdcdc5 FIX Button receive products not visible 2018-04-16 11:20:29 +02:00
Laurent Destailleur
99633eb815 FIX button "Classify bill" on supplier order was not visible 2018-04-16 11:12:27 +02:00
atm-greg
90f1ab8af4 add hooks on supplier documents 2018-04-16 06:46:22 +02:00
Laurent Destailleur
57c03553dd Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/core/lib/functions.lib.php
2018-04-15 12:09:07 +02:00
Laurent Destailleur
64dafbc37f Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-15 11:33:40 +02:00
Laurent Destailleur
37e4da30d0 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-15 11:33:27 +02:00
Laurent Destailleur
e29476428c Merge pull request #8594 from hregis/6.0_multicompany
FIX project category is type 6 not 5 !!
2018-04-15 11:32:49 +02:00
Laurent Destailleur
6b3c17680f Merge pull request #8596 from simnandez/5.0
FIX: some localtaxes errors
2018-04-15 11:25:27 +02:00
Juanjo Menent
bfed1b9db1 FIX: some localtaxes errors 2018-04-14 12:45:40 +02:00
Regis Houssin
79c34f4d69 Fix: project category is type 6 not 5 !! 2018-04-14 10:03:21 +02:00
Laurent Destailleur
6a3c2f9808 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/fourn/facture/card.php
2018-04-13 23:27:14 +02:00
Laurent Destailleur
50a3b73a6f Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-13 23:21:29 +02:00
Laurent Destailleur
3ec295935c Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-13 23:21:18 +02:00
Laurent Destailleur
ecdb56606d Merge pull request #8590 from atm-greg/FIX_supplier_invoice_line_rank
Rank of invoice_supplier lines was always -1
2018-04-13 23:20:42 +02:00
Laurent Destailleur
c4076fc8bd Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-13 23:08:34 +02:00
Laurent Destailleur
8cfcdabcac Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/fourn/class/fournisseur.commande.class.php
2018-04-13 23:03:46 +02:00
Laurent Destailleur
e1bd605604 Merge pull request #8587 from atm-greg/Fix_specialcode_on_supplier_doc_lines
Fix specialcode on order_supplier doc lines
2018-04-13 22:24:04 +02:00
Laurent Destailleur
235bf2a961 Merge pull request #8591 from hregis/7.0_bug6
FIX avoid focus problem when select2 is in a modal dialog window
2018-04-13 22:22:24 +02:00
Regis Houssin
556a418132 Fix: best method 2018-04-13 19:30:11 +02:00
Regis Houssin
199bf4c044 Fix: avoid focus problem when select2 is in a modal dialog window 2018-04-13 17:10:07 +02:00
atm-greg
4fae1e3236 rank of invoice_supplier lines was always -1 2018-04-13 17:01:10 +02:00
atm-greg
8d4126274a rang was missing on order_supplier lines 2018-04-13 15:53:49 +02:00
atm-greg
ef2c6a0ed4 fix sql error 2018-04-13 10:31:36 +02:00
atm-greg
58535993c1 use special_code on order_supplier lines 2018-04-13 10:31:27 +02:00
Laurent Destailleur
04aafbc493 Fix css to restore focus undertext on select2 combo lists 2018-04-13 10:01:07 +02:00
Laurent Destailleur
891925874f FIX #8574 2018-04-13 00:54:08 +02:00
Laurent Destailleur
ecd18da137 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-13 00:43:37 +02:00
Laurent Destailleur
f7bb781b42 FIX #8571 2018-04-13 00:43:15 +02:00
Laurent Destailleur
2bbde44f63 FIX #8580 2018-04-12 23:54:53 +02:00
Laurent Destailleur
7bf9801b80 Merge pull request #8577 from atm-florian/6.0
fix error on first install pgsql
2018-04-12 23:47:10 +02:00
Laurent Destailleur
421a794942 FIX #8559 Bug to generate cheque receipt 2018-04-12 17:22:51 +02:00
florian HENRY
cd2f6616be fix index creation with unique name for pgSQL 2018-04-12 16:41:53 +02:00
florian HENRY
def28be0ab fix error on first install pgsql 2018-04-12 16:36:04 +02:00
Laurent Destailleur
e437989853 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-12 13:25:27 +02:00
Laurent Destailleur
8da84af973 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-11 19:31:48 +02:00
Laurent Destailleur
8aa41c09c0 Fix phpunit 2018-04-11 19:31:28 +02:00
Laurent Destailleur
eec99b436e Merge pull request #8565 from atm-greg/Add_supplierContactName_on_documents
Add supplier contact name on supplier documents
2018-04-11 19:25:01 +02:00
Laurent Destailleur
3df873ee06 Merge pull request #8562 from ATM-Marc/FIX_modulebuilder
FIX: various modulebuilder-related issues
2018-04-11 18:01:04 +02:00
Laurent Destailleur
9ccba03a17 Update html.form.class.php 2018-04-11 18:00:34 +02:00
Laurent Destailleur
885c2389af Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-11 17:58:37 +02:00
Laurent Destailleur
afdd504e16 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/accountancy/journal/sellsjournal.php
2018-04-11 17:58:21 +02:00
Laurent Destailleur
0f3d2cc8df Merge pull request #8564 from atm-ph/fix_6.0_sellsjournal_situation_invoice
Fix wrong amount for situation invoice in sellsjournal
2018-04-11 17:51:00 +02:00
atm-greg
ae34fa6fbd add supplier contact name on supplier documents 2018-04-11 17:42:26 +02:00
Laurent Destailleur
d7da83ebc5 Merge pull request #8560 from atm-john/Fix_extrafield_list_from_table_entity
Fix extrafield entity query filter
2018-04-11 17:31:36 +02:00
Laurent Destailleur
9a83a6ad6e Merge pull request #8546 from atm-quentin/FIX_Issue_8455
FIX Issue #8455
2018-04-11 17:26:13 +02:00
Laurent Destailleur
e4f2e0ecbd Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-11 17:21:14 +02:00
Laurent Destailleur
590bc2948a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/compta/bank/card.php
	htdocs/core/tpl/admin_extrafields_view.tpl.php
2018-04-11 17:20:49 +02:00
Laurent Destailleur
9fafefa0d7 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-11 17:18:09 +02:00
Laurent Destailleur
0518218aed Fix regression 2018-04-11 17:17:03 +02:00
atm-ph
6f526eb780 Fix wrong amount for situation invoice in sellsjournal 2018-04-11 16:40:59 +02:00
Laurent Destailleur
73a8966659 Merge pull request #8538 from atm-arnaud/FIX_8389_html_in_lang_DE
FIX #8389
2018-04-11 16:31:36 +02:00
Laurent Destailleur
307f217d56 Merge pull request #8543 from ATM-Nicolas/fix_duplicate_events
FIX : multiple creation of same event
2018-04-11 16:28:32 +02:00
Laurent Destailleur
23dba46c8c Merge pull request #8551 from ATM-Nicolas/fix_datetime_extrafields
FIX : update wrong datetime extrafield
2018-04-11 16:28:04 +02:00
Laurent Destailleur
ca6b7205ef Update commonobject.class.php 2018-04-11 16:27:56 +02:00
Laurent Destailleur
b732844e91 Merge pull request #8537 from atm-arnaud/FIX_8023_missing_escape_htmltag
FIX #8023
2018-04-11 16:25:33 +02:00
Laurent Destailleur
628b437e28 Update card.php 2018-04-11 16:25:05 +02:00
Laurent Destailleur
c392b9b8ef Merge pull request #8541 from atm-gauthier/FIX_count_6.0
FIX #8478 !empty instead of count to avoid warning
2018-04-11 14:55:41 +02:00
Laurent Destailleur
75bc3d17e6 Update admin_extrafields_view.tpl.php 2018-04-11 14:55:29 +02:00
Laurent Destailleur
bc1515cb56 Merge pull request #8535 from atm-greg/Fix_dolGetFirstLastname
fix #8521
2018-04-11 14:54:15 +02:00
Laurent Destailleur
1f21078e08 Merge pull request #8536 from atm-florian/7.0_fix8474
fix #8474
2018-04-11 14:53:26 +02:00
Laurent Destailleur
ab43d9d675 Merge pull request #8544 from ATM-Marc/FIX_odt_cond_reglement
FIX: payment term doc-specific label was not used (issue #8414)
2018-04-11 14:52:06 +02:00
Laurent Destailleur
0d15d8e0ad Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/user/card.php
2018-04-11 14:45:11 +02:00
Laurent Destailleur
804703c9c9 Fix regression 2018-04-11 14:43:16 +02:00
Laurent Destailleur
e1c83df086 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-04-11 14:39:13 +02:00
Laurent Destailleur
560038fa18 Fix regression in update contact 2018-04-11 14:38:56 +02:00
Laurent Destailleur
c2eb2bf10e Merge pull request #8542 from ATM-Marc/FIX_user_autocomplete
FIX: weird password autocompletion in Google Chrome (issue #8479)
2018-04-11 13:22:42 +02:00
Laurent Destailleur
4f7fbb80ba Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-11 13:21:36 +02:00
Laurent Destailleur
21c65f812a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-11 13:21:20 +02:00
Laurent Destailleur
edb59c05dc Merge pull request #8525 from atm-greg/Add_projettaskcard_hook
add doActions hook on projettaskcard
2018-04-11 13:20:07 +02:00
Laurent Destailleur
73aa34dfbe Merge pull request #8528 from hregis/7.0_bug6
FIX avoid Error: Call to undefined method mysqli::get_charset()
2018-04-11 13:19:33 +02:00
Laurent Destailleur
ba526dd7f2 Merge pull request #8530 from hregis/7.0_bug3
FIX missing User object with API REST
2018-04-11 13:11:27 +02:00
Laurent Destailleur
e642535389 Merge pull request #8561 from frederic34/patch-11
Update combinations.php
2018-04-11 13:09:34 +02:00
Laurent Destailleur
6731e238a3 Merge pull request #8550 from atm-quentin/FIX_Issue_8037
FIX issue #8037
2018-04-11 13:06:26 +02:00
Laurent Destailleur
7d7c0624d2 Update traduction.php 2018-04-11 12:59:24 +02:00
Laurent Destailleur
50dd75632c Merge pull request #8532 from atm-arnaud/FIX_8359_project_link_categ_list
FIX #8359
2018-04-11 12:57:41 +02:00
Laurent Destailleur
c958a4f865 Merge pull request #8558 from atm-greg/Fix_contact_birthday_update
FIX #8259 can't update contact birthday with REST API
2018-04-11 12:53:41 +02:00
Laurent Destailleur
d02405dccd Merge pull request #8533 from atm-quentin/FIX_issues_8470
FIX issue #8470
2018-04-11 12:52:44 +02:00
Laurent Destailleur
dfe93bce21 Merge pull request #8534 from atm-maxime/fix_suporder_defaultcurrency
FIX default currency not set on supplier order creation from commercial menu #8459
2018-04-11 12:52:17 +02:00
Marc de Lima Lucio
fa8cf98249 FIX: modulebuilder: handle 'price' fieldtype 2018-04-11 12:18:54 +02:00
Frédéric FRANCE
a95bc76afb Update combinations.php 2018-04-11 12:10:58 +02:00
Frédéric FRANCE
bc7623d383 Update getCombinations.php 2018-04-11 12:05:23 +02:00
Marc de Lima Lucio
bbc12cf06b FIX: default addupdatedelete actions: uniformize add/update value checks 2018-04-11 11:49:29 +02:00
Marc de Lima Lucio
2f75bfcd83 FIX: modulebuilder: could not create html fields 2018-04-11 11:46:47 +02:00
Frédéric FRANCE
2c76a6cd80 Update combinations.php 2018-04-11 11:44:22 +02:00
Marc de Lima Lucio
c966cdbd47 FIX: selectForFormsList: entity checked even is object not multi-entity managed 2018-04-11 11:43:51 +02:00
John
96e26100f0 Add extrafield entity query filter 2018-04-11 11:27:47 +02:00
atm-greg
7cdc1c8bef Fix #8259 can't update contact birthday with REST API 2018-04-11 07:08:40 +02:00
ATM-Nicolas
cffe1e9771 FIX : Multiple creation of same event 2018-04-10 17:11:18 +02:00
ATM-Nicolas
47d5b1f6fd FIX : update wrong datetime extrafield 2018-04-10 16:39:28 +02:00
atm-quentin
809b2a91ed FIX issue #8037 2018-04-10 16:27:18 +02:00
atm-quentin
cc832bd972 FIX Issue #8455 2018-04-10 15:47:06 +02:00
Marc de Lima Lucio
1fd5dba118 FIX: payment term doc-specific label was not used 2018-04-10 15:24:57 +02:00
Marc de Lima Lucio
307ede8b22 FIX: weird password autocompletion in Goocle Chrome (issue #8479) 2018-04-10 15:03:50 +02:00
gauthier
5621d1f8ea FIX #8478 !empty instead of count to avoid warning 2018-04-10 15:03:15 +02:00
atm-arnaud
26e9f10833 FIX #8389 2018-04-10 14:52:16 +02:00
atm-arnaud
848d76ee78 FIX #8023 2018-04-10 14:43:32 +02:00
florian HENRY
84f80795c3 fix #8474 2018-04-10 14:38:41 +02:00
atm-greg
4f13a4f45b fix #8521 2018-04-10 14:16:01 +02:00
Maxime Kohlhaas
cb1a011b50 Fix default currency not set on supplier order creation from commercial menu #8459 2018-04-10 14:14:16 +02:00
atm-arnaud
d24b36f768 FIX #8359 2018-04-10 14:10:40 +02:00
atm-quentin
6277928b67 FIX issue #8470 2018-04-10 14:01:35 +02:00
Regis Houssin
97bf6fff7f Fix: missing User object with API REST 2018-04-10 08:07:23 +02:00
Regis Houssin
89ec185f51 Fix: avoid Error: Call to undefined method mysqli::get_charset() 2018-04-09 12:53:03 +02:00
Regis Houssin
976b5c26c7 Fix: TODO get_charset() function don't exists 2018-04-09 12:26:39 +02:00
atm-greg
b1469ba761 add doActions hook on projettaskcard 2018-04-09 07:06:20 +02:00
Laurent Destailleur
79af10fc83 Fix search filters 2018-04-08 13:01:42 +02:00
Laurent Destailleur
3d36e3ee49 Fix search criteria in bookkeeping table 2018-04-08 12:41:03 +02:00
Laurent Destailleur
560c84be0d FIX When clearing filter, we must not save tmp criterias in session 2018-04-08 12:40:19 +02:00
Laurent Destailleur
8cca3dabd6 FIX look and feel v7 "back to" for bookkeeping record 2018-04-08 11:29:30 +02:00
Laurent Destailleur
aad99bdcc0 FIX Removed error when no error on accounting setup page 2018-04-07 22:27:42 +02:00
Laurent Destailleur
304adff973 FIX view of balance before field
Conflicts:
	htdocs/compta/bank/bankentries_list.php
2018-04-07 21:49:59 +02:00
Laurent Destailleur
989d1c87c6 Fix link to reconcile 2018-04-07 20:06:19 +02:00
Laurent Destailleur
bacee3c298 Translation 2018-04-07 20:06:14 +02:00
Laurent Destailleur
5a34a22934 Code comment 2018-04-07 13:04:52 +02:00
Laurent Destailleur
15c7bbf9d8 Fix input lost when error 2018-04-07 12:28:10 +02:00
Laurent Destailleur
ebb418fe3a Fix CSRF test 2018-04-06 20:06:05 +02:00
Laurent Destailleur
35d2f0e441 Fix no lose entry when error on survey comment submission 2018-04-06 19:42:59 +02:00
Laurent Destailleur
84426c69e3 Fix not not saved 2018-04-06 19:26:24 +02:00
Laurent Destailleur
77f2b137b5 FIX XSS 2018-04-06 19:23:41 +02:00
Laurent Destailleur
1a321e19c8 FIX XSS in company setup page 2018-04-06 19:12:13 +02:00
Laurent Destailleur
417c07a6e8 Fix REFLECTED XSS 2018-04-06 18:33:51 +02:00
Laurent Destailleur
2d1183cbb7 FIX can bypass the CSRF protection with url with domain inside 2018-04-06 17:58:30 +02:00
Laurent Destailleur
7877854693 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-06 17:37:19 +02:00
Laurent Destailleur
1623fea618 FIX SQL Injection CWE-89 2018-04-06 17:25:22 +02:00
Laurent Destailleur
f56438112f FIX CWE-89 2018-04-06 17:22:14 +02:00
Laurent Destailleur
1009a629d9 Try better Fix for #8432 2018-04-06 13:20:09 +02:00
François J
a78c064461 Fix CommandeFournisseur::getDispachedLines line ID & return quantity 2018-04-06 11:22:15 +02:00
Laurent Destailleur
723ac6fba0 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-06 00:02:06 +02:00
Laurent Destailleur
920891ba70 Fix edit of default opportunit percent 2018-04-06 00:01:24 +02:00
Laurent Destailleur
2207e5e470 Fix tooltip 2018-04-05 19:23:36 +02:00
TuxGasy
47dcc0d5c6 fix notrigger ignored on BILL_CREATE 2018-04-05 18:32:41 +02:00
Laurent Destailleur
8cf56a5b9c Fix regression 2018-04-05 16:29:37 +02:00
Laurent Destailleur
dfa37be7e9 Merge pull request #8499 from atm-maxime/7.0
FIX service creation, right is tested regarding the product type
2018-04-05 16:21:06 +02:00
Laurent Destailleur
55719cd166 Update card.php 2018-04-05 16:20:50 +02:00
Laurent Destailleur
ab27b105c0 Merge pull request #8490 from hregis/7.0_bug6
FIX limit access of email template page to internal users
2018-04-05 16:11:04 +02:00
Laurent Destailleur
45d074c39d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-04-05 13:25:59 +02:00
Laurent Destailleur
2b135dc951 FIX #8488 2018-04-05 13:13:45 +02:00
Laurent Destailleur
08ab67289b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/societe/class/societe.class.php
2018-04-05 13:10:11 +02:00
Regis Houssin
5914bfdf18 Fix: more complete 2018-04-05 13:00:55 +02:00
Regis Houssin
156d26ddb9 Fix: backward compatibility 2018-04-05 13:00:50 +02:00
Laurent Destailleur
0223d54107 FIX Support or multicompany for sheduled jobs
FIX Use priority to define order of sheduled jobs

Conflicts:
	htdocs/cron/list.php
2018-04-05 12:38:42 +02:00
Laurent Destailleur
88b3e08b22 FIX filter/sorting on extrafield on contact list from contact tab 2018-04-05 11:34:26 +02:00
Laurent Destailleur
7c70f9ed03 Fix option STOCK_SUPPORTS_SERVICES 2018-04-03 20:23:47 +02:00
Maxime Kohlhaas
0c3b92f09a Better fix 2018-04-03 14:53:57 +02:00
Maxime Kohlhaas
39eab6d88d Fix service creation, right is tested regarding the product type 2018-04-03 14:38:20 +02:00
Laurent Destailleur
8595d7621b Fix POST mut use method POST no GET 2018-04-02 23:30:23 +02:00
Laurent Destailleur
fba40575f7 Remove dead code 2018-04-02 16:39:48 +02:00
Regis Houssin
c720345e6d Fix: better test 2018-04-01 11:47:10 +02:00
Regis Houssin
20e80a58a8 Fix: limit access to internal users 2018-04-01 11:43:39 +02:00
Laurent Destailleur
84bb4c6ad7 FIX With x extrafields, request for multicompany label was done x times 2018-03-30 19:51:53 +02:00
Laurent Destailleur
2e22c13062 Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 7.0 2018-03-29 15:31:35 +02:00
Laurent Destailleur
fdfcb96176 Fix length of combobox 2018-03-29 15:31:21 +02:00
Laurent Destailleur
39758625b7 Merge pull request #8471 from atm-ph/fix_6.0_error_creating_soc
Fix error on creating company with external module in 'custom' folder…
2018-03-29 13:48:36 +02:00
Laurent Destailleur
0e986b8f97 Update societe.class.php 2018-03-29 13:48:09 +02:00
Laurent Destailleur
839ebb428b Merge pull request #8477 from ggg44473/7.0
Fix wrong approve time in expense report
2018-03-29 13:40:33 +02:00
Laurent Destailleur
92cbcd9ccb Merge pull request #8462 from atm-florian/7.0
Fix error log
2018-03-29 13:38:35 +02:00
Laurent Destailleur
188e5d286d Fix statut 2018-03-29 13:28:29 +02:00
Laurent Destailleur
072b6c02c0 FIX Test on mandatory status when closing proposal failed 2018-03-29 13:25:03 +02:00
Laurent Destailleur
b806b85761 Fix field filtert is set twice 2018-03-29 11:15:50 +02:00
florian HENRY
cc7deb0add Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0 2018-03-29 09:36:05 +02:00
florian HENRY
78812ef826 better error management 2018-03-29 09:35:47 +02:00
Sean Wang
3dd9d47089 Fix wrong approve time in expense report
The approve time showed was 8 hours more than the real time.
Checking database turned out that it had the wrong data(+8 hours).

After checking every timezone related settings were correct,
I found that it do twice idate() in setApproved().
Since we have idate() in $sql, we don't need the idate()
at the line 1249.
2018-03-29 14:49:06 +08:00
Laurent Destailleur
125085acee Fix name of method to avoid ci errors 2018-03-29 03:01:05 +02:00
atm-ph
a89983ef5c Fix error on creating company with external module in 'custom' folder with a file to generate accountancy code 2018-03-28 15:41:10 +02:00
florian HENRY
7635f23d78 Merge branch '7.0' of https://github.com/Dolibarr/dolibarr.git into 7.0 2018-03-27 18:39:56 +02:00
florian HENRY
af7c1d8da1 fix error log 2018-03-27 18:39:18 +02:00
Frédéric FRANCE
299c32d262 Update actions_sendmails.inc.php 2018-03-27 18:02:27 +02:00
Laurent Destailleur
34fae0bd48 Merge pull request #8456 from atm-greg/Fix_bankentries_list
FIX sql error using no category
2018-03-27 17:49:01 +02:00
Bruno Généré
925e0c46dd BUG - Point of sale - buttons for cheque and CB are not displayed properly when one account is not defined
I find out in the point of sale module that when you have an account for CB but not for check than you could use check but not CB.
It seems quite obvious when you look to the previous code that a mistake was done.
This is now fixed I expect.
The workaround for now is to define both default accounts (for check and for CB).
2018-03-27 17:13:25 +02:00
Laurent Destailleur
460344fbfb Traduction 2018-03-27 16:02:06 +02:00
Laurent Destailleur
51cd793d80 Fix log and duplicate vat_by_date function 2018-03-27 14:37:29 +02:00
Laurent Destailleur
f9ee2930e2 FIX Data on income/expense report was always 0 2018-03-27 14:16:59 +02:00
Laurent Destailleur
0b13cd17ac FIX Some report have data when several chart of accounts exists
FIX Detail per account not visible when total < 0
2018-03-27 13:55:10 +02:00
Laurent Destailleur
2b588b9e43 FIX Initial month on report income/expense per predefined group 2018-03-27 13:37:40 +02:00
Laurent Destailleur
930512d9a2 FIX Add a test to avoid to reset binding by error. 2018-03-27 13:08:16 +02:00
Laurent Destailleur
56944115cb Hide a very dangerous feature. Should be useless. 2018-03-27 12:46:15 +02:00
Laurent Destailleur
dab8dbd671 FIX Binding pages must start on fiscal month not calendar month 2018-03-27 12:31:08 +02:00
Laurent Destailleur
88939a8469 FIX Draft invoice must be excluded from report 2018-03-27 11:10:12 +02:00
atm-greg
91d6a1b621 fix sql error using no category 2018-03-27 06:40:12 +02:00
Laurent Destailleur
89bf781fe6 FIX Add warning when expense report line not into range
FIX Name of user not visible on journalizing expense report payments
FIX Only approved expense report must be journalized
2018-03-26 14:13:40 +02:00
Laurent Destailleur
934d2d8881 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 7.0
Conflicts:
	htdocs/filefunc.inc.php
2018-03-25 15:27:31 +02:00
Laurent Destailleur
c85cb7fe0a Merge pull request #8447 from fappels/7.0_modulbuilder
Update on module builder
2018-03-24 16:41:43 +01:00
Laurent Destailleur
1c581c6fff Merge pull request #8443 from atm-florian/6.0
fix user right on modRessource,  fix security check on fourn card
2018-03-24 16:37:11 +01:00
Laurent Destailleur
d63c8356f4 Merge pull request #8437 from hregis/7.0_bug6
Fix: uniformize getEntity('intervention')
2018-03-24 16:36:27 +01:00
Laurent Destailleur
224fa1c03e Fix external links ko when substitution key are inside domain 2018-03-24 12:48:33 +01:00
Laurent Destailleur
a3c199e9e3 FIX Missing include 2018-03-24 12:48:19 +01:00
fappels
caa43ae2f6 Make helper methods available for derived classes.
Use-case: a module build with modulebuilder can make it's own fetch
method using the helper methods.
2018-03-23 17:35:46 +01:00
Laurent Destailleur
83b6dd4cb9 Prepare 7.0.2 2018-03-23 16:17:56 +01:00
Laurent Destailleur
a15abb2ded Update lang 2018-03-23 16:17:28 +01:00
Laurent Destailleur
c12469860a Update lang 2018-03-23 16:17:10 +01:00
florian HENRY
11446fb2f7 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr.git into 6.0 2018-03-22 23:26:37 +01:00
florian HENRY
46d2b4d62d fix security check on fourn card 2018-03-22 23:25:54 +01:00
Laurent Destailleur
9f67bb0aa3 Start 6.0.7 2018-03-22 21:58:24 +01:00
Regis Houssin
9cf66e53f6 Fix: wrong module name 2018-03-22 16:39:47 +01:00
Regis Houssin
b5f37301a5 Fix: uniformize getEntity('intervention') 2018-03-22 16:28:00 +01:00
florian HENRY
1feb22ea9c fix user right on modRessource 2018-03-21 22:24:11 +01:00
TuxGasy
34145ed443 Do not display multicurrency cols if currency of object is same as main currency 2018-03-11 21:58:32 +01:00
atm-ph
53ce297ab3 Fix travis - missing documentation of new param 2018-03-09 09:30:11 +01:00
atm-ph
5971cd8e59 Fix label goes in desc and lost fourn ref 2018-03-05 17:18:03 +01:00
atm-ph
ebb4da8417 Fix keep supplier proposal price in supplier order 2018-03-05 16:58:35 +01:00
atm-ph
d300b943e1 Fix wrong price on supplier order line 2018-02-23 15:10:25 +01: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
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
1370 changed files with 22634 additions and 13882 deletions

1
.gitignore vendored Executable file → Normal file
View File

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

View File

@@ -38,7 +38,6 @@ php:
- '7.0'
- '7.1'
- '7.2'
#- hhvm only with dist: trusty
- nightly
env:
@@ -60,10 +59,19 @@ env:
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: nightly
# We exclude some combinations not usefull to save Travis CPU
exclude:
- php: '5.4'
env: DB=mariadb
- php: '5.5'
env: DB=mariadb
- php: '5.6'
env: DB=mariadb
- php: '7.0'
env: DB=mariadb
- php: '7.1'
env: DB=mariadb
- php: '5.4'
env: DB=postgresql
- php: '5.5'
@@ -74,8 +82,6 @@ matrix:
env: DB=postgresql
- php: '7.1'
env: DB=postgresql
- php: hhvm
env: DB=postgresql
- php: nightly
env: DB=postgresql

232
ChangeLog
View File

@@ -3,6 +3,195 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
***** 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
FIX: #8722
FIX: #8762
FIX: #8813
FIX: #8858 #8860 Backport better compatibility fix
FIX: #8893 to get formatted price as substitution vars
FIX: Avoid converting into reduction twice and draft invoice
FIX: bad result on fetch ProductStockEntrepot
FIX: Bad substitution key used for default send proposal email
FIX: button to pay still visible when amount null used
FIX: clause must not be there
FIX: Contact tab not visible when using canvas
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: If we enable 3 steps for supplier order approbation, we must not delete all fourn rights def.
FIX: intervention: extrafield error when calling insertExtrafields
FIX: It's not possible to remove a contact which is assigned to an event #8852
FIX: javascript showempty error
FIX: Keep supplier proposal price for supplier order
FIX: link for projets not linked to a thirdparties
FIX: Missing extrafields in export of stock or products
FIX: missing filters during ordering
FIX: missing filters during reordering
FIX: missing parenthesis
FIX: need to filter on aa.entity for same accounting accounts available in several entities
FIX: picto for type in product link in accountany list is wrong
FIX: Problems in accountancy module when using multicompany module.
FIX: proposal: missing contact type translation key
FIX: pu_ht_devise was not converted to numeric so decimals were lost when calculating total_ht_devise
FIX: Select user on add time spent form
FIX: shipment: fk_proje(c)t not handled in fetch() and update() methods
FIX: sometimes amounts are identical but php find them different.
FIX: supplier order: product supplier ref not saved on addline
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: wrong var name $search_month_lim
***** ChangeLog for 7.0.2 compared to 7.0.1 *****
FIX: #8023
FIX: #8259 can't update contact birthday with REST API
FIX: #8359
FIX: #8389
FIX: #8478 !empty instead of count to avoid warning
FIX: #8488
FIX: #8559 Bug to generate cheque receipt
FIX: #8571
FIX: #8574
FIX: #8580
FIX: #8650
FIX: actioncomm export: type filtering not working
FIX: Add a test to avoid to reset binding by error.
FIX: addline on invoice supplier manage rank on its own if not provided
FIX: Add warning when expense report line not into range
FIX: avoid Error: Call to undefined method mysqli::get_charset()
FIX: avoid focus problem when select2 is in a modal dialog window
FIX: Binding pages must start on fiscal month not calendar month
FIX: button "Classify bill" on supplier order was not visible
FIX: Button receive products not visible
FIX: can bypass the CSRF protection with url with domain inside
FIX: Can't edit option PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY
FIX: commonobject: don't require notnull field if default set
FIX: CommonObject: don't require 'notnull' field if 'default' set
FIX: cron script disabled if module disabled
FIX: CVE-2018-10092
FIX: CVE-2018-10094
FIX: CVE-2018-10095
FIX: CVE-2018-9019
FIX: CWE-89
FIX: Data on income/expense report was always 0
FIX: default addupdatedelete actions: uniformize add/update value checks
FIX: default currency not set on supplier order creation from commercial menu #8459
FIX: delete all product variants of a parent product
FIX: Detail per account not visible when total < 0
FIX: DOL_AUTOSET_COOKIE was not correctly setting value of cookie
FIX: don't print empty date in CommonObject::showOutputField
FIX: dont print empty date in CommonObject::showOutputField
FIX: Draft invoice must be excluded from report
FIX: environment shown on cron card
FIX: Error in ContractLigne not return to Contract
FIX: extrafields price and double were lost during a failed post.
FIX: File name not visible in email preview
FIX: filter/sorting on extrafield on contact list from contact tab
FIX: Initial month on report income/expense per predefined group
FIX: issue #8037
FIX: Issue #8455
FIX: issue #8470
FIX: label in getnomurl projectlist
FIX: limit access of email template page to internal users
FIX: look and feel v7 "back to" for bookkeeping record
FIX: Max nb of generation of recurring invoice should not show warning
FIX: missing english name for object
FIX: Missing include
FIX: missing User object with API REST
FIX: modulebuilder: could not create html fields
FIX: modulebuilder: handle 'price' fieldtype
FIX: multiple creation of same event
FIX: Name of user not visible on journalizing expense report payments
FIX: Not approved holidays must not be visible into timesheet
FIX: Only approved expense report must be journalized
FIX: payment term doc-specific label was not used
FIX: payment term doc-specific label was not used (issue #8414)
FIX: project category is type 6 not 5
FIX: Projet is not prefilled when created from overwiew page
FIX: Related contact printed in societe agenda
FIX: Removed error when no error on accounting setup page
FIX: remove var_dump
FIX: sanitize setup params
FIX: selectForFormsList: entity checked even is object not multi-entity managed
FIX: service creation, right is tested regarding the product type
FIX: some localtaxes errors
FIX: Some report have data when several chart of accounts exists
FIX: sql error using no category
FIX: SQL Injection CWE-89
FIX: Support or multicompany for sheduled jobs
FIX: Test on mandatory status when closing proposal failed
FIX: to allow IRPF not null even if main VAT is null.
FIX: update wrong datetime extrafield
FIX: Use priority to define order of sheduled jobs
FIX: various modulebuilder-related issues
FIX: view of balance before field
FIX: weird password autocompletion in Goocle Chrome (issue #8479)
FIX: weird password autocompletion in Google Chrome (issue #8479)
FIX: When clearing filter, we must not save tmp criterias in session
FIX: With x extrafields, request for multicompany label was done x times
FIX: several XSS
FIX: zip not filtered
***** ChangeLog for 7.0.1 compared to 7.0.0 *****
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
FIX: #8200
@@ -357,8 +546,49 @@ 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.6 compared to 6.0.6 *****
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
FIX: #8023
FIX: #8259 can't update contact birthday with REST API
FIX: #8478 !empty instead of count to avoid warning
FIX: #8488
FIX: actioncomm export: type filtering not working
FIX: addline on invoice supplier manage rank on its own if not provided
FIX: issue #8037
FIX: label in getnomurl projectlist
FIX: payment term doc-specific label was not used
FIX: payment term doc-specific label was not used (issue #8414)
FIX: project category is type 6 not 5 !!
FIX: some localtaxes errors
FIX: weird password autocompletion in Google Chrome (issue #8479)
***** ChangeLog for 6.0.6 compared to 6.0.5 *****
FIX: #7974 Contract - Invalid reference on the document
FIX: #8139
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php

View File

@@ -1,6 +1,6 @@
# DOLIBARR ERP & CRM
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/develop.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
![Build status](https://img.shields.io/travis/Dolibarr/dolibarr/7.0.svg) ![Downloads per day](https://img.shields.io/sourceforge/dm/dolibarr.svg)
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).

View File

@@ -22,6 +22,8 @@
* \brief This script create a xml checksum file
*/
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Do not create database handler $db
$sapi_type = php_sapi_name();
$script_file = basename(__FILE__);
$path=dirname(__FILE__).'/';

View File

@@ -466,10 +466,12 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.gz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.tar.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.gz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tgz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
@@ -849,6 +851,8 @@ if ($nboftargetok) {
unlink("$NEWDESTI/${FILENAMEDEB}.changes");
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz");
print "Remove target ${FILENAMEDEB}.debian.tar.xz...\n";
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.xz");
print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
@@ -1024,7 +1028,7 @@ if ($nboftargetok) {
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.orig.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.debian.tar.gz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.debian.tar.xz "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
next;
}
@@ -1168,7 +1172,7 @@ if ($nboftargetok) {
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'none', # none means it won't be published on SF
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'none', # none means it won't be published on SF
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
@@ -1181,8 +1185,7 @@ if ($nboftargetok) {
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_amd64.changes"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',

View File

@@ -176,10 +176,10 @@ $pcgver = $conf->global->CHARTOFACCOUNTS;
$sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.pcg_subtype, aa.account_number, aa.account_parent , aa.label, aa.active, ";
$sql .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version AND aa.entity = " . $conf->entity;
// Dirty hack wainting that foreign key account_parent is an integer to be compared correctly with rowid
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER)";
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED)";
if ($db->type == 'pgsql') $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS INTEGER) AND a2.entity = " . $conf->entity;
else $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as a2 ON a2.rowid = CAST(aa.account_parent AS UNSIGNED) AND a2.entity = " . $conf->entity;
$sql .= " WHERE asy.rowid = " . $pcgver;
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);

View File

@@ -45,7 +45,7 @@ $langs->loadLangs(array("errors","admin","companies","resource","holiday","compt
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$confirm=GETPOST('confirm','alpha');
$id=GETPOST('id','int');
$id=31;
$rowid=GETPOST('rowid','alpha');
$code=GETPOST('code','alpha');
@@ -58,8 +58,8 @@ $listoffset=GETPOST('listoffset');
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
$active = 1;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$sortfield = GETPOST("sortfield",'aZ09comma');
$sortorder = GETPOST("sortorder",'aZ09comma');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $listlimit * $page ;
@@ -84,59 +84,48 @@ $hookmanager->initHooks(array('admin'));
$tabname=array();
$tabname[31]= MAIN_DB_PREFIX."accounting_system";
$tabname[32]= MAIN_DB_PREFIX."c_accounting_category";
// Dictionary labels
$tablib=array();
$tablib[31]= "Pcg_version";
$tablib[32]= "DictionaryAccountancyCategory";
// Requests to extract data
$tabsql=array();
$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.fk_country as country_id, c.code as country_code, c.label as country, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_country=c.rowid and c.active=1";
$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
// Criteria to sort dictionaries
$tabsqlsort=array();
$tabsqlsort[31]="pcg_version ASC";
$tabsqlsort[32]="position ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array();
$tabfield[31]= "pcg_version,label,country_id,country";
$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country";
// Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array();
$tabfieldvalue[31]= "pcg_version,label,country";
$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country";
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array();
$tabfieldinsert[31]= "pcg_version,label,fk_country";
$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country";
// Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on
// "nameoffield" if id field is not "rowid" or has not autoincrement on
$tabrowid=array();
$tabrowid[31]= "";
$tabrowid[32]= "";
// Condition to show dictionary in setup page
$tabcond=array();
$tabcond[31]= ! empty($conf->accounting->enabled);
$tabcond[32]= ! empty($conf->accounting->enabled);
// List of help for fields
$tabhelp=array();
$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
// List of check for fields (NOT USED YET)
$tabfieldcheck=array();
$tabfieldcheck[31] = array();
$tabfieldcheck[32] = array();
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
@@ -484,7 +473,7 @@ print "<br>\n";
// Confirmation de la suppression de la ligne
if ($action == 'delete')
{
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.urlencode($page).'&':'').'sortfield='.urlencode($sortfield).'&sortorder='.urlencode($sortorder).'&rowid='.urlencode($rowid).'&code='.urlencode($code).'&id='.urlencode($id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
}
//var_dump($elementList);
@@ -503,24 +492,9 @@ if ($id)
$sql.= " c.rowid = ".$search_country_id;
}
if ($sortfield)
{
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
$sql.=" ".strtoupper($sortorder);
}
$sql.=", ";
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
}
else {
$sql.=" ORDER BY ";
}
$sql.=$tabsqlsort[$id];
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($listlimit+1,$offset);
//print $sql;

View File

@@ -88,7 +88,7 @@ $formaccounting = new FormAccounting($db);
llxheader('', $langs->trans('AccountingCategory'));
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories_list.php?search_country_id='.$mysoc->country_id.'">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
print load_fiche_titre($langs->trans('AccountingCategory'), $linkback);

View File

@@ -54,8 +54,8 @@ $listoffset=GETPOST('listoffset');
$listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000;
$active = 1;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$sortfield = GETPOST("sortfield",'aZ09comma');
$sortorder = GETPOST("sortorder",'aZ09comma');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $listlimit * $page ;
@@ -300,7 +300,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
if ($tabrowid[$id]) { $rowidcol=$tabrowid[$id]; }
else { $rowidcol="rowid"; }
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'";
$sql = "DELETE from ".$tabname[$id]." WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
dol_syslog("delete", LOG_DEBUG);
$result = $db->query($sql);
@@ -324,10 +324,10 @@ if ($action == $acts[0])
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'";
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$this->db->escape($code)."'";
$sql = "UPDATE ".$tabname[$id]." SET active = 1 WHERE code = '".$db->escape($code)."'";
}
$result = $db->query($sql);
@@ -344,10 +344,10 @@ if ($action == $acts[1])
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'";
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$this->db->escape($code)."'";
$sql = "UPDATE ".$tabname[$id]." SET active = 0 WHERE code = '".$db->escape($code)."'";
}
$result = $db->query($sql);
@@ -364,10 +364,10 @@ if ($action == 'activate_favorite')
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'";
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$this->db->escape($code)."'";
$sql = "UPDATE ".$tabname[$id]." SET favorite = 1 WHERE code = '".$db->escape($code)."'";
}
$result = $db->query($sql);
@@ -384,10 +384,10 @@ if ($action == 'disable_favorite')
else { $rowidcol="rowid"; }
if ($rowid) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$this->db->escape($rowid)."'";
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE ".$rowidcol." = '".$db->escape($rowid)."'";
}
elseif ($code) {
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$this->db->escape($code)."'";
$sql = "UPDATE ".$tabname[$id]." SET favorite = 0 WHERE code = '".$db->escape($code)."'";
}
$result = $db->query($sql);
@@ -437,24 +437,9 @@ if ($id)
$sql.= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)";
}
if ($sortfield)
{
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
$sql.=" ".strtoupper($sortorder);
}
$sql.=", ";
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
}
else {
$sql.=" ORDER BY ";
}
$sql.=$tabsqlsort[$id];
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($listlimit+1,$offset);
//print $sql;
@@ -793,7 +778,7 @@ if ($id)
print '<td class="center">';
if (empty($obj->formula))
{
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories.php?action=display&account_category='.$obj->rowid.'">';
print '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories.php?action=display&save_lastsearch_values=1&account_category='.$obj->rowid.'">';
print $langs->trans("ListOfAccounts");
print '</a>';
}

View File

@@ -27,9 +27,8 @@
* \ingroup Advanced accountancy
* \brief Setup page to configure accounting expert module
*/
require '../../main.inc.php';
// Class
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@@ -65,39 +64,23 @@ $accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' :
if ($action == 'update') {
$error = 0;
$accounting_modes = array (
'RECETTES-DEPENSES',
'CREANCES-DETTES'
);
if (! $error)
{
foreach ($list as $constname)
{
$constvalue = GETPOST($constname, 'alpha');
$accounting_mode = GETPOST('accounting_mode', 'alpha');
if (in_array($accounting_mode, $accounting_modes)) {
if (! dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
} else {
$error ++;
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
}
if ($error) {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
if ($error) {
setEventMessages($langs->trans("Error"), null, 'errors');
}
foreach ($list as $constname)
{
$constvalue = GETPOST($constname, 'alpha');
if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error ++;
}
}
if (! $error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}

View File

@@ -30,13 +30,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
$langs->load("admin");
$langs->load("compta");
$langs->load("accountancy");
$langs->loadLangs(array("admin","compta","accountancy"));
$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view';
$confirm=GETPOST('confirm','alpha');
$id=GETPOST('id','int');
$id=35;
$rowid=GETPOST('rowid','alpha');
$code=GETPOST('code','alpha');
@@ -400,24 +398,9 @@ if ($id)
$sql=$tabsql[$id];
$sql.= " WHERE a.entity = ".$conf->entity;
if ($sortfield)
{
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
$sql.=" ".strtoupper($sortorder);
}
$sql.=", ";
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
}
else {
$sql.=" ORDER BY ";
}
$sql.=$tabsqlsort[$id];
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($listlimit+1,$offset);
$fieldlist=explode(',',$tabfield[$id]);

View File

@@ -36,26 +36,28 @@ $langs->load("accountancy");
$langs->load("bills");
$langs->load("compta");
$action = GETPOST('action','aZ09');
$id = GETPOST('id', 'int'); // id of record
$mode = GETPOST('mode','aZ09'); // '' or 'tmp'
$piece_num = GETPOST("piece_num",'int'); // id of transaction (several lines share the same transaction id)
// Security check
$id = GETPOST('id', 'int');
if ($user->societe_id > 0) {
accessforbidden();
}
$action = GETPOST('action','aZ09');
$mode = GETPOST('mode','aZ09'); // '' or 'tmp'
$piece_num = GETPOST("piece_num");
$mesg = '';
$account_number = GETPOST('account_number');
$subledger_account = GETPOST('subledger_account');
$account_number = GETPOST('account_number','alphanohtml');
$subledger_account = GETPOST('subledger_account','alphanohtml');
if ($subledger_account == - 1) {
$subledger_account = null;
}
$label_compte = GETPOST('label_compte');
$label_operation= GETPOST('label_operation');
$debit = price2num(GETPOST('debit'));
$credit = price2num(GETPOST('credit'));
$label_compte = GETPOST('label_compte','alphanohtml');
$label_operation= GETPOST('label_operation','alphanohtml');
$debit = price2num(GETPOST('debit','alpha'));
$credit = price2num(GETPOST('credit','alpha'));
$save = GETPOST('save','alpha');
if (! empty($save)) $action = 'add';
@@ -340,13 +342,14 @@ if ($action == 'create')
dol_fiche_head();
print '<table class="border" width="100%">';
print '<tr>';
/*print '<tr>';
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("NumPiece") . '</td>';
print '<td>' . $next_num_mvt . '</td>';
print '</tr>';
print '</tr>';*/
print '<tr>';
print '<td class="fieldrequired">' . $langs->trans("Docdate") . '</td>';
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Docdate") . '</td>';
print '<td>';
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
print '</td>';
@@ -389,7 +392,7 @@ if ($action == 'create')
if (! empty($book->piece_num))
{
$backlink = '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php">' . $langs->trans('BackToList') . '</a>';
$backlink = '<a href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?restore_lastsearch_values=1">' . $langs->trans('BackToList') . '</a>';
print load_fiche_titre($langs->trans("UpdateMvts"), $backlink);
@@ -594,7 +597,7 @@ if ($action == 'create')
print "</tr>\n";
foreach ( $book->linesmvt as $line ) {
foreach ($book->linesmvt as $line) {
print '<tr class="oddeven">';
$total_debit += $line->debit;
$total_credit += $line->credit;
@@ -673,8 +676,8 @@ if ($action == 'create')
print '<input type="text" name="subledger_account" value="">';
}
print '</td>';
print '<td><input type="text" class="minwidth100" name="label_compte" value="' . $line->label_compte . '"/></td>';
print '<td><input type="text" class="minwidth300" name="label_operation" value="' . $line->label_operation. '"/></td>';
print '<td><input type="text" class="minwidth100" name="label_compte" value=""/></td>';
print '<td><input type="text" class="minwidth300" name="label_operation" value=""/></td>';
print '<td align="right"><input type="text" size="6" class="right" name="debit" value="' . ($debit ? price($debit) : '') . '"/></td>';
print '<td align="right"><input type="text" size="6" class="right" name="credit" value="' . ($credit ? price($credit) : '') . '"/></td>';
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';

View File

@@ -39,8 +39,8 @@ $action = GETPOST('action', 'alpha');
$search_mvt_num = GETPOST('search_mvt_num', 'int');
$search_doc_type = GETPOST("search_doc_type");
$search_doc_ref = GETPOST("search_doc_ref");
$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_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
$search_date_end = dol_mktime(0, 0, 0, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
$search_date_creation_end = dol_mktime(0, 0, 0, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
@@ -75,6 +75,8 @@ if ($search_accountancy_aux_code_end == - 1) {
}
$search_mvt_label = GETPOST('search_mvt_label', 'alpha');
$search_direction = GETPOST('search_direction', 'alpha');
$search_debit = GETPOST('search_debit', 'alpha');
$search_credit = GETPOST('search_credit', 'alpha');
$search_ledger_code = GETPOST('search_ledger_code', 'alpha');
// Load variable for pagination
@@ -98,7 +100,7 @@ $form = new Form($db);
if (! in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && ! isset($_POST['begin']) && ! isset($_GET['begin']) && ! isset($_POST['formfilteraction']) && GETPOST('page','int') == '' && ! GETPOST('noreset','int'))
{
if (empty($search_date_start) && empty($search_date_end))
if (empty($search_date_start) && empty($search_date_end) && ! GETPOSTISSET('restore_lastsearch_values'))
{
$query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$query.= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1";
@@ -181,12 +183,12 @@ $filter = array ();
if (! empty($search_date_start)) {
$filter['t.doc_date>='] = $search_date_start;
$tmp=dol_getdate($search_date_start);
$param .= '&date_startmonth=' . $tmp['mon'] . '&date_startday=' . $tmp['mday'] . '&date_startyear=' . $tmp['year'];
$param .= '&search_date_startmonth=' . $tmp['mon'] . '&search_date_startday=' . $tmp['mday'] . '&search_date_startyear=' . $tmp['year'];
}
if (! empty($search_date_end)) {
$filter['t.doc_date<='] = $search_date_end;
$tmp=dol_getdate($search_date_end);
$param .= '&date_endmonth=' . $tmp['mon'] . '&date_endday=' . $tmp['mday'] . '&date_endyear=' . $tmp['year'];
$param .= '&search_date_endmonth=' . $tmp['mon'] . '&search_date_endday=' . $tmp['mday'] . '&search_date_endyear=' . $tmp['year'];
}
if (! empty($search_doc_date)) {
$filter['t.doc_date'] = $search_doc_date;
@@ -195,51 +197,51 @@ if (! empty($search_doc_date)) {
}
if (! empty($search_doc_type)) {
$filter['t.doc_type'] = $search_doc_type;
$param .= '&search_doc_type=' . $search_doc_type;
$param .= '&search_doc_type=' . urlencode($search_doc_type);
}
if (! empty($search_doc_ref)) {
$filter['t.doc_ref'] = $search_doc_ref;
$param .= '&search_doc_ref=' . $search_doc_ref;
$param .= '&search_doc_ref=' . urlencode($search_doc_ref);
}
if (! empty($search_accountancy_code)) {
$filter['t.numero_compte'] = $search_accountancy_code;
$param .= '&search_accountancy_code=' . $search_accountancy_code;
$param .= '&search_accountancy_code=' . urlencode($search_accountancy_code);
}
if (! empty($search_accountancy_code_start)) {
$filter['t.numero_compte>='] = $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . $search_accountancy_code_start;
$param .= '&search_accountancy_code_start=' . urlencode($search_accountancy_code_start);
}
if (! empty($search_accountancy_code_end)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . $search_accountancy_code_end;
$param .= '&search_accountancy_code_end=' . urlencode($search_accountancy_code_end);
}
if (! empty($search_accountancy_aux_code)) {
$filter['t.subledger_account'] = $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code=' . $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code=' . urlencode($search_accountancy_aux_code);
}
if (! empty($search_accountancy_aux_code_start)) {
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start=' . $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start=' . urlencode($search_accountancy_aux_code_start);
}
if (! empty($search_accountancy_aux_code_end)) {
$filter['t.subledger_account<='] = $search_accountancy_aux_code_end;
$param .= '&search_accountancy_aux_code_end=' . $search_accountancy_aux_code_end;
$param .= '&search_accountancy_aux_code_end=' . urlencode($search_accountancy_aux_code_end);
}
if (! empty($search_mvt_label)) {
$filter['t.label_operation'] = $search_mvt_label;
$param .= '&search_mvt_label=' . $search_mvt_label;
$param .= '&search_mvt_label=' . urlencode($search_mvt_label);
}
if (! empty($search_direction)) {
$filter['t.sens'] = $search_direction;
$param .= '&search_direction=' . $search_direction;
$param .= '&search_direction=' . urlencode($search_direction);
}
if (! empty($search_ledger_code)) {
$filter['t.code_journal'] = $search_ledger_code;
$param .= '&search_ledger_code=' . $search_ledger_code;
$param .= '&search_ledger_code=' . urlencode($search_ledger_code);
}
if (! empty($search_mvt_num)) {
$filter['t.piece_num'] = $search_mvt_num;
$param .= '&search_mvt_num=' . $search_mvt_num;
$param .= '&search_mvt_num=' . urlencode($search_mvt_num);
}
if (! empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
@@ -263,11 +265,11 @@ if (! empty($search_date_modification_end)) {
}
if (! empty($search_debit)) {
$filter['t.debit'] = $search_debit;
$param .= '&search_debit=' . $search_debit;
$param .= '&search_debit=' . urlencode($search_debit);
}
if (! empty($search_credit)) {
$filter['t.credit'] = $search_credit;
$param .= '&search_credit=' . $search_credit;
$param .= '&search_credit=' . urlencode($search_credit);
}
if ($action == 'delbookkeeping') {
@@ -460,11 +462,11 @@ if (! empty($arrayfields['t.doc_date']['checked']))
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $langs->trans('From') . ' ';
print $form->select_date($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1);
print $form->select_date($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
print '</div>';
print '<div class="nowrap">';
print $langs->trans('to') . ' ';
print $form->select_date($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1);
print $form->select_date($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
print '</div>';
print '</td>';
}
@@ -612,7 +614,12 @@ if ($num > 0)
// Piece number
if (! empty($arrayfields['t.piece_num']['checked']))
{
print '<td><a href="./card.php?piece_num=' . $line->piece_num . '">' . $line->piece_num . '</a></td>';
print '<td>';
$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

@@ -378,7 +378,7 @@ class AccountancyCategory
* 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)
{
@@ -493,7 +493,7 @@ class AccountancyCategory
*
* @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
* @return array|int Array of accounting accounts or -1 if error
*/
public function getCptsCat($cat_id, $predefinedgroupwhere='')
{

View File

@@ -84,7 +84,8 @@ class AccountingAccount extends CommonObject
* @param int $limittocurrentchart 1=Do not load record if it is into another accounting system
* @return int <0 if KO, 0 if not found, Id of record if OK and found
*/
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0) {
function fetch($rowid = null, $account_number = null, $limittocurrentchart = 0)
{
global $conf;
if ($rowid || $account_number) {
@@ -96,10 +97,10 @@ class AccountingAccount extends CommonObject
if ($rowid) {
$sql .= " a.rowid = '" . $rowid . "'";
} elseif ($account_number) {
$sql .= " a.account_number = '" . $account_number . "'";
$sql .= " a.account_number = '" . $this->db->escape($account_number) . "'";
}
if (! empty($limittocurrentchart)) {
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM ' . MAIN_DB_PREFIX . 'accounting_system WHERE rowid=' . $this->db->escape($conf->global->CHARTOFACCOUNTS) . ')';
}
dol_syslog(get_class($this) . "::fetch sql=" . $sql, LOG_DEBUG);
@@ -201,9 +202,9 @@ class AccountingAccount extends CommonObject
$sql .= ", " . (empty($this->pcg_type) ? 'NULL' : "'" . $this->db->escape($this->pcg_type) . "'");
$sql .= ", " . (empty($this->pcg_subtype) ? 'NULL' : "'" . $this->db->escape($this->pcg_subtype) . "'");
$sql .= ", " . (empty($this->account_number) ? 'NULL' : "'" . $this->db->escape($this->account_number) . "'");
$sql .= ", " . (empty($this->account_parent) ? 'NULL' : "'" . $this->db->escape($this->account_parent) . "'");
$sql .= ", " . (empty($this->account_parent) ? '0' : "'" . $this->db->escape($this->account_parent) . "'");
$sql .= ", " . (empty($this->label) ? 'NULL' : "'" . $this->db->escape($this->label) . "'");
$sql .= ", " . (empty($this->account_category) ? 'NULL' : "'" . $this->db->escape($this->account_category) . "'");
$sql .= ", " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
$sql .= ", " . $user->id;
$sql .= ", " . (! isset($this->active) ? 'NULL' : $this->db->escape($this->active));
$sql .= ")";
@@ -274,7 +275,7 @@ class AccountingAccount extends CommonObject
$sql .= " , account_number = '" . $this->db->escape($this->account_number) . "'";
$sql .= " , account_parent = '" . $this->db->escape($this->account_parent) . "'";
$sql .= " , label = " . ($this->label ? "'" . $this->db->escape($this->label) . "'" : "null");
$sql .= " , fk_accounting_category = '" . $this->db->escape($this->account_category) . "'";
$sql .= " , fk_accounting_category = " . (empty($this->account_category) ? 0 : $this->db->escape($this->account_category));
$sql .= " , fk_user_modif = " . $user->id;
$sql .= " , active = " . $this->active;
$sql .= " WHERE rowid = " . $this->id;

View File

@@ -354,6 +354,67 @@ class BookKeeping extends CommonObject
}
}
/**
* Return a link to the object card (with optionaly the picto)
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to ('nolink', ...)
* @param int $notooltip 1=Disable tooltip
* @param string $morecss Add more css on link
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
{
global $db, $conf, $langs;
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $menumanager;
if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips
$result = '';
$companylink = '';
$label = '<u>' . $langs->trans("Transaction") . '</u>';
$label.= '<br>';
$label.= '<b>' . $langs->trans('Ref') . ':</b> ' . $this->piece_num;
$url = DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$this->piece_num;
if ($option != 'nolink')
{
// Add param to save lastsearch_values or not
$add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0);
if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1;
if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1';
}
$linkclose='';
if (empty($notooltip))
{
if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowTransaction");
$linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.=' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"';
}
else $linkclose = ($morecss?' class="'.$morecss.'"':'');
$linkstart = '<a href="'.$url.'"';
$linkstart.=$linkclose.'>';
$linkend='</a>';
$result .= $linkstart;
if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1);
if ($withpicto != 2) $result.= $this->piece_num;
$result .= $linkend;
//if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
return $result;
}
/**
* Create object into database
*
@@ -804,13 +865,14 @@ class BookKeeping extends CommonObject
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
} elseif ($key == 't.tms>=' || $key == 't.tms<=') {
$sqlwhere[] = $key . '\'' . $this->db->idate($value) . '\'';
} elseif ($key == 't.credit' || $key == 't.debit') {
$sqlwhere[] = natural_search($key, $value, 1, 1);
} else {
$sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\'';
$sqlwhere[] = natural_search($key, $value, 0, 1);
}
}
}
$sql.= ' WHERE 1 = 1';
$sql .= " AND entity IN (" . getEntity('accountancy') . ")";
$sql.= ' WHERE entity IN (' . getEntity('accountancy') . ')';
if (count($sqlwhere) > 0) {
$sql .= ' AND ' . implode(' ' . $filtermode . ' ', $sqlwhere);
}

View File

@@ -47,52 +47,76 @@ if ($user->societe_id > 0)
if (! $user->rights->accounting->bind->write)
accessforbidden();
// Filter
$year = GETPOST("year",'int');
if ($year == 0) {
$year_current = strftime("%Y", time());
$year_start = $year_current;
} else {
$year_current = $year;
$year_start = $year;
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
if (GETPOST("year",'int')) $year_start = GETPOST("year",'int');
else
{
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)
{
$month_end = 12;
$year_end--;
}
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
$search_date_end = dol_get_last_day($year_end, $month_end);
$year_current = $year_start;
// Validate History
$action = GETPOST('action','aZ09');
/*
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facturedet.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "facturedet.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_sell=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
@@ -108,30 +132,6 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
// Now clean
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1.= " SET fk_code_ventilation = 0";
$sql1.= " WHERE fd.fk_facture IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture as f";
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
}
@@ -146,54 +146,14 @@ $textnextyear = '&nbsp;<a href="' . $_SERVER["PHP_SELF"] . '?year=' . ($year_cur
print load_fiche_titre($langs->trans("CustomersVentilation") . " " . $textprevyear . " " . $langs->trans("Year") . " " . $year_start . " " . $textnextyear, '', 'title_accountancy');
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
print $langs->trans("DescVentilCustomer") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
$sql = "SELECT count(*) FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " , " . MAIN_DB_PREFIX . "facture as f";
$sql .= " WHERE fd.fk_code_ventilation = 0";
$sql .= " AND f.rowid = fd.fk_facture";
$sql .= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
} else {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_DEPOSIT . "," . Facture::TYPE_SITUATION . ")";
}
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
dol_syslog('htdocs/accountancy/customer/index.php');
$result = $db->query($sql);
if ($result) {
$row = $db->fetch_row($result);
$nbfac = $row[0];
$db->free($result);
}
$y = $year_current;
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
$buttonreset = '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>';
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
@@ -203,21 +163,26 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, 'fd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND f.fk_statut > 0";
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NULL";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
@@ -262,32 +227,38 @@ if ($resql) {
print "</table>\n";
print '</div>';
print '<br>';
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, '');
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT " . $db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') . " AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, 'fd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
$sql .= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
} else {
@@ -319,7 +290,7 @@ if ($resql) {
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
for($i = 2; $i <= 12; $i++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';
@@ -345,20 +316,25 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("TotalVente") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("TotalVente") . "' AS total,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, 'fd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, 'fd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
$sql .= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
} else {
@@ -392,20 +368,25 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400">' . $langs->trans("TotalMarge") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("Vide") . "' AS marge,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $i, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(f.datef)=' . $j, '(fd.total_ht-(fd.qty * fd.buy_price_ht))', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM((fd.total_ht-(fd.qty * fd.buy_price_ht))) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND f.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " WHERE f.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND f.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND f.entity IN (" . getEntity('facture', 0) . ")"; // We don't share object for accountancy
$sql .= " AND f.fk_statut > 0";
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND f.type IN (" . Facture::TYPE_STANDARD . "," . Facture::TYPE_REPLACEMENT . "," . Facture::TYPE_CREDIT_NOTE . "," . Facture::TYPE_SITUATION . ")";
} else {

View File

@@ -110,27 +110,37 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
if (is_array($changeaccount) && count($changeaccount) > 0) {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
$sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent','int');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
if (! (GETPOST('account_parent','int') >= 0))
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facturedet as l";
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/customer/lines.php::changeaccount sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
}
$account_parent = ''; // Protection to avoid to mass apply it a second time
}
$account_parent = ''; // Protection to avoid to mass apply it a second time
}
@@ -164,13 +174,13 @@ print '<script type="text/javascript">
* Customer Invoice lines
*/
$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.datef, f.ref_client,";
$sql .= " fd.rowid, fd.description, fd.product_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql .= " fd.rowid, fd.description, fd.product_type as line_type, fd.total_ht, fd.total_tva, fd.tva_tx, fd.vat_src_code, fd.total_ttc,";
$sql .= " s.rowid as socid, s.nom as name, s.code_compta, s.code_client,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.accountancy_code_sell, aa.rowid as fk_compte, aa.account_number, aa.label as label_compte,";
$sql .= " fd.situation_percent, co.label as country, s.tva_intra";
$sql .= " FROM " . MAIN_DB_PREFIX . "facturedet as fd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = fd.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = fd.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture as f ON f.rowid = fd.fk_facture";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
@@ -272,7 +282,7 @@ if ($result) {
print $langs->trans("DescVentilDoneCustomer") . '<br>';
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
print $formaccounting->select_account($account_parent, 'account_parent', 1);
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '"/></div>';
$moreforfilter = '';
@@ -328,8 +338,8 @@ if ($result) {
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->product_type;
$product_static->label = $objp->product_label;
$product_static->type = $objp->line_type;
print '<tr class="oddeven">';

View File

@@ -219,9 +219,9 @@ $sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facture as f";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facturedet as l ON f.rowid = l.fk_facture";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_sell = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa2 ON p.accountancy_code_sell_intra = aa2.account_number AND aa2.fk_pcg_version = '" . $chartaccountcode."' AND aa2.entity = " . $conf->entity;
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa3 ON p.accountancy_code_sell_export = aa3.account_number AND aa3.fk_pcg_version = '" . $chartaccountcode."' AND aa3.entity = " . $conf->entity;
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND l.product_type <= 2";
// Add search filter like

View File

@@ -27,6 +27,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
// Langs
$langs->load("compta");
@@ -37,58 +38,82 @@ $langs->load("accountancy");
// Security check
if (empty($conf->accounting->enabled)) {
accessforbidden();
accessforbidden();
}
if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->bind->write)
accessforbidden();
// Filter
$year = GETPOST('year', 'int');
if ($year == 0) {
$year_current = strftime("%Y", time());
$year_start = $year_current;
} else {
$year_current = $year;
$year_start = $year;
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
if (GETPOST("year",'int')) $year_start = GETPOST("year",'int');
else
{
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)
{
$month_end = 12;
$year_end--;
}
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
$search_date_end = dol_get_last_day($year_end, $month_end);
$year_current = $year_start;
// Validate History
$action = GETPOST('action','aZ09');
/*
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'expensereport WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "expensereport_det.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd, " . MAIN_DB_PREFIX . "c_type_fees as t, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
$sql1 .= " AND erd.fk_code_ventilation = 0";
}
@@ -104,32 +129,9 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
// Now clean
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1.= " SET fk_code_ventilation = 0";
$sql1.= " WHERE erd.fk_expensereport IN ( SELECT er.rowid FROM " . MAIN_DB_PREFIX . "expensereport as er";
$sql1.= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
$sql1.= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
$sql1.= " AND er.entity IN (" . getEntity('accountancy') . ")";
$sql1.=")";
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
}
/*
* View
*/
@@ -145,57 +147,39 @@ print $langs->trans("DescVentilExpenseReport") . '<br>';
print $langs->trans("DescVentilExpenseReportMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE erd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
$y = $year_current;
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
$buttonreset = '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>';
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $j, 'erd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(erd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND er.fk_statut > 0 ";
$sql .= " WHERE er.date_debut >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND er.date_debut <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NULL";
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
@@ -203,9 +187,9 @@ $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
dol_syslog('/accountancy/expensereport/index.php:: sql=' . $sql);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$num = $db->num_rows($resql);
while ( $row = $db->fetch_row($resql)) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
@@ -238,7 +222,7 @@ print '</div>';
print '<br>';
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, '');
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
@@ -246,22 +230,26 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_debut)=' . $j, 'erd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = erd.fk_code_ventilation";
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND er.fk_statut > 0 ";
$sql .= " WHERE er.date_debut >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND er.date_debut <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NOT NULL";
$sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
@@ -269,9 +257,9 @@ $sql .= " GROUP BY erd.fk_code_ventilation,aa.account_number,aa.label";
dol_syslog('htdocs/accountancy/expensereport/index.php');
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$num = $db->num_rows($resql);
while ( $row = $db->fetch_row($resql)) {
while ( $row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
if ($row[0] == 'tobind')
@@ -280,6 +268,7 @@ if ($resql) {
}
else print length_accountg($row[0]);
print '</td>';
print '<td align="left">';
if ($row[0] == 'tobind')
{
@@ -303,7 +292,7 @@ print '</div>';
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report that should rely on result of this step ?
if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange. Why showing a report where results depends on next step (so not yet available) ?
{
print '<br>';
print '<br>';
@@ -314,20 +303,24 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("TotalExpenseReport") . "' AS label,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $i, 'erd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(er.date_create)=' . $j, 'erd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(erd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "expensereport as er ON er.rowid = erd.fk_expensereport";
$sql .= " WHERE er.date_debut >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND er.date_debut <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND er.fk_statut > 0 ";
$sql .= " WHERE er.date_debut >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND er.date_debut <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.")";
$sql .= " AND er.entity IN (" . getEntity('expensereport', 0) . ")"; // We don't share object for accountancy
dol_syslog('htdocs/accountancy/expensereport/index.php');
@@ -335,7 +328,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
if ($resql) {
$num = $db->num_rows($resql);
while ( $row = $db->fetch_row($resql)) {
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';

View File

@@ -43,7 +43,7 @@ $langs->load("accountancy");
$langs->load("trips");
$langs->load("productbatch");
$account_parent = GETPOST('account_parent');
$account_parent = GETPOST('account_parent','int');
$changeaccount = GETPOST('changeaccount');
// Search Getpost
$search_expensereport = GETPOST('search_expensereport', 'alpha');
@@ -103,27 +103,36 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
if (is_array($changeaccount) && count($changeaccount) > 0) {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET erd.fk_code_ventilation=" . GETPOST('account_parent','int');
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
if (! (GETPOST('account_parent','int') >= 0))
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
$account_parent = ''; // Protection to avoid to mass apply it a second time
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql1 .= " SET erd.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE erd.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
}
$account_parent = ''; // Protection to avoid to mass apply it a second time
}
}
@@ -164,10 +173,10 @@ $sql .= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
$sql .= " , " . MAIN_DB_PREFIX . "accounting_account as aa";
$sql .= " , " . MAIN_DB_PREFIX . "expensereport_det as erd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
$sql .= " WHERE er.rowid = erd.fk_expensereport and er.fk_statut >= 5 AND erd.fk_code_ventilation <> 0 ";
$sql .= " WHERE er.rowid = erd.fk_expensereport and er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <> 0 ";
$sql .= " AND aa.rowid = erd.fk_code_ventilation";
if (strlen(trim($search_expensereport))) {
$sql .= " AND er.ref like '%" . $search_expensereport . "%'";
$sql .= natural_search("er.ref", $search_expensereport);
}
if (strlen(trim($search_label))) {
$sql .= natural_search("f.label", $search_label);
@@ -246,7 +255,7 @@ if ($result) {
print $langs->trans("DescVentilDoneExpenseReport") . '<br>';
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
print $formaccounting->select_account(GETPOST('account_parent'), 'account_parent', 1);
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
$moreforfilter = '';

View File

@@ -200,8 +200,8 @@ $sql.= " aa.rowid as aarowid";
$sql.= " FROM " . MAIN_DB_PREFIX . "expensereport as er";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "expensereport_det as erd ON er.rowid = erd.fk_expensereport";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "c_type_fees as f ON f.id = erd.fk_c_type_fees";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " WHERE er.fk_statut > 4 AND erd.fk_code_ventilation <= 0";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON f.accountancy_code = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " WHERE er.fk_statut IN (".ExpenseReport::STATUS_APPROVED.", ".ExpenseReport::STATUS_CLOSED.") AND erd.fk_code_ventilation <= 0";
// Add search filter like
if (strlen(trim($search_expensereport))) {
$sql .= natural_search("er.ref",$search_expensereport);

View File

@@ -63,111 +63,118 @@ print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy'
$step = 0;
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
print "<br>\n";print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print '<hr>';
print "<br>\n";
// STEPS
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
print "<br>\n";
print "<br>\n";
print $langs->trans("AccountancyAreaDescActionOnceBis");
print "<br>\n";
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong>')."\n";
print "<br>\n";
$step++;
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
print "<br>\n";
if (! empty($conf->tax->enabled))
if ($conf->accounting->enabled)
{
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
print "<br>\n";
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
print "<br>\n";print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
print '<hr>';
print "<br>\n";
// STEPS
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'</strong>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'</strong>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'</strong>');
print "<br>\n";
print "<br>\n";
print $langs->trans("AccountancyAreaDescActionOnceBis");
print "<br>\n";
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong>')."\n";
print "<br>\n";
$step++;
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong>';
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
print "<br>\n";
if (! empty($conf->tax->enabled))
{
$textlink = '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong>';
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
print "<br>\n";
}
/*if (! empty($conf->salaries->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
// htdocs/admin/salaries.php
print "<br>\n";
print "<br>\n";
}*/
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
print "<br>\n";
}
/*
if (! empty($conf->loan->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print "<br>\n";
}
if (! empty($conf->don->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
print "<br>\n";
}*/
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
print "<br>\n";
print '<br>';
print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print '<hr>';
print "<br>\n";
$step = 0;
$langs->loadLangs(array('bills', 'trips'));
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
print "<br>\n";
$step++;
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";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
print "<br>\n";
}
/*if (! empty($conf->salaries->enabled))
else
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
// htdocs/admin/salaries.php
print "<br>\n";
print "<br>\n";
}*/
if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong>');
print "<br>\n";
print $langs->trans("Module10Desc")."<br>\n";
}
/*
if (! empty($conf->loan->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
print "<br>\n";
}
if (! empty($conf->don->enabled))
{
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'</strong>');
print "<br>\n";
}*/
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'</strong>');
print "<br>\n";
print '<br>';
print "<br>\n";
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
print '<hr>';
print "<br>\n";
$step = 0;
$langs->loadLangs(array('bills', 'trips'));
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'</strong>')."\n";
print "<br>\n";
$step++;
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";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
print "<br>\n";
$step++;
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
print "<br>\n";
llxFooter();
$db->close();

View File

@@ -104,8 +104,8 @@ $idpays = $mysoc->country_id;
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type, b.fk_account,";
$sql .= " ba.courant, ba.ref as baref, ba.account_number, ba.fk_accountancy_journal,";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, bu1.type as typeop_company,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, bu2.type as typeop_user,";
$sql .= " soc.code_compta, soc.code_compta_fournisseur, soc.rowid as socid, soc.nom as name, soc.email as email, bu1.type as typeop_company,";
$sql .= " u.accountancy_code, u.rowid as userid, u.lastname as lastname, u.firstname as firstname, u.email as useremail, bu2.type as typeop_user,";
$sql .= " bu3.type as typeop_payment, bu4.type as typeop_payment_supplier";
$sql .= " FROM " . MAIN_DB_PREFIX . "bank as b";
$sql .= " JOIN " . MAIN_DB_PREFIX . "bank_account as ba on b.fk_account=ba.rowid";
@@ -212,6 +212,7 @@ if ($result) {
'id' => $obj->socid,
'name' => $obj->name,
'code_compta' => $compta_soc,
'email' => $obj->email
);
// Set accountancy code for user
@@ -222,7 +223,8 @@ if ($result) {
'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),
'lastname' => $obj->lastname,
'firstname' => $obj->firstname,
'accountancy_code' => $compta_user,
'email' => $obj->useremail,
'accountancy_code' => $compta_user
);
// Variable bookkeeping ($obj->rowid is Bank Id)
@@ -237,7 +239,7 @@ if ($result) {
} else {
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
}
$links = $object->get_url($obj->rowid);
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
//var_dump($i);
//var_dump($tabpay);
@@ -282,11 +284,15 @@ if ($result) {
} else if ($links[$key]['type'] == 'company') {
$societestatic->id = $links[$key]['url_id'];
$societestatic->name = $links[$key]['label'];
$societestatic->email = $tabcompany[$obj->rowid]['email'];
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
} else if ($links[$key]['type'] == 'user') {
$userstatic->id = $links[$key]['url_id'];
$userstatic->name = $links[$key]['label'];
$userstatic->email = $tabuser[$obj->rowid]['email'];
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
@@ -341,7 +347,7 @@ if ($result) {
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
} else if ($links[$key]['type'] == 'payment_expensereport') {
$paymentexpensereportstatic->id = $links[$key]['url_id'];
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentexpensereportstatic->getNomUrl(2);
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
} else if ($links[$key]['type'] == 'payment_various') {
$paymentvariousstatic->id = $links[$key]['url_id'];
@@ -825,7 +831,7 @@ if (empty($action) || $action == 'view') {
//$description = $langs->trans("DescFinanceJournal") . '<br>';
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices=array('already'=>$langs->trans("AlreadyInGeneralLedger"), 'notyet'=>$langs->trans("NotYetInGeneralLedger"));
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@@ -531,7 +531,7 @@ if (empty($action) || $action == 'view') {
$builddate=dol_now();
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
$listofchoices=array('already'=>$langs->trans("AlreadyInGeneralLedger"), 'notyet'=>$langs->trans("NotYetInGeneralLedger"));
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@@ -723,7 +723,7 @@ if (empty($action) || $action == 'view') {
$description .= $langs->trans("DepositsAreIncluded");
}
$listofchoices=array('already'=>$langs->trans("AlreadyInGeneralLedger"), 'notyet'=>$langs->trans("NotYetInGeneralLedger"));
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@@ -59,11 +59,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);
@@ -171,7 +175,8 @@ if ($result) {
$line->fetch($obj->fdid);
// Situation invoices handling
$prev_progress = $line->get_prev_progress($obj->fdid);
$prev_progress = $line->get_prev_progress($obj->rowid);
if ($obj->type == Facture::TYPE_SITUATION) {
// Avoid divide by 0
if ($obj->situation_percent == 0) {
@@ -653,7 +658,7 @@ if (empty($action) || $action == 'view') {
else
$description .= $langs->trans("DepositsAreIncluded");
$listofchoices=array('already'=>$langs->trans("AlreadyInGeneralLedger"), 'notyet'=>$langs->trans("NotYetInGeneralLedger"));
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
$varlink = 'id_journal=' . $id_journal;

View File

@@ -38,58 +38,83 @@ $langs->load("accountancy");
// Security check
if (empty($conf->accounting->enabled)) {
accessforbidden();
accessforbidden();
}
if ($user->societe_id > 0)
accessforbidden();
if (! $user->rights->accounting->bind->write)
accessforbidden();
// Filter
$year = GETPOST("year",'int');
if ($year == 0) {
$year_current = strftime("%Y", time());
$year_start = $year_current;
} else {
$year_current = $year;
$year_start = $year;
$month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
if (GETPOST("year",'int')) $year_start = GETPOST("year",'int');
else
{
$year_start = dol_print_date(dol_now(), '%Y');
if (dol_print_date(dol_now(), '%m') < $month_start) $year_start--; // If current month is lower that starting fiscal month, we start last year
}
$year_end = $year_start + 1;
$month_end = $month_start - 1;
if ($month_end < 1)
{
$month_end = 12;
$year_end--;
}
$search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
$search_date_end = dol_get_last_day($year_end, $month_end);
$year_current = $year_start;
// Validate History
$action = GETPOST('action', 'aZ09');
$action = GETPOST('action','aZ09');
/*
* Actions
*/
if ($action == 'clean' || $action == 'validatehistory')
{
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ' AND accnt.entity = '.$conf->entity.')';
$sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'facture_fourn WHERE entity = '.$conf->entity.')';
$sql1 .= ' AND fk_code_ventilation <> 0';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
}
if ($action == 'validatehistory') {
$error = 0;
$db->begin();
// First clean corrupted data
$sqlclean = "UPDATE " . MAIN_DB_PREFIX . "facturedet as fd";
$sqlclean .= " SET fk_code_ventilation = 0";
$sqlclean .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sqlclean .= ' (SELECT accnt.rowid ';
$sqlclean .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sqlclean .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sqlclean .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
$resql = $db->query($sqlclean);
// Now make the binding. Bind automatically only for product with a dedicated account that exists into chart of account, others need a manual bind
if ($db->type == 'pgsql') {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE " . MAIN_DB_PREFIX . "facture_fourn_det.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
$sql1 .= " AND " . MAIN_DB_PREFIX . "facture_fourn_det.fk_code_ventilation = 0";
} else {
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd, " . MAIN_DB_PREFIX . "product as p, " . MAIN_DB_PREFIX . "accounting_account as accnt , " . MAIN_DB_PREFIX . "accounting_system as syst";
$sql1 .= " SET fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS;
$sql1 .= " WHERE fd.fk_product = p.rowid AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=" . $conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity;
$sql1 .= " AND accnt.active = 1 AND p.accountancy_code_buy=accnt.account_number";
$sql1 .= " AND fd.fk_code_ventilation = 0";
}
@@ -105,31 +130,9 @@ if ($action == 'validatehistory') {
$db->commit();
setEventMessages($langs->trans('AutomaticBindingDone'), null, 'mesgs');
}
} elseif ($action == 'cleanaccountancycode') {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1.= " SET fk_code_ventilation = 0";
$sql1.= " WHERE fd.fk_facture_fourn IN ( SELECT f.rowid FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql1.= " WHERE f.datef >= '" . $db->idate(dol_get_first_day($year_current, 1, false)) . "'";
$sql1.= " AND f.datef <= '" . $db->idate(dol_get_last_day($year_current, 12, false)) . "'";
$sql1.= " AND f.entity IN (" . getEntity('accountancy') . ")";
$sql1.= ")";
dol_syslog("htdocs/accountancy/customer/index.php cleanaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
setEventMessage($langs->trans('Done'), 'mesgs');
}
}
/*
* View
*/
@@ -145,31 +148,9 @@ print $langs->trans("DescVentilSupplier") . '<br>';
print $langs->trans("DescVentilMore", $langs->transnoentitiesnoconv("ValidateHistory"), $langs->transnoentitiesnoconv("ToBind")) . '<br>';
print '<br>';
// Clean database
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as fd";
$sql1 .= " SET fk_code_ventilation = 0";
$sql1 .= ' WHERE fd.fk_code_ventilation NOT IN ';
$sql1 .= ' (SELECT accnt.rowid ';
$sql1 .= ' FROM ' . MAIN_DB_PREFIX . 'accounting_account as accnt';
$sql1 .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'accounting_system as syst';
$sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid=' . $conf->global->CHARTOFACCOUNTS . ')';
dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
$db->rollback();
setEventMessage($db->lasterror(), 'errors');
} else {
$db->commit();
}
// End clean database
$y = $year_current;
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
$buttonreset = '<a class="butActionDelete" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=cleanaccountancycode">' . $langs->trans("CleanHistory", $year_current) . '</a>';
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
@@ -179,22 +160,26 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $j, 'ffd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(ffd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation";
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND ff.fk_statut > 0 ";
$sql .= " WHERE ff.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND ff.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND ff.fk_statut > 0";
$sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NULL";
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
@@ -238,29 +223,33 @@ print '</div>';
print '<br>';
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), $buttonreset, '');
print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="200">' . $langs->trans("Account") . '</td>';
print '<td width="200" align="left">' . $langs->trans("Label") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number') ." AS codecomptable,";
$sql .= " " . $db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label') . " AS intitule,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $j, 'ffd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(ffd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = ffd.fk_code_ventilation";
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND ff.fk_statut > 0 ";
$sql .= " WHERE ff.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND ff.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND ff.fk_statut > 0";
$sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NOT NULL";
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
@@ -286,7 +275,7 @@ if ($resql) {
}
else print $row[1];
print '</td>';
for($i = 2; $i <= 12; $i ++) {
for($i = 2; $i <= 12; $i++) {
print '<td align="right">' . price($row[$i]) . '</td>';
}
print '<td align="right">' . price($row[13]) . '</td>';
@@ -313,20 +302,24 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="400" align="left">' . $langs->trans("Total") . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
print '<td width="60" align="right">' . $langs->trans('MonthShort' . str_pad($j, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td width="60" align="right"><b>' . $langs->trans("Total") . '</b></td></tr>';
$sql = "SELECT '" . $langs->trans("CAHTF") . "' AS label,";
for($i = 1; $i <= 12; $i ++) {
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $i, 'ffd.total_ht', '0') . ") AS month" . str_pad($i, 2, '0', STR_PAD_LEFT) . ",";
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START?$conf->global->SOCIETE_FISCAL_MONTH_START:1) - 1;
if ($j > 12) $j-=12;
$sql .= " SUM(" . $db->ifsql('MONTH(ff.datef)=' . $j, 'ffd.total_ht', '0') . ") AS month" . str_pad($j, 2, '0', STR_PAD_LEFT) . ",";
}
$sql .= " SUM(ffd.total_ht) as total";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as ffd";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn as ff ON ff.rowid = ffd.fk_facture_fourn";
$sql .= " WHERE ff.datef >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
$sql .= " AND ff.datef <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
$sql .= " AND ff.fk_statut > 0 ";
$sql .= " WHERE ff.datef >= '" . $db->idate($search_date_start) . "'";
$sql .= " AND ff.datef <= '" . $db->idate($search_date_end) . "'";
$sql .= " AND ff.fk_statut > 0";
$sql .= " AND ff.entity IN (" . getEntity('facture_fourn', 0) . ")"; // We don't share object for accountancy
dol_syslog('htdocs/accountancy/supplier/index.php');
@@ -334,9 +327,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
if ($resql) {
$num = $db->num_rows($resql);
while ( $row = $db->fetch_row($resql)) {
while ($row = $db->fetch_row($resql)) {
print '<tr><td>' . $row[0] . '</td>';
for($i = 1; $i <= 12; $i ++) {
print '<td align="right">' . price($row[$i]) . '</td>';
@@ -344,7 +335,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
print '<td align="right"><b>' . price($row[13]) . '</b></td>';
print '</tr>';
}
$db->free($resql);
} else {
print $db->lasterror(); // Show last sql error

View File

@@ -111,27 +111,36 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
if (is_array($changeaccount) && count($changeaccount) > 0) {
$error = 0;
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql1 .= " SET l.fk_code_ventilation=" . GETPOST('account_parent','int');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
if (! (GETPOST('account_parent','int') >= 0))
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors');
}
$account_parent = ''; // Protection to avoid to mass apply it a second time
if (! $error)
{
$db->begin();
$sql1 = "UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql1 .= " SET l.fk_code_ventilation=" . (GETPOST('account_parent','int') > 0 ? GETPOST('account_parent','int') : '0');
$sql1 .= ' WHERE l.rowid IN (' . implode(',', $changeaccount) . ')';
dol_syslog('accountancy/supplier/lines.php::changeaccount sql= ' . $sql1);
$resql1 = $db->query($sql1);
if (! $resql1) {
$error ++;
setEventMessages($db->lasterror(), null, 'errors');
}
if (! $error) {
$db->commit();
setEventMessages($langs->trans('Save'), null, 'mesgs');
} else {
$db->rollback();
setEventMessages($db->lasterror(), null, 'errors');
}
$account_parent = ''; // Protection to avoid to mass apply it a second time
}
}
@@ -165,17 +174,16 @@ print '<script type="text/javascript">
* Supplier Invoice lines
*/
$sql = "SELECT f.rowid as facid, f.ref as facnumber, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql.= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
$sql.= " aa.label, aa.account_number, ";
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
$sql.= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, co.label as country, s.tva_intra";
$sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn_det as l";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.rowid = l.fk_code_ventilation";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn as f ON f.rowid = l.fk_facture_fourn";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "societe as s ON s.rowid = f.fk_soc";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "c_country as co ON co.rowid = s.fk_pays ";
$sql.= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 ";
$sql.= " AND aa.rowid = l.fk_code_ventilation";
if ($search_lineid) {
$sql .= natural_search("l.rowid", $search_lineid, 1);
}
@@ -269,7 +277,7 @@ if ($result) {
print $langs->trans("DescVentilDoneSupplier") . '<br>';
print '<br><div class="inline-block divButAction">' . $langs->trans("ChangeAccount") . '<br>';
print $formaccounting->select_account($account_parent, 'account_parent', 1);
print $formaccounting->select_account($account_parent, 'account_parent', 2, array(), 0, 0, 'maxwidth300 maxwidthonsmartphone valignmiddle');
print '<input type="submit" class="button valignmiddle" value="' . $langs->trans("ChangeBinding") . '" /></div>';
$moreforfilter = '';
@@ -330,8 +338,8 @@ if ($result) {
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->type;
$product_static->label = $objp->product_label;
$product_static->type = $objp->line_type;
print '<tr class="oddeven">';

View File

@@ -220,7 +220,7 @@ $sql.=$hookmanager->resPrint;
$sql.= " FROM " . MAIN_DB_PREFIX . "facture_fourn as f";
$sql.= " INNER JOIN " . MAIN_DB_PREFIX . "facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "product as p ON p.rowid = l.fk_product";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."'";
$sql.= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON p.accountancy_code_buy = aa.account_number AND aa.fk_pcg_version = '" . $chartaccountcode."' AND aa.entity = " . $conf->entity;
$sql.= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql.= " AND l.product_type <= 2";
// Add search filter like

View File

@@ -212,7 +212,7 @@ if (empty($reshook))
}
else
{
setEventMessages($object->errors, $object->error, 'errors');
setEventMessages($object->error, $object->errors, 'errors');
}
}

View File

@@ -29,19 +29,18 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/member/modules_cards.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/printsheet/modules_labels.php';
$langs->load("members");
$langs->load("errors");
$langs->loadLangs(array("members","errors"));
// Choix de l'annee d'impression ou annee courante.
$now = dol_now();
$year=dol_print_date($now,'%Y');
$month=dol_print_date($now,'%m');
$day=dol_print_date($now,'%d');
$foruserid=GETPOST('foruserid');
$foruserlogin=GETPOST('foruserlogin');
$mode=GETPOST('mode');
$model=GETPOST("model"); // Doc template to use for business cards
$modellabel=GETPOST("modellabel"); // Doc template to use for address sheet
$foruserid=GETPOST('foruserid','alphanohtml');
$foruserlogin=GETPOST('foruserlogin','alphanohtml');
$mode=GETPOST('mode','aZ09');
$model=GETPOST("model",'aZ09'); // Doc template to use for business cards
$modellabel=GETPOST("modellabel",'aZ09'); // Doc template to use for address sheet
$mesg='';
$adherentstatic=new Adherent($db);

View File

@@ -599,14 +599,14 @@ class Adherent extends CommonObject
$error++;
}
}
}
if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('MEMBER_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}
if (! $error && ! $notrigger)
{
// Call trigger
$result=$this->call_trigger('MEMBER_MODIFY',$user);
if ($result < 0) { $error++; }
// End call triggers
}
if (! $error)

View File

@@ -75,7 +75,7 @@ if ($action == 'dolibarr2ldap')
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
}
else {
setEventMessages($ldap->errors, $ldap->error, 'errors');
setEventMessages($ldap->error, $ldap->errors, 'errors');
}
}

View File

@@ -43,7 +43,7 @@ $toselect = GETPOST('toselect', 'array');
$result=restrictedArea($user,'adherent');
$filter=GETPOST("filter",'alpha');
$statut=GETPOST("statut",'alpha');
$statut=GETPOST("statut",'intcomma');
$search=GETPOST("search",'alpha');
$search_ref=GETPOST("search_ref",'alpha');
$search_lastname=GETPOST("search_lastname",'alpha');

View File

@@ -75,6 +75,12 @@ else
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_event = '';
$action = '';
}
if (GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') ||GETPOST('button_search','alpha')) // To avoid the save when we click on search
{
$action = '';
}
if ($action == "save" && empty($cancel))
@@ -106,34 +112,6 @@ if ($action == "save" && empty($cancel))
}
}
if (preg_match('/set_(.*)/',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
/**

View File

@@ -52,10 +52,10 @@ $type = 'action';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if (preg_match('/set_(.*)/',$action,$reg))
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
@@ -67,7 +67,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
if (preg_match('/del_(.*)/',$action,$reg))
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -47,10 +47,10 @@ $type = 'action';
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if (preg_match('/set_(.*)/',$action,$reg))
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
@@ -62,7 +62,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
if (preg_match('/del_(.*)/',$action,$reg))
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -78,7 +78,7 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("town",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("zipcode",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'aZ09'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity);
@@ -154,26 +154,26 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
}
}
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'int'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'aZ09'),'chaine',0,'',$conf->entity);
// Local taxes
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", GETPOST("optionlocaltax1",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", GETPOST("optionlocaltax2",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", GETPOST("optionlocaltax1",'aZ09'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", GETPOST("optionlocaltax2",'aZ09'),'chaine',0,'',$conf->entity);
if($_POST["optionlocaltax1"]=="localtax1on")
{
@@ -183,9 +183,9 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
}
else
{
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','aZ09'),'chaine',0,'',$conf->entity);
}
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity);
}
if($_POST["optionlocaltax2"]=="localtax2on")
{
@@ -195,9 +195,9 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
}
else
{
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','aZ09'),'chaine',0,'',$conf->entity);
}
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'alpha'),'chaine',0,'',$conf->entity);
dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity);
}
if ($action != 'updateedit' && ! $error)
@@ -409,7 +409,7 @@ if ($action == 'edit' || $action == 'updateedit')
// IDs of the company (country-specific)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
$langs->load("companies");
@@ -562,7 +562,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td class="titlefield">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
print '<td width="140">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
print '<td align="right">&nbsp;</td>';
print "</tr>\n";
@@ -595,7 +595,7 @@ if ($action == 'edit' || $action == 'updateedit')
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
print '<td width="140">'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
print '<td align="right">&nbsp;</td>';
print "</tr>\n";

View File

@@ -36,11 +36,11 @@ $rowid=GETPOST('rowid','int');
$entity=GETPOST('entity','int');
$action=GETPOST('action','alpha');
$update=GETPOST('update','alpha');
$delete=GETPOST('delete'); // Do not use alpha here
$delete=GETPOST('delete','none'); // Do not use alpha here
$debug=GETPOST('debug','int');
$consts=GETPOST('const','array');
$constname=GETPOST('constname','alpha');
$constvalue=GETPOST('constvalue');
$constvalue=GETPOST('constvalue','none'); // We shoul dbe able to send everything here
$constnote=GETPOST('constnote','alpha');
@@ -247,7 +247,7 @@ if ($result)
while ($i < $num)
{
$obj = $db->fetch_object($result);
print "\n";

View File

@@ -38,7 +38,7 @@ if (!$user->admin) accessforbidden();
$id=GETPOST('rowid','int');
$action=GETPOST('action','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus'
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');

View File

@@ -965,14 +965,14 @@ if (empty($id))
print "<br>\n";
$param = '&id='.$id;
if ($search_country_id > 0) $param.= '&search_country_id='.$search_country_id;
$param = '&id='.urlencode($id);
if ($search_country_id > 0) $param.= '&search_country_id='.urlencode($search_country_id);
if ($search_code != '') $param.= '&search_code='.urlencode($search_country_id);
if ($entity != '') $param.= '&entity=' . (int) $entity;
$paramwithsearch = $param;
if ($sortorder) $paramwithsearch.= '&sortorder='.$sortorder;
if ($sortfield) $paramwithsearch.= '&sortfield='.$sortfield;
if (GETPOST('from')) $paramwithsearch.= '&from='.GETPOST('from','alpha');
if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder);
if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield);
if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha'));
// Confirmation de la suppression de la ligne
@@ -999,10 +999,10 @@ if ($id)
{
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.= " ORDER BY ".$sortfield;
$sql.= " ORDER BY ".$db->escape($sortfield);
if ($sortorder)
{
$sql.=" ".strtoupper($sortorder);
$sql.=" ".strtoupper($db->escape($sortorder));
}
$sql.=", ";
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value

View File

@@ -33,7 +33,7 @@ if (! $user->admin) accessforbidden();
/*
* Action
*/
if (preg_match('/set_(.*)/',$action,$reg))
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
@@ -47,7 +47,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
if (preg_match('/del_(.*)/',$action,$reg))
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -315,8 +315,8 @@ if ($action == 'edit') // Edit
// Firstname/Name
print '<tr><td class="titlefield">'.$langs->trans("FirstnameNamePosition").'</td><td>';
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"),1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
$array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Lastname"), 1=>$langs->trans("Lastname").' '.$langs->trans("Firstname"));
print $form->selectarray('MAIN_FIRSTNAME_NAME_POSITION', $array, (isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0));
print '</td>';
print '<td width="20">&nbsp;</td>';
print '</tr>';

View File

@@ -55,8 +55,7 @@ $search_lang=GETPOST('search_lang','alpha');
$search_fk_user=GETPOST('search_fk_user','intcomma');
$search_topic=GETPOST('search_topic','alpha');
$allowed=1;
if (! $allowed) accessforbidden();
if (! empty($user->socid)) accessforbidden();
$acts[0] = "activate";
$acts[1] = "disable";
@@ -431,24 +430,9 @@ if ($search_type_template != '' && $search_type_template != '-1') $sql.=natural_
if ($search_lang) $sql.=natural_search('lang', $search_lang);
if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_user', $search_fk_user, 2);
if ($search_topic) $sql.=natural_search('topic', $search_topic);
if ($sortfield)
{
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
$sql.=" ".strtoupper($sortorder);
}
$sql.=", ";
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
}
else {
$sql.=" ORDER BY ";
}
$sql.=$tabsqlsort[$id];
// If sort order is "country", we use country_code instead
if ($sortfield == 'country') $sortfield='country_code';
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($listlimit+1,$offset);
//print $sql;

View File

@@ -89,7 +89,7 @@ if ($action == 'update')
if ($result > 0)
{
$menu->titre=GETPOST('titre', 'alpha');
$menu->leftmenu=GETPOST('leftmenu', 'alpha');
$menu->leftmenu=GETPOST('leftmenu', 'aZ09');
$menu->url=GETPOST('url','alpha');
$menu->langs=GETPOST('langs','alpha');
$menu->position=GETPOST('position','int');

View File

@@ -79,9 +79,9 @@ $familyinfo=array(
$param='';
if ($search_keyword) $param.='&search_keyword='.urlencode($search_keyword);
if ($search_status > -1) $param.='&search_status='.urlencode($search_status);
if ($search_nature > -1) $param.='&search_nature='.urlencode($search_nature);
if ($search_version > -1) $param.='&search_version='.urlencode($search_version);
if ($search_status && $search_status != '-1') $param.='&search_status='.urlencode($search_status);
if ($search_nature && $search_nature != '-1') $param.='&search_nature='.urlencode($search_nature);
if ($search_version && $search_version != '-1') $param.='&search_version='.urlencode($search_version);
$dirins=DOL_DOCUMENT_ROOT.'/custom';
$urldolibarrmodules='https://www.dolistore.com/';
@@ -466,7 +466,7 @@ if ($mode == 'common')
{
dol_set_focus('#search_keyword');
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';

View File

@@ -48,10 +48,11 @@ $action = GETPOST('action', 'alpha');
*/
if (preg_match('/set_(.*)/',$action,$reg))
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0)
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
@@ -62,7 +63,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
if (preg_match('/del_(.*)/',$action,$reg))
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, 0) > 0)

View File

@@ -257,17 +257,6 @@ print $form->selectyesno("FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS",$con
print '</td><td align="right">';
print "</td></tr>\n";
// Add js auto fill amount on paiement form
/* always on now
$var=! $var;
print '<tr class="oddeven"><td>';
print $langs->trans("JSOnPaimentBill");
print '</td><td width="60" align="center">';
print $form->selectyesno("INVOICE_AUTO_FILLJS",$conf->global->INVOICE_AUTO_FILLJS,1);
print '</td><td align="right">';
print "</td></tr>\n";
*/
print '</table>';
print '<center>';

View File

@@ -51,41 +51,17 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
dol_add_file_process($upload_dir, 0, 0, 'userfile');
}
if (preg_match('/set_(.*)/',$action,$reg))
if ($action == 'updateform')
{
$code=$reg[1];
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
$antivircommand = GETPOST('MAIN_ANTIVIRUS_COMMAND','none'); // Use GETPOST none because we must accept ". Example c:\Progra~1\ClamWin\bin\clamscan.exe
$antivirparam = GETPOST('MAIN_ANTIVIRUS_PARAM','none'); // Use GETPOST none because we must accept ". Example --database="C:\Program Files (x86)\ClamWin\lib"
$antivircommand = dol_string_nospecial($antivircommand, '', array("|", ";", "<", ">", "&")); // Sanitize command
$antivirparam = dol_string_nospecial($antivirparam, '', array("|", ";", "<", ">", "&")); // Sanitize params
else if (preg_match('/del_(.*)/',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
else if ($action == 'updateform')
{
$res3=dolibarr_set_const($db, 'MAIN_UPLOAD_DOC',GETPOST('MAIN_UPLOAD_DOC','alpha'),'chaine',0,'',$conf->entity);
$res4=dolibarr_set_const($db, "MAIN_UMASK", GETPOST('MAIN_UMASK','alpha'),'chaine',0,'',$conf->entity);
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim(GETPOST('MAIN_ANTIVIRUS_COMMAND','none')),'chaine',0,'',$conf->entity); // Use GETPOST none because we must accept "
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim(GETPOST('MAIN_ANTIVIRUS_PARAM','none')),'chaine',0,'',$conf->entity); // Use GETPOST none because we must accept "
$res5=dolibarr_set_const($db, "MAIN_ANTIVIRUS_COMMAND", trim($antivircommand),'chaine',0,'',$conf->entity);
$res6=dolibarr_set_const($db, "MAIN_ANTIVIRUS_PARAM", trim($antivirparam),'chaine',0,'',$conf->entity);
if ($res3 && $res4 && $res5 && $res6) setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
}
@@ -95,10 +71,10 @@ else if ($action == 'updateform')
else if ($action == 'delete')
{
$langs->load("other");
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile','alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret=dol_delete_file($file);
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile','alpha')), null, 'mesgs');
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile','alpha')), null, 'errors');
Header('Location: '.$_SERVER["PHP_SELF"]);
exit;
}

View File

@@ -43,10 +43,10 @@ $action=GETPOST('action','alpha');
* Actions
*/
if (preg_match('/set_(.*)/',$action,$reg))
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
$value=(GETPOST($code) ? GETPOST($code) : 1);
$value=(GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0)
{
Header("Location: ".$_SERVER["PHP_SELF"]);
@@ -58,7 +58,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
else if (preg_match('/del_(.*)/',$action,$reg))
else if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -179,24 +179,30 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
// TODO We add/delete permission here until permission can have a condition on a global var
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
$newmodule=new modFournisseur($db);
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
// clear default rights array
$newmodule->rights=array();
// add new right
$r=0;
$newmodule->rights[$r][0] = 1190;
$newmodule->rights[$r][1] = $langs->trans("Permission1190");
$newmodule->rights[$r][2] = 'w';
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
// Insert
$newmodule->insert_permissions(1);
}
else
{
// Remove all rights with Permission1190
$newmodule->delete_permissions();
// Add all right without Permission1190
$newmodule->insert_permissions(1);
}
}

View File

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

View File

@@ -72,7 +72,7 @@ print '<br>';
$file_list = array('missing' => array(), 'updated' => array());
// Local file to compare to
$xmlshortfile = GETPOST('xmlshortfile')?GETPOST('xmlshortfile'):'/install/filelist-'.DOL_VERSION.'.xml';
$xmlshortfile = GETPOST('xmlshortfile','alpha')?GETPOST('xmlshortfile','alpha'):'/install/filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX)?'':$conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml';
$xmlfile = DOL_DOCUMENT_ROOT.$xmlshortfile;
// Remote file to compare to
$xmlremote = GETPOST('xmlremote');
@@ -83,8 +83,8 @@ if (empty($xmlremote)) $xmlremote = 'https://www.dolibarr.org/files/stable/signa
// Test if remote test is ok
$enableremotecheck = True;
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=False;
$enableremotecheck = true;
if (preg_match('/beta|alpha|rc/i', DOL_VERSION) || ! empty($conf->global->MAIN_ALLOW_INTEGRITY_CHECK_ON_UNSTABLE)) $enableremotecheck=false;
$enableremotecheck = true;
print '<form name="check" action="'.$_SERVER["PHP_SELF"].'">';

View File

@@ -39,7 +39,7 @@ $transkey=GETPOST('transkey','alpha');
$transvalue=GETPOST('transvalue','alpha');
$mode = GETPOST('mode')?GETPOST('mode'):'overwrite';
$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'overwrite';
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');

View File

@@ -86,7 +86,7 @@ elseif ($action == 'setdoc')
}
$res = true;
}
elseif (preg_match('/set_(.*)/',$action,$reg))
elseif (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
@@ -100,7 +100,7 @@ elseif (preg_match('/set_(.*)/',$action,$reg))
}
}
elseif (preg_match('/del_(.*)/',$action,$reg))
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -83,7 +83,7 @@ elseif ($action == 'setdoc')
}
$res = true;
}
elseif (preg_match('/set_(.*)/',$action,$reg))
elseif (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
@@ -97,7 +97,7 @@ elseif (preg_match('/set_(.*)/',$action,$reg))
}
}
elseif (preg_match('/del_(.*)/',$action,$reg))
elseif (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -419,24 +419,7 @@ if ($id)
{
// Complete requete recherche valeurs avec critere de tri
$sql=$tabsql[$id];
if ($sortfield)
{
// If sort order is "country", we use country_code instead
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
$sql.=" ".strtoupper($sortorder);
}
$sql.=", ";
// Clear the required sort criteria for the tabsqlsort to be able to force it with selected value
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]);
$tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]);
}
else {
$sql.=" ORDER BY ";
}
$sql.=$tabsqlsort[$id];
$sql.=$db->order($sortfield,$sortorder);
$sql.=$db->plimit($limit+1, $offset);
//print $sql;

View File

@@ -65,6 +65,8 @@ class DolibarrApi
$this->r->setBaseUrls($urlwithouturlroot, $urlwithouturlrootautodetect);
$this->r->setAPIVersion(1);
//$this->r->setSupportedFormats('json');
//$this->r->setSupportedFormats('jsonFormat');
}
/**

View File

@@ -313,12 +313,15 @@ class BlockedLog
* @param Object $object object to store
* @param string $action action
* @param string $amounts amounts
* @param User $fuser User object (forced)
* @return int >0 if OK, <0 if KO
*/
public function setObjectData(&$object, $action, $amounts)
public function setObjectData(&$object, $action, $amounts, $fuser = null)
{
global $langs, $user, $mysoc;
if (is_object($fuser)) $user = $fuser;
// Generic fields
// action

View File

@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.net>
* Copyright (C) 2018 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
@@ -150,7 +151,8 @@ switch($action)
$obj_facturation->id($ret['rowid']);
$obj_facturation->ref($ret['ref']);
$obj_facturation->stock($ret['reel']);
$obj_facturation->prix($ret['price']);
//$obj_facturation->prix($ret['price']);
$obj_facturation->prix($pu_ht);
$vatrate = $tva_tx;

View File

@@ -183,7 +183,7 @@ $langs->load("cashdesk");
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("Cash").'" onclick="javascript: verifClic(\'ESP\');" />';
print '</div>';
print '<div class="inline-block" style="margin: 6px;">';
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] < 0)
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CB']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] < 0)
{
$langs->load("errors");
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';
@@ -191,7 +191,7 @@ $langs->load("cashdesk");
else print '<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="'.$langs->trans("CreditCard").'" onclick="javascript: verifClic(\'CB\');" />';
print '</div>';
print '<div class="inline-block" style="margin: 6px;">';
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CB']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] < 0)
if (empty($_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE']) || $_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] < 0)
{
$langs->load("errors");
print '<input class="bouton_mode_reglement_disabled" type="button" name="btnModeReglement" value="'.$langs->trans("CheckBank").'" title="'.dol_escape_htmltag($langs->trans("ErrorModuleSetupNotComplete")).'" />';

View File

@@ -38,7 +38,7 @@ $action=GETPOST('action','aZ09');
* Actions
*/
if (preg_match('/set_(.*)/',$action,$reg))
if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0)
@@ -52,7 +52,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
}
}
if (preg_match('/del_(.*)/',$action,$reg))
if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg))
{
$code=$reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0)

View File

@@ -674,7 +674,7 @@ if ($type == Categorie::TYPE_PROJECT)
{
print "\t".'<tr class="oddeven">'."\n";
print '<td class="nowrap" valign="top">';
print $project->getNomUrl(1,0);
print $project->getNomUrl(1);
print "</td>\n";
print '<td class="tdtop">'.$project->ref."</td>\n";
print '<td class="tdtop">'.$project->title."</td>\n";

View File

@@ -417,6 +417,7 @@ if ($action == 'update')
$object->location = GETPOST('location');
$object->socid = GETPOST("socid");
$socpeopleassigned = GETPOST("socpeopleassigned",'array');
$object->socpeopleassigned = array();
foreach ($socpeopleassigned as $cid) $object->socpeopleassigned[$cid] = array('id' => $cid);
$object->contactid = GETPOST("contactid",'int');
$object->fk_project = GETPOST("projectid",'int');
@@ -1244,8 +1245,13 @@ if ($id > 0)
if (! empty($object->fk_element) && ! empty($object->elementtype))
{
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print '<tr><td>'.$langs->trans("LinkedObject").'</td>';
print '<td>'.dolGetElementUrl($object->fk_element,$object->elementtype,1).'</td></tr>';
print '<tr>';
print '<td>'.$langs->trans("LinkedObject").'</td>';
print '<td>'.dolGetElementUrl($object->fk_element,$object->elementtype,1);
print '<input type="hidden" name="fk_element" value="'.$object->fk_element.'">';
print '<input type="hidden" name="elementtype" value="'.$object->elementtype.'">';
print '</td>';
print '</tr>';
}
// Description
@@ -1605,7 +1611,7 @@ if ($id > 0)
$var=true;
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

@@ -894,7 +894,7 @@ class ActionComm extends CommonObject
$val=array('id'=>$val);
}
$sql ="INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['manadatory'])?'0':$val['manadatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
$sql.=" VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory'])?'0':$val['mandatory']).", ".(empty($val['transparency'])?'0':$val['transparency']).", ".(empty($val['answer_status'])?'0':$val['answer_status']).")";
$resql = $this->db->query($sql);
if (! $resql)

View File

@@ -115,13 +115,17 @@ class AgendaEvents extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
if (empty($conf->societe->enabled)) $search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
$sql = "SELECT t.id as rowid";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
if (! empty($conf->societe->enabled))
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as t";
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
if (! empty($conf->societe->enabled))
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
$sql.= ' WHERE t.entity IN ('.getEntity('agenda').')';
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
if (! empty($conf->societe->enabled))
if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
if ($user_ids) $sql.=" AND t.fk_user_action IN (".$user_ids.")";
if ($socid > 0) $sql.= " AND t.fk_soc = ".$socid;
// Insert sale filter

View File

@@ -541,8 +541,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{
@@ -1260,7 +1260,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
$nextindextouse=count($colorindexused); // At first run this is 0, so first user has 0, next 1, ...
$nextindextouse=is_array($colorindexused)?count($colorindexused):0; // At first run this is 0, so fist user has 0, next 1, ...
//var_dump($colorindexused);
foreach ($eventarray as $daykey => $notused)

View File

@@ -44,7 +44,7 @@ $month=GETPOST("month",'int');
$day=GETPOST("day",'int');
$pid=GETPOST("projectid",'int',3);
$status=GETPOST("status",'alpha');
$type=GETPOST('type');
$type=GETPOST('type','alphanohtml');
$optioncss = GETPOST('optioncss','alpha');
// Set actioncode (this code must be same for setting actioncode into peruser, listacton and index)
if (GETPOST('actioncode','array'))
@@ -234,7 +234,7 @@ $sql.= ' a.fk_user_author,a.fk_user_action,';
$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";
$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 : '');
$sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
@@ -291,8 +291,8 @@ if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == '100') { $sql.= " AND a.percent = 100"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
if ($search_title) $sql.=natural_search("a.label", $search_title);
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
@@ -358,7 +358,7 @@ if ($resql)
//if ($actioncode) $nav.='<input type="hidden" name="actioncode" value="'.$actioncode.'">';
//if ($resourceid) $nav.='<input type="hidden" name="resourceid" value="'.$resourceid.'">';
if ($filter) $nav.='<input type="hidden" name="filter" value="'.$filter.'">';
if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
//if ($filtert) $nav.='<input type="hidden" name="filtert" value="'.$filtert.'">';
//if ($socid) $nav.='<input type="hidden" name="socid" value="'.$socid.'">';
if ($showbirthday) $nav.='<input type="hidden" name="showbirthday" value="1">';
//if ($pid) $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
@@ -606,9 +606,14 @@ if ($resql)
print '<td>';
if ($obj->fk_contact > 0)
{
$contactstatic->id=$obj->fk_contact;
$contactstatic->email=$obj->email;
$contactstatic->lastname=$obj->lastname;
$contactstatic->firstname=$obj->firstname;
$contactstatic->id=$obj->fk_contact;
$contactstatic->phone_pro=$obj->phone_pro;
$contactstatic->phone_mobile=$obj->phone_mobile;
$contactstatic->phone_perso=$obj->phone_perso;
$contactstatic->country_id=$obj->country_id;
print $contactstatic->getNomUrl(1,'',28);
}
else

View File

@@ -427,8 +427,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{

View File

@@ -453,8 +453,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable
if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; }
if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND (a.percent >= 0 AND a.percent < 100)"; }
// We must filter on assignement table
if ($filtert > 0 || $usergroup > 0)
{

View File

@@ -80,6 +80,7 @@ $originid = GETPOST('originid', 'int');
$confirm = GETPOST('confirm', 'alpha');
$lineid = GETPOST('lineid', 'int');
$contactid = GETPOST('contactid','int');
$projectid = GETPOST('projectid','int');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@@ -613,7 +614,7 @@ if (empty($reshook))
// Close proposal
else if ($action == 'setstatut' && $user->rights->propal->cloturer && ! GETPOST('cancel','alpha'))
{
if (! GETPOST('statut','int')) {
if (! (GETPOST('statut','int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
$action = 'statut';
} else {
@@ -1360,7 +1361,7 @@ if ($action == 'create')
}
$objectsrc->fetch_thirdparty();
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : '');
$projectid = (! empty($objectsrc->fk_project) ? $objectsrc->fk_project : 0);
$ref_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
@@ -1488,7 +1489,7 @@ if ($action == 'create')
// Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1);
print '</td></tr>';
}
@@ -1526,9 +1527,6 @@ if ($action == 'create')
// Project
if (! empty($conf->projet->enabled))
{
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
$langs->load("projects");
print '<tr>';
print '<td>' . $langs->trans("Project") . '</td><td>';

View File

@@ -12,6 +12,7 @@
* 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) 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
@@ -426,6 +427,7 @@ class Propal extends CommonObject
$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);
@@ -647,6 +649,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent);
$qty=price2num($qty);
$pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva = price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
@@ -1016,6 +1019,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);
}
@@ -1088,13 +1092,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)
{
@@ -1341,6 +1338,7 @@ class Propal extends CommonObject
$sql.= ", p.fk_shipping_method";
$sql.= ", p.fk_incoterms, p.location_incoterms";
$sql.= ", p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc";
$sql.= ", p.tms as date_modification";
$sql.= ", i.libelle as libelle_incoterms";
$sql.= ", c.label as statut_label";
$sql.= ", ca.code as availability_code, ca.label as availability";
@@ -1394,6 +1392,7 @@ class Propal extends CommonObject
$this->datev = $this->db->jdate($obj->datev); // TODO deprecated
$this->date_creation = $this->db->jdate($obj->datec); //Creation date
$this->date_validation = $this->db->jdate($obj->datev); //Validation date
$this->date_modification = $this->db->jdate($obj->date_modification); // tms
$this->date = $this->db->jdate($obj->dp); // Proposal date
$this->datep = $this->db->jdate($obj->dp); // deprecated
$this->fin_validite = $this->db->jdate($obj->dfv);
@@ -3937,7 +3936,7 @@ class PropaleLigne extends CommonObjectLine
$sql.= " ".price2num($this->localtax2_tx).",";
$sql.= " '".$this->db->escape($this->localtax1_type)."',";
$sql.= " '".$this->db->escape($this->localtax2_type)."',";
$sql.= " ".($this->subprice?price2num($this->subprice):"null").",";
$sql.= " ".(price2num($this->subprice)!==''?price2num($this->subprice):"null").",";
$sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".(isset($this->info_bits)?"'".$this->db->escape($this->info_bits)."'":"null").",";
$sql.= " ".price2num($this->total_ht).",";

View File

@@ -74,6 +74,8 @@ $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$viewstatut=GETPOST('viewstatut','alpha');
$optioncss = GETPOST('optioncss','alpha');
@@ -87,7 +89,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -283,7 +285,7 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).
if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet);
if ($search_refproject) $sql .= natural_search('pr.ref', $search_refproject);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
if ($search_login) $sql .= natural_search("u.login", $search_login);
@@ -379,6 +381,7 @@ if ($resql)
if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($socid > 0) $param.='&socid='.urlencode($socid);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_product_category != '') $param.='&search_product_category='.$search_product_category;
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';

View File

@@ -28,9 +28,9 @@
*/
/**
* \file htdocs/commande/card.php
* \file htdocs/commande/card.php
* \ingroup commande
* \brief Page to show customer order
* \brief Page to show customer order
*/
require '../main.inc.php';
@@ -76,6 +76,7 @@ $action = GETPOST('action', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$lineid = GETPOST('lineid', 'int');
$projectid = GETPOST('projectid', 'int');
$origin = GETPOST('origin', 'alpha');
$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
@@ -228,7 +229,7 @@ if (empty($reshook))
// Link to a project
else if ($action == 'classin' && $user->rights->commande->creer)
{
$object->setProject(GETPOST('projectid'));
$object->setProject(GETPOST('projectid','int'));
}
// Add order
@@ -259,8 +260,8 @@ if (empty($reshook))
$object->note_private = GETPOST('note_private','none');
$object->note_public = GETPOST('note_public','none');
$object->source = GETPOST('source_id');
$object->fk_project = GETPOST('projectid');
$object->ref_client = GETPOST('ref_client');
$object->fk_project = GETPOST('projectid','int');
$object->ref_client = GETPOST('ref_client','alpha');
$object->modelpdf = GETPOST('model');
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
@@ -1389,7 +1390,6 @@ if ($action == 'create' && $user->rights->commande->creer)
if ($socid > 0)
$res = $soc->fetch($socid);
$projectid = 0;
$remise_absolue = 0;
$currency_code = $conf->currency;
@@ -1486,7 +1486,6 @@ if ($action == 'create' && $user->rights->commande->creer)
$remise_percent = $soc->remise_percent;
$remise_absolue = 0;
$dateorder = empty($conf->global->MAIN_AUTOFILL_DATE_ORDER)?-1:'';
$projectid = 0;
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
@@ -1494,7 +1493,6 @@ if ($action == 'create' && $user->rights->commande->creer)
$note_public = $object->getDefaultCreateValueFor('note_public');
}
print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
print '<input type="hidden" name="action" value="add">';
@@ -1852,13 +1850,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value'
// => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse','int')?GETPOST('idwarehouse','int'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
@@ -1884,13 +1883,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value'
// => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
@@ -1925,13 +1925,14 @@ if ($action == 'create' && $user->rights->commande->creer)
$langs->load("stocks");
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value'
// => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"),
// 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
);
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1);

View File

@@ -1282,6 +1282,7 @@ class Commande extends CommonOrder
$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);
@@ -1676,10 +1677,11 @@ class Commande extends CommonOrder
// Retrieve all extrafields for invoice
// fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// $extrafields=new ExtraFields($this->db);
// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
// $this->fetch_optionals($this->id,$extralabels);
$this->fetch_optionals();
$this->db->free($result);
@@ -1881,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++;
@@ -2870,6 +2875,7 @@ class Commande extends CommonOrder
$qty=price2num($qty);
$pu = price2num($pu);
$pa_ht=price2num($pa_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2);
@@ -4063,7 +4069,7 @@ class OrderLine extends CommonOrderLine
$sql.= ' '.(! empty($this->fk_product)?$this->fk_product:"null").',';
$sql.= " '".$this->db->escape($this->product_type)."',";
$sql.= " '".price2num($this->remise_percent)."',";
$sql.= " ".($this->subprice!=''?"'".price2num($this->subprice)."'":"null").",";
$sql.= " ".(price2num($this->subprice)!==''?price2num($this->subprice):"null").",";
$sql.= " ".($this->price!=''?"'".price2num($this->price)."'":"null").",";
$sql.= " '".price2num($this->remise)."',";
$sql.= ' '.(! empty($this->fk_remise_except)?$this->fk_remise_except:"null").',';
@@ -4072,11 +4078,11 @@ class OrderLine extends CommonOrderLine
$sql.= ' '.(! empty($this->fk_fournprice)?$this->fk_fournprice:"null").',';
$sql.= ' '.price2num($this->pa_ht).',';
$sql.= " '".$this->db->escape($this->info_bits)."',";
$sql.= " '".price2num($this->total_ht)."',";
$sql.= " '".price2num($this->total_tva)."',";
$sql.= " '".price2num($this->total_localtax1)."',";
$sql.= " '".price2num($this->total_localtax2)."',";
$sql.= " '".price2num($this->total_ttc)."',";
$sql.= " ".price2num($this->total_ht).",";
$sql.= " ".price2num($this->total_tva).",";
$sql.= " ".price2num($this->total_localtax1).",";
$sql.= " ".price2num($this->total_localtax2).",";
$sql.= " ".price2num($this->total_ttc).",";
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").',';
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);

View File

@@ -75,6 +75,9 @@ $search_total_ht=GETPOST('search_total_ht','alpha');
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$viewstatut=GETPOST('viewstatut');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$search_project_ref=GETPOST('search_project_ref','alpha');
// Security check
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
@@ -88,7 +91,7 @@ $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) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
@@ -384,6 +387,7 @@ if ($resql)
$arrayofselected=is_array($toselect)?$toselect:array();
$param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if ($sall) $param.='&sall='.urlencode($sall);
@@ -401,12 +405,19 @@ if ($resql)
if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
if ($search_total_ht != '') $param.='&search_total_ht='.urlencode($search_total_ht);
if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat);
if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc);
if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref);
if ($search_total_vat != '') $param.='&search_total_vat='.urlencode($search_total_vat);
if ($search_total_ttc != '') $param.='&search_total_ttc='.urlencode($search_total_ttc);
if ($search_project_ref >= 0) $param.="&search_project_ref=".urlencode($search_project_ref);
if ($search_town != '') $param .= '&search_town='.urlencode($search_town);
if ($search_zip != '') $param .= '&search_zip='.urlencode($search_zip);
if ($search_state != '') $param .= '&search_state='.urlencode($search_state);
if ($search_country != '') $param .= '&search_country='.urlencode($search_country);
if ($search_type_thirdparty != '') $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category);
if ($show_files) $param.='&show_files=' .urlencode($show_files);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($billed != '') $param.='&billed='.urlencode($billed);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';

View File

@@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Andreu Bisquerra Gaya <jove@bisquerra.com>
* Copyright (C) 2012 David Rodriguez Martinez <davidrm146@gmail.com>
* Copyright (C) 2012-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@@ -285,6 +285,13 @@ if (($action == 'create' || $action == 'add') && !$error)
{
$fk_parent_line = 0;
}
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$array_options = $lines[$i]->array_options;
}
$result = $object->addline(
$desc,
$lines[$i]->subprice,
@@ -309,7 +316,8 @@ if (($action == 'create' || $action == 'add') && !$error)
$fk_parent_line,
$lines[$i]->fk_fournprice,
$lines[$i]->pa_ht,
$lines[$i]->label
$lines[$i]->label,
$array_options
);
if ($result > 0)
{

View File

@@ -384,7 +384,8 @@ if (dol_strlen($search_dv_start) > 0) $param .= '&search_start_dvmonth=' . GETPO
if (dol_strlen($search_dv_end) > 0) $param .= '&search_end_dvmonth=' . GETPOST('search_end_dvmonth', 'int') . '&search_end_dvday=' . GETPOST('search_end_dvday', 'int') . '&search_end_dvyear=' . GETPOST('search_end_dvyear', 'int');
if ($search_req_nb) $param.='&req_nb='.urlencode($search_req_nb);
if (GETPOST("search_thirdparty",'int')) $param.='&thirdparty='.urlencode(GETPOST("search_thirdparty",'int'));
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($action == 'reconcile') $param.='&action=reconcile';
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@@ -423,19 +424,17 @@ if ($id > 0 || ! empty($ref))
if ($action != 'reconcile')
{
//print '<div class="tabsAction">';
if ($object->canBeConciliated() > 0)
{
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate) {
$buttonreconcile = '<a class="butAction" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&search_conciliated=0'.$param.'">'.$langs->trans("Conciliate").'</a>';
$newparam = $param;
$newparam = preg_replace('/search_conciliated=\d+/i','',$newparam);
$buttonreconcile = '<a class="butAction" style="margin-bottom: 5px !important; margin-top: 5px !important" href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?action=reconcile&search_conciliated=0'.$newparam.'">'.$langs->trans("Conciliate").'</a>';
} else {
$buttonreconcile = '<a class="butActionRefused" style="margin-bottom: 5px !important; margin-top: 5px !important" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("Conciliate").'</a>';
}
}
//print '</div>';
}
}
else
@@ -455,7 +454,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql.= " FROM ";
if ($search_bid) $sql.= MAIN_DB_PREFIX."bank_class as l,";
if ($search_bid>0) $sql.= MAIN_DB_PREFIX."bank_class as l,";
$sql.= " ".MAIN_DB_PREFIX."bank_account as ba,";
$sql.= " ".MAIN_DB_PREFIX."bank as b";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_extrafields as ef on (b.rowid = ef.fk_object)";
@@ -993,12 +992,12 @@ if ($resql)
{
$tmpnbfieldbeforebalance=0;
$tmpnbfieldafterbalance=0;
$balancefieldfound=false;
$balancefieldfound=0;
foreach($arrayfields as $key => $val)
{
if ($key == 'balancebefore' || $key == 'balance')
{
$balancefieldfound=true;
$balancefieldfound++;
continue;
}
if (! empty($arrayfields[$key]['checked']))
@@ -1029,10 +1028,22 @@ if ($resql)
print '<td colspan="'.$tmpnbfieldbeforebalance.'">';
print '</td>';
}
print '<td align="right">';
print price(price2num($balance, 'MT'), 1, $langs);
if (! empty($arrayfields['balancebefore']['checked']))
{
print '<td align="right">';
print price(price2num($balance, 'MT'), 1, $langs);
print '</td>';
}
if (! empty($arrayfields['balance']['checked']))
{
print '<td align="right">';
print price(price2num($balance, 'MT'), 1, $langs);
print '</td>';
}
print '<td align="center">';
print '</td>';
print '<td colspan="'.($tmpnbfieldafterbalance+3).'">';
print '<td colspan="'.($tmpnbfieldafterbalance+2).'">';
print '</td>';
print '</tr>';
}
@@ -1457,7 +1468,7 @@ if ($resql)
elseif ($totalarray['totalcredfield'] == $i) print '<td align="right">'.price($totalarray['totalcred']).'</td>';
elseif ($i == $posconciliatecol)
{
print '<td>';
print '<td class="center">';
if ($user->rights->banque->consolidate && $action == 'reconcile') print '<input class="button" name="confirm_reconcile" type="submit" value="' . $langs->trans("Conciliate") . '">';
print '</td>';
}

View File

@@ -811,11 +811,11 @@ else
// Ref
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
print '<td><input size="8" type="text" class="flat" name="ref" value="'.(isset($_POST["ref"])?GETPOST("ref"):$object->ref).'"></td></tr>';
print '<td><input size="8" type="text" class="flat" name="ref" value="'.dol_escape_htmltag(isset($_POST["ref"])?GETPOST("ref"):$object->ref).'"></td></tr>';
// Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
print '<td><input type="text" class="flat minwidth300" name="label" value="'.(isset($_POST["label"])?GETPOST("label"):$object->label).'"></td></tr>';
print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(isset($_POST["label"])?GETPOST("label"):$object->label).'"></td></tr>';
// Type
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';

View File

@@ -332,7 +332,7 @@ class Account extends CommonObject
* @param int $fk_bank To search using bank transaction id
* @param int $url_id To search using link to
* @param string $type To search using type
* @return array|-1 Array of links or -1 on error
* @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
*/
function get_url($fk_bank='', $url_id='', $type='')
{

View File

@@ -435,6 +435,7 @@ if ($result)
// Type of payment / Number
print "<tr><td>".$langs->trans("Type")." / ".$langs->trans("Numero");
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
print "</td>";
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
@@ -457,22 +458,10 @@ if ($result)
}
print "</tr>";
// Bank of cheque
print "<tr><td>".$langs->trans("Bank")."</td>";
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<td>';
print '<input type="text" class="flat minwidth200" name="banque" value="'.(empty($objp->banque) ? '' : $objp->banque).'">';
print '</td>';
}
else
{
print '<td>'.$objp->banque.'</td>';
}
print "</tr>";
// Transmitter
print "<tr><td>".$langs->trans("CheckTransmitter")."</td>";
print "<tr><td>".$langs->trans("CheckTransmitter");
print ' <em>('.$langs->trans("ChequeMaker").')</em>';
print "</td>";
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<td>';
@@ -485,6 +474,22 @@ if ($result)
}
print "</tr>";
// Bank of cheque
print "<tr><td>".$langs->trans("Bank");
print ' <em>('.$langs->trans("ChequeBank").')</em>';
print "</td>";
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
{
print '<td>';
print '<input type="text" class="flat minwidth200" name="banque" value="'.(empty($objp->banque) ? '' : $objp->banque).'">';
print '</td>';
}
else
{
print '<td>'.$objp->banque.'</td>';
}
print "</tr>";
// Date ope
print '<tr><td>'.$langs->trans("DateOperation").'</td>';
if ($user->rights->banque->modifier || $user->rights->banque->consolidate)

View File

@@ -49,8 +49,8 @@ if ($action == 'add')
$dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int'));
$label = GETPOST('label','alpha');
$amount= GETPOST('amount');
$amountto= GETPOST('amountto');
$amount= GETPOST('amount','alpha');
$amountto= GETPOST('amountto','alpha');
if (! $label)
{
@@ -125,7 +125,7 @@ if ($action == 'add')
if (! $error)
{
$mesgs = $langs->trans("TransferFromToDone",'<a href="bankentries_list.php?id='.$accountfrom->id.'&sortfield=b.datev,b.dateo,b.rowid&sortorder=desc">'.$accountfrom->label."</a>",'<a href="bankentries_list.php?id='.$accountto->id.'">'.$accountto->label."</a>",$amount,$langs->transnoentities("Currency".$conf->currency));
$mesgs = $langs->trans("TransferFromToDone", '<a href="bankentries_list.php?id='.$accountfrom->id.'&sortfield=b.datev,b.dateo,b.rowid&sortorder=desc">'.$accountfrom->label."</a>", '<a href="bankentries_list.php?id='.$accountto->id.'">'.$accountto->label."</a>", $amount, $langs->transnoentities("Currency".$conf->currency));
setEventMessages($mesgs, null, 'mesgs');
$db->commit();
}
@@ -153,6 +153,12 @@ llxHeader();
print ' <script type="text/javascript">
$(document).ready(function () {
$(".selectbankaccount").change(function() {
console.log("We change bank account");
init_page();
});
function init_page() {
console.log("Set fields according to currency");
var account1 = $("#selectaccount_from").val();
var account2 = $("#selectaccount_to").val();
var currencycode1="";
@@ -199,7 +205,9 @@ print ' <script type="text/javascript">
}).fail(function( data ) {
console.error("Error: has returned an empty page. Should be an empty json array.");
});
});
}
init_page();
});
</script>';
@@ -210,12 +218,12 @@ $account_to='';
$label='';
$amount='';
if($error)
if ($error)
{
$account_from = GETPOST('account_from','int');
$account_to = GETPOST('account_to','int');
$label = GETPOST('label','alpha');
$amount = GETPOST('amount','int');
$amount = GETPOST('amount','alpha');
}
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'title_bank.png');
@@ -246,9 +254,9 @@ print "</td>\n";
print "<td>";
$form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
print "</td>\n";
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.$label.'"></td>';
print '<td><input name="amount" class="flat" type="text" size="6" value="'.$amount.'"></td>';
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.$amountto.'"></td>';
print '<td><input name="label" class="flat quatrevingtpercent" type="text" value="'.dol_escape_htmltag($label).'"></td>';
print '<td><input name="amount" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amount).'"></td>';
print '<td style="display:none" class="multicurrency"><input name="amountto" class="flat" type="text" size="6" value="'.dol_escape_htmltag($amountto).'"></td>';
print "</table>";

View File

@@ -349,7 +349,7 @@ if ($action == 'create')
print '<div class="center">';
print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
print ' &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '<input type="button" class="button" value="'.$langs->trans("Cancel").'" onclick="javascript:history.go(-1)">';
print '</div>';
print '</form>';

View File

@@ -12,7 +12,7 @@
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2014-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -189,13 +189,16 @@ if (empty($reshook))
$qualified_for_stock_change = $object->hasProductsOrServices(1);
}
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1');
exit();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
if ($object->is_erasable())
{
$result = $object->delete($user, 0, $idwarehouse);
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php?restore_lastsearch_values=1');
exit();
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
}
}
@@ -405,7 +408,7 @@ if (empty($reshook))
//var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit;
if ($discount->amount_ttc > $object->getRemainToPay(0))
if (price2num($discount->amount_ttc) > price2num($object->getRemainToPay(0)))
{
// TODO Split the discount in 2 automatically
$error++;
@@ -720,7 +723,6 @@ if (empty($reshook))
$sql.= ' WHERE pf.fk_facture = '.$object->id;
$sql.= ' AND pf.fk_paiement = p.rowid';
$sql.= ' AND p.entity IN (' . getEntity('facture').')';
$sql.= ' ORDER BY p.datep, p.tms';
$resql = $db->query($sql);
if (! $resql) dol_print_error($db);
@@ -1444,11 +1446,26 @@ if (empty($reshook))
$object->origin = $origin;
$object->origin_id = $originid;
foreach ($object->lines as &$line)
foreach ($object->lines as $i => &$line)
{
$line->origin = $object->origin;
$line->origin_id = $line->id;
$line->fetch_optionals($line->id);
// Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée
if ($line->fk_remise_except)
{
$discount=new DiscountAbsolute($line->db);
$result=$discount->fetch($line->fk_remise_except);
if ($result > 0)
{
// Check if discount not already affected to another invoice
if ($discount->fk_facture_line > 0)
{
$line->fk_remise_except = 0;
}
}
}
}
}
@@ -3047,13 +3064,14 @@ else if ($id > 0 || ! empty($ref))
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease");
$forcecombo=0;
if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
$formquestion = array(
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' =>
// 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
// => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"))));
// 'text' => $langs->trans("ConfirmClone"),
// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"), 0, $forcecombo))
);
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1);
} else {
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1);
@@ -4358,7 +4376,7 @@ else if ($id > 0 || ! empty($ref))
if ($objectidnext) {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseReplacedInvoice") . '">' . $langs->trans('DoPayment') . '</span></div>';
} else {
//if ($resteapayer == 0) {
//if ($resteapayer == 0) { // Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done)
// print '<div class="inline-block divButAction"><span class="butActionRefused" title="' . $langs->trans("DisabledBecauseRemainderToPayIsZero") . '">' . $langs->trans('DoPayment') . '</span></div>';
//} else {
print '<div class="inline-block divButAction"><a class="butAction" href="'. DOL_URL_ROOT .'/compta/paiement.php?facid=' . $object->id . '&amp;action=create&amp;accountid='.$object->fk_account.'">' . $langs->trans('DoPayment') . '</a></div>';
@@ -4391,7 +4409,7 @@ else if ($id > 0 || ! empty($ref))
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&amp;action=converttoreduc">' . $langs->trans('ConvertToReduc') . '</a></div>';
}
// For deposit invoice
if ($object->type == Facture::TYPE_DEPOSIT && $user->rights->facture->creer && empty($discount->id))
if ($object->type == Facture::TYPE_DEPOSIT && $user->rights->facture->creer && $object->statut > 0 && empty($discount->id))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'&amp;action=converttoreduc">'.$langs->trans('ConvertToReduc').'</a></div>';
}

View File

@@ -973,6 +973,7 @@ class FactureRec extends CommonInvoice
$sql.= " AND (date_when IS NULL OR date_when <= '".$db->idate($today)."')";
$sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)';
$sql.= ' AND suspended = 0';
$sql.= ' AND entity = '.$conf->entity; // MUST STAY = $conf->entity here
$sql.= $db->order('entity', 'ASC');
//print $sql;exit;
@@ -987,7 +988,7 @@ class FactureRec extends CommonInvoice
$saventity = $conf->entity;
while ($i < $num) // Loop on each template invoice
while ($i < $num) // Loop on each template invoice. If $num = 0, test is false at first pass.
{
$line = $db->fetch_object($resql);
@@ -996,49 +997,59 @@ class FactureRec extends CommonInvoice
$facturerec = new FactureRec($db);
$facturerec->fetch($line->rowid);
// Set entity context
$conf->entity = $facturerec->entity;
if ($facturerec->id > 0)
{
// Set entity context
$conf->entity = $facturerec->entity;
dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity);
dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity);
$error=0;
$error=0;
$facture = new Facture($db);
$facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice
$facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice
$facture = new Facture($db);
$facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice
$facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice
$facture->type = self::TYPE_STANDARD;
$facture->brouillon = 1;
$facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later.
$facture->socid = $facturerec->socid;
$facture->type = self::TYPE_STANDARD;
$facture->brouillon = 1;
$facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later.
$facture->socid = $facturerec->socid;
$invoiceidgenerated = $facture->create($user);
if ($invoiceidgenerated <= 0)
{
$this->errors = $facture->errors;
$this->error = $facture->error;
$error++;
}
if (! $error && $facturerec->auto_validate)
{
$result = $facture->validate($user);
if ($result <= 0)
{
$this->errors = $facture->errors;
$this->error = $facture->error;
$error++;
}
}
if (! $error && $facturerec->generate_pdf)
{
$result = $facture->generateDocument($facturerec->modelpdf, $langs);
if ($result <= 0)
{
$this->errors = $facture->errors;
$this->error = $facture->error;
$error++;
}
}
$invoiceidgenerated = $facture->create($user);
if ($invoiceidgenerated <= 0)
{
$this->errors = $facture->errors;
$this->error = $facture->error;
$error++;
}
if (! $error && $facturerec->auto_validate)
{
$result = $facture->validate($user);
if ($result <= 0)
{
$this->errors = $facture->errors;
$this->error = $facture->error;
$error++;
}
}
if (! $error && $facturerec->generate_pdf)
{
$result = $facture->generateDocument($facturerec->modelpdf, $langs);
if ($result <= 0)
{
$this->errors = $facture->errors;
$this->error = $facture->error;
$error++;
}
}
}
else
{
$error++;
$this->error="Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n";
$this->errors[]="Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity;
dol_syslog("createRecurringInvoices Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity);
}
if (! $error && $invoiceidgenerated >= 0)
{

View File

@@ -15,6 +15,7 @@
* Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
*
* 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
@@ -746,10 +747,16 @@ class Facture extends CommonInvoice
}
else if ($reshook < 0) $error++;*/
// Call trigger
$result=$this->call_trigger('BILL_CREATE',$user);
if ($result < 0) $error++;
// End call triggers
if (! $error)
{
if (! $notrigger)
{
// Call trigger
$result=$this->call_trigger('BILL_CREATE',$user);
if ($result < 0) $error++;
// End call triggers
}
}
if (! $error)
{
@@ -1346,10 +1353,12 @@ class Facture extends CommonInvoice
// Retrieve all extrafield for invoice
// fetch optionals attributes and labels
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
$this->fetch_optionals($this->id,$extralabels);
// require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// $extrafields=new ExtraFields($this->db);
// $extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
// $this->fetch_optionals($this->id,$extralabels);
$this->fetch_optionals();
/*
* Lines
@@ -1470,7 +1479,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;
@@ -2599,6 +2608,7 @@ class Facture extends CommonInvoice
$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);
@@ -2822,6 +2832,7 @@ class Facture extends CommonInvoice
$remise_percent = price2num($remise_percent);
$qty = price2num($qty);
$pu = price2num($pu);
$pu_ht_devise = price2num($pu_ht_devise);
$pa_ht = price2num($pa_ht);
$txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1);
@@ -3973,9 +3984,10 @@ class Facture extends CommonInvoice
* @param int $hidedetails Hide details of lines
* @param int $hidedesc Hide description
* @param int $hideref Hide ref
* @param null|array $moreparams Array to provide more information
* @return int <0 if KO, >0 if OK
*/
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
public function generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{
global $conf,$langs;
@@ -3994,7 +4006,7 @@ class Facture extends CommonInvoice
$modelpath = "core/modules/facture/doc/";
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
}
/**
@@ -4803,7 +4815,7 @@ class FactureLigne extends CommonInvoiceLine
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
return $res['situation_percent'];
return floatval($res['situation_percent']);
} 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

@@ -43,10 +43,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
$langs->load('bills');
$langs->load('compta');
$langs->load('admin');
$langs->load('other');
$langs->loadLangs(array('bills','compta','admin','other','products'));
$action = GETPOST('action','alpha');
$massaction = GETPOST('massaction','alpha');
@@ -1518,7 +1515,7 @@ else
}
print '</td></tr>';
// Date when
// Date when (next invoice generation)
print '<tr><td>';
if ($action == 'date_when' || $object->frequency > 0)
{
@@ -1534,7 +1531,14 @@ else
print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached');
}
//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
if (! $object->isMaxNbGenReached())
{
if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
}
else
{
print img_info($langs->trans("MaxNumberOfGenerationReached"));
}
print '</td>';
print '</tr>';

View File

@@ -598,11 +598,18 @@ if ($resql)
// Date next generation
if (! empty($arrayfields['f.date_when']['checked']))
{
print '<td align="center">';
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'<strike>':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'</strike>':'') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
print '</td>';
if (! $i) $totalarray['nbfield']++;
print '<td align="center">';
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'<strike>':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'</strike>':'') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
if (! $invoicerectmp->isMaxNbGenReached())
{
if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
}
else
{
print img_info($langs->trans("MaxNumberOfGenerationReached"));
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['f.datec']['checked']))
{
@@ -629,7 +636,11 @@ if ($resql)
print '<td align="center">';
if ($user->rights->facture->creer && empty($invoicerectmp->suspended))
{
if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today)
if ($invoicerectmp->isMaxNbGenReached())
{
print $langs->trans("MaxNumberOfGenerationReached");
}
elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today)
{
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';
print $langs->trans("CreateBill").'</a>';

View File

@@ -89,12 +89,14 @@ $search_country=GETPOST("search_country",'int');
$search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
$search_user = GETPOST('search_user','int');
$search_sale = GETPOST('search_sale','int');
$day = GETPOST('day','int');
$month = GETPOST('month','int');
$year = GETPOST('year','int');
$day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$search_day = GETPOST('search_day','int');
$search_month = GETPOST('search_month','int');
$search_year = GETPOST('search_year','int');
$search_day_lim = GETPOST('search_day_lim','int');
$search_month_lim = GETPOST('search_month_lim','int');
$search_year_lim = GETPOST('search_year_lim','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$option = GETPOST('option');
if ($option == 'late') {
@@ -106,7 +108,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
if (! $sortorder) $sortorder='DESC';
@@ -219,14 +221,14 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','a
$search_type='';
$search_country='';
$search_type_thirdparty='';
$day='';
$year='';
$month='';
$search_day='';
$search_year='';
$search_month='';
$option='';
$filter='';
$day_lim='';
$year_lim='';
$month_lim='';
$search_day_lim='';
$search_year_lim='';
$search_month_lim='';
$toselect='';
$search_array_options=array();
}
@@ -444,31 +446,31 @@ if ($search_status != '' && $search_status >= 0)
if ($search_status == '3') $sql.=" AND f.fk_statut = 3"; // abandonned
}
if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode);
if ($month > 0)
if ($search_month > 0)
{
if ($year > 0 && empty($day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'";
else if ($year > 0 && ! empty($day))
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'";
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, $search_year))."'";
else
$sql.= " AND date_format(f.datef, '%m') = '".$month."'";
}
else if ($year > 0)
else if ($search_year > 0)
{
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'";
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
}
if ($month_lim > 0)
if ($search_month_lim > 0)
{
if ($year_lim > 0 && empty($day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,$month_lim,false))."' AND '".$db->idate(dol_get_last_day($year_lim,$month_lim,false))."'";
else if ($year_lim > 0 && ! empty($day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month_lim, $day_lim, $year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month_lim, $day_lim, $year_lim))."'";
if ($search_year_lim > 0 && empty($search_day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($search_year_lim,$search_month_lim,false))."' AND '".$db->idate(dol_get_last_day($search_year_lim,$search_month_lim,false))."'";
else if ($search_year_lim > 0 && ! empty($search_day_lim))
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_lim, $search_day_lim, $search_year_lim))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_lim, $search_day_lim, $search_year_lim))."'";
else
$sql.= " AND date_format(f.date_lim_reglement, '%m') = '".$db->escape($month_lim)."'";
$sql.= " AND date_format(f.date_lim_reglement, '%m') = '".$db->escape($search_month_lim)."'";
}
else if ($year_lim > 0)
else if ($search_year_lim > 0)
{
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($year_lim,12,false))."'";
$sql.= " AND f.date_lim_reglement BETWEEN '".$db->idate(dol_get_first_day($search_year_lim,1,false))."' AND '".$db->idate(dol_get_last_day($search_year_lim,12,false))."'";
}
if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'";
if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale;
@@ -539,29 +541,31 @@ if ($resql)
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($sall) $param.='&sall='.urlencode($sall);
if ($day) $param.='&day='.urlencode($day);
if ($month) $param.='&month='.urlencode($month);
if ($year) $param.='&year=' .urlencode($year);
if ($day_lim) $param.='&day_lim='.urlencode($day_lim);
if ($month_lim) $param.='&month_lim='.urlencode($month_lim);
if ($year_lim) $param.='&year_lim=' .urlencode($year_lim);
if ($search_day) $param.='&search_day='.urlencode($search_day);
if ($search_month) $param.='&search_month='.urlencode($search_month);
if ($search_year) $param.='&search_year=' .urlencode($search_year);
if ($search_day_lim) $param.='&search_day_lim='.urlencode($search_day_lim);
if ($search_month_lim) $param.='&search_month_lim='.urlencode($search_month_lim);
if ($search_year_lim) $param.='&search_year_lim=' .urlencode($search_year_lim);
if ($search_ref) $param.='&search_ref=' .urlencode($search_ref);
if ($search_refcustomer) $param.='&search_refcustomer=' .urlencode($search_refcustomer);
if ($search_type != '') $param.='&search_type='.urlencode($search_type);
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
if ($search_town) $param.='&search_town='.urlencode($search_town);
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 ($show_files) $param.='&show_files=' .$show_files;
if ($option) $param.="&option=".$option;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($show_files) $param.='&show_files=' .urlencode($show_files);
if ($option) $param.="&option=".urlencode($option);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
@@ -702,18 +706,18 @@ if ($resql)
if (! empty($arrayfields['f.date']['checked']))
{
print '<td class="liste_titre nowraponall" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day" value="'.dol_escape_htmltag($day).'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.dol_escape_htmltag($month).'">';
$formother->select_year($year?$year:-1,'year',1, 20, 5, 0, 0, '', 'width75');
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.dol_escape_htmltag($search_day).'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.dol_escape_htmltag($search_month).'">';
$formother->select_year($search_year?$search_year:-1,'search_year',1, 20, 5, 0, 0, '', 'width75');
print '</td>';
}
// Date due
if (! empty($arrayfields['f.date_lim_reglement']['checked']))
{
print '<td class="liste_titre nowraponall" align="center">';
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="day_lim" value="'.dol_escape_htmltag($day_lim).'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="month_lim" value="'.dol_escape_htmltag($month_lim).'">';
$formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5, 0, 0, '', 'width75');
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day_lim" value="'.dol_escape_htmltag($search_day_lim).'">';
print '<input class="flat" type="text" size="1" maxlength="2" name="search_month_lim" value="'.dol_escape_htmltag($search_month_lim).'">';
$formother->select_year($search_year_lim?$search_year_lim:-1,'search_year_lim',1, 20, 5, 0, 0, '', 'width75');
print '<br><input type="checkbox" name="option" value="late"'.($option == 'late'?' checked':'').'> '.$langs->trans("Late");
print '</td>';
}
@@ -872,7 +876,8 @@ if ($resql)
print "</tr>\n";
$projectstatic=new Project($db);
$discount = new DiscountAbsolute($db);
if ($num > 0)
{
$i=0;
@@ -886,6 +891,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;
@@ -905,7 +913,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

@@ -45,14 +45,14 @@ if ($year == 0)
// Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
if ($user->societe_id)
if ($user->societe_id)
$socid=$user->societe_id;
$result = restrictedArea($user, 'tax', '', '', 'charges');
// Define modetax (0 or 1)
// 0=normal, 1=option vat for services is on debit
$modetax = $conf->global->TAX_MODE;
if (isset($_GET["modetax"]))
if (isset($_GET["modetax"]))
$modetax=$_GET["modetax"];
/**
@@ -81,7 +81,7 @@ function pt ($db, $sql, $date)
$var=True;
while ($i < $num) {
$obj = $db->fetch_object($result);
print '<tr class="oddeven">';
print '<td class="nowrap">'.$obj->dm."</td>\n";
$total = $total + $obj->mm;
@@ -166,16 +166,16 @@ $var=True;
$total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
$i=0;
for ($m = 1 ; $m < 13 ; $m++ ) {
$coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m);
$coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m);
$coll_listsell = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m);
$coll_listbuy = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m);
$action = "tva";
$object = array(&$coll_listsell, &$coll_listbuy);
$parameters["mode"] = $modetax;
$parameters["year"] = $y;
$parameters["month"] = $m;
$parameters["type"] = 'localtax'.$localTaxType;
// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('externalbalance'));
$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
@@ -190,7 +190,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
break;
}
print '<tr class="oddeven">';
print '<td class="nowrap">'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>';
if($CalcLT==0) {
@@ -221,7 +221,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
}
$subtotalcoll = $subtotalcoll + $x_coll;
print "<td class=\"nowrap\" align=\"right\">".price($x_coll)."</td><td></td>";
}
if($CalcLT==0) {
@@ -231,7 +231,7 @@ for ($m = 1 ; $m < 13 ; $m++ ) {
} elseif($CalcLT==2) {
$diff= $x_coll;
}
$total = $total + $diff;
$subtotal = $subtotal + $diff;

View File

@@ -94,7 +94,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.accountancy_journal,";
$sql.= " ba.ref, 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";
@@ -130,6 +130,7 @@ if ($resql)
$accountstatic->currency_code=$objp->currency_code;
$accountstatic->account_number=$objp->account_number;
$accountstatic->accountancy_journal=$objp->code;
$accountstatic->fk_accountancy_journal=$objp->fk_accountancy_journal;
print '<tr class="oddeven">'."\n";

View File

@@ -6,6 +6,7 @@
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -288,39 +289,40 @@ class Paiement extends CommonObject
{
$amount_ht = $amount_tva = $amount_ttc = array();
// Loop on each vat rate
$i = 0;
foreach ($invoice->lines as $line)
{
if ($line->total_ht!=0)
{ // no need to create discount if amount is null
$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 ++;
}
}
// Insert one discount by VAT rate category
$discount = new DiscountAbsolute($this->db);
$discount->fetch('',$invoice->id);
if (empty($discount->id)) { // If the invoice was not yet converted into a discount (this may have been done manually before we come here)
// Insert one discount by VAT rate category
$discount = new DiscountAbsolute($this->db);
$discount->description = '(DEPOSIT)';
$discount->fk_soc = $invoice->socid;
$discount->fk_facture_source = $invoice->id;
foreach ($amount_ht as $tva_tx => $xxx)
{
$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->tva_tx = abs($tva_tx);
$discount->description = '(DEPOSIT)';
$discount->fk_soc = $invoice->socid;
$discount->fk_facture_source = $invoice->id;
$result = $discount->create($user);
if ($result < 0)
{
$error++;
break;
}
}
// Loop on each vat rate
$i = 0;
foreach ($invoice->lines as $line) {
if ($line->total_ht != 0) { // no need to create discount if amount is null
$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++;
}
}
foreach ($amount_ht as $tva_tx => $xxx) {
$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->tva_tx = abs($tva_tx);
$result = $discount->create($user);
if ($result < 0) {
$error++;
break;
}
}
}
if ($error)
{

View File

@@ -47,7 +47,10 @@ $result = restrictedArea($user, 'prelevement', '', '', 'bons');
$action = GETPOST('action','alpha');
$mode = GETPOST('mode','alpha')?GETPOST('mode','alpha'):'real';
$format = GETPOST('format','aZ09');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$page = GETPOST("page",'int');
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
/*
* Actions
@@ -196,13 +199,33 @@ $sql.= " AND pfd.traite = 0";
$sql.= " AND pfd.fk_facture = f.rowid";
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
}
$sql.= $db->plimit($limit+1,$offset);
$resql=$db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print load_fiche_titre($langs->trans("InvoiceWaitingWithdraw").($num > 0?' ('.$num.')':''),'','');
$param='';
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
if($socid) $param .= '&socid='.urlencode($socid);
if($option) $param .= "&option=".urlencode($option);
if(! empty($page) && $num <= $nbtotalofrecords) $page = 0;
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print_barre_liste($langs->trans("InvoiceWaitingWithdraw"),$page,$_SERVER['PHP_SELF'],$param,'','','',$num,$nbtotalofrecords,'title_accountancy.png',0,'','', $limit);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
@@ -219,7 +242,7 @@ if ($resql)
require_once DOL_DOCUMENT_ROOT . '/societe/class/companybankaccount.class.php';
$bac = new CompanyBankAccount($db);
while ($i < $num && $i < 20)
while ($i < $num && $i < $limit)
{
$obj = $db->fetch_object($resql);
@@ -260,6 +283,7 @@ if ($resql)
}
else print '<tr '.$bc[0].'><td colspan="5" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print "</table>";
print "</form>";
print "<br>\n";
}
else

View File

@@ -61,6 +61,9 @@ $arrayfields=array(
//...
);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('supplierbalencelist','globalcard'));
/*
* Actions
*/
@@ -100,7 +103,7 @@ if ($id > 0)
// Invoice list
print load_fiche_titre($langs->trans("CustomerPreview"));
print '<table class="noborder" width="100%">';
print '<table class="noborder tagtable liste" width="100%">';
print '<tr class="liste_titre">';
if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'],$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
print '<td>'.$langs->trans("Element").'</td>';
@@ -253,13 +256,18 @@ if ($id > 0)
if (!empty($data['fk_facture'])) print dol_print_date($data['date'],'day');
elseif (!empty($data['fk_paiement'])) print dol_print_date($data['date'],'dayhour');
print "</td>\n";
print '<td>'.$data['link']."</td>\n";
print '<td aling="left">'.$data['status'].'</td>';
print '<td align="right">'.(($data['amount'] > 0) ? price(abs($data['amount'])) : '')."</td>\n";
$totalDebit += ($data['amount'] > 0) ? abs($data['amount']) : 0;
print '<td align="right">'.(($data['amount'] > 0) ? '' : price(abs($data['amount'])))."</td>\n";
$totalCredit += ($data['amount'] > 0) ? 0 : abs($data['amount']);
// Balance
print '<td align="right">'.price($data['balance'])."</td>\n";

View File

@@ -107,13 +107,13 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
}
// $date_start and $date_end are defined. We force $start_year and $nbofyear
// $date_start and $date_end are defined. We force $year_start and $nbofyear
$tmps=dol_getdate($date_start);
$start_year = $tmps['year'];
$year_start = $tmps['year'];
$tmpe=dol_getdate($date_end);
$year_end = $tmpe['year'];
$nbofyear = ($year_end - $start_year) + 1;
//var_dump($start_year." ".$end_year." ".$nbofyear);
//var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour'));
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING')
$modecompta = $conf->global->ACCOUNTING_MODE;
@@ -253,8 +253,8 @@ if ($modecompta == 'BOOKKEEPING')
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as f";
$sql.= ", ".MAIN_DB_PREFIX."accounting_account as aa";
$sql.= " WHERE f.numero_compte = aa.account_number";
//$sql.= " AND fk_statut in (1,2)";
$sql.= " AND ".$predefinedgroupwhere;
$sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
$sql.= " AND f.entity = ".$conf->entity;
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'";
@@ -295,7 +295,7 @@ if ($modecompta == 'BOOKKEEPING')
if ($showaccountdetail != 'no')
{
$tmppredefinedgroupwhere="pcg_type = '".$db->escape($objp->pcg_type)."' AND pcg_subtype = '".$db->escape($objp->pcg_subtype)."'";
$tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$charofaccountstring."'";
$tmppredefinedgroupwhere.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
//$tmppredefinedgroupwhere.= " AND thirdparty_code = '".$db->escape($objp->name)."'";
// Get cpts of category/group
@@ -312,7 +312,7 @@ if ($modecompta == 'BOOKKEEPING')
}
if ($showaccountdetail == 'all' || $resultN > 0)
if ($showaccountdetail == 'all' || $resultN <> 0)
{
print '<tr>';
print '<td></td>';

View File

@@ -85,13 +85,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end
if ($q==4) { $date_start=dol_get_first_day($year_start,10,false); $date_end=dol_get_last_day($year_start,12,false); }
}
// $date_start and $date_end are defined. We force $start_year and $nbofyear
// $date_start and $date_end are defined. We force $year_start and $nbofyear
$tmps=dol_getdate($date_start);
$start_year = $tmps['year'];
$year_start = $tmps['year'];
$tmpe=dol_getdate($date_end);
$year_end = $tmpe['year'];
$nbofyear = ($year_end - $start_year) + 1;
//var_dump($start_year." ".$end_year." ".$nbofyear);
//var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour'));
// Security check
$socid = GETPOST('socid','int');
@@ -376,7 +377,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -409,7 +409,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -443,7 +442,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -474,7 +472,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -537,7 +534,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -600,7 +596,6 @@ if (! empty($conf->tax->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
$result=$db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -647,7 +642,6 @@ if (! empty($conf->salaries->enabled) && ($modecompta == 'CREANCES-DETTES' || $m
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$var = false;
$i = 0;
if ($num) {
while ($i < $num) {
@@ -775,7 +769,6 @@ if (! empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modeco
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
@@ -810,32 +803,35 @@ elseif ($modecompta == 'BOOKKEEPING') {
if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
{
$subtotal_ht = 0;
$subtotal_ttc = 0;
$predefinedgroupwhere = "(";
//$predefinedgroupwhere.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
$predefinedgroupwhere.= " (pcg_type = 'EXPENSE')";
$predefinedgroupwhere.= " OR ";
//$predefinedgroupwhere.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
$predefinedgroupwhere.= " (pcg_type = 'INCOME')";
$predefinedgroupwhere.= ")";
$charofaccountstring = $conf->global->CHARTOFACCOUNTS;
$charofaccountstring=dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version');
$sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa";
$sql.= " WHERE b.numero_compte = aa.account_number AND b.entity = ".$conf->entity;
//$sql.= " AND fk_statut in (1,2)";
$sql.= " AND (";
//$sql.= " (pcg_type = 'EXPENSE' and pcg_subtype in ('PRODUCT','SERVICE'))";
$sql.= " (pcg_type = 'EXPENSE')";
$sql.= " OR ";
//$sql.= " (pcg_type = 'INCOME' and pcg_subtype in ('PRODUCT','SERVICE'))";
$sql.= " (pcg_type = 'INCOME')";
$sql.= ")";
//$sql.= " AND code_journal in ('VT', 'AC')";
$sql.= " AND ".$predefinedgroupwhere;
$sql.= " AND fk_pcg_version = '".$db->escape($charofaccountstring)."'";
if (! empty($date_start) && ! empty($date_end))
$sql.= " AND b.doc_date >= '".$db->idate($date_start)."' AND b.doc_date <= '".$db->idate($date_end)."'";
$sql.= " GROUP BY b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, pcg_type, dm";
//print $sql;
$subtotal_ht = 0;
$subtotal_ttc = 0;
dol_syslog("get bookkeeping record");
$result=$db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$var=false;
$i = 0;
if ($num)
{
@@ -845,9 +841,8 @@ if (! empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING'))
if (! isset($encaiss[$obj->dm])) $encaiss[$obj->dm]=0;
$encaiss[$obj->dm] += $obj->debit;
if (! isset($encaiss_ttc[$obj->dm])) $encaiss_ttc[$obj->dm]=0;
$encaiss_ttc[$obj->dm] += $obj->credit;
$encaiss_ttc[$obj->dm] += 0;
$i++;
}
@@ -908,7 +903,6 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
}
print '</tr>';
$var=True;
// Loop on each month
$nb_mois_decalage = $conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START-1):0;
@@ -926,21 +920,44 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
$case = strftime("%Y-%m",dol_mktime(12,0,0,$mois_modulo,1,$annee_decalage));
print '<td align="right">&nbsp;';
if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0)
if ($modecompta == 'BOOKKEEPING')
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($decaiss_ttc[$case],'MT')).'</a>';
if (! isset($totsorties[$annee])) $totsorties[$annee]=0;
$totsorties[$annee]+=$decaiss_ttc[$case];
if (isset($decaiss[$case]) && $decaiss[$case] != 0)
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($decaiss[$case],'MT')).'</a>';
if (! isset($totsorties[$annee])) $totsorties[$annee]=0;
$totsorties[$annee]+=$decaiss[$case];
}
}
else
{
if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0)
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($decaiss_ttc[$case],'MT')).'</a>';
if (! isset($totsorties[$annee])) $totsorties[$annee]=0;
$totsorties[$annee]+=$decaiss_ttc[$case];
}
}
print "</td>";
print '<td align="right" class="borderrightlight">&nbsp;';
//if (isset($encaiss_ttc[$case]) && $encaiss_ttc[$case] != 0)
if (isset($encaiss_ttc[$case]))
if ($modecompta == 'BOOKKEEPING')
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss_ttc[$case],'MT')).'</a>';
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;
$totentrees[$annee]+=$encaiss_ttc[$case];
if (isset($encaiss[$case]))
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss[$case],'MT')).'</a>';
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;
$totentrees[$annee]+=$encaiss[$case];
}
}
else
{
if (isset($encaiss_ttc[$case]))
{
print '<a href="clientfourn.php?year='.$annee_decalage.'&month='.$mois_modulo.($modecompta?'&modecompta='.$modecompta:'').'">'.price(price2num($encaiss_ttc[$case],'MT')).'</a>';
if (! isset($totentrees[$annee])) $totentrees[$annee]=0;
$totentrees[$annee]+=$encaiss_ttc[$case];
}
}
print "</td>";
}
@@ -951,7 +968,10 @@ for ($mois = 1+$nb_mois_decalage ; $mois <= 12+$nb_mois_decalage ; $mois++)
// Total
$nbcols=0;
print '<tr class="liste_total impair"><td>'.$langs->trans("TotalTTC").'</td>';
print '<tr class="liste_total impair"><td>';
if ($modecompta == 'BOOKKEEPING') print $langs->trans("Total");
else print $langs->trans("TotalTTC");
print '</td>';
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
{
$nbcols+=2;

View File

@@ -144,8 +144,8 @@ $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
$i=0;
for ($m = 1 ; $m < 13 ; $m++ )
{
$coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m);
$coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m);
$coll_listsell = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'sell', $m);
$coll_listbuy = tax_by_date('vat', $db, $y, 0, 0, 0, $modetax, 'buy', $m);
$action = "tva";
$object = array(&$coll_listsell, &$coll_listbuy);

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