2
0
forked from Wavyzz/dolibarr

Compare commits

..

835 Commits
6.0.2 ... 6.0.8

Author SHA1 Message Date
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
Frédéric FRANCE
c3f07dd2e0 define $code for all execution paths 2018-10-09 19:28:52 +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
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
Marc de Lima Lucio
82651cd920 FIX: invoice stats: situation invoices were not counted 2018-10-05 12:12:04 +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
atm-greg
583ea05567 fix missing letter... 2018-10-03 12:13:53 +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
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
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
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
d15c52db3b Update rssparser.class.php 2018-09-25 08:16:05 +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
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
gauthier
d62118dca8 FIX : langs fr 2018-09-19 14:53:56 +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
cdbb79a26c correct typo in multicurrency doc pdf 2018-09-19 09:26:56 +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
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
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
e0b272941f Fix mariadb 2018-09-02 15:25:27 +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
179feebd80 Merge pull request #9347 from atm-greg/fix_getLabelOfUnit
remove useless db begin
2018-09-01 12:34:43 +02:00
atm-greg
f8fef61075 remove useless db begin 2018-08-30 09:19:44 +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
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
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
53e476483c Build Badge for 6.0 2018-08-28 09:38:24 +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
Frédéric FRANCE
b1a3238c94 Build badge for 5.0 2018-08-21 14:22:29 +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
e03d7eba8c Merge pull request #9254 from frederic34/patch-17
Build Badge by branch
2018-08-21 12:48:23 +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
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
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
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
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
florian HENRY
06189f8153 Merge branch '6.0' into 6.0_fhe 2018-08-09 18:31:59 +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
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
Juanjo Menent
2cf51fbdf1 Merge pull request #9173 from frederic34/patch-22
fix #8820
2018-08-02 11:08:47 +02:00
florian HENRY
ceb85cfa45 fix : odt project and task extrafields management 2018-07-31 17:29:08 +02:00
John BOTELLA
4ddca02bb9 fix situation line's total 2018-07-31 14:58:33 +02:00
Frédéric FRANCE
7dada7ae8e fix #8820 2018-07-29 09:15:42 +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
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
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
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
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
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
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
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
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
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
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
dab264c641 Merge pull request #8994 from hregis/6.0_multicompany
Fix: to avoid deleting line breaks
2018-06-22 15:00:26 +02:00
Regis Houssin
8fc2f7441c Fix: to avoid deleting line breaks 2018-06-20 09:06: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
gauthier
fed61930d5 FIX : clause must not be there 2018-06-18 11:37:15 +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
altatof
5d6cd381b9 Fix <br/> detection 2018-06-15 15:59:14 +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
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
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
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
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
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
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
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
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
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
60321aabd8 Fix regression 2018-05-30 11:59:23 +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
florian HENRY
b65b545e0f add hook on balence pages 2018-05-29 16:29:14 +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
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
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
atm-quentin
eb224e43a5 FIX missing filters during ordering 2018-05-24 10:41:24 +02:00
ATM-Nicolas
734ecbc9b5 FIX : Fetch shipping will now fetch project id 2018-05-23 09:47:29 +02:00
Laurent Destailleur
be21405d21 Fix missing error message 2018-05-22 19:24:56 +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
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
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
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
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
2e9f5d1c94 Merge pull request #8798 from atm-florian/6.0
fix SQL and add hook
2018-05-18 11:18:10 +02:00
John
3dd11e1eaf Fix discount id 2018-05-18 11:02:04 +02:00
Juanjo Menent
dd259043cd Fix: Cashdesk does not apply multi-price or price per customer 2018-05-18 09:20:18 +02:00
Juanjo Menent
dc7a1610e7 Fix: extrafiels is not passing orders to invoice 2018-05-17 18:56:01 +02:00
florian HENRY
630e38072b fix SQL and add hook 2018-05-15 17:02:54 +02:00
John
b42c87256c Fix_situation_discount_used 2018-05-14 14:55:33 +02:00
Laurent Destailleur
842c6168a2 FIX #8762 2018-05-10 11:50:35 +02:00
Laurent Destailleur
20c50e809d Start 6.0.8 2018-05-06 10:43:40 +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
b958311819 Prepare 6.0.7 2018-05-05 20:25:06 +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
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
atm-arnaud
6245f25deb FIX label in getnomurl projectlist 2018-05-03 11:47:31 +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
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
ab85fa8721 Backport EXPENSEREPORT_ALLOW_OVERLAPPING_PERIODS to solve blocking
situation.
2018-04-30 17:45:34 +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
Marc de Lima Lucio
c044d9ab58 FIX: actioncomm export: type filtering not working 2018-04-25 16:20:09 +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
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
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
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
dd835c4868 Fix: missing drop index with postgresql 2018-04-17 17:18:59 +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
atm-greg
90f1ab8af4 add hooks on supplier documents 2018-04-16 06:46:22 +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
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
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
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
7bf9801b80 Merge pull request #8577 from atm-florian/6.0
fix error on first install pgsql
2018-04-12 23:47:10 +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
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
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
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
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
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
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
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
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
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
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
Frédéric FRANCE
2c76a6cd80 Update combinations.php 2018-04-11 11:44:22 +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-quentin
809b2a91ed FIX issue #8037 2018-04-10 16:27:18 +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
848d76ee78 FIX #8023 2018-04-10 14:43:32 +02:00
atm-greg
b1469ba761 add doActions hook on projettaskcard 2018-04-09 07:06:20 +02:00
Laurent Destailleur
2b135dc951 FIX #8488 2018-04-05 13:13:45 +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
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
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
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
Laurent Destailleur
5efb94b06f Prepare 5.0.6 2018-03-22 14:13:58 +01:00
Laurent Destailleur
ed2d9f179b Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/contrat/card.php
2018-03-22 14:12:37 +01:00
florian HENRY
1feb22ea9c fix user right on modRessource 2018-03-21 22:24:11 +01:00
Laurent Destailleur
7d5c3a5c4f Merge pull request #8426 from atm-ph/fix_5.0_files_lost_on_contract
Fix documents are lost if we rename contrat ref
2018-03-21 20:40:23 +01:00
atm-ph
2094c48b7f Fix missing folder with multientity 2018-03-21 12:14:04 +01:00
atm-ph
cad7bdc74b Fix documents are lost if we rename contrat ref 2018-03-21 11:54:25 +01:00
Laurent Destailleur
04199c2b4b Fix according to mail of Olivier Geffroy the 21th of march 2018-03-21 10:59:13 +01:00
Laurent Destailleur
f371f80de3 Merge pull request #8400 from atm-arnaud/6.0_fix_societe_banner_status
FIX show status on societe banner
2018-03-18 12:46:19 +01:00
arnaud
32ce42610a FIX show status on societe banner 2018-03-16 11:18:00 +01:00
Laurent Destailleur
f3be6045f9 Merge pull request #8385 from ATM-Nicolas/fix_project_delete_task
FIX : Delete tasks on project delete will now trigger TASK_DELETE
2018-03-15 00:39:18 +01:00
ATM-Nicolas
e801b5a431 FIX : Delete tasks on project delete will now trigger TASK_DELETE 2018-03-14 11:38:42 +01:00
Laurent Destailleur
6b2490f4e4 Merge pull request #8375 from atm-quentin/6.0
FIX reverse field to have object loaded in doaction
2018-03-13 17:56:06 +01:00
atm-quentin
af09a3714b FIX reverse field to have object loaded in doaction 2018-03-13 17:12:03 +01:00
Laurent Destailleur
f82bedb36c Merge pull request #8367 from atm-quentin/6.0
FIX check shipping on delete order
2018-03-13 09:53:57 +01:00
Laurent Destailleur
dcd3387a30 Update commande.class.php 2018-03-13 09:53:21 +01:00
Laurent Destailleur
51229a602f Update commande.class.php 2018-03-13 09:51:45 +01:00
atm-quentin
6c7a5cebdf FIX check verif exped on delete order 2018-03-13 09:34:50 +01:00
Laurent Destailleur
d045dca003 Fix financial commitment 2018-03-12 20:04:25 +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
Laurent Destailleur
95e7062ca3 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-03-11 19:29:01 +01:00
Laurent Destailleur
d5d6939fd9 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/core/class/commonobject.class.php
2018-03-11 19:28:39 +01:00
Laurent Destailleur
f98ca2e31a Merge pull request #8335 from inoveaconseil/patch-1
Fix #8092
2018-03-11 00:06:28 +01:00
Laurent Destailleur
03f7df88c6 Update card.php 2018-03-11 00:05:32 +01:00
Laurent Destailleur
c755d5f58d Merge pull request #8333 from atm-maxime/fix_advtargetemailin
Fix #8057
2018-03-10 23:54:34 +01:00
Inovea Conseil
c2397fad60 Fix #8092 2018-03-10 23:49:43 +01:00
Maxime Kohlhaas
c008853842 Fix #8057 2018-03-10 23:05:33 +01:00
Laurent Destailleur
faef7a2e0c Merge pull request #8324 from atm-maxime/fix_unit_replen
Fix unit in replenish #7225
2018-03-10 12:58:16 +01:00
Maxime Kohlhaas
fd36ade61a Fix unit in replenish #7225 2018-03-10 11:20:32 +01:00
Laurent Destailleur
1d571c4159 Merge pull request #8315 from tuxgasy/5.0_invoice_supplier_multicurrency
Fix bug when updating multi currency rate on invoice supplier
2018-03-09 22:49:50 +01:00
TuxGasy
9eeb80151e Fix bug when updating multi currency rate on invoice supplier 2018-03-09 21:13:54 +01:00
atm-ph
53ce297ab3 Fix travis - missing documentation of new param 2018-03-09 09:30:11 +01:00
Laurent Destailleur
6d0c4deb6e Merge pull request #8295 from ATM-Marc/FIX_product_photo_ecm
FIX: warning when adding ECM files using old photo path
2018-03-08 16:24:42 +01:00
Marc de Lima Lucio
884b74a6bb FIX: warning when adding ECM files using old photo path 2018-03-07 17:12:59 +01:00
Laurent Destailleur
8b9041b93e Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-03-07 13:02:18 +01:00
Laurent Destailleur
4caefbe926 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-03-07 12:59:52 +01:00
Laurent Destailleur
94de6efa4b Merge pull request #8291 from ATM-Marc/FIX_order_export_date_livraison
FIX: add planned delivery to order exports
2018-03-07 12:59:32 +01:00
Laurent Destailleur
3284ebdcf1 Merge pull request #8290 from atm-alexis/6.0_fix_natural_search_double_space
FIX natural search double quote
2018-03-07 12:56:37 +01:00
Marc de Lima Lucio
dd208348c4 FIX: add planned delivery to order exports 2018-03-07 12:18:08 +01:00
alexis Algoud
cb27eb98e1 FIX natural search double quote 2018-03-07 11:42:47 +01:00
Laurent Destailleur
f9f37c52de Merge pull request #8275 from ATM-Nicolas/fix_order_line_fk_multicurrency
Fix order line fk multicurrency
2018-03-05 20:50:14 +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-Nicolas
60f8ca1283 Merge branch '6.0' of github.com:Dolibarr/dolibarr into fix_order_line_fk_multicurrency 2018-03-05 09:03:20 +01:00
Laurent Destailleur
57d6417095 Merge pull request #8264 from atm-alexis/FIX_migrate_script_product_photo
FIX migration script for product photo
2018-03-02 18:12:18 +01:00
Laurent Destailleur
6bb91dd5d2 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-03-02 17:54:42 +01:00
Laurent Destailleur
aab0a33f40 Merge pull request #8251 from atm-gauthier/5.0_fix_last_situation
FIX : if we make a mistake with situation_percent, now we can correct…
2018-03-02 17:54:20 +01:00
alexis Algoud
ce2fc28d80 FIX migration script for product photo 2018-03-02 16:12:58 +01:00
Laurent Destailleur
ee4fcba4f2 Fix class not found 2018-02-27 22:11:11 +01:00
gauthier
4d05bff780 FIX : if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back 2018-02-27 12:27:25 +01:00
ATM-Nicolas
27100df927 FIX : Avoid empty value to fk_multicurrency attribute 2018-02-27 11:06:11 +01:00
Laurent Destailleur
64dd6439e7 Merge pull request #8223 from atm-florian/6.0
fix bad link invoice URL into acoutantcy customer affectation
2018-02-25 12:42:03 +01:00
Laurent Destailleur
286d62edb8 Merge pull request #8221 from ATM-Marc/FIX_usercard_columns
FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup
2018-02-25 12:35:05 +01:00
Laurent Destailleur
c698558d9e Merge pull request #8212 from simnandez/6.0
Fix: Not showing link to ad event if module is disabled
2018-02-25 12:28:06 +01:00
Laurent Destailleur
b20ae45265 Merge pull request #8210 from atm-john/fix_sql_entity
Fix sql entity for sub query
2018-02-25 12:27:35 +01:00
Laurent Destailleur
2d252e85e6 FIX Import process must stop after ending line nb to import 2018-02-25 12:15:36 +01:00
atm-ph
d300b943e1 Fix wrong price on supplier order line 2018-02-23 15:10:25 +01:00
florian HENRY
b4b185abe0 fix bad link invoice URL into acoutantcy customer affectation 2018-02-23 14:42:52 +01:00
Marc de Lima Lucio
36cc1c6ca9 FIX: solve column mismatch in user card's usergroup list + code cleanup 2018-02-23 11:59:22 +01:00
Juanjo Menent
1d6baf5f2b Fix: Not showing link to ad event if module is disabled 2018-02-22 10:16:53 +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
John
b276a8186e Fix sql entity for sub query 2018-02-21 10:03:04 +01:00
Laurent Destailleur
7f419a29e7 Merge pull request #8072 from laudeco/hotfix/8028_replacement_bill
fix the bill replacement with discounts #8028
2018-02-20 15:19:19 +01:00
Laurent Destailleur
01c2971f4f Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-20 15:08:17 +01:00
Laurent Destailleur
9690e68bfb Merge pull request #8206 from fmarcet/5.0
Fix: Barcode type on massive init
2018-02-20 15:07:53 +01:00
Laurent Destailleur
b8736f5103 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-20 14:59:40 +01:00
Laurent Destailleur
a698ba0b56 Merge pull request #8205 from steschuser/5.0
FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php
2018-02-20 14:59:20 +01:00
Laurent Destailleur
85e5ac678f Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-20 14:56:17 +01:00
Laurent Destailleur
6c8e7494f0 Merge pull request #8200 from atm-maxime/fix_contact_tooltiip
Fix contact tooltip
2018-02-20 14:56:06 +01:00
Laurent Destailleur
276f2dce77 FIX #8200 2018-02-20 14:55:23 +01:00
Laurent Destailleur
67ee443b34 Fix can set holiday remaining to 0 2018-02-20 14:53:19 +01:00
Laurent Destailleur
4056b87a74 Fix syntax error 2018-02-20 12:36:03 +01:00
Laurent Destailleur
7321829732 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-20 12:34:15 +01:00
Laurent Destailleur
ea071b7680 Fix can't delete holiday refused 2018-02-20 12:31:26 +01:00
Ferran Marcet
671b4a399d Fix: Barcode type 2018-02-19 17:47:24 +01:00
Ferran Marcet
2e1727e323 Fix: Barcode type 2018-02-19 17:45:19 +01:00
Ferran Marcet
5535daf84a Merge branch '5.0up' into 5.0 2018-02-19 17:43:14 +01:00
sschwebel
7c583227fb FIX: #8139 2018-02-19 10:58:05 +01:00
Laurent Destailleur
033b898106 Merge pull request #8202 from atm-john/6.0_fix_invoice_extrafield_transmition_to_credit
fix invoice extrafield transmition to credit
2018-02-15 17:31:23 +01:00
John
49bad95d31 fix method exist test 2018-02-15 17:04:27 +01:00
John
63987fa32e fix invoice extrafield transmition to credit 2018-02-15 16:39:47 +01:00
Maxime Kohlhaas
bfd46f62ea Fix : contact and user getnomurl needs all info to display tooltip correctly 2018-02-15 15:18:25 +01:00
Maxime Kohlhaas
6fe69d4a60 Wrong field in thirdparty getnomurl 2018-02-15 15:17:59 +01:00
Laurent Destailleur
15ab37b46e Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-14 21:51:55 +01:00
Laurent Destailleur
b21feca9d7 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-14 21:51:35 +01:00
Laurent Destailleur
147b35d62e Merge pull request #8194 from hregis/6.0_multicompany
Fix: Update entity field in llx_user_rights and llx_usergroup_rights
2018-02-14 21:31:02 +01:00
Laurent Destailleur
cf5c972c65 Merge pull request #8193 from atm-ph/fix_6.0_multicurrency_situation_invoice
Fix apply global progress don't update multicurrency values
2018-02-14 21:27:52 +01:00
Laurent Destailleur
483bfb096b Merge pull request #8188 from atm-quentin/6.0_develop
NEW Add sale representative einstein_pdf_modules
2018-02-14 21:27:24 +01:00
Laurent Destailleur
c28d87252b Merge pull request #8184 from laudeco/hotfix/8183_welcome_email_adherent
Fix 8183 - adherent welcome e-mail edition always put 1 instead of keeping the e-mail
2018-02-14 20:51:57 +01:00
Laurent Destailleur
d0fdf700d7 Update type.php 2018-02-14 20:51:33 +01:00
Laurent Destailleur
0d00c51c2a Update type.php 2018-02-14 20:51:05 +01:00
Laurent Destailleur
94a76a1393 Merge pull request #8180 from atm-maxime/fix_service_list
Fix : contract service list context was mixing up with service list from product/service module
2018-02-14 20:43:03 +01:00
Laurent Destailleur
27c55635f3 Merge pull request #8164 from hregis/6.0_bug
Fix: nocheck for "fournisseur", already check with "societe"
2018-02-14 20:36:22 +01:00
Laurent Destailleur
23ee6748f7 Update fournisseurs.php 2018-02-14 20:36:13 +01:00
Regis Houssin
fa2fddcdc1 Fix: Update entity field in llx_user_rights and llx_usergroup_rights 2018-02-14 14:30:39 +01:00
atm-ph
c690dfb258 Fix apply global progress don't update multicurrency values 2018-02-14 10:15:38 +01:00
atm-quentin
144c13998a NEW_einstein_pdf_modules 2018-02-13 09:51:33 +01:00
De Coninck Laurent
1052213c97 Fix 8183 - adherent welcome e-mail
Fix the adherent welcome e-mail.

[see: #8183]
2018-02-12 18:12:43 +01:00
Maxime Kohlhaas
ef05171641 Fix : contract service list context was mixing up with service list from product/service module 2018-02-12 13:48:43 +01:00
Regis Houssin
24cc687724 Fix: you can't check "fournisseur" with checkUserAccessToObject without
object ID
2018-02-12 09:28:41 +01:00
Regis Houssin
448fcae02f Fix: move "fournisseur" in $checksoc 2018-02-12 09:03:53 +01:00
Regis Houssin
abb7e651d1 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr.git into 6.0_bug 2018-02-12 09:02:12 +01:00
Laurent Destailleur
4d6f87e544 Merge pull request #8168 from simnandez/6.0
Fix: Contracts not show price
2018-02-12 03:13:31 +01:00
Laurent Destailleur
d731857fd0 Update linkedobjectblock.tpl.php 2018-02-12 03:13:12 +01:00
Laurent Destailleur
12f1e4c04b Merge pull request #8167 from atm-john/fix_contract_line_extrafields_on_save
Fix Missing insert of extrafields on contract add line
2018-02-12 02:56:19 +01:00
Laurent Destailleur
d3d3bcaca5 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-12 02:53:21 +01:00
Laurent Destailleur
f88874c1f7 Code comment 2018-02-12 02:53:08 +01:00
Laurent Destailleur
5c59f5c63b Merge pull request #8159 from atm-ph/fix_6.0_cant_update_nblignes_on_pdf_creation
Fix can't update $nblignes on beforePDFCreation if we update $object->lines
2018-02-12 02:34:52 +01:00
Juanjo Menent
67ce71bc48 Fix: Contracts not show price 2018-02-09 18:23:11 +01:00
John
2817ace0d2 Fix contract line extrafields save on add line 2018-02-09 15:47:18 +01:00
Regis Houssin
a5814ce779 Fix: nocheck for "fournisseur", already check with "societe" 2018-02-09 11:00:43 +01:00
atm-ph
b074f580db Fix can't update $nblignes on beforePDFCreation if we update $object->lines 2018-02-08 16:59:17 +01:00
Laurent Destailleur
39cd63e2d4 Merge pull request #8143 from simnandez/6.0
FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page
2018-02-08 14:07:14 +01:00
Laurent Destailleur
371b168db1 Merge pull request #8133 from atm-quentin/6.0
FIX unset categorie
2018-02-08 13:09:52 +01:00
Laurent Destailleur
3f17c92aa3 Update card.php 2018-02-08 13:09:21 +01:00
Laurent Destailleur
c988d3f1cc Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/compta/facture.php
2018-02-08 12:53:26 +01:00
Laurent Destailleur
2e3bb4a585 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-08 12:48:48 +01:00
Laurent Destailleur
414093f94f Merge pull request #8155 from atm-ph/fix_6.0_pdf_writelinkedobjects_position
Fix position if module use pdf hook "linkedobjects"
2018-02-08 12:48:37 +01:00
Laurent Destailleur
8156374005 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-08 12:45:30 +01:00
Laurent Destailleur
a26bb2d884 FIX #8151 2018-02-08 12:41:31 +01:00
atm-ph
6254e20c67 Fix position if module use pdf hook "linkedobjects" 2018-02-07 15:41:39 +01:00
Juanjo Menent
9b56555962 FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page 2018-02-06 18:49:29 +01:00
atm-quentin
d989483d2b Merge branch '60test' into 6.0 2018-02-05 16:10:40 +01:00
atm-quentin
783dc18cd0 Merge 2018-02-05 16:10:19 +01:00
atm-quentin
2081aefc84 FIX creer into lire 2018-02-05 16:07:08 +01:00
atm-quentin
bb93b98260 NEW field commerciaux and categ export CustomersInvoicesAndPayments 2018-02-05 15:25:49 +01:00
Laurent Destailleur
2d4624a1be Merge pull request #8134 from hregis/6.0_multicompany
Fix: avoid error -1
2018-02-05 15:13:31 +01:00
Regis Houssin
839de65012 Fix: avoid error -1 2018-02-05 11:30:31 +01:00
atm-quentin
ae9c7ad6b6 FIX unset categorie 2018-02-05 10:40:52 +01:00
Laurent Destailleur
906a9eaa5a Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-02-04 23:12:57 +01:00
Laurent Destailleur
dbe45d03d3 Fix: amount into form must be numeric without format 2018-02-04 23:12:19 +01:00
Laurent Destailleur
e5cb2be618 Merge pull request #8129 from hregis/6.0_bug
Fix: remove lines with special code when convert to reduc
2018-02-04 12:18:20 +01:00
Laurent Destailleur
c4277c1e54 Merge pull request #8128 from hregis/5.0_bug
Fix: remove lines with special code when convert to reduc
2018-02-04 12:17:54 +01:00
Laurent Destailleur
f3700b66c6 Fix size of columns when using PRODUCT_USE_UNIT 2018-02-04 11:17:45 +01:00
Laurent Destailleur
fd8f89c708 FIX a discount is a percent, not an amount, so we use vatrate not price 2018-02-04 11:13:47 +01:00
Regis Houssin
8ee1186492 Fix: wrong test 2018-02-04 09:05:35 +01:00
Regis Houssin
d5b7184c8d Fix: wrong test 2018-02-04 09:04:15 +01:00
Regis Houssin
a161ca37ff Fix: use product_type instead special_code 2018-02-04 08:58:31 +01:00
Regis Houssin
c1e6d88442 Fix: use product_type instead special_code 2018-02-04 08:55:51 +01:00
Laurent Destailleur
2114e6ba4e Merge pull request #8101 from simnandez/6.0
FIX: #7974 Contract - Invalid reference on the document
2018-02-03 16:57:22 +01:00
Laurent Destailleur
c9e7e6d925 Merge pull request #8130 from hregis/6.0_bug2
Fix: compatibility with multicompany sharing
2018-02-03 16:45:16 +01:00
Juanjo Menent
c434136ba5 Merge remote-tracking branch 'upstream/6.0' into 6.0 2018-02-02 23:44:54 +01:00
Juanjo Menent
464ee6f9d6 Revert 2018-02-02 17:46:25 +01:00
Regis Houssin
13106d34a6 Fix: compatibility with multicompany sharing 2018-02-02 12:36:47 +01:00
Regis Houssin
38d735341c Fix: remove lines with special code when convert to reduc 2018-02-02 10:24:16 +01:00
Regis Houssin
2147bd23e6 Fix: remove lines with special code when convert to reduc 2018-02-02 10:22:47 +01:00
Laurent Destailleur
cba0447cf1 Merge pull request #8117 from atm-quentin/6.0
FIX update_extras on fourn card
2018-02-01 15:51:36 +01:00
atm-quentin
c80fa48225 FIX update_extras on fourn card 2018-02-01 09:31:04 +01:00
Laurent Destailleur
bdfbe462df Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-29 21:04:49 +01:00
Laurent Destailleur
8102883356 Fix error when email list contains ', ,'
Fix output dir of notification
2018-01-29 20:36:40 +01:00
Laurent Destailleur
d2b81c23c0 Merge pull request #8105 from kadogo/fichinter-api-cannot-grab-the-good-informations
FIX: Global on $user parameter reset the variable
2018-01-29 19:48:52 +01:00
Juanjo Menent
3c281ccefa FIX: Bad localtaxes assignment in cashdesk 2018-01-29 17:50:00 +01:00
kadogo
ba58578d60 FIX: Global on $user parameter reset the variable
When we use the fichinter API with global, the $user object is reset
If global is not applied on $user we can retrieve the informations from it
2018-01-27 19:31:48 +01:00
Juanjo Menent
cdb63bada3 FIX: #7974 Contract - Invalid reference on the document 2018-01-26 18:13:55 +01:00
Laurent Destailleur
1834be79a0 Fix supplier suggested when creating order from project overview 2018-01-26 11:31:34 +01:00
Laurent Destailleur
5b917c039e Prepare 6.0.6 2018-01-26 11:08:08 +01:00
Laurent Destailleur
92cace6747 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-26 01:40:55 +01:00
Laurent Destailleur
40b63be4b9 Fix package 2018-01-26 01:40:32 +01:00
Laurent Destailleur
47d0b6583e Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-01-26 01:40:04 +01:00
Laurent Destailleur
c0e719e3d8 Fix package scripts 2018-01-26 01:39:42 +01:00
Laurent Destailleur
d3c0414b4f Update changelog 2018-01-26 01:16:36 +01:00
Laurent Destailleur
2c0eeaf8de FIX #8093 2018-01-25 20:57:51 +01:00
Laurent Destailleur
1da7b154c1 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-24 11:48:31 +01:00
Laurent Destailleur
54fb59d8db Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/compta/paiement.php
2018-01-24 11:45:43 +01:00
Laurent Destailleur
e66b266432 Merge pull request #8090 from atm-arnaud/FIX_sepa_mail_encode
FIX email sent was not in HTML
2018-01-24 11:17:16 +01:00
Laurent Destailleur
f339719ae9 Merge pull request #8088 from atm-john/fix_sql_check_margin
Fix SQL error when multiple entities are used
2018-01-24 11:16:00 +01:00
Laurent Destailleur
adb70e0456 Merge pull request #8086 from atm-ph/fix_5.0_align_payment_total
Fix each total isn't aligned on payment card
2018-01-24 11:14:43 +01:00
De Coninck Laurent
53ac13c792 check on type replacement #8028 2018-01-23 18:03:29 +01:00
arnaud
c0481be8d8 FIX subject mail sepa 2018-01-23 17:01:03 +01:00
arnaud
19c616756a FIX email sent was not in HTML 2018-01-23 12:14:22 +01:00
John
f2ae3ee41d Fix get entity if multiple 2018-01-23 09:49:21 +01:00
atm-ph
054d98a2ba Fix each total isn't aligned on payment card 2018-01-22 17:09:17 +01:00
Laurent Destailleur
1420149b95 Merge pull request #8069 from atm-maxime/fix_contrat_validate
Fix validate contrat was not using force_number parameter
2018-01-20 12:33:50 +01:00
De Coninck Laurent
4874d08062 fix the bill replacement with discounts #8028 2018-01-19 09:01:37 +01:00
Maxime Kohlhaas
4c0dc21ca0 Fix validate contrat was not using force_number parameter 2018-01-18 14:07:32 +01:00
Laurent Destailleur
bc7bd77cea Fix permission to open supplier order 2018-01-17 15:54:27 +01:00
Laurent Destailleur
5d4eda68e0 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-16 19:53:02 +01:00
Laurent Destailleur
94b1d59f2b Fix missing check on object entity 2018-01-16 19:52:14 +01:00
Laurent Destailleur
f307fecaf6 Merge pull request #8064 from atm-quentin/6.0
FIX missing hook invoice index
2018-01-16 12:15:06 +01:00
atm-quentin
6feacab4f5 FIX missing hook invoice index 2018-01-15 14:24:19 +01:00
Laurent Destailleur
4c8af0ff50 Fix name alias on list 2018-01-15 12:24:56 +01:00
Laurent Destailleur
b154357683 Merge pull request #7982 from simnandez/6.0
FIX: Bad name alias showing in name of third column
2018-01-15 12:22:40 +01:00
Laurent Destailleur
3b9aee7d4c Update list.php 2018-01-15 12:22:21 +01:00
Laurent Destailleur
9f6118ed52 Code comments 2018-01-14 03:12:22 +01:00
Laurent Destailleur
c947502efa Fix typo 2018-01-13 17:22:59 +01:00
Philippe
7406d3c7ee Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-11 15:32:52 +01:00
Laurent Destailleur
dbb9caa196 Prepare 6.0.5 2018-01-11 09:53:47 +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
Laurent Destailleur
764646634d Merge pull request #8051 from atm-florian/6.0
fix: search translation into external module files also
2018-01-11 01:12:53 +01:00
Laurent Destailleur
0ae02d76a3 Merge pull request #8049 from fmarcet/6.0
Fix: Still using property ->client instead of ->thirdparty.
2018-01-11 01:03:47 +01:00
Laurent Destailleur
e9bf6ed4ce Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-11 00:56:01 +01:00
Laurent Destailleur
54228b4f98 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-11 00:55:51 +01:00
Laurent Destailleur
58589b8454 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-01-11 00:55:10 +01:00
Laurent Destailleur
387dd967e2 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2018-01-11 00:55:00 +01:00
Laurent Destailleur
5adeaf9d76 Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2018-01-11 00:54:30 +01:00
Laurent Destailleur
205e715b7f Merge pull request #8046 from hregis/6.0_bug
Fix: avoid Warning: A non-numeric value encountered
2018-01-11 00:53:07 +01:00
Laurent Destailleur
79562f8d5b Merge pull request #8036 from atm-ph/fix_6.0_model_pdf_invoice_payment
Fix wrong address used into PDF model of supplier payment
2018-01-11 00:37:37 +01:00
Laurent Destailleur
b5fe953a64 Merge pull request #8035 from pdermody/6.0
Fix #8034 - Surface and volume units are calculated incorrectly
2018-01-11 00:36:00 +01:00
Laurent Destailleur
df22a311c2 Merge pull request #8030 from steschuser/5.0
FIX #8029 Unable to make leave request in holyday module
2018-01-11 00:32:45 +01:00
Laurent Destailleur
9253fed754 Revert "Code comment"
This reverts commit 8000777864.
2018-01-11 00:17:32 +01:00
florian HENRY
c8c550cd33 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr.git into 6.0 2018-01-10 20:49:48 +01:00
Laurent Destailleur
8000777864 Code comment 2018-01-10 20:43:56 +01:00
florian HENRY
0bd45dc64b fix: search translation into external module files also 2018-01-10 20:34:32 +01:00
Ferran Marcet
d99535d9da Fix: Still using property ->client instead of ->thirdparty. 2018-01-10 16:40:43 +01:00
Ferran Marcet
7ce7c0d5e5 Merge branch '5.0up' into 5.0 2018-01-10 16:12:53 +01:00
Regis Houssin
0f51aa15d8 Fix: avoid Warning: A non-numeric value encountered 2018-01-10 10:52:30 +01:00
atm-ph
22d92c0540 Fix wrong address used into PDF model of supplier payment 2018-01-08 15:25:18 +01:00
Paul Dermody
a1ac285a25 Fixed automated computation of surface and volume to use correct units. It was failing for inches and feet. 2018-01-07 12:42:14 -06:00
Philippe
e66847d5c3 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2018-01-05 14:47:04 +01:00
sschwebel
7e8fda2d71 FIX #8029 Unable to make leave request in holyday module
wrong variable name in card.php
2018-01-05 12:09:45 +01:00
Laurent Destailleur
301f509611 Merge pull request #8019 from atm-gauthier/6.0_fix_vat_mass_update
FIX : $oldvatrateclean & $newvatrateclean must be set if preg_match === false
2018-01-04 21:03:20 +01:00
Laurent Destailleur
550fc37e62 Merge pull request #8017 from atm-florian/6.0
fix : linked object (new format  of linked_object atribut on 6.0)
2018-01-04 21:02:31 +01:00
Laurent Destailleur
a14a3db2e9 Merge pull request #8013 from atm-john/FIX_invoice_filter_type
fix filter for TYPE_SITUATION invoice
2018-01-04 20:59:32 +01:00
Laurent Destailleur
e4d37c3e23 Merge pull request #8012 from ATM-Nicolas/fix_product_best_price
Fix product best price
2018-01-04 20:58:59 +01:00
Laurent Destailleur
b2feac9d90 CVE-2017-17971 2018-01-04 19:25:52 +01:00
Juanjo Menent
762ab74940 FIX: Cashdesk should not sell to inactive third parties 2018-01-04 18:09:25 +01:00
Juanjo Menent
9471495dca Merge remote-tracking branch 'upstream/6.0' into 6.0 2018-01-04 18:05:55 +01:00
gauthier
58470e0913 FIX : $oldvatrateclean & $newvatrateclean must be set if preg_match === false 2018-01-04 12:01:21 +01:00
Laurent Destailleur
f6ff6610e4 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-03 20:13:56 +01:00
Laurent Destailleur
c7798d11ce Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2018-01-03 20:13:17 +01:00
florian HENRY
25390e5f73 fix : linked object (new format of linked_object atribut on 6.0) 2018-01-03 17:03:00 +01:00
ATM-Nicolas
2e6c036ad8 Merge branch '6.0' of github.com:Dolibarr/dolibarr into fix_product_best_price 2018-01-02 17:22:53 +01:00
ATM-Nicolas
61efda4cbd FIX : product best price on product list 2018-01-02 17:21:04 +01:00
John
1331e8add7 fix filter for TYPE_SITUATION invoice 2018-01-02 17:19:42 +01:00
Laurent Destailleur
0abe19c30d Merge pull request #7998 from hregis/6.0_bug
Fix: avoid warning
2017-12-28 12:53:04 +01:00
Laurent Destailleur
bbcf70cf4e Remove spaces 2017-12-28 09:48:41 +01:00
Laurent Destailleur
70e75753f8 Merge pull request #7994 from fmarcet/6.0
Fix: Missing include for Project class
2017-12-28 08:48:41 +01:00
Laurent Destailleur
3ac413084f Merge branch '6.0' into 6.0 2017-12-28 08:46:22 +01:00
Laurent Destailleur
3d4e6c9169 Merge pull request #7987 from atm-arnaud/FIX_trans_product_stats
FIX stats trad for customerinvoice
2017-12-28 07:10:14 +01:00
Laurent Destailleur
56bc0dbd25 Merge pull request #7986 from atm-arnaud/FIX_contractline_trans_unactivate
FIX trans unactivate on contractline
2017-12-28 07:09:28 +01:00
Laurent Destailleur
31b5d9df52 Merge pull request #7985 from atm-arnaud/FIX_search_contact_list
FIX search on contact list
2017-12-28 07:07:47 +01:00
Laurent Destailleur
de305cb3b2 Merge pull request #7980 from hregis/6.0_bug2
Fix: avoid php warning
2017-12-28 06:53:09 +01:00
Regis Houssin
59a89b250d Fix: avoid warning (https://github.com/Dolibarr/dolibarr/issues/7993) 2017-12-27 11:56:58 +01:00
Ferran Marcet
1c7b99d3dc Fix: Missing include for Project class 2017-12-26 12:13:35 +01:00
Juanjo Menent
b650ba21c4 Merge remote-tracking branch 'upstream/6.0' into 6.0 2017-12-26 10:52:46 +01:00
Laurent Destailleur
b70dd36ffa Better js comment 2017-12-24 12:16:48 +01:00
Laurent Destailleur
6a62e13960 FIX security vulnerability reported by ADLab of Venustech 2017-12-21 13:32:16 +01:00
Laurent Destailleur
62f895e2ec Fix: avoid infinite loop 2017-12-21 13:31:39 +01:00
Laurent Destailleur
4a5988accb FIX security vulnerability reported by ADLab of Venustech 2017-12-21 12:52:19 +01:00
arnaud
b1ce3fc5c8 FIX stats trad for customerinvoice 2017-12-21 12:12:50 +01:00
arnaud
4ba039d229 FIX trans unactivate on contractline 2017-12-21 12:07:29 +01:00
arnaud
ae7f8c3fe4 FIX search on contact list 2017-12-21 12:01:30 +01:00
Juanjo Menent
dc930dd6c5 FIX: Bad name alias showing in name of third column 2017-12-20 16:46:49 +01:00
Laurent Destailleur
3f6b3b51ca Fix css 2017-12-20 15:09:58 +01:00
Laurent Destailleur
6900771c70 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-20 13:17:39 +01:00
Laurent Destailleur
ca8ae3c723 Fix option MAIN_USE_JQUERY_JEDITABLE 2017-12-20 13:17:21 +01:00
Laurent Destailleur
b1f98b5903 Fix inline edit 2017-12-20 12:45:38 +01:00
Regis Houssin
2821459894 Fix: avoid php warning 2017-12-20 11:36:51 +01:00
Philippe
dd8ef47a25 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-12-18 15:37:46 +01:00
Laurent Destailleur
a020dbf3d7 Merge pull request #7953 from atm-ph/fix_6.0_checkbox_credit_note
Fix since jquery 3 we can check all checkbox of credit note options
2017-12-16 01:13:55 +01:00
Laurent Destailleur
aaadc6e001 Merge pull request #7954 from atm-ph/fix_6.0_wrong_char_in_url_param
Fix wrong or missing char for url
2017-12-16 01:10:37 +01:00
Laurent Destailleur
0db03cfbcc Merge pull request #7957 from frederic34/patch-1
Update product.php
2017-12-16 01:08:30 +01:00
Frédéric FRANCE
ab558ee5fa Update product.php 2017-12-14 09:49:55 +01:00
atm-ph
a2f4afbf88 Fix wrong or missing char for url 2017-12-13 16:17:22 +01:00
atm-ph
46770178d2 Fix since jquery 3 we can check all checkbox of credit note options 2017-12-13 15:24:09 +01:00
Laurent Destailleur
ef9468f78a Fix missing field label 2017-12-12 11:48:51 +01:00
Laurent Destailleur
48499fb506 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-11 15:21:22 +01:00
Laurent Destailleur
f2e429e28f Fix file integrity checker (exclude files excluded from package) 2017-12-11 15:03:34 +01:00
Laurent Destailleur
4017d09613 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-10 21:28:36 +01:00
Laurent Destailleur
fd85088a6c Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-10 21:27:03 +01:00
Laurent Destailleur
1d9d8980a9 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-10 21:16:49 +01:00
Laurent Destailleur
d3150ede42 Merge pull request #7942 from delcroip/fixDeleteSalaries
fix: unable to remove salaries, plus correct default rights management
2017-12-10 21:09:15 +01:00
Laurent Destailleur
f18edd5787 Update security.lib.php 2017-12-10 21:08:13 +01:00
Laurent Destailleur
7e69a31dd6 Merge pull request #7941 from atm-maxime/fix_errmsg_stockneg
Fix display error message when stock not enough on invoice validation #7846
2017-12-10 21:05:23 +01:00
Laurent Destailleur
3a181a5d28 Merge pull request #7936 from atm-maxime/5.0
Fix event late alert on third event list #7912
2017-12-10 20:58:32 +01:00
Laurent Destailleur
59aa49076c Merge pull request #7934 from aspangaro/6.0
FIX : Edit accountancy account and warning message on loan
2017-12-10 20:56:34 +01:00
Laurent Destailleur
e4725f4248 FIX #7933 2017-12-10 20:55:51 +01:00
patrick Delcroix
033016da7f fix: unable to remove salaries, plus correct default rights management 2017-12-10 20:02:26 +01:00
Maxime Kohlhaas
12d0928244 Fix display error message when stock not enough on invoice validation 2017-12-10 19:59:56 +01:00
Maxime Kohlhaas
3db4d10fc0 Fix event late alert on third event list #7912 2017-12-10 08:12:49 +01:00
Alexandre SPANGARO
60fc500fa8 FIX : Edit accountancy account and warning message on loan 2017-12-10 07:00:46 +01:00
Laurent Destailleur
3ddc582edd Merge pull request #7913 from atm-ph/fix_6.0_var_name
Fix $boad instead of $board
2017-12-08 16:55:28 +01:00
Laurent Destailleur
5128ad6e24 Merge pull request #7926 from atm-florian/6.0
fix MAIN_COPY_FILE_IN_EVENT_AUTO
2017-12-08 16:55:12 +01:00
florian HENRY
eb03f8f08e fix MAIN_COPY_FILE_IN_EVENT_AUTO 2017-12-08 15:03:42 +01:00
Laurent Destailleur
b671edb116 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-08 13:10:30 +01:00
Laurent Destailleur
09d3db145b Merge 2017-12-08 13:10:13 +01:00
Laurent Destailleur
8dc3d7323d Merge pull request #7923 from fmarcet/6.0
FIX #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO varieable
2017-12-08 13:02:07 +01:00
Laurent Destailleur
9b9b5adf66 Fix must be compatible with old and new storage location 2017-12-08 13:01:45 +01:00
Laurent Destailleur
08abb1490a Remove code using not defined var 2017-12-08 12:54:08 +01:00
Laurent Destailleur
8a5c53550b Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-08 12:43:53 +01:00
Laurent Destailleur
049a038f56 Merge pull request #7925 from hregis/5.0_bug
Fix: wrong translation if multilang activated
2017-12-08 12:43:37 +01:00
Laurent Destailleur
e526162e8e Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-08 12:42:22 +01:00
Regis Houssin
1b16eb731d Fix: missing load product translation file 2017-12-08 11:00:23 +01:00
Regis Houssin
1bdffa961f Fix: wrong translation if multilang activated 2017-12-08 10:41:14 +01:00
Laurent Destailleur
6de3a40546 Merge pull request #7916 from atm-ph/fix_4.0_require_class
Fix include class WorkboardResponse
2017-12-08 10:40:26 +01:00
Laurent Destailleur
5f71165020 Merge pull request #7924 from hregis/6.0_bug2
Fix: Avoid warning "A non-numeric value encountered"
2017-12-08 10:34:54 +01:00
Regis Houssin
04327189f7 Fix: access error when user not right to view all customers 2017-12-08 09:41:33 +01:00
Regis Houssin
c4b2c3e697 FIXME $accounts[$bid] is a label ! 2017-12-08 09:17:12 +01:00
Regis Houssin
8e1a9064cb Fix: avoid warning again 2017-12-08 09:00:05 +01:00
Regis Houssin
95fa183fac Fix: Avoid warning "A non-numeric value encountered" 2017-12-08 08:49:03 +01:00
Ferran Marcet
bfc476a118 FIX #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO varieable 2017-12-07 18:44:33 +01:00
atm-ph
c90ece1188 Fix include class WorkboardResponse 2017-12-06 14:22:37 +01:00
atm-ph
c70dff89dd Fix $boad instead of $board 2017-12-06 12:13:15 +01:00
Laurent Destailleur
340287f073 FIX #7903
Conflicts:
	htdocs/holiday/class/holiday.class.php
2017-12-05 11:56:32 +01:00
Laurent Destailleur
365639a6c0 Prepare 6.0.5 2017-12-05 11:54:26 +01:00
Laurent Destailleur
44e5566ee5 Update changelog 2017-12-02 14:17:49 +01:00
Laurent Destailleur
38be224665 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-12-02 14:14:26 +01:00
Laurent Destailleur
29568287ef Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-02 14:13:44 +01:00
Laurent Destailleur
5fae19b4d6 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-12-02 14:13:29 +01:00
Laurent Destailleur
c7d0e917fb Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0 2017-12-02 14:12:43 +01:00
Laurent Destailleur
9cafb08759 Merge pull request #7853 from atm-ph/fix_5.0_invoice_updateline_calcul_price_total
Fix product type is ignored and can generate a diffrent result with s…
2017-12-02 14:06:25 +01:00
Laurent Destailleur
03fd69c3b9 Fix missing lang 2017-12-01 16:48:43 +01:00
Laurent Destailleur
a832bbb348 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/compta/facture/stats/index.php
2017-12-01 16:18:03 +01:00
Laurent Destailleur
5308acdcde Merge pull request #7895 from atm-alexis/FIX_add_line_bad_price_and_ref
FIX add line bad price and ref
2017-12-01 16:03:21 +01:00
Alexis ALGOUD
b2effa7cc8 fix travis 2017-11-30 11:36:35 +01:00
root
b7f26ea788 FIX add line bad price and ref 2017-11-30 11:10:01 +01:00
Laurent Destailleur
d2135fd139 Merge pull request #7888 from atm-gauthier/5.0_fix_where_fk_status
FIX : test for filter fk_status
2017-11-29 15:32:51 +01:00
Laurent Destailleur
acd2d0121d Merge pull request #7886 from ptibogxiv/patch-8
Fix for multicompany
2017-11-29 15:31:21 +01:00
Laurent Destailleur
9fa6bfd1a5 Fix edit external user or not 2017-11-29 15:30:41 +01:00
Laurent Destailleur
359e82fd3e Merge pull request #7884 from jfefe/patch-15
FIX : external user cannot be set as internal
2017-11-29 15:07:18 +01:00
Laurent Destailleur
dbde97f25f Update card.php 2017-11-29 15:07:09 +01:00
gauthier
f04af6c1b3 FIX : test for filter fk_status 2017-11-29 11:06:33 +01:00
ptibogxiv
c194538609 Update fraise.modules.php 2017-11-29 10:45:16 +01:00
ptibogxiv
883c9dbf99 Fix for multicompany
last fix for multicompany compliance
2017-11-29 09:28:03 +01:00
jfefe
d0ab117488 FIX : external user cannot be set as internal 2017-11-28 15:06:23 +01:00
Laurent Destailleur
3071796bc3 Merge pull request #7876 from ptibogxiv/patch-6
fix for multicompany
2017-11-28 12:12:50 +01:00
Laurent Destailleur
fa1bb9d672 Merge pull request #7874 from ptibogxiv/patch-4
Fix stat  don in multicompany
2017-11-28 12:10:35 +01:00
ptibogxiv
a9e4fcfdca Update fraise.modules.php 2017-11-27 15:49:28 +01:00
ptibogxiv
780e8ce470 fix for multicompany 2017-11-27 15:13:14 +01:00
ptibogxiv
2e9952439e Fix stat don in multicompany 2017-11-27 15:03:34 +01:00
atm-ph
5fef6478a5 Fix wrong calcul_price_total() update 2017-11-27 11:26:41 +01:00
Laurent Destailleur
61798d1af0 FIX list of module not complete when module mb_strlen not available
Conflicts:
	dev/dolibarr_changes.txt
2017-11-25 02:34:24 +01:00
Laurent Destailleur
4cbcf5189a FIX #7806 2017-11-25 01:24:24 +01:00
Laurent Destailleur
38c770ffb3 FIX #7806 2017-11-25 01:16:12 +01:00
Laurent Destailleur
07cd1fb3c2 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-24 16:54:38 +01:00
Laurent Destailleur
2493c2468d Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/core/class/conf.class.php
	htdocs/core/lib/files.lib.php
2017-11-24 16:51:59 +01:00
Laurent Destailleur
306dcf3600 Merge pull request #7863 from atm-quentin/6.0
FIX too much users on holiday list
2017-11-24 16:39:06 +01:00
Laurent Destailleur
c2f84309db Update holiday.class.php 2017-11-24 16:38:52 +01:00
Philippe
2f2b0630e2 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-11-23 21:52:11 +01:00
atm-quentin
314c30f489 FIX too much users on holiday list 2017-11-23 14:26:26 +01:00
Laurent Destailleur
1e4844fd1c Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-22 17:25:49 +01:00
Laurent Destailleur
e1344eb97c Fix edit of time spent 2017-11-22 17:25:31 +01:00
atm-ph
219e58d0e4 Fix product type is ignored and can generate a diffrent result with situation invoice 2017-11-22 12:15:02 +01:00
Laurent Destailleur
356f36c5bf Merge pull request #7851 from atm-gauthier/5.0_backport_feature
Fix: some problems with medias in multicompany (backport 6.0 commit 762b4eb876)
2017-11-22 11:58:09 +01:00
Laurent Destailleur
9a75cb466a Merge pull request #7834 from ptibogxiv/patch-2
FIX list of donation not filtered on multicompany
2017-11-22 11:23:13 +01:00
Laurent Destailleur
dc5127e619 Merge pull request #7831 from ptibogxiv/patch-1
FIX createfromorder
2017-11-22 11:17:00 +01:00
Regis Houssin
a9bfe0f48f Fix: some problems with medias in multicompany (backport 6.0 commit 762b4eb876) 2017-11-22 10:12:51 +01:00
ptibogxiv
5d6555b9dd Update list.php 2017-11-19 21:54:14 +01:00
ptibogxiv
3f360601af Fix entity
Fix entity in list.php
2017-11-19 21:52:18 +01:00
ptibogxiv
35182066a8 update createfromorder
lack of 2 fields date_start and date_end not imported from order
2017-11-19 16:25:35 +01:00
Laurent Destailleur
a6e4e4ddb0 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/product/stock/replenishorders.php
2017-11-17 14:17:49 +01:00
Laurent Destailleur
c3c14277e1 Merge 2017-11-17 14:15:07 +01:00
Laurent Destailleur
42b7d80567 FIX #7824
Conflicts:
	htdocs/product/stock/replenishorders.php
2017-11-17 14:12:53 +01:00
Laurent Destailleur
fde33594a2 FIX #7824 2017-11-17 14:06:08 +01:00
Laurent Destailleur
7f28c9fff6 FIX #7824
Conflicts:
	htdocs/product/stock/replenishorders.php
2017-11-17 14:01:21 +01:00
Laurent Destailleur
57a6ada2a3 FIX #7824 2017-11-17 13:57:40 +01:00
Laurent Destailleur
5741d4d67d Merge pull request #7811 from atm-florian/6.0_fixvatcodesupplier
fix : return vat code for supplier price
2017-11-17 13:02:56 +01:00
Laurent Destailleur
4b90510b82 Fix time assigned to wrong user 2017-11-16 22:35:55 +01:00
Laurent Destailleur
924cf871a7 FIX CSS for IE10 2017-11-15 10:40:24 +01:00
Laurent Destailleur
77b6ef7396 Code comment 2017-11-14 19:41:57 +01:00
Laurent Destailleur
388b90a94c Fix repair of utf8 2017-11-14 19:00:52 +01:00
Laurent Destailleur
f789714f14 Fix translation 2017-11-14 18:16:01 +01:00
florian HENRY
e195cf0b95 fix : return vat code for supplier price 2017-11-14 09:53:06 +01:00
Laurent Destailleur
a2c80a704f Code comment 2017-11-13 19:06:58 +01:00
Laurent Destailleur
b5196b7164 FIX A lot of several fix on local taxes and NPR tax 2017-11-13 14:24:40 +01:00
Laurent Destailleur
1a5bbef266 FIX Locatax were not propagated when cloning order or proposal 2017-11-13 13:07:31 +01:00
Laurent Destailleur
05683bbf61 Code comment 2017-11-13 11:41:37 +01:00
Laurent Destailleur
90615a8682 Fix busy tag not set sometimes 2017-11-13 02:44:02 +01:00
Laurent Destailleur
36b4d50cff FIX #7737 2017-11-12 20:41:25 +01:00
Laurent Destailleur
d421b90376 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-12 20:18:56 +01:00
Laurent Destailleur
356525730d FIX #7786 2017-11-12 20:12:56 +01:00
Laurent Destailleur
d29233f553 Merge pull request #7801 from atm-maxime/fix_multi_vat_deposit
Fix multi VAT deposit when special lines are in origin document
2017-11-11 18:03:31 +01:00
Laurent Destailleur
5703c704f9 Merge pull request #7792 from atm-ph/fix_6.0_pdf_width_payment_term
Fix width of payment term is to large
2017-11-11 17:45:54 +01:00
Laurent Destailleur
50ed463b9f Merge pull request #7784 from frederic34/patch-3
account number on create bank account
2017-11-11 17:37:29 +01:00
Laurent Destailleur
3889941406 Merge pull request #7783 from frederic34/patch-2
Update card.php
2017-11-11 17:36:51 +01:00
Laurent Destailleur
0d38e154cf Merge pull request #7781 from frederic34/patch-1
Fetch right account
2017-11-11 17:33:26 +01:00
Maxime Kohlhaas
22a3721dda Fix multi VAT deposit when special lines are in origin document 2017-11-11 16:10:06 +01:00
atm-ph
2636c2470b Fix width of payment term is to large 2017-11-10 10:52:58 +01:00
Frédéric FRANCE
1ea6df14d0 Update card.php 2017-11-08 11:35:15 +01:00
Frédéric FRANCE
fe3ce78ae4 Update card.php 2017-11-08 11:24:33 +01:00
Frédéric FRANCE
27ace14fb7 Fetch right account 2017-11-07 16:28:51 +01:00
Ferran Marcet
7f1adc6a6a FIX: Saving wrong localtax on order addline 2017-11-07 09:46:39 +01:00
Laurent Destailleur
6eb2204c2b Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	ChangeLog
	htdocs/filefunc.inc.php
	htdocs/product/list.php
2017-11-06 21:20:06 +01:00
Laurent Destailleur
1d9873e1a9 FIX #7756 Add better error message 2017-11-06 21:17:30 +01:00
Laurent Destailleur
bc9b816719 Fix deletion of files that contains __ 2017-11-06 17:54:18 +01:00
Laurent Destailleur
825ceeaa8d Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-06 11:47:20 +01:00
Laurent Destailleur
864af9cc3b Fix error not returned if output directory not writable 2017-11-06 11:47:03 +01:00
Laurent Destailleur
d453961afc Merge pull request #7758 from atm-maxime/fix_search_service
Fix : type was forced to 0 so service are not in the list
2017-11-05 18:30:20 +01:00
Laurent Destailleur
7d4b43f368 Merge pull request #7757 from atm-maxime/fix_search_product
Fix display of product/service list
2017-11-05 18:29:24 +01:00
Laurent Destailleur
d3a0cff30a Merge pull request #7755 from frederic34/currency
default currency on propal create
2017-11-05 18:28:40 +01:00
Laurent Destailleur
52421406ce FIX #7751 2017-11-05 18:25:33 +01:00
Laurent Destailleur
eb4a5f6570 Fix link can't be a htm link in innosetup 2017-11-05 18:21:29 +01:00
Maxime Kohlhaas
e992e4bea5 Fix : type was forced to 0 so service are not in the list 2017-11-03 09:09:07 +01:00
Maxime Kohlhaas
13667e4850 Fix display of product/service list 2017-11-03 08:56:23 +01:00
Frédéric FRANCE
b58df17545 default currency on propal create 2017-11-02 18:14:55 +01:00
Laurent Destailleur
a291919cf7 Merge pull request #7754 from atm-gauthier/6.0_fix_filter_typeactioncomm_with_multiselect
FIX : Wrong alias sql
2017-11-02 16:40:40 +01:00
gauthier
03544f783a FIX : Wrong alias sql 2017-11-02 16:16:29 +01:00
Laurent Destailleur
6ea69f421f Merge pull request #7752 from atm-gauthier/6.0_fix_filter_typeactioncomm_with_multiselect
FIX : Filter type on actioncomm with multiselect doesn't work
2017-11-02 15:51:49 +01:00
Laurent Destailleur
310bf4bde4 Update peruser.php 2017-11-02 15:51:35 +01:00
Laurent Destailleur
ec3a07cd52 Try to restore compatibility when actioncode=CODE1,CODE2,... 2017-11-02 15:50:55 +01:00
Laurent Destailleur
63a363080e Update index.php 2017-11-02 15:48:56 +01:00
Laurent Destailleur
323a0d7d0d Update index.php 2017-11-02 15:48:24 +01:00
gauthier
b7cf434ebd FIX : Filter type on actioncomm with multiselect doesn't work 2017-11-02 14:58:33 +01:00
Laurent Destailleur
555b37411f Merge pull request #7750 from atm-florian/6.0_missinghook
fix : missing hook in accountancy
2017-11-02 13:53:45 +01:00
florian HENRY
bd68b94411 fix : missing hook in accountancy 2017-11-02 13:27:09 +01:00
Laurent Destailleur
141df52dd6 Merge pull request #7741 from frederic34/patch-1
swap llxfooter() and $db->close()
2017-11-02 09:53:06 +01:00
Laurent Destailleur
fb3f1ef667 Code comment 2017-11-02 09:49:41 +01:00
Laurent Destailleur
4755197503 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-11-02 09:42:47 +01:00
Laurent Destailleur
59df957181 Fix return HTTP code 501 if calling a non existing api 2017-11-02 01:43:27 +01:00
Laurent Destailleur
192dc43b87 Fix regression 2017-11-02 01:16:42 +01:00
Laurent Destailleur
91fbb4da41 Fix changelog 2017-11-01 20:12:15 +01:00
Laurent Destailleur
a6879775bb FIX Search into language is ok for file into external modules two. 2017-11-01 20:05:28 +01:00
Frédéric FRANCE
01a3787664 swap llxfooter() and $db->close() 2017-10-31 13:45:13 +01:00
Laurent Destailleur
3db101ffdd Clean packager 2017-10-31 01:06:07 +01:00
Laurent Destailleur
2b966e630b Doc 2017-10-30 19:49:48 +01:00
Laurent Destailleur
892798bf79 Code comment 2017-10-30 12:40:12 +01:00
Laurent Destailleur
007783cf76 FIX Searching translation should not be case sensitive 2017-10-30 01:45:39 +01:00
Laurent Destailleur
0de1b878bd Prepare 6.0.4 2017-10-29 16:17:52 +01:00
Laurent Destailleur
777d2f7027 Prepare 5.0.8 2017-10-29 16:17:36 +01:00
Laurent Destailleur
78645c718f Fix position of quick search 2017-10-29 16:15:54 +01:00
Laurent Destailleur
0b271cca46 Prepare 5.0.7 2017-10-29 10:38:57 +01:00
Laurent Destailleur
985a268477 Update doc 2017-10-28 22:10:56 +02:00
Laurent Destailleur
cd5e43483e Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/contrat/card.php
	htdocs/core/lib/project.lib.php
	htdocs/expedition/card.php
	htdocs/projet/class/task.class.php
2017-10-28 22:08:16 +02:00
Laurent Destailleur
02f47b5a91 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-10-28 22:03:23 +02:00
Laurent Destailleur
4feecbeab8 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-10-28 22:03:06 +02:00
Laurent Destailleur
0630542e20 Merge pull request #7723 from atm-maxime/fix_contract_desc
Fix : contract lines from origin were containing all lines desc
2017-10-28 22:02:13 +02:00
Laurent Destailleur
783efd1a71 Merge pull request #7722 from fmarcet/4.0
FIX: paid supplier invoices are shown as abandoned
2017-10-28 22:01:30 +02:00
Laurent Destailleur
5313d61847 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-28 20:35:35 +02:00
Laurent Destailleur
92c33b76dc Fix position of search element in quick search 2017-10-28 20:35:21 +02:00
Maxime Kohlhaas
7c1d6251f7 Fix : contract lines from origin were containing all lines desc 2017-10-27 13:27:38 +02:00
Ferran Marcet
9178d80349 Merge remote-tracking branch 'origin/4.0' into 4.0 2017-10-27 11:52:15 +02:00
Ferran Marcet
bc8127d685 Fix: paid supplier invoices are shown as abandoned on the consumption card. 2017-10-27 11:52:05 +02:00
Laurent Destailleur
8e18d5906d Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-10-27 02:32:28 +02:00
Laurent Destailleur
f02e731c67 Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Conflicts:
	htdocs/core/lib/project.lib.php
2017-10-27 02:32:09 +02:00
Laurent Destailleur
9bcf01bf3f Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0 2017-10-27 02:30:55 +02:00
Laurent Destailleur
fed0f3d09e Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 4.0
Conflicts:
	htdocs/core/lib/project.lib.php
	htdocs/projet/class/task.class.php
2017-10-27 02:30:33 +02:00
Laurent Destailleur
07b25e457b Merge pull request #7652 from fappels/5.0_Fix_old_batch_not_shown_multi_shipping
FIX old batch not shown in multi shipping
2017-10-27 02:26:45 +02:00
Laurent Destailleur
78e3c63ead Update card.php 2017-10-27 02:26:37 +02:00
Laurent Destailleur
6b7c59635e Merge pull request #7715 from grandoc/new_branch_26_10_17
Fix : Warning: A non-numeric value encountered in on line 57 58 59
2017-10-27 02:18:26 +02:00
Laurent Destailleur
61909d842d Update document.php 2017-10-27 02:18:11 +02:00
Laurent Destailleur
4c5bb7660c Merge pull request #7713 from atm-gauthier/6.0_fix_hook_on_shipping_card
FIX : hook formObjectOptions() must use $expe and not $object which i…
2017-10-27 02:15:30 +02:00
Laurent Destailleur
bbc13b8ac9 Merge pull request #7712 from atm-florian/6.0
FIX : #7458
2017-10-27 01:58:51 +02:00
Laurent Destailleur
71622b9f86 Merge pull request #7711 from atm-ph/fix_6_0_empty_extrafields
Fix empty extrafields if from origin
2017-10-27 01:56:44 +02:00
Laurent Destailleur
82231b77a2 Fix data for supplier must be not visible if supplier module off 2017-10-27 01:46:54 +02:00
Laurent Destailleur
67208b111d Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/compta/facture.php
	htdocs/expedition/card.php
	htdocs/product/list.php
2017-10-26 17:02:40 +02:00
Laurent Destailleur
c48721e008 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-10-26 16:50:53 +02:00
Laurent Destailleur
0efd118d43 Fix hook on product list 2017-10-26 16:50:38 +02:00
Philippe GRAND
d9d4b6e06d Fix : Warning: A non-numeric value encountered in on line 57 58 59 2017-10-26 13:03:39 +02:00
florian HENRY
f4a95f89ac Ok, now suppliers payment are correctly logged 2017-10-26 12:26:25 +02:00
florian HENRY
a7655b69e8 agin fix blockedlog on supplier incvoive payument 2017-10-26 12:13:47 +02:00
gauthier
ce6d1d306d FIX : hook formObjectOptions() must use $expe and not $object which is an order here 2017-10-26 11:32:26 +02:00
florian HENRY
5f89b4427f fixagain blocked log supplier 2017-10-26 10:49:11 +02:00
florian HENRY
9427b2f4b1 fix supplier payamnet blockedlog 2017-10-26 10:40:36 +02:00
florian HENRY
1d0c93c0b6 FIX : #7458 2017-10-26 10:31:14 +02:00
atm-ph
08e83983d0 Fix empty extrafields if from origin 2017-10-26 09:40:12 +02:00
Philippe
26e3593c98 Merge branch '6.0' of https://github.com/Dolibarr/dolibarr into 6.0 2017-10-25 14:15:59 +02:00
fappels
eaafe83ae4 Only show old batch number and qty 2017-10-24 16:05:41 +02:00
Laurent Destailleur
58584d8784 Update fournisseur.commande.class.php 2017-10-24 13:05:12 +02:00
dolibarr95
76aa2df807 Try to fix #7692
`$this->fk_soc` is empty replace by `$this->socid`
2017-10-24 13:05:05 +02:00
Laurent Destailleur
da93081f47 Merge pull request #7688 from atm-florian/6.0
fix accountancy index display
2017-10-24 12:41:39 +02:00
Laurent Destailleur
ba434617dc FIX Missing function getLinesArray 2017-10-23 14:44:06 +02:00
Laurent Destailleur
97b694b59c Fix missing field in migration v6 2017-10-23 10:22:45 +02:00
florian HENRY
c258e229c8 fix accountancy index display 2017-10-23 10:00:22 +02:00
Laurent Destailleur
611f5f638d FIX #7616 2017-10-22 15:07:41 +02:00
Laurent Destailleur
79279caa2e FIX #7619 2017-10-22 14:56:00 +02:00
Laurent Destailleur
745c4625a6 FIX #7619 2017-10-22 14:48:42 +02:00
Laurent Destailleur
be0cd601a9 Fix dead code 2017-10-22 14:07:54 +02:00
Laurent Destailleur
703d4a6aee FIX #7648 2017-10-22 14:02:24 +02:00
Laurent Destailleur
6b0d060289 Merge pull request #7677 from frederic34/stockinvoice
stock on supplier invoice back to draft
2017-10-22 03:33:11 +02:00
Laurent Destailleur
4325363084 Merge pull request #7676 from frederic34/patch-2
FIX #7675
2017-10-22 03:25:22 +02:00
Laurent Destailleur
c387436a68 Merge pull request #7671 from simnandez/4.0
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
2017-10-22 03:20:22 +02:00
Laurent Destailleur
fba3adbc5e Merge pull request #7670 from atm-ph/fix_5_0_empty_ref_shipment
Fix shipment ref is empty
2017-10-22 03:00:26 +02:00
Laurent Destailleur
030cea6a0f Merge pull request #7664 from frederic34/patch-1
keep vat input with multiprices product creation
2017-10-22 02:42:44 +02:00
Laurent Destailleur
b70808eca7 Merge pull request #7663 from tuxgasy/5.0_anchor_addline
Fix anchor after add line
2017-10-22 02:35:13 +02:00
Laurent Destailleur
16c212c9fd Merge pull request #7662 from atm-florian/6.0
fix displaying accountancy code
2017-10-22 02:32:01 +02:00
Laurent Destailleur
8ac7dd8e9a Merge pull request #7660 from atm-gauthier/fix_project_time_spent
FIX : wrong personnal project time spent
2017-10-22 02:26:34 +02:00
Laurent Destailleur
1afbf75cbc Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0
Conflicts:
	htdocs/index.php
2017-10-22 01:30:25 +02:00
Laurent Destailleur
da8fe06301 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-22 01:26:17 +02:00
Laurent Destailleur
cad44ee68a FIX substitution in ODT of thirdparties documents 2017-10-22 01:25:59 +02:00
Frédéric FRANCE
8baad70f6c stock on supplier invoice back to draft 2017-10-21 20:26:32 +02:00
Frédéric FRANCE
735f06fd83 FIX #7675 2017-10-21 16:20:06 +02:00
Juanjo Menent
75580f253e FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart 2017-10-20 12:57:32 +02:00
atm-ph
08d5ff4736 Fix shipment ref is empty 2017-10-20 12:28:33 +02:00
Laurent Destailleur
a1217d61b6 Merge pull request #7654 from simnandez/6.0
FIX: Bad localtax apply
2017-10-19 19:28:02 +02:00
Laurent Destailleur
fbc3be84e3 Merge pull request #7643 from atm-maxime/fix_dashboard_stats_links
Fix dashboard stats links
2017-10-19 19:26:49 +02:00
Laurent Destailleur
efaa0b1e2a Merge pull request #7640 from atm-florian/6.0_fixeventiconstatus
fix : better icon for event status Non applicable
2017-10-19 19:18:56 +02:00
Laurent Destailleur
f7556e7ad2 FIX make of link to other object during creation 2017-10-19 19:06:48 +02:00
Frédéric FRANCE
5afd2695fb keep vat input with multiprices product creation 2017-10-19 18:33:15 +02:00
Laurent Destailleur
d4ade7b935 FIX API to get object does not return data o flinked objects 2017-10-19 17:57:16 +02:00
Laurent Destailleur
d7113a3602 Fix init of environment for a dedicated entity in API 2017-10-19 17:32:23 +02:00
Laurent Destailleur
8da7f789d8 Fix init of environment for a dedicated entity in API 2017-10-19 17:30:08 +02:00
TuxGasy
9c3805c0d5 Fix anchor after add line 2017-10-19 14:10:58 +02:00
Laurent Destailleur
83440f5bbc FIX #7626 2017-10-19 13:07:33 +02:00
florian HENRY
b0c68ddc61 fix displaying accountancy code 2017-10-19 12:35:59 +02:00
Laurent Destailleur
cb089987ee Fix code comment 2017-10-19 12:35:15 +02:00
Laurent Destailleur
93d16bf4d7 Fix several fixes in APIs 2017-10-19 12:30:36 +02:00
gauthier
3793ae323a FIX : wrong personnal project time spent 2017-10-19 09:46:19 +02:00
Laurent Destailleur
7ee64fc0d4 Fix css 2017-10-18 19:39:22 +02:00
Laurent Destailleur
3e43e164ae FIX Bad ressource list in popup in gantt view 2017-10-18 19:13:44 +02:00
Laurent Destailleur
74b401b70d Fix bad perm to delete file 2017-10-18 17:40:47 +02:00
Laurent Destailleur
8626d6279a Fix perm to delete files 2017-10-18 17:21:30 +02:00
Juanjo Menent
df53870c01 FIX: Bad localtax apply 2017-10-18 12:13:32 +02:00
Juanjo Menent
4382642099 FIX: Bad localtax apply 2017-10-18 12:10:00 +02:00
Laurent Destailleur
b124c7f16d Clean params 2017-10-18 11:15:54 +02:00
Laurent Destailleur
000c1bddb2 Fix we lose the private not when closing proposal 2017-10-18 11:12:59 +02:00
fappels
6b557fd92f Fix old batches not displayed in multi warehouse shipping
Old batches not available in product_lot table are not shown for
shipping from multiple warehouses
2017-10-17 22:19:45 +02:00
fappels
6ba7fe26a7 Merge remote-tracking branch 'refs/remotes/Dolibarr/5.0' into 5.0 2017-10-17 16:59:24 +02:00
florian HENRY
50cacfee3d lighter icon 2017-10-17 13:24:38 +02:00
Laurent Destailleur
aa1ff189e1 Fix var not correctly initialized when using api + multicompany 2017-10-17 12:58:26 +02:00
Laurent Destailleur
235817c581 Fix missing default limit 2017-10-17 12:02:58 +02:00
Laurent Destailleur
81e7f45200 FIX Stats on invoices show nothing 2017-10-17 11:08:49 +02:00
Laurent Destailleur
5998f60764 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-17 10:51:21 +02:00
Laurent Destailleur
5937fba373 Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-17 10:51:11 +02:00
Laurent Destailleur
626fea3f7a Merge pull request #7608 from atm-john/fix_supplier_invoice_from_supp_order
Fix extrafields transmition from supplier order to supplier invoice
2017-10-16 20:22:26 +02:00
Maxime Kohlhaas
b3f17dc614 Better with leftmenu 2017-10-16 20:20:55 +02:00
Maxime Kohlhaas
dac99c7745 Missing menus in links on index stats 2017-10-16 20:16:30 +02:00
Laurent Destailleur
a4b4eab2ae Fix API when using an API key for a user in another entity 2017-10-16 16:23:50 +02:00
Laurent Destailleur
bec985a551 Fix error message 2017-10-16 14:56:56 +02:00
Laurent Destailleur
b491d22c16 FIX selection of thirdparty was lost on stats page of invoices 2017-10-14 02:30:33 +02:00
Laurent Destailleur
5a4480bd1d Fix navigation on bank receipts 2017-10-13 21:32:14 +02:00
Laurent Destailleur
807724e0f0 Add link other invoices of third party on supplier card to 2017-10-13 21:32:05 +02:00
Laurent Destailleur
11614af2c2 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-13 17:46:40 +02:00
Laurent Destailleur
5f021990b4 Code comment 2017-10-13 17:46:16 +02:00
Laurent Destailleur
5f22afa450 Merge pull request #7621 from atm-ph/fix_distinct_credit_note
Fix distinct credit note select list
2017-10-13 13:32:04 +02:00
atm-ph
647c4036cf Fix simplification of code 2017-10-13 09:21:37 +02:00
Laurent Destailleur
857b59409c FIX sql syntax error because of old field accountancy_journal 2017-10-13 01:50:00 +02:00
Laurent Destailleur
c3ada19892 Fix demo backup 2017-10-13 01:27:49 +02:00
Laurent Destailleur
558f261b60 FIX #7593 2017-10-13 01:03:33 +02:00
Laurent Destailleur
20d4ba9ddd Merge pull request #7620 from atm-gauthier/fix_selectthirdparty
FIX : wrong key in selectarray
2017-10-13 00:46:15 +02:00
Laurent Destailleur
5ab88e629b Merge branch '5.0' of git@github.com:Dolibarr/dolibarr.git into 5.0 2017-10-12 18:32:33 +02:00
Laurent Destailleur
463441c808 Fix bad table name 2017-10-12 18:32:10 +02:00
Laurent Destailleur
2fd0ffbfec Fix tz for date creation/update 2017-10-12 14:50:25 +02:00
atm-ph
8d3df7ea57 Fix can not distinct which credit note are in select list 2017-10-12 09:59:25 +02:00
gauthier
1e7676d26f FIX : wrong key in selectarray 2017-10-12 09:30:04 +02:00
Laurent Destailleur
cd814d420b Fix repair utf8 mix collation 2017-10-11 16:54:17 +02:00
Laurent Destailleur
68ec8ef313 Fix lang missing 2017-10-11 12:05:48 +02:00
Laurent Destailleur
e717bfc04b Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-11 12:00:52 +02:00
Laurent Destailleur
538c7579ba Merge pull request #7502 from fappels/6.0_fix_dispatch
FIX: #7211 Update qty dispatched on qty change
2017-10-11 11:59:45 +02:00
Laurent Destailleur
b4018846e8 Merge pull request #7610 from atm-arnaud/FIX_search_conciliated_bankentries
FIX bankentries search conciliated if val 0
2017-10-11 11:54:21 +02:00
dolibarr95
220b37133b Wrong test
https://github.com/Dolibarr/dolibarr/issues/7604#issuecomment-335387587
2017-10-11 11:49:46 +02:00
Laurent Destailleur
cfce9f7171 Merge pull request #7611 from hregis/6.0_bug2
Fix: if module is not activated, functionality of module is deactivated!
2017-10-11 11:42:57 +02:00
Laurent Destailleur
d59d7887bb Update subscription.php 2017-10-11 11:42:39 +02:00
Laurent Destailleur
7e999603fc Update list.php 2017-10-11 11:40:19 +02:00
Laurent Destailleur
f8771c2214 Update list.php 2017-10-11 11:39:56 +02:00
Laurent Destailleur
1b04c4beb7 Merge branch '6.0' into 6.0_bug2 2017-10-11 11:37:38 +02:00
Laurent Destailleur
fa7a277d64 Merge pull request #7601 from aspangaro/6.0-4
Fix : missing class AccountingJournal in subscription member page when accountancy not activated
2017-10-11 11:36:48 +02:00
Regis Houssin
f2ad205538 Fix: wrong copy/paste ! 2017-10-11 07:36:02 +02:00
Regis Houssin
6d5c2bf7b2 Fix: check if module bank activated
Conflicts:
	htdocs/adherents/subscription.php
2017-10-11 07:35:44 +02:00
Regis Houssin
913a5d1df2 Fix: if module is not activated, functionality of module is deactivated! 2017-10-11 07:27:27 +02:00
arnaud
fd796723f2 FIX bankentries search conciliated if val 0 2017-10-10 17:15:01 +02:00
John
b213c7ed24 Fix extrafields transmition from supplier order to supplier invoice 2017-10-10 14:15:06 +02:00
Alexandre SPANGARO
2a76cc6f54 Fix : missing class AccountingJournal in subscription member page when accountancy not activated 2017-10-10 06:34:16 +02:00
Laurent Destailleur
dce71d6e7d Fix loose filter 2017-10-09 18:51:33 +02:00
Laurent Destailleur
19de053054 Fix itf8 mix collation 2017-10-09 17:43:57 +02:00
Laurent Destailleur
ec9c355791 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into 6.0 2017-10-08 19:46:48 +02:00
Laurent Destailleur
257fe68f13 Prepare 6.0.3 2017-10-08 19:46:24 +02:00
Laurent Destailleur
21bb799e7b Merge pull request #7592 from atm-maxime/fix_advtarget
Fix : missing new target type in advance target selection
2017-10-08 15:06:52 +02:00
Maxime Kohlhaas
8513ddb9b4 Fix : missing new target type in advance target selection 2017-10-08 10:08:49 +02:00
Laurent Destailleur
346c17b649 Merge pull request #7176 from atm-maxime/fix_member_search_pgsql
Fix : search on rowid don't work with pgsql and natural search
2017-10-05 10:39:17 +02:00
Laurent Destailleur
56acb2c08c Fix: with 5.0 and 6.0, supplier prices are always in main currency. The currency is not yet available in supplier prices.
Field to define the currency of supplier prices were added in database but not yet used by screen/code.
2017-10-05 10:38:58 +02:00
Maxime Kohlhaas
37b1b161f9 Merge branch '5.0' of github.com:atm-maxime/dolibarr into fix_member_search_pgsql 2017-10-03 18:15:01 +02:00
Maxime Kohlhaas
123c9d2315 Better fix only if bdd is pgsql 2017-10-03 18:12:17 +02:00
Maxime Kohlhaas
29a6c7e6ba Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-10-02 21:32:29 +02:00
fappels
d4488cb040 Fix for 'lessone' mode 2017-09-26 15:44:40 +02:00
fappels
2fe0736b87 Update qty dispatched on qty change
Store qty dispatched and qty ordered only once per orderline
2017-09-26 12:32:50 +02:00
Maxime Kohlhaas
5018bf1baf Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-09-19 09:13:22 +02:00
Maxime Kohlhaas
5383df5246 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-09-18 09:58:15 +02:00
Maxime Kohlhaas
0608778b9c Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-09-12 11:00:28 +02:00
fappels
d5b7b7ec52 Merge remote-tracking branch 'refs/remotes/Dolibarr/5.0' into 5.0 2017-09-11 18:13:14 +02:00
Maxime Kohlhaas
18cbe31a84 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-09-07 09:10:24 +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
Maxime Kohlhaas
4638ebac8a Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-09-05 09:46:31 +02:00
Maxime Kohlhaas
49a29a16e6 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-08-31 09:02:21 +02:00
Maxime Kohlhaas
c3152a6343 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-08-28 10:32:04 +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
Maxime Kohlhaas
e1dd85d261 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-27 10:05:00 +02:00
Maxime Kohlhaas
4cab48a000 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-19 08:06:54 +02:00
Maxime Kohlhaas
f876833b9a Fix : search on rowid don't work with pgsql and natural search 2017-07-18 10:31:35 +02:00
Maxime Kohlhaas
ce534491fd Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-18 10:19:11 +02:00
Maxime Kohlhaas
843172ccc8 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-17 11:38:37 +02:00
Maxime Kohlhaas
794d638ded Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-11 09:37:45 +02:00
Laurent Destailleur
6b4cecd0a8 Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop 2017-07-09 19:43:21 +02:00
Maxime Kohlhaas
ba283377b9 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-09 10:13:02 +02:00
Laurent Destailleur
eec10660ab Merge branch '6.0' of git@github.com:Dolibarr/dolibarr.git into develop 2017-07-08 22:19:33 +02:00
Laurent Destailleur
4d560a8e03 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2017-07-08 22:18:12 +02:00
Laurent Destailleur
ff2b2e5b64 Merge pull request #7129 from AlainRnet/patch-6
Update main.lang
2017-07-08 21:55:32 +02:00
AlainRnet
8d1c8e2da7 Update main.lang
StatusInterInvoiced missing and I don't know its wording.
2017-07-08 08:09:02 +02:00
Maxime Kohlhaas
f8ad108da6 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-07-07 12:07:35 +02:00
Maxime Kohlhaas
98208b9963 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-28 00:33:24 +02:00
Maxime Kohlhaas
8eba418715 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-27 12:19:10 +02:00
Maxime Kohlhaas
ea616114a9 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-20 22:16:19 +02:00
Maxime Kohlhaas
166b5da560 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-20 09:29:26 +02:00
Maxime Kohlhaas
c8172d2b49 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-13 11:59:10 +02:00
Maxime Kohlhaas
ec5b304634 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-09 11:05:37 +02:00
Maxime Kohlhaas
e19de25297 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-08 11:36:02 +02:00
Maxime Kohlhaas
9b74a632e1 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-07 09:24:40 +02:00
Maxime Kohlhaas
5f6c63948e Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-01 13:06:32 +02:00
Maxime Kohlhaas
0b5adc7795 Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-06-01 11:55:54 +02:00
Maxime Kohlhaas
2f6fe2c65e Merge branch '5.0' of https://github.com/Dolibarr/dolibarr into 5.0 2017-05-30 14:10:20 +02:00
Maxime Kohlhaas
6ac08c3bee Fix : Product supplier price is related to supplier's currency 2017-05-29 10:32:17 +02:00
438 changed files with 5607 additions and 3069 deletions

1
.gitignore vendored Executable file → Normal file
View File

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

View File

@@ -63,6 +63,14 @@ matrix:
- php: nightly - php: nightly
# We exclude some combinations not usefull to save Travis CPU # We exclude some combinations not usefull to save Travis CPU
exclude: 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: '5.4' - php: '5.4'
env: DB=postgresql env: DB=postgresql
- php: '5.5' - php: '5.5'

174
ChangeLog
View File

@@ -2,9 +2,158 @@
English Dolibarr ChangeLog English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** 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 no…
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 ordering
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
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
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()
FIX: test is_erasable() must be done before call function delete() too to avoid delete invoice with &action=delete in url
FIX: we must see number of all shared projects
FIX: wrong var name
***** ChangeLog for 6.0.7 compared to 6.0.6 *****
FIX: #8023
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
FIX: #8151
FIX: #8200
FIX: add planned delivery to order exports
FIX: a discount is a percent, not an amount, so we use vatrate not price
FIX: Avoid empty value to fk_multicurrency attribute
FIX: Bad localtaxes assignment in cashdesk
FIX: check shipping on delete order
FIX: check verif exped on delete order
FIX: creer into lire
FIX: Delete tasks on project delete will now trigger TASK_DELETE
FIX: Global on $user parameter reset the variable
FIX: if we make a mistake with situation_percent, now we can correct…
FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back
FIX: Import process must stop after ending line nb to import
FIX: migration script for product photo
FIX: natural search double quote
FIX: reverse field to have object loaded in doaction
FIX: Saving wrong localtax on order addline
FIX: show status on societe banner
FIX: solve column mismatch in user card's usergroup list + code cleanup
FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup
FIX: unset categorie
FIX: update_extras on fourn card
FIX: warning when adding ECM files using old photo path
FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page
NEW: Add sale representative einstein_pdf_modules
NEW_einstein_pdf_modules
NEW: field commerciaux and categ export CustomersInvoicesAndPayments
***** ChangeLog for 6.0.5 compared to 6.0.4 *****
FIX: security vulnerability reported by ADLab of Venustech
CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900
FIX: #7379: Compatibility with PRODUCT_USE_OLD_PATH_FOR_PHOTO variable
FIX: #7903
FIX: #7933
FIX: #8029 Unable to make leave request in holyday module
FIX: #8093
FIX: Bad name alias showing in name of third column
FIX: Cashdesk should not sell to inactive third parties
FIX: Edit accountancy account and warning message on loan
FIX: $accounts[$bid] is a label !
FIX: $oldvatrateclean & $newvatrateclean must be set if preg_match === false
FIX: product best price on product list
FIX: search on contact list
FIX: stats trad for customerinvoice
FIX: translate unactivate on contractline
FIX: email sent was not in HTML
FIX: missing hook invoice index
FIX: subject mail sepa
***** ChangeLog for 6.0.4 compared to 6.0.3 *****
FIX: #7737
FIX: #7751
FIX: #7756 Add better error message
FIX: #7786
FIX: #7806
FIX: #7824
FIX: add line bad price and ref
FIX: A lot of several fix on local taxes and NPR tax
FIX: createfromorder
FIX: CSS for IE10
FIX: external user cannot be set as internal
FIX: Filter type on actioncomm with multiselect doesn't work
FIX: list of donation not filtered on multicompany
FIX: list of module not complete when module mb_strlen not available
FIX: Locatax were not propagated when cloning order or proposal
FIX: Searching translation should not be case sensitive
FIX: Search into language is ok for file into external modules two.
FIX: test for filter fk_status
FIX: too much users on holiday list
FIX: Wrong alias sql
***** ChangeLog for 6.0.3 compared to 6.0.2 *****
FIX: #7211 Update qty dispatched on qty change
FIX: #7458
FIX: #7593
FIX: #7616
FIX: #7619
FIX: #7626
FIX: #7648
FIX: #7675
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: API to get object does not return data of linked objects
FIX: Bad localtax apply
FIX: Bad ressource list in popup in gantt view
FIX: bankentries search conciliated if val 0
FIX: hook formObjectOptions() must use $expe and not $object
FIX: make of link to other object during creation
FIX: Missing function getLinesArray
FIX: old batch not shown in multi shipping
FIX: paid supplier invoices are shown as abandoned
FIX: selection of thirdparty was lost on stats page of invoices
FIX: sql syntax error because of old field accountancy_journal
FIX: Stats on invoices show nothing
FIX: substitution in ODT of thirdparties documents
FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 6.0.2 compared to 6.0.1 ***** ***** ChangeLog for 6.0.2 compared to 6.0.1 *****
FIX: #7148 FIX: #7148
FIX: #7288 FIX: #7288
FIX: #7366 renaming table with pgsql FIX: #7366 renaming table with pgsql
@@ -38,7 +187,6 @@ FIX: wrong basePath in the swagger view
FIX: Implementation of a Luracast recommandation for the REST api server FIX: Implementation of a Luracast recommandation for the REST api server
***** ChangeLog for 6.0.1 compared to 6.0.* ***** ***** ChangeLog for 6.0.1 compared to 6.0.* *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7325 Default VAT rate when editing template invoices is 0% FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7330 FIX: #7330
@@ -80,7 +228,6 @@ FIX: CVE-2017-9840, CVE-2017-14238, CVE-2017-14239, CVE-2017-14240, CVE-2017-142
CVE-2017-14242 CVE-2017-14242
***** ChangeLog for 6.0.0 compared to 5.0.* ***** ***** ChangeLog for 6.0.0 compared to 5.0.* *****
NEW: Add experimental BlockeLog module (to log business events in a non reversible log file). NEW: Add experimental BlockeLog module (to log business events in a non reversible log file).
NEW: Add a payment module for Stripe. NEW: Add a payment module for Stripe.
NEW: Add module "Product variant" (like red, blue for the product shoes) NEW: Add module "Product variant" (like red, blue for the product shoes)
@@ -221,7 +368,9 @@ Following changes may create regression for some external modules, but were nece
exists, but if an external module need action on it, it must provides itself its trigger file. exists, but if an external module need action on it, it must provides itself its trigger file.
* Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode. So, if you set var * Use $conf->global->MULTICOMPANY_TRANSVERSE_MODE instead $conf->multicompany->transverse_mode. So, if you set var
$multicompany_transverse_mode to 1 into your conf file, you must remove this line and a new key into $multicompany_transverse_mode to 1 into your conf file, you must remove this line and a new key into
the Home - setup - other admin page. the Home - setup - other admin page.
* If you use Multicompany transverse mode, it will be necessary to check the activation of the modules in the children
entities and to review completely the rights of the groups and the users.
* Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx') * Use getEntity('xxx') instead getEntity('xxx', 1) and use getEntity('xxx', 0) instead getEntity('xxx')
* Some other change were done in the way we read permission of a user when module multicompany is enabled. You can * Some other change were done in the way we read permission of a user when module multicompany is enabled. You can
retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1. retreive the old behavior by adding constant MULTICOMPANY_BACKWARD_COMPATIBILITY to 1.
@@ -229,6 +378,23 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint". hook specifications so you must return output into "resprint".
***** ChangeLog for 5.0.7 compared to 5.0.6 *****
FIX: #7000 Dashboard link for late pending payment supplier invoices do not work
FIX: #7148
FIX: #7325 Default VAT rate when editing template invoices is 0%
FIX: #7366 renaming table with pgsql
FIX: #7391
FIX: #7510 Bug: extrafield content disappear when generate pdf within intervention
FIX: Agenda events are not exported in the ICAL, VCAL if begin exactly with the same $datestart
FIX: Bad link to unpayed suppliers invoices
FIX: bankentries search conciliated if val 0
FIX: multicompany better accuracy in rounding and with revenue stamp.
FIX: PDF output was sharing 2 different currencies in same total
FIX: Upgrade missing on field
FIX: wrong key in selectarray
FIX: wrong personnal project time spent
***** ChangeLog for 5.0.6 compared to 5.0.5 ***** ***** ChangeLog for 5.0.6 compared to 5.0.5 *****
FIX: Removed a bad symbolic link into custom directory. FIX: Removed a bad symbolic link into custom directory.
FIX: Renaming a resource ref rename also the directory of attached files. FIX: Renaming a resource ref rename also the directory of attached files.

View File

@@ -1,6 +1,6 @@
# DOLIBARR ERP & CRM # 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/6.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, ...). Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...).

View File

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

View File

@@ -17,11 +17,13 @@
*/ */
/** /**
* \file build/generate_filecheck_xml.php * \file build/generate_filelist_xml.php
* \ingroup dev * \ingroup dev
* \brief This script create a xml checksum file * \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(); $sapi_type = php_sapi_name();
$script_file = basename(__FILE__); $script_file = basename(__FILE__);
$path=dirname(__FILE__).'/'; $path=dirname(__FILE__).'/';
@@ -45,7 +47,7 @@ $includeconstants=array();
if (empty($argv[1])) if (empty($argv[1]))
{ {
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n";
print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n";
exit -1; exit -1;
} }
@@ -68,11 +70,20 @@ while ($i < $argc)
$i++; $i++;
} }
// If release is auto, we take current version
$tmpver=explode('-', $release, 2);
if ($tmpver[0] == 'auto')
{
$release=DOL_VERSION;
if ($tmpver[1]) $release.='-'.$tmpver[1];
}
if (empty($includecustom)) if (empty($includecustom))
{ {
if (DOL_VERSION != $release) $tmpver=explode('-', $release, 2);
if (DOL_VERSION != $tmpver[0])
{ {
print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n"; print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n";
print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n";
exit -1; exit -1;
} }
@@ -131,7 +142,7 @@ $iterator1 = new RecursiveIteratorIterator($dir_iterator1);
$files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i'); $files = new RegexIterator($iterator1, '#^(?:[A-Z]:)?(?:/(?!(?:'.($includecustom?'':'custom\/|').'documents\/|conf\/|install\/))[^/]+)+/[^/]+\.(?:php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$#i');
*/ */
$regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$'; $regextoinclude='\.(php|css|html|js|json|tpl|jpg|png|gif|sql|lang)$';
$regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install)$'; // Exclude dirs $regextoexclude='('.($includecustom?'':'custom|').'documents|conf|install|public\/test|Shared\/PCLZip|nusoap\/lib\/Mail|php\/example|php\/test|geoip\/sample.*\.php|ckeditor\/samples|ckeditor\/adapters)$'; // Exclude dirs
$files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname'); $files = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude, 'fullname');
$dir=''; $dir='';
$needtoclose=0; $needtoclose=0;

View File

@@ -19,7 +19,7 @@ use Term::ANSIColor;
# Change this to defined target for option 98 and 99 # Change this to defined target for option 98 and 99
$PROJECT="dolibarr"; $PROJECT="dolibarr";
$PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr"; $PUBLISHSTABLE="eldy,dolibarr\@frs.sourceforge.net:/home/frs/project/dolibarr";
$PUBLISHBETARC="ldestailleur\@vmprod.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files"; $PUBLISHBETARC="dolibarr\@vmprod1.dolibarr.org:/home/dolibarr/dolibarr.org/httpdocs/files";
#@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages #@LISTETARGET=("TGZ","ZIP","RPM_GENERIC","RPM_FEDORA","RPM_MANDRIVA","RPM_OPENSUSE","DEB","APS","EXEDOLIWAMP","SNAPSHOT"); # Possible packages
@@ -466,10 +466,12 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr_*.dsc`; $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.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-*.deb`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.rpm`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.tar`; $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.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-*.tgz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.xz`;
$ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`; $ret=`rm -f $BUILDROOT/$PROJECT/build/dolibarr-*.zip`;
@@ -556,9 +558,6 @@ if ($nboftargetok) {
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems.
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
#$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball #$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball
@@ -571,6 +570,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/.gitattributes`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Classes/license.md`;
@@ -579,6 +579,7 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/Examples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/unitTests`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpoffice/phpexcel/license.md`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
@@ -590,6 +591,8 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
print "Remove subdir of custom dir\n"; print "Remove subdir of custom dir\n";
print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n"; print "find $BUILDROOT/$PROJECT/htdocs/custom/* -type d -exec rm -fr {} \\;\n";
@@ -848,6 +851,8 @@ if ($nboftargetok) {
unlink("$NEWDESTI/${FILENAMEDEB}.changes"); unlink("$NEWDESTI/${FILENAMEDEB}.changes");
print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n"; print "Remove target ${FILENAMEDEB}.debian.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEB}.debian.tar.gz"); 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"; print "Remove target ${FILENAMEDEBNATIVE}.orig.tar.gz...\n";
unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz"); unlink("$NEWDESTI/${FILENAMEDEBNATIVE}.orig.tar.gz");
@@ -1023,7 +1028,7 @@ if ($nboftargetok) {
$ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*_all.deb "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`; $ret=`mv $BUILDROOT/*.dsc "$NEWDESTI/"`;
$ret=`mv $BUILDROOT/*.orig.tar.gz "$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/"`; $ret=`mv $BUILDROOT/*.changes "$NEWDESTI/"`;
next; next;
} }
@@ -1167,7 +1172,7 @@ if ($nboftargetok) {
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'Dolibarr installer for Debian-Ubuntu (DoliDeb)', "$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}_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}.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_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/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'Dolibarr installer for Windows (DoliWamp)',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM', "$DESTI/standard/$FILENAMETGZ.tgz"=>'Dolibarr ERP-CRM',
@@ -1180,8 +1185,7 @@ if ($nboftargetok) {
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}_all.deb"=>'package_debian-ubuntu', "$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}_amd64.changes"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEB}.dsc"=>'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/${FILENAMEDEB}.debian.tar.xz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu', "$DESTI/package_debian-ubuntu/${FILENAMEDEBSHORT}.orig.tar.gz"=>'package_debian-ubuntu',
"$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows', "$DESTI/package_windows/$FILENAMEEXEDOLIWAMP.exe"=>'package_windows',
"$DESTI/standard/$FILENAMETGZ.tgz"=>'standard', "$DESTI/standard/$FILENAMETGZ.tgz"=>'standard',

View File

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

View File

@@ -187,6 +187,7 @@ export list="
--ignore-table=$base.llx_bt_webseedfiles --ignore-table=$base.llx_bt_webseedfiles
--ignore-table=$base.llx_c_civilite --ignore-table=$base.llx_c_civilite
--ignore-table=$base.llx_c_dolicloud_plans --ignore-table=$base.llx_c_dolicloud_plans
--ignore-table=$base.llx_c_pays
--ignore-table=$base.llx_c_source --ignore-table=$base.llx_c_source
--ignore-table=$base.llx_cabinetmed_c_banques --ignore-table=$base.llx_cabinetmed_c_banques
--ignore-table=$base.llx_cabinetmed_c_ccam --ignore-table=$base.llx_cabinetmed_c_ccam

View File

@@ -94,9 +94,9 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
if (empty($reshook)) if (empty($reshook))
{ {
if (! empty($cancel)) $action = ''; if (! empty($cancel)) $action = '';
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{ {
$search_account = ""; $search_account = "";
@@ -106,13 +106,13 @@ if (empty($reshook))
$search_pcgsubtype = ""; $search_pcgsubtype = "";
$search_array_options=array(); $search_array_options=array();
} }
if (GETPOST('change_chart')) if (GETPOST('change_chart'))
{ {
$chartofaccounts = GETPOST('chartofaccounts', 'int'); $chartofaccounts = GETPOST('chartofaccounts', 'int');
if (! empty($chartofaccounts)) { if (! empty($chartofaccounts)) {
if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) { if (! dolibarr_set_const($db, 'CHARTOFACCOUNTS', $chartofaccounts, 'chaine', 0, '', $conf->entity)) {
$error ++; $error ++;
} }
@@ -120,12 +120,12 @@ if (empty($reshook))
$error ++; $error ++;
} }
} }
if ($action == 'disable') { if ($action == 'disable') {
if ($accounting->fetch($id)) { if ($accounting->fetch($id)) {
$result = $accounting->account_desactivate($id); $result = $accounting->account_desactivate($id);
} }
$action = 'update'; $action = 'update';
if ($result < 0) { if ($result < 0) {
setEventMessages($accounting->error, $accounting->errors, 'errors'); setEventMessages($accounting->error, $accounting->errors, 'errors');
@@ -160,10 +160,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 = "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 .= " a2.rowid as rowid2, a2.label as label2, a2.account_number as account_number2";
$sql .= " FROM " . MAIN_DB_PREFIX . "accounting_account as aa"; $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 // 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)"; 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)"; 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; $sql .= " WHERE asy.rowid = " . $pcgver;
if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account); if (strlen(trim($search_account))) $sql .= natural_search("aa.account_number", $search_account);
@@ -179,7 +179,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{ {
$resql = $db->query($sql); $resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql); $nbtotalofrecords = $db->num_rows($resql);
} }
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
@@ -209,11 +209,11 @@ if ($resql)
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">'; print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
$htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>'; $htmlbuttonadd = '<a class="butAction" href="./card.php?action=create">' . $langs->trans("Addanaccount") . '</a>';
print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd); print_barre_liste($langs->trans('ListAccounts'), $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $htmlbuttonadd);
// Box to select active chart of account // Box to select active chart of account
print $langs->trans("Selectchartofaccounts") . " : "; print $langs->trans("Selectchartofaccounts") . " : ";
print '<select class="flat" name="chartofaccounts" id="chartofaccounts">'; print '<select class="flat" name="chartofaccounts" id="chartofaccounts">';
@@ -227,22 +227,22 @@ if ($resql)
$i = 0; $i = 0;
while ( $i < $numbis ) { while ( $i < $numbis ) {
$row = $db->fetch_row($resqlchart); $row = $db->fetch_row($resqlchart);
print '<option value="' . $row[0] . '"'; print '<option value="' . $row[0] . '"';
print $pcgver == $row[0] ? ' selected' : ''; print $pcgver == $row[0] ? ' selected' : '';
print '>' . $row[1] . ' - ' . $row[2] . '</option>'; print '>' . $row[1] . ' - ' . $row[2] . '</option>';
$i ++; $i ++;
} }
} }
print "</select>"; print "</select>";
print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">'; print '<input type="submit" class="button" name="change_chart" value="'.dol_escape_htmltag($langs->trans("ChangeAndLoad")).'">';
print '<br>'; print '<br>';
print '<br>'; print '<br>';
$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
print '<div class="div-table-responsive">'; print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
@@ -259,7 +259,7 @@ if ($resql)
print $searchpicto; print $searchpicto;
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.account_number']['checked'])) print_liste_field_titre($arrayfields['aa.account_number']['label'], $_SERVER["PHP_SELF"],"aa.account_number","",$param,'',$sortfield,$sortorder);
if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['aa.label']['checked'])) print_liste_field_titre($arrayfields['aa.label']['label'], $_SERVER["PHP_SELF"],"aa.label","",$param,'',$sortfield,$sortorder);
@@ -274,14 +274,14 @@ if ($resql)
$accountparent = new AccountingAccount($db); $accountparent = new AccountingAccount($db);
$i=0; $i=0;
while ($i < min($num, $limit)) while ($i < min($num, $limit))
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$accountstatic->id = $obj->rowid; $accountstatic->id = $obj->rowid;
$accountstatic->label = $obj->label; $accountstatic->label = $obj->label;
$accountstatic->account_number = $obj->account_number; $accountstatic->account_number = $obj->account_number;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
// Account number // Account number
@@ -310,7 +310,7 @@ if ($resql)
$accountparent->id = $obj->rowid2; $accountparent->id = $obj->rowid2;
$accountparent->label = $obj->label2; $accountparent->label = $obj->label2;
$accountparent->account_number = $obj->account_number2; $accountparent->account_number = $obj->account_number2;
print "<td>"; print "<td>";
print $accountparent->getNomUrl(1); print $accountparent->getNomUrl(1);
print "</td>\n"; print "</td>\n";
@@ -371,11 +371,11 @@ if ($resql)
} }
print '</td>' . "\n"; print '</td>' . "\n";
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }
print "</table>"; print "</table>";
print "</div>"; print "</div>";
print '</form>'; print '</form>';

View File

@@ -86,7 +86,7 @@ $tablib[35]= "DictionaryAccountancyJournal";
// Requests to extract data // Requests to extract data
$tabsql=array(); $tabsql=array();
$tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a"; $tabsql[35]= "SELECT a.rowid as rowid, a.code as code, a.label, a.nature, a.active FROM ".MAIN_DB_PREFIX."accounting_journal as a WHERE a.entity=".$conf->entity;
// Criteria to sort dictionaries // Criteria to sort dictionaries
$tabsqlsort=array(); $tabsqlsort=array();
@@ -102,7 +102,7 @@ $tabfieldvalue[35]= "code,label,nature";
// Nom des champs dans la table pour insertion d'un enregistrement // Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert=array(); $tabfieldinsert=array();
$tabfieldinsert[35]= "code,label,nature"; $tabfieldinsert[35]= "code,label,nature,entity";
// Nom du rowid si le champ n'est pas de type autoincrement // Nom du rowid si le champ n'est pas de type autoincrement
// Example: "" if id field is "rowid" and has autoincrement on // Example: "" if id field is "rowid" and has autoincrement on

View File

@@ -28,7 +28,9 @@ require '../../main.inc.php';
// Class // Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';

View File

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

View File

@@ -322,7 +322,6 @@ if ($resql) {
} }
else print $row[1]; else print $row[1];
print '</td>'; print '</td>';
print '<td align="left">' . $row[1] . '</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[$i]) . '</td>';
} }

View File

@@ -152,7 +152,7 @@ print '<script type="text/javascript">
/* /*
* Customer Invoice lines * Customer Invoice lines
*/ */
$sql = "SELECT f.rowid, f.facnumber, f.type, f.datef, f.ref_client,"; $sql = "SELECT f.rowid as factid, 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, 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 .= " 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.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,";
@@ -302,7 +302,7 @@ if ($result) {
$codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte; $codecompta = length_accountg($objp->account_number) . ' - ' . $objp->label_compte;
$facture_static->ref = $objp->facnumber; $facture_static->ref = $objp->facnumber;
$facture_static->id = $objp->rowid; $facture_static->id = $objp->factid;
$product_static->ref = $objp->product_ref; $product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id; $product_static->id = $objp->product_id;

View File

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

View File

@@ -135,9 +135,9 @@ if ($result) {
$compta_fees = $obj->compte; $compta_fees = $obj->compte;
$vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0); $vatdata = getTaxesFromId($obj->tva_tx.($obj->vat_src_code?' ('.$obj->vat_src_code.')':''), $mysoc, $mysoc, 0);
$compta_tva = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $account_vat); $compta_tva = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $account_vat);
$compta_localtax1 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); $compta_localtax1 = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
$compta_localtax2 = (! empty($vatdata['accountancy_code_sell']) ? $vatdata['accountancy_code_sell'] : $cpttva); $compta_localtax2 = (! empty($vatdata['accountancy_code_buy']) ? $vatdata['accountancy_code_buy'] : $cpttva);
// Define array to display all VAT rates that use this accounting account $compta_tva // Define array to display all VAT rates that use this accounting account $compta_tva
if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code)) if (price2num($obj->tva_tx) || ! empty($obj->vat_src_code))

View File

@@ -164,7 +164,7 @@ if ($result) {
// Situation invoices handling // Situation invoices handling
$line = new FactureLigne($db); $line = new FactureLigne($db);
$line->fetch($obj->fdid); $line->fetch($obj->fdid);
$prev_progress = $line->get_prev_progress($obj->fdid); $prev_progress = $line->get_prev_progress($obj->rowid);
if ($obj->type == Facture::TYPE_SITUATION) { if ($obj->type == Facture::TYPE_SITUATION) {
// Avoid divide by 0 // Avoid divide by 0
if ($obj->situation_percent == 0) { if ($obj->situation_percent == 0) {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1730,8 +1730,8 @@ else
//$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref); //$filedir = $conf->adherent->dir_output . '/' . get_exdir($object->id, 2, 0, 0, $object, 'member') . dol_sanitizeFileName($object->ref);
$filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member'); $filedir = $conf->adherent->dir_output . '/' . get_exdir(0, 0, 0, 0, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id; $urlsource = $_SERVER['PHP_SELF'] . '?id=' . $object->id;
$genallowed = $user->rights->adherent->creer; $genallowed = $user->rights->adherent->lire;
$delallowed = $user->rights->adherent->supprimer; $delallowed = $user->rights->adherent->creer;
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object); print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $object->default_lang, '', $object);
$somethingshown = $formfile->numoffiles; $somethingshown = $formfile->numoffiles;

View File

@@ -33,7 +33,7 @@ class Subscription extends CommonObject
public $element='subscription'; public $element='subscription';
public $table_element='subscription'; public $table_element='subscription';
public $picto='payment'; public $picto='payment';
var $datec; // Date creation var $datec; // Date creation
var $datem; // Date modification var $datem; // Date modification
var $dateh; // Subscription start date (date subscription) var $dateh; // Subscription start date (date subscription)
@@ -193,12 +193,11 @@ class Subscription extends CommonObject
*/ */
function delete($user) function delete($user)
{ {
$accountline=new AccountLine($this->db);
// It subscription is linked to a bank transaction, we get it // It subscription is linked to a bank transaction, we get it
if ($this->fk_bank > 0) if ($this->fk_bank > 0)
{ {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$accountline=new AccountLine($this->db);
$result=$accountline->fetch($this->fk_bank); $result=$accountline->fetch($this->fk_bank);
} }
@@ -288,7 +287,7 @@ class Subscription extends CommonObject
{ {
return ''; return '';
} }
/** /**
* Renvoi le libelle d'un statut donne * Renvoi le libelle d'un statut donne
* *
@@ -301,7 +300,7 @@ class Subscription extends CommonObject
$langs->load("members"); $langs->load("members");
return ''; return '';
} }
/** /**
* Load information of the subscription object * Load information of the subscription object
* *

View File

@@ -100,6 +100,7 @@ $fieldstosearchall = array(
'd.note_public'=>'NotePublic', 'd.note_public'=>'NotePublic',
'd.note_private'=>'NotePrivate', 'd.note_private'=>'NotePrivate',
); );
if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
$arrayfields=array( $arrayfields=array(
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),

View File

@@ -1,8 +1,8 @@
<?php <?php
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com> * Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -31,10 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("bills"); $langs->load("bills");
@@ -819,7 +819,6 @@ if ($rowid > 0)
if ($result) if ($result)
{ {
$subscriptionstatic=new Subscription($db); $subscriptionstatic=new Subscription($db);
$accountstatic=new Account($db);
$num = $db->num_rows($result); $num = $db->num_rows($result);
$i = 0; $i = 0;
@@ -838,6 +837,8 @@ if ($rowid > 0)
} }
print "</tr>\n"; print "</tr>\n";
$accountstatic=new Account($db);
while ($i < $num) while ($i < $num)
{ {
$objp = $db->fetch_object($result); $objp = $db->fetch_object($result);
@@ -849,20 +850,23 @@ if ($rowid > 0)
print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->dateh),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
print '<td align="right">'.price($objp->subscription).'</td>'; print '<td align="right">'.price($objp->subscription).'</td>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
print '<td align="right">'; print '<td align="right">';
if ($objp->bid) if ($objp->bid)
{ {
$accountstatic->label=$objp->label; $accountstatic->label=$objp->label;
$accountstatic->id=$objp->baid; $accountstatic->id=$objp->baid;
$accountstatic->number=$objp->number; $accountstatic->number=$objp->number;
$accountstatic->account_number=$objp->account_number; $accountstatic->account_number=$objp->account_number;
$accountingjournal = new AccountingJournal($db); if (! empty($conf->accounting->enabled))
$accountingjournal->fetch($objp->fk_accountancy_journal); {
$accountingjournal = new AccountingJournal($db);
$accountingjournal->fetch($objp->fk_accountancy_journal);
$accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1); $accountstatic->accountancy_journal = $accountingjournal->getNomUrl(0,1,1,'',1);
}
$accountstatic->ref=$objp->ref; $accountstatic->ref=$objp->ref;
print $accountstatic->getNomUrl(1); print $accountstatic->getNomUrl(1);
@@ -1093,12 +1097,12 @@ if ($rowid > 0)
print '</a>)'; print '</a>)';
} }
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0); if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0);
if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
{ {
$prodtmp=new Product($db); $prodtmp=new Product($db);
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
} }
print '<br>'; print '<br>';
} }
// Add invoice with payments // Add invoice with payments
@@ -1118,12 +1122,12 @@ if ($rowid > 0)
print '</a>)'; print '</a>)';
} }
if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0); if (empty($conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS) || $conf->global->ADHERENT_VAT_FOR_SUBSCRIPTIONS != 'defaultforfoundationcountry') print '. '.$langs->trans("NoVatOnSubscription",0);
if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled))) if (! empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) && (! empty($conf->product->enabled) || ! empty($conf->service->enabled)))
{ {
$prodtmp=new Product($db); $prodtmp=new Product($db);
$prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); $prodtmp->fetch($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product print '. '.$langs->transnoentitiesnoconv("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS", $prodtmp->getNomUrl(1)); // must use noentitiesnoconv to avoid to encode html into getNomUrl of product
} }
print '<br>'; print '<br>';
} }
print '</td></tr>'; print '</td></tr>';

View File

@@ -25,7 +25,9 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->banque->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
}
$langs->load("companies"); $langs->load("companies");
$langs->load("bills"); $langs->load("bills");
@@ -231,20 +233,20 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
{ {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">'; print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur" colspan="2">';
if ($object->fk_bank) if ($object->fk_bank)
{ {
$bankline=new AccountLine($db); $bankline=new AccountLine($db);
$result=$bankline->fetch($object->fk_bank); $result=$bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1,0,'showall'); print $bankline->getNomUrl(1,0,'showall');
} }
else else
{ {
print $langs->trans("NoneF"); print $langs->trans("NoneF");
} }
print '</td></tr>'; print '</td></tr>';
} }
} }
print '</table>'; print '</table>';
@@ -326,27 +328,26 @@ if ($rowid && $action != 'edit')
// Amount // Amount
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur">'.$object->note.'</td></tr>';
// Bank line // Bank line
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank) if ($conf->global->ADHERENT_BANK_USE || $object->fk_bank)
{ {
print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">'; print '<tr><td>'.$langs->trans("BankTransactionLine").'</td><td class="valeur">';
if ($object->fk_bank) if ($object->fk_bank)
{ {
$bankline=new AccountLine($db); $bankline=new AccountLine($db);
$result=$bankline->fetch($object->fk_bank); $result=$bankline->fetch($object->fk_bank);
print $bankline->getNomUrl(1,0,'showall'); print $bankline->getNomUrl(1,0,'showall');
} }
else else
{ {
print $langs->trans("NoneF"); print $langs->trans("NoneF");
} }
print '</td></tr>'; print '</td></tr>';
} }
} }
print "</table>\n"; print "</table>\n";
print '</div>'; print '</div>';
@@ -389,8 +390,8 @@ if ($rowid && $action != 'edit')
$filename = dol_sanitizeFileName($object->ref); $filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); $filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id; $urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
$genallowed = $user->rights->facture->creer; $genallowed = $user->rights->facture->lire;
$delallowed = $user->rights->facture->supprimer; $delallowed = $user->rights->facture->creer;
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
$somethingshown = $formfile->numoffiles; $somethingshown = $formfile->numoffiles;

View File

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

View File

@@ -304,22 +304,22 @@ if ($result)
print dol_trunc($obj->note,32); print dol_trunc($obj->note,32);
print '</td>'; print '</td>';
// Banque // Banque
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {
if ($obj->fk_account) if ($obj->fk_account > 0)
{ {
$accountstatic->id=$obj->fk_account; $accountstatic->id=$obj->fk_account;
$accountstatic->fetch($obj->fk_account); $accountstatic->fetch($obj->fk_account);
//$accountstatic->label=$obj->label; //$accountstatic->label=$obj->label;
print '<td>'.$accountstatic->getNomUrl(1).'</td>'; print '<td>'.$accountstatic->getNomUrl(1).'</td>';
} }
else else
{ {
print "<td>"; print "<td>";
print "</td>\n"; print "</td>\n";
} }
} }
// Date start // Date start
print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($obj->dateadh),'day')."</td>\n";

View File

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

View File

@@ -96,7 +96,7 @@ if ($action == 'add' && $user->rights->adherent->configurer)
$object->label = trim($label); $object->label = trim($label);
$object->subscription = (int) trim($subscription); $object->subscription = (int) trim($subscription);
$object->note = trim($comment); $object->note = trim($comment);
$object->mail_valid = (boolean) trim($mail_valid); $object->mail_valid = trim($mail_valid);
$object->vote = (boolean) trim($vote); $object->vote = (boolean) trim($vote);
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
@@ -134,7 +134,7 @@ if ($action == 'update' && $user->rights->adherent->configurer)
$object->label = trim($label); $object->label = trim($label);
$object->subscription = (int) trim($subscription); $object->subscription = (int) trim($subscription);
$object->note = trim($comment); $object->note = trim($comment);
$object->mail_valid = (boolean) trim($mail_valid); $object->mail_valid = trim($mail_valid);
$object->vote = (boolean) trim($vote); $object->vote = (boolean) trim($vote);
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form

View File

@@ -365,7 +365,7 @@ if ($mode == 'desc')
if ($mode == 'feature') if ($mode == 'feature')
{ {
$text.='<br><strong>'.$langs->trans("DependsOn").':</strong> '; $text.='<br><strong>'.$langs->trans("DependsOn").':</strong> ';
if (count($objMod->requiredby)) $text.=join(',', $objMod->depends); if (count($objMod->depends)) $text.=join(',', $objMod->depends);
else $text.=$langs->trans("None"); else $text.=$langs->trans("None");
$text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> '; $text.='<br><strong>'.$langs->trans("RequiredBy").':</strong> ';
if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby);

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 // 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'; include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
$newmodule=new modFournisseur($db); $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) 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); $newmodule->insert_permissions(1);
} }
else else
{ {
// Remove all rights with Permission1190
$newmodule->delete_permissions(); $newmodule->delete_permissions();
// Add all right without Permission1190
$newmodule->insert_permissions(1);
} }
} }

View File

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

View File

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

View File

@@ -69,7 +69,7 @@ class DolibarrApiAccess implements iAuthenticate
*/ */
public function __isAllowed() public function __isAllowed()
{ {
global $db; global $conf, $db;
$login = ''; $login = '';
$stored_key = ''; $stored_key = '';
@@ -100,10 +100,13 @@ class DolibarrApiAccess implements iAuthenticate
if ($api_key) if ($api_key)
{ {
$userentity = 0;
$sql = "SELECT u.login, u.datec, u.api_key, "; $sql = "SELECT u.login, u.datec, u.api_key, ";
$sql.= " u.tms as date_modification, u.entity"; $sql.= " u.tms as date_modification, u.entity";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE u.api_key = '".$db->escape($api_key)."'"; $sql.= " WHERE u.api_key = '".$db->escape($api_key)."'";
// TODO Check if 2 users has same API key.
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
@@ -113,24 +116,34 @@ class DolibarrApiAccess implements iAuthenticate
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
$login = $obj->login; $login = $obj->login;
$stored_key = $obj->api_key; $stored_key = $obj->api_key;
$userentity = $obj->entity;
if (! defined("DOLENTITY") && $conf->entity != ($obj->entity?$obj->entity:1)) // If API was not forced with HTTP_DOLENTITY, and user is on another entity, so we reset entity to entity of user
{
$conf->entity = ($obj->entity?$obj->entity:1);
// We must also reload global conf to get params from the entity
dol_syslog("Entity was not set on http header with HTTP_DOLAPIENTITY (recommanded for performance purpose), so we switch now on entity of user (".$conf->entity .") and we have to reload configuration.", LOG_WARNING);
$conf->setValues($db);
}
} }
} }
else { else {
throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg); throw new RestException(503, 'Error when fetching user api_key :'.$db->error_msg);
} }
if ($stored_key != $api_key) { if ($stored_key != $api_key) { // This should not happen since we did a search on api_key
$userClass::setCacheIdentifier($api_key); $userClass::setCacheIdentifier($api_key);
return false; return false;
} }
if (! $login) if (! $login)
{ {
throw new RestException(503, 'Error when searching logn user fro mapi key'); throw new RestException(503, 'Error when searching login user from api key');
} }
$fuser = new User($db); $fuser = new User($db);
if(! $fuser->fetch('',$login)) { $result = $fuser->fetch('', $login, '', 0, (empty($userentity) ? -1 : $conf->entity)); // If user is not entity 0, we search in working entity $conf->entity (that may have been forced to a different value than user entity)
throw new RestException(503, 'Error when fetching user :'.$fuser->error); if ($result <= 0) {
throw new RestException(503, 'Error when fetching user :'.$fuser->error.' (conf->entity='.$conf->entity.')');
} }
$fuser->getrights(); $fuser->getrights();
static::$user = $fuser; static::$user = $fuser;
@@ -143,14 +156,14 @@ class DolibarrApiAccess implements iAuthenticate
} }
else else
{ {
throw new RestException(401, "Failed to login to API. No parameter 'DOLAPIKEY' on HTTP header (neither in URL)."); throw new RestException(401, "Failed to login to API. No parameter 'HTTP_DOLAPIKEY' on HTTP header (and no parameter DOLAPIKEY in URL).");
} }
$userClass::setCacheIdentifier(static::$role); $userClass::setCacheIdentifier(static::$role);
Resources::$accessControlFunction = 'DolibarrApiAccess::verifyAccess'; Resources::$accessControlFunction = 'DolibarrApiAccess::verifyAccess';
$requirefortest = static::$requires; $requirefortest = static::$requires;
if (! is_array($requirefortest)) $requirefortest=explode(',',$requirefortest); if (! is_array($requirefortest)) $requirefortest=explode(',',$requirefortest);
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin'; return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
} }
/** /**

View File

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

View File

@@ -37,6 +37,10 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); // Do not lo
if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session) if (! defined("NOLOGIN")) define("NOLOGIN",'1'); // If this page is public (can be called outside logged session)
// Force entity if a value is provided into HTTP header. Otherwise, will use the entity of user of token used.
if (! empty($_SERVER['HTTP_DOLAPIENTITY'])) define("DOLENTITY", (int) $_SERVER['HTTP_DOLAPIENTITY']);
$res=0; $res=0;
if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php'; if (! $res && file_exists("../main.inc.php")) $res=include '../main.inc.php';
if (! $res) die("Include of main fails"); if (! $res) die("Include of main fails");
@@ -124,7 +128,7 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
foreach ($modulesdir as $dir) foreach ($modulesdir as $dir)
{ {
// Search available module // Search available module
dol_syslog("Scan directory ".$dir." for module descriptor to after search for API files"); dol_syslog("Scan directory ".$dir." for module descriptor files, then search for API files");
$handle=@opendir(dol_osencode($dir)); $handle=@opendir(dol_osencode($dir));
if (is_resource($handle)) if (is_resource($handle))
@@ -135,14 +139,14 @@ if (! empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/resources.json' |
{ {
$module = strtolower($regmod[1]); $module = strtolower($regmod[1]);
$moduledirforclass = getModuleDirForApiClass($module); $moduledirforclass = getModuleDirForApiClass($module);
$moduleforperm = $module; $modulenameforenabled = $module;
if ($module == 'propale') { $moduleforperm='propal'; } if ($module == 'propale') { $modulenameforenabled='propal'; }
//dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass); dol_syslog("Found module file ".$file." - module=".$module." - moduledirforclass=".$moduledirforclass);
// Defined if module is enabled // Defined if module is enabled
$enabled=true; $enabled=true;
if (empty($conf->$moduleforperm->enabled)) $enabled=false; if (empty($conf->$modulenameforenabled->enabled)) $enabled=false;
if ($enabled) if ($enabled)
{ {
@@ -231,7 +235,13 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
if ($module == 'order') { $classname='Commande'; } if ($module == 'order') { $classname='Commande'; }
//var_dump($classfile);var_dump($classname);exit; //var_dump($classfile);var_dump($classname);exit;
require_once $dir_part_file; $res = include_once $dir_part_file;
if (! $res)
{
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
exit(0);
}
if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/'); if (class_exists($classname.'Api')) $api->r->addAPIClass($classname.'Api', '/');
} }
else else
@@ -242,7 +252,14 @@ if (! empty($reg[1]) && ($reg[1] != 'explorer' || ($reg[2] != '/resources.json'
$dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php'); $dir_part_file = dol_buildpath('/'.$moduledirforclass.'/class/api_'.$classfile.'.class.php');
$classname=ucwords($module); $classname=ucwords($module);
require_once $dir_part_file; $res = include_once $dir_part_file;
if (! $res)
{
print 'API not found (failed to include API file)';
header('HTTP/1.1 501 API not found (failed to include API file)');
exit(0);
}
if (class_exists($classname)) $api->r->addAPIClass($classname); if (class_exists($classname)) $api->r->addAPIClass($classname);
} }
} }

View File

@@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2014-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -143,7 +144,7 @@ if ($action == 'initbarcodeproducts')
$nextvalue=$modBarCodeProduct->getNextValue($productstatic,''); $nextvalue=$modBarCodeProduct->getNextValue($productstatic,'');
//print 'Set value '.$nextvalue.' to product '.$productstatic->id." ".$productstatic->ref." ".$productstatic->type."<br>\n"; //print 'Set value '.$nextvalue.' to product '.$productstatic->id." ".$productstatic->ref." ".$productstatic->type."<br>\n";
$result=$productstatic->setValueFrom('barcode', $nextvalue, '', '', 'date', '', $user, 'PRODUCT_MODIFY'); $result=$productstatic->setValueFrom('barcode', $nextvalue, '', '', 'text', '', $user, 'PRODUCT_MODIFY');
$nbtry++; $nbtry++;
if ($result > 0) $nbok++; if ($result > 0) $nbok++;

View File

@@ -108,6 +108,17 @@ class BlockedLog
$this->error++; $this->error++;
} }
} }
if($this->element === 'invoice_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$object = new FactureFournisseur($this->db);
if($object->fetch($this->fk_object)>0) {
return $object->getNomUrl(1);
}
else{
$this->error++;
}
}
else if($this->element === 'payment') { else if($this->element === 'payment') {
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
@@ -119,6 +130,17 @@ class BlockedLog
$this->error++; $this->error++;
} }
} }
else if($this->element === 'payment_supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
$object = new PaiementFourn($this->db);
if($object->fetch($this->fk_object)>0) {
return $object->getNomUrl(1);
}
else{
$this->error++;
}
}
return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object); return $langs->trans('ImpossibleToReloadObject', $this->element, $this->fk_object);
@@ -153,7 +175,7 @@ class BlockedLog
*/ */
public function setObjectData(&$object) { public function setObjectData(&$object) {
if($object->element=='payment') { if($object->element=='payment' || $object->element=='payment_supplier') {
$this->date_object = $object->datepaye; $this->date_object = $object->datepaye;
} }
else{ else{
@@ -183,13 +205,28 @@ class BlockedLog
$this->object_data->note_private= (double) $object->note_private; $this->object_data->note_private= (double) $object->note_private;
} }
elseif($this->element==='payment'){ if($this->element === 'invoice_supplier') {
if(empty($object->thirdparty))$object->fetch_thirdparty();
$this->object_data->thirdparty = new stdClass();
foreach($object->thirdparty as $key=>$value) {
if(!is_object($value)) $this->object_data->thirdparty->{$key} = $value;
}
$this->object_data->total_ht = (double) $object->total_ht;
$this->object_data->total_tva = (double) $object->total_tva;
$this->object_data->total_ttc = (double) $object->total_ttc;
$this->object_data->total_localtax1= (double) $object->total_localtax1;
$this->object_data->total_localtax2= (double) $object->total_localtax2;
$this->object_data->note_public = (double) $object->note_public;
$this->object_data->note_private= (double) $object->note_private;
}
elseif($this->element==='payment'|| $object->element=='payment_supplier'){
$this->object_data->amounts = $object->amounts; $this->object_data->amounts = $object->amounts;
} }
} }
/** /**
@@ -511,6 +548,15 @@ class BlockedLog
$this->amounts = (double) $obj->amount; $this->amounts = (double) $obj->amount;
} }
} }
if($this->element === 'payment_supplier') {
$sql="SELECT amount FROM ".MAIN_DB_PREFIX."paiementfourn WHERE rowid=".$this->fk_object;
$res = $this->db->query($sql);
if($res && $obj = $this->db->fetch_object($res)) {
$this->amounts = (double) $obj->amount;
}
}
elseif($this->element === 'facture') { elseif($this->element === 'facture') {
$sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object; $sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object;

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -103,7 +103,7 @@ print "</tr>\n";
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>'; print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,0,1,array(),0); print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3) AND s.status = 1',1,0,1,array(),0);
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->banque->enabled)) if (! empty($conf->banque->enabled))
{ {

View File

@@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net> /* Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
* Copyright (C) 2008-2010 Laurent Destailleur <eldy@uers.sourceforge.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 * 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 * it under the terms of the GNU General Public License as published by
@@ -114,10 +115,13 @@ switch($action)
{ {
if (count($prodcustprice->lines) > 0) if (count($prodcustprice->lines) > 0)
{ {
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
else else
@@ -147,7 +151,8 @@ switch($action)
$obj_facturation->id($ret['rowid']); $obj_facturation->id($ret['rowid']);
$obj_facturation->ref($ret['ref']); $obj_facturation->ref($ret['ref']);
$obj_facturation->stock($ret['reel']); $obj_facturation->stock($ret['reel']);
$obj_facturation->prix($ret['price']); //$obj_facturation->prix($ret['price']);
$obj_facturation->prix($pu_ht);
$vatrate = $tva_tx; $vatrate = $tva_tx;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -579,7 +579,7 @@ if ($action == 'mupdate')
// Actions to delete doc // Actions to delete doc
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
$permissioncreate = ($user->rights->agenda->allactions->delete || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete)); $permissioncreate = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
@@ -1329,6 +1329,8 @@ if ($id > 0)
print '</div>'; print '</div>';
if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid))) if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
{ {
//var_dump($object->userassigned);
//var_dump($listofuserid);
print '<div class="myavailability">'; print '<div class="myavailability">';
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
print '</div>'; print '</div>';
@@ -1483,8 +1485,8 @@ if ($id > 0)
$filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id; $filedir=$conf->agenda->multidir_output[$conf->entity].'/'.$object->id;
$urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id; $urlsource=$_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed=$user->rights->agenda->myactions->create; $genallowed=$user->rights->agenda->myactions->read;
$delallowed=$user->rights->agenda->myactions->delete; $delallowed=$user->rights->agenda->myactions->create;
$var=true; $var=true;

View File

@@ -2,8 +2,8 @@
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -225,11 +225,11 @@ class ActionComm extends CommonObject
if ($this->elementtype=='commande') $this->elementtype='order'; if ($this->elementtype=='commande') $this->elementtype='order';
if ($this->elementtype=='contrat') $this->elementtype='contract'; if ($this->elementtype=='contrat') $this->elementtype='contract';
if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility if (! is_array($this->userassigned) && ! empty($this->userassigned)) // For backward compatibility when userassigned was an int instead fo array
{ {
$tmpid=$this->userassigned; $tmpid=$this->userassigned;
$this->userassigned=array(); $this->userassigned=array();
$this->userassigned[$tmpid]=array('id'=>$tmpid); $this->userassigned[$tmpid]=array('id'=>$tmpid, 'transparency'=>$this->transparency);
} }
if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated if (is_object($this->contact) && isset($this->contact->id) && $this->contact->id > 0 && ! ($this->contactid > 0)) $this->contactid = $this->contact->id; // For backward compatibility. Using this->contact->xx is deprecated
@@ -240,7 +240,7 @@ class ActionComm extends CommonObject
// Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...). // Be sure assigned user is defined as an array of array('id'=>,'mandatory'=>,...).
if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned)) if (empty($this->userassigned) || count($this->userassigned) == 0 || ! is_array($this->userassigned))
$this->userassigned = array($userownerid=>array('id'=>$userownerid)); $this->userassigned = array($userownerid=>array('id'=>$userownerid, 'transparency'=>$this->transparency));
if (! $this->type_id || ! $this->type_code) if (! $this->type_id || ! $this->type_code)
{ {
@@ -1333,6 +1333,7 @@ class ActionComm extends CommonObject
{ {
// Note: Output of sql request is encoded in $conf->file->character_set_client // Note: Output of sql request is encoded in $conf->file->character_set_client
// This assignment in condition is not a bug. It allows walking the results. // This assignment in condition is not a bug. It allows walking the results.
$diff = 0;
while ($obj=$this->db->fetch_object($resql)) while ($obj=$this->db->fetch_object($resql))
{ {
$qualified=true; $qualified=true;
@@ -1367,8 +1368,9 @@ class ActionComm extends CommonObject
if ($qualified && $datestart) if ($qualified && $datestart)
{ {
$eventarray[$datestart]=$event; $eventarray[$datestart+$diff]=$event;
} }
$diff++;
} }
} }
else else

View File

@@ -75,7 +75,7 @@ if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name"; if (! $sortfield) $sortfield="name";
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart='contract'; $modulepart='actions';
/* /*

View File

@@ -297,7 +297,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param=''; $param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
@@ -482,7 +486,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
else else
{ {
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; if (is_array($actioncode))
{
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
} }
} }
} }
@@ -523,8 +534,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable 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 == '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 == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 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)"; }
// We must filter on assignement table // We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) if ($filtert > 0 || $usergroup > 0)
{ {
@@ -1232,7 +1243,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
$ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day);
$nextindextouse=count($colorindexused); // At first run this is 0, so fist 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, ...
//print $nextindextouse; //print $nextindextouse;
foreach ($eventarray as $daykey => $notused) foreach ($eventarray as $daykey => $notused)

View File

@@ -169,7 +169,11 @@ $listofextcals=array();
$param=''; $param='';
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
if ($actioncode != '') $param.="&actioncode=".$actioncode; if ($actioncode != '') {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status != '' && $status > -1) $param.="&status=".$status; if ($status != '' && $status > -1) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
@@ -227,7 +231,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND c.type = 'systemauto'";
else else
{ {
$sql.=" AND c.code IN ('".implode("','", explode(',',$actioncode))."')"; if (is_array($actioncode))
{
$sql.=" AND c.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND c.code IN ('".implode("','", explode(',', $actioncode))."')";
}
} }
} }
} }
@@ -242,8 +253,8 @@ if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable 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 == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // Running already started
if ($status == '100') { $sql.= " AND a.percent = 100"; } 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 == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 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)"; }
if ($search_title) $sql.=natural_search("a.label", $search_title); if ($search_title) $sql.=natural_search("a.label", $search_title);
// We must filter on assignement table // We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) if ($filtert > 0 || $usergroup > 0)

View File

@@ -427,8 +427,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable 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 == '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 == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 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)"; }
// We must filter on assignement table // We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) if ($filtert > 0 || $usergroup > 0)
{ {

View File

@@ -203,7 +203,11 @@ if ($status == 'done') $title=$langs->trans("DoneActions");
if ($status == 'todo') $title=$langs->trans("ToDoActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions");
$param=''; $param='';
if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) {
if(is_array($actioncode)) {
foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action;
} else $param.="&actioncode=".$actioncode;
}
if ($resourceid > 0) $param.="&resourceid=".$resourceid; if ($resourceid > 0) $param.="&resourceid=".$resourceid;
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status;
if ($filter) $param.="&filter=".$filter; if ($filter) $param.="&filter=".$filter;
@@ -394,7 +398,14 @@ if (! empty($actioncode))
elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'"; elseif ($actioncode == 'AC_ALL_AUTO') $sql.= " AND ca.type = 'systemauto'";
else else
{ {
$sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; if (is_array($actioncode))
{
$sql.=" AND ca.code IN ('".implode("','", $actioncode)."')";
}
else
{
$sql.=" AND ca.code IN ('".implode("','", explode(',', $actioncode))."')";
}
} }
} }
} }
@@ -435,8 +446,8 @@ if ($type) $sql.= " AND ca.id = ".$type;
if ($status == '0') { $sql.= " AND a.percent = 0"; } if ($status == '0') { $sql.= " AND a.percent = 0"; }
if ($status == '-1') { $sql.= " AND a.percent = -1"; } // Not applicable 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 == '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 == 'done' || $status == '100') { $sql.= " AND (a.percent = 100)"; }
if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 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)"; }
// We must filter on assignement table // We must filter on assignement table
if ($filtert > 0 || $usergroup > 0) if ($filtert > 0 || $usergroup > 0)
{ {

View File

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

View File

@@ -79,6 +79,7 @@ $originid = GETPOST('originid', 'int');
$confirm = GETPOST('confirm', 'alpha'); $confirm = GETPOST('confirm', 'alpha');
$lineid = GETPOST('lineid', 'int'); $lineid = GETPOST('lineid', 'int');
$contactid = GETPOST('contactid','int'); $contactid = GETPOST('contactid','int');
$projectid = GETPOST('projectid','int');
// PDF // PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@@ -611,7 +612,7 @@ if (empty($reshook))
// prevent browser refresh from closing proposal several times // prevent browser refresh from closing proposal several times
if ($object->statut == Propal::STATUS_VALIDATED) if ($object->statut == Propal::STATUS_VALIDATED)
{ {
$result=$object->cloture($user, GETPOST('statut'), GETPOST('note')); $result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note','none'));
if ($result < 0) if ($result < 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@@ -805,6 +806,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx); $tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx . ' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
} }
@@ -864,13 +868,33 @@ if (empty($reshook))
// Add custom code and origin country into description // Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code)))
{ {
$tmptxt = '('; // Define output language
if (! empty($prod->customcode)) if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; $outputlangs = $langs;
if (! empty($prod->customcode) && ! empty($prod->country_code)) $newlang = '';
$tmptxt .= ' - '; if (empty($newlang) && GETPOST('lang_id','alpha'))
if (! empty($prod->country_code)) $newlang = GETPOST('lang_id','alpha');
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
}
if (! empty($prod->customcode))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
} else {
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
}
$tmptxt .= ')'; $tmptxt .= ')';
$desc = dol_concatdesc($desc, $tmptxt); $desc = dol_concatdesc($desc, $tmptxt);
} }
@@ -1297,7 +1321,7 @@ if ($action == 'create')
} }
$objectsrc->fetch_thirdparty(); $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_client = (! empty($objectsrc->ref_client) ? $objectsrc->ref_client : '');
$ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : ''); $ref_int = (! empty($objectsrc->ref_int) ? $objectsrc->ref_int : '');
@@ -1427,7 +1451,7 @@ if ($action == 'create')
// Bank Account // Bank Account
if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) { if (! empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && ! empty($conf->banque->enabled)) {
print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>'; 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>'; print '</td></tr>';
} }
@@ -1465,9 +1489,6 @@ if ($action == 'create')
// Project // Project
if (! empty($conf->projet->enabled) && $socid > 0) if (! empty($conf->projet->enabled) && $socid > 0)
{ {
$projectid = GETPOST('projectid')?GETPOST('projectid'):0;
if ($origin == 'project') $projectid = ($originid ? $originid : 0);
$langs->load("projects"); $langs->load("projects");
print '<tr>'; print '<tr>';
print '<td>' . $langs->trans("Project") . '</td><td>'; print '<td>' . $langs->trans("Project") . '</td><td>';
@@ -2173,7 +2194,7 @@ if ($action == 'create')
// Show object lines // Show object lines
$result = $object->getLinesArray(); $result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '"> <input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">
@@ -2355,8 +2376,8 @@ if ($action == 'create')
$filename = dol_sanitizeFileName($object->ref); $filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref); $filedir = $conf->propal->dir_output . "/" . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->propal->creer; $genallowed = $user->rights->propal->lire;
$delallowed = $user->rights->propal->supprimer; $delallowed = $user->rights->propal->creer;
$var = true; $var = true;

View File

@@ -280,14 +280,14 @@ class Proposals extends DolibarrApi
$request_data->date_end, $request_data->date_end,
$request_data->array_options, $request_data->array_options,
$request_data->fk_unit, $request_data->fk_unit,
$this->element, $request_data->origin,
$request_data->id, $request_data->origin_id,
$request_data->multicurrency_subprice, $request_data->multicurrency_subprice,
$request_data->fk_remise_except $request_data->fk_remise_except
); );
if ($updateRes > 0) { if ($updateRes > 0) {
return $this->get($id)->line->rowid; return $updateRes;
} }
return false; return false;

View File

@@ -371,12 +371,12 @@ class Propal extends CommonObject
* by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product) * by whose calling the method get_default_tva (societe_vendeuse, societe_acheteuse, '' product)
* and desc must already have the right value (it's up to the caller to manage multilanguage) * and desc must already have the right value (it's up to the caller to manage multilanguage)
* *
* @param string $desc Description de la ligne * @param string $desc Description of line
* @param float $pu_ht Prix unitaire * @param float $pu_ht Unit price
* @param float $qty Quantite * @param float $qty Quantity
* @param float $txtva Taux de tva * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id du produit/service predefini * @param int $fk_product Id du produit/service predefini
* @param float $remise_percent Pourcentage de remise de la ligne * @param float $remise_percent Pourcentage de remise de la ligne
* @param string $price_base_type HT or TTC * @param string $price_base_type HT or TTC
@@ -417,6 +417,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent); $remise_percent=price2num($remise_percent);
$qty=price2num($qty); $qty=price2num($qty);
$pu_ht=price2num($pu_ht); $pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc); $pu_ttc=price2num($pu_ttc);
$txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5' $txtva=price2num($txtva); // $txtva can have format '5.0(XXX)' or '5'
$txlocaltax1=price2num($txlocaltax1); $txlocaltax1=price2num($txlocaltax1);
@@ -590,6 +591,11 @@ class Propal extends CommonObject
return -2; return -2;
} }
} }
else
{
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
return -3;
}
} }
@@ -633,6 +639,7 @@ class Propal extends CommonObject
$remise_percent=price2num($remise_percent); $remise_percent=price2num($remise_percent);
$qty=price2num($qty); $qty=price2num($qty);
$pu = price2num($pu); $pu = price2num($pu);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva = price2num($txtva); $txtva = price2num($txtva);
$txlocaltax1=price2num($txlocaltax1); $txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2); $txlocaltax2=price2num($txlocaltax2);
@@ -831,8 +838,9 @@ class Propal extends CommonObject
if (empty($this->availability_id)) $this->availability_id=0; if (empty($this->availability_id)) $this->availability_id=0;
if (empty($this->demand_reason_id)) $this->demand_reason_id=0; if (empty($this->demand_reason_id)) $this->demand_reason_id=0;
// Multicurrency // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $this->date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
{ {
$this->multicurrency_code = $conf->currency; $this->multicurrency_code = $conf->currency;
@@ -955,9 +963,51 @@ class Propal extends CommonObject
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (! $resql) $error++; if (! $resql) $error++;
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
{
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
}
// Add object linked
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
{
foreach($this->linked_objects as $origin => $tmp_origin_id)
{
if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...))
{
foreach($tmp_origin_id as $origin_id)
{
$ret = $this->add_object_linked($origin, $origin_id);
if (! $ret)
{
$this->error=$this->db->lasterror();
$error++;
}
}
}
else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
{
$origin_id = $tmp_origin_id;
$ret = $this->add_object_linked($origin, $origin_id);
if (! $ret)
{
$this->error=$this->db->lasterror();
$error++;
}
}
}
}
// Add linked object (deprecated, use ->linkedObjectsIds instead)
if (! $error && $this->origin && $this->origin_id)
{
$ret = $this->add_object_linked();
if (! $ret) dol_print_error($this->db);
}
/* /*
* Insertion du detail des produits dans la base * Insertion du detail des produits dans la base
*/ */
if (! $error) if (! $error)
{ {
$fk_parent_line=0; $fk_parent_line=0;
@@ -970,11 +1020,15 @@ class Propal extends CommonObject
$fk_parent_line = 0; $fk_parent_line = 0;
} }
// Complete vat rate with code
$vatrate = $this->lines[$i]->tva_tx;
if ($this->lines[$i]->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$this->lines[$i]->vat_src_code.')';
$result = $this->addline( $result = $this->addline(
$this->lines[$i]->desc, $this->lines[$i]->desc,
$this->lines[$i]->subprice, $this->lines[$i]->subprice,
$this->lines[$i]->qty, $this->lines[$i]->qty,
$this->lines[$i]->tva_tx, $vatrate,
$this->lines[$i]->localtax1_tx, $this->lines[$i]->localtax1_tx,
$this->lines[$i]->localtax2_tx, $this->lines[$i]->localtax2_tx,
$this->lines[$i]->fk_product, $this->lines[$i]->fk_product,
@@ -1011,13 +1065,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 // Set delivery address
if (! $error && $this->fk_delivery_address) if (! $error && $this->fk_delivery_address)
{ {
@@ -1186,7 +1233,6 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = ''; if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $clonedObj->ref_client = '';
// Create clone // Create clone
$result=$clonedObj->create($user); $result=$clonedObj->create($user);
if ($result < 0) $error++; if ($result < 0) $error++;
else else

View File

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

View File

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

View File

@@ -83,12 +83,14 @@ $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
$search_day=GETPOST("search_day","int"); $search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int"); $search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int"); $search_year=GETPOST("search_year","int");
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $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; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
@@ -384,6 +386,7 @@ if ($resql)
if ($search_zip) $param.='&search_zip='.urlencode($search_zip); if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
if ($socid > 0) $param.='&socid='.urlencode($socid); if ($socid > 0) $param.='&socid='.urlencode($socid);
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
if ($search_product_category != '') $param.='&search_product_category='.$search_product_category;
// Add $param from extra fields // Add $param from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
@@ -1031,7 +1034,7 @@ if ($resql)
$filedir=$diroutputmassaction; $filedir=$diroutputmassaction;
$genallowed=$user->rights->propal->lire; $genallowed=$user->rights->propal->lire;
$delallowed=$user->rights->propal->lire; $delallowed=$user->rights->propal->creer;
print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'',''); print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
} }

View File

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

View File

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

View File

@@ -389,7 +389,7 @@ if ($socid > 0)
$facturestatic->id=$obj->fk_facture_source; $facturestatic->id=$obj->fk_facture_source;
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("Invoice"),$obj->description).' '.$facturestatic->getNomURl(1); print preg_replace('/\(EXCESS RECEIVED\)/',$langs->trans("ExcessReceived"),$obj->description).' '.$facturestatic->getNomURl(1);
print '</td>'; print '</td>';
} }
else else

View File

@@ -766,10 +766,13 @@ if (empty($reshook))
{ {
if (count($prodcustprice->lines) > 0) if (count($prodcustprice->lines) > 0)
{ {
$pu_ht = price($prodcustprice->lines [0]->price); $pu_ht = price($prodcustprice->lines[0]->price);
$pu_ttc = price($prodcustprice->lines [0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines [0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines [0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
else else
@@ -821,12 +824,33 @@ if (empty($reshook))
// Add custom code and origin country into description // Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
$tmptxt = '('; $tmptxt = '(';
if (! empty($prod->customcode)) // Define output language
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
if (! empty($prod->customcode) && ! empty($prod->country_code)) $outputlangs = $langs;
$tmptxt .= ' - '; $newlang = '';
if (! empty($prod->country_code)) if (empty($newlang) && GETPOST('lang_id','alpha'))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); $newlang = GETPOST('lang_id','alpha');
if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
}
if (! empty($prod->customcode))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
} else {
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
}
$tmptxt .= ')'; $tmptxt .= ')';
$desc = dol_concatdesc($desc, $tmptxt); $desc = dol_concatdesc($desc, $tmptxt);
} }
@@ -2389,7 +2413,7 @@ if ($action == 'create' && $user->rights->commande->creer)
*/ */
$result = $object->getLinesArray(); $result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '"> <input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">
@@ -2576,8 +2600,8 @@ if ($action == 'create' && $user->rights->commande->creer)
$relativepath = $comref . '/' . $comref . '.pdf'; $relativepath = $comref . '/' . $comref . '.pdf';
$filedir = $conf->commande->dir_output . '/' . $comref; $filedir = $conf->commande->dir_output . '/' . $comref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$genallowed = $user->rights->commande->creer; $genallowed = $user->rights->commande->lire;
$delallowed = $user->rights->commande->supprimer; $delallowed = $user->rights->commande->creer;
print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); print $formfile->showdocuments('commande', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);

View File

@@ -52,9 +52,9 @@ class Orders extends DolibarrApi
} }
/** /**
* Get properties of a commande object * Get properties of an order object
* *
* Return an array with commande informations * Return an array with order informations
* *
* @param int $id ID of order * @param int $id ID of order
* @return array|mixed data without useless information * @return array|mixed data without useless information
@@ -176,7 +176,7 @@ class Orders extends DolibarrApi
* Create order object * Create order object
* *
* @param array $request_data Request data * @param array $request_data Request data
* @return int ID of commande * @return int ID of order
*/ */
function post($request_data = NULL) function post($request_data = NULL)
{ {
@@ -196,6 +196,7 @@ class Orders extends DolibarrApi
} }
$this->commande->lines = $lines; $this->commande->lines = $lines;
}*/ }*/
if ($this->commande->create(DolibarrApiAccess::$user) < 0) { if ($this->commande->create(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors)); throw new RestException(500, "Error creating order", array_merge(array($this->commande->error), $this->commande->errors));
} }
@@ -236,8 +237,8 @@ class Orders extends DolibarrApi
/** /**
* Add a line to given order * Add a line to given order
* *
* @param int $id Id of commande to update * @param int $id Id of order to update
* @param array $request_data Orderline data * @param array $request_data OrderLine data
* *
* @url POST {id}/lines * @url POST {id}/lines
* *
@@ -281,12 +282,13 @@ class Orders extends DolibarrApi
$request_data->label, $request_data->label,
$request_data->array_options, $request_data->array_options,
$request_data->fk_unit, $request_data->fk_unit,
$this->element, $request_data->origin,
$request_data->id $request_data->origin_id,
$request_data->multicurrency_subprice
); );
if ($updateRes > 0) { if ($updateRes > 0) {
return $this->get($id)->line->rowid; return $updateRes;
} }
return false; return false;
@@ -295,9 +297,9 @@ class Orders extends DolibarrApi
/** /**
* Update a line to given order * Update a line to given order
* *
* @param int $id Id of commande to update * @param int $id Id of order to update
* @param int $lineid Id of line to update * @param int $lineid Id of line to update
* @param array $request_data Orderline data * @param array $request_data OrderLine data
* *
* @url PUT {id}/lines/{lineid} * @url PUT {id}/lines/{lineid}
* *
@@ -310,7 +312,7 @@ class Orders extends DolibarrApi
$result = $this->commande->fetch($id); $result = $this->commande->fetch($id);
if( ! $result ) { if( ! $result ) {
throw new RestException(404, 'Commande not found'); throw new RestException(404, 'Order not found');
} }
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) { if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
@@ -338,7 +340,8 @@ class Orders extends DolibarrApi
$request_data->label, $request_data->label,
$request_data->special_code, $request_data->special_code,
$request_data->array_options, $request_data->array_options,
$request_data->fk_unit $request_data->fk_unit,
$request_data->multicurrency_subprice
); );
if ($updateRes > 0) { if ($updateRes > 0) {
@@ -353,7 +356,7 @@ class Orders extends DolibarrApi
* Delete a line to given order * Delete a line to given order
* *
* *
* @param int $id Id of commande to update * @param int $id Id of order to update
* @param int $lineid Id of line to delete * @param int $lineid Id of line to delete
* *
* @url DELETE {id}/lines/{lineid} * @url DELETE {id}/lines/{lineid}
@@ -384,7 +387,7 @@ class Orders extends DolibarrApi
/** /**
* Update order general fields (won't touch lines of order) * Update order general fields (won't touch lines of order)
* *
* @param int $id Id of commande to update * @param int $id Id of order to update
* @param array $request_data Datas * @param array $request_data Datas
* *
* @return int * @return int
@@ -396,7 +399,7 @@ class Orders extends DolibarrApi
$result = $this->commande->fetch($id); $result = $this->commande->fetch($id);
if( ! $result ) { if( ! $result ) {
throw new RestException(404, 'Commande not found'); throw new RestException(404, 'Order not found');
} }
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) { if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {

View File

@@ -709,7 +709,7 @@ class Commande extends CommonOrder
// $date_commande is deprecated // $date_commande is deprecated
$date = ($this->date_commande ? $this->date_commande : $this->date); $date = ($this->date_commande ? $this->date_commande : $this->date);
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code, $date);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
@@ -821,11 +821,15 @@ class Commande extends CommonOrder
$fk_parent_line = 0; $fk_parent_line = 0;
} }
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline( $result = $this->addline(
$line->desc, $line->desc,
$line->subprice, $line->subprice,
$line->qty, $line->qty,
$line->tva_tx, $vatrate,
$line->localtax1_tx, $line->localtax1_tx,
$line->localtax2_tx, $line->localtax2_tx,
$line->fk_product, $line->fk_product,
@@ -875,6 +879,11 @@ class Commande extends CommonOrder
{ {
$this->ref = $initialref; $this->ref = $initialref;
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
{
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
}
// Add object linked // Add object linked
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
{ {
@@ -887,7 +896,7 @@ class Commande extends CommonOrder
$ret = $this->add_object_linked($origin, $origin_id); $ret = $this->add_object_linked($origin, $origin_id);
if (! $ret) if (! $ret)
{ {
dol_print_error($this->db); $this->error=$this->db->lasterror();
$error++; $error++;
} }
} }
@@ -898,7 +907,7 @@ class Commande extends CommonOrder
$ret = $this->add_object_linked($origin, $origin_id); $ret = $this->add_object_linked($origin, $origin_id);
if (! $ret) if (! $ret)
{ {
dol_print_error($this->db); $this->error=$this->db->lasterror();
$error++; $error++;
} }
} }
@@ -1206,9 +1215,9 @@ class Commande extends CommonOrder
* @param string $desc Description of line * @param string $desc Description of line
* @param float $pu_ht Unit price (without tax) * @param float $pu_ht Unit price (without tax)
* @param float $qty Quantite * @param float $qty Quantite
* @param float $txtva Taux de tva force, sinon -1 * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param float $txlocaltax1 Local tax 1 rate * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param float $txlocaltax2 Local tax 2 rate * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of product * @param int $fk_product Id of product
* @param float $remise_percent Pourcentage de remise de la ligne * @param float $remise_percent Pourcentage de remise de la ligne
* @param int $info_bits Bits de type de lignes * @param int $info_bits Bits de type de lignes
@@ -1260,6 +1269,7 @@ class Commande extends CommonOrder
$remise_percent=price2num($remise_percent); $remise_percent=price2num($remise_percent);
$qty=price2num($qty); $qty=price2num($qty);
$pu_ht=price2num($pu_ht); $pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc); $pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht); $pa_ht=price2num($pa_ht);
$txtva = price2num($txtva); $txtva = price2num($txtva);
@@ -1431,10 +1441,10 @@ class Commande extends CommonOrder
return -2; return -2;
} }
} }
else else
{ {
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR); dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
return -3; return -3;
} }
} }
@@ -2806,6 +2816,7 @@ class Commande extends CommonOrder
$qty=price2num($qty); $qty=price2num($qty);
$pu = price2num($pu); $pu = price2num($pu);
$pa_ht=price2num($pa_ht); $pa_ht=price2num($pa_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$txtva=price2num($txtva); $txtva=price2num($txtva);
$txlocaltax1=price2num($txlocaltax1); $txlocaltax1=price2num($txlocaltax1);
$txlocaltax2=price2num($txlocaltax2); $txlocaltax2=price2num($txlocaltax2);
@@ -3117,7 +3128,13 @@ class Commande extends CommonOrder
if ($result < 0) $error++; if ($result < 0) $error++;
// End call triggers // End call triggers
} }
if ($this->nb_expedition() != 0)
{
$this->errors[] = $langs->trans('SomeShipmentExists');
$error++;
}
//TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail //TODO: Check for error after each action. If one failed we rollback, don't waste time to do action if previous fail
if (! $error) if (! $error)
{ {
@@ -4025,7 +4042,7 @@ class OrderLine extends CommonOrderLine
$sql.= " ".(! empty($this->date_start)?"'".$this->db->idate($this->date_start)."'":"null").','; $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.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null").',';
$sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit); $sql.= ' '.(!$this->fk_unit ? 'NULL' : $this->fk_unit);
$sql.= ", ".$this->fk_multicurrency; $sql.= ", ".(! empty($this->fk_multicurrency) ? $this->fk_multicurrency : 'NULL');
$sql.= ", '".$this->db->escape($this->multicurrency_code)."'"; $sql.= ", '".$this->db->escape($this->multicurrency_code)."'";
$sql.= ", ".$this->multicurrency_subprice; $sql.= ", ".$this->multicurrency_subprice;
$sql.= ", ".$this->multicurrency_total_ht; $sql.= ", ".$this->multicurrency_total_ht;

View File

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

View File

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

View File

@@ -74,6 +74,8 @@ $search_total_ht=GETPOST('search_total_ht','alpha');
$optioncss = GETPOST('optioncss','alpha'); $optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int'); $billed = GETPOST('billed','int');
$viewstatut=GETPOST('viewstatut'); $viewstatut=GETPOST('viewstatut');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
// Security check // Security check
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int')); $id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
@@ -86,7 +88,7 @@ $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $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; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
@@ -627,6 +629,13 @@ if ($resql)
if ($show_files) $param.='&show_files=' .$show_files; if ($show_files) $param.='&show_files=' .$show_files;
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($billed != '') $param.='&billed='.$billed; if ($billed != '') $param.='&billed='.$billed;
if ($search_town != '')$param .= '&search_town='.$search_town;
if ($search_zip != '')$param .= '&search_zip='.$search_zip;
if ($search_state != '')$param .= '&search_state='.$search_state;
if ($search_country != '')$param .= '&search_country='.$search_country;
if ($search_type_thirdparty != '')$param .= '&search_type_thirdparty='.$search_type_thirdparty;
if ($search_product_category != '')$param .= '&search_product_category='.$search_product_category;
// Add $param from extra fields // Add $param from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {
@@ -1452,7 +1461,7 @@ if ($resql)
$filedir=$diroutputmassaction; $filedir=$diroutputmassaction;
$genallowed=$user->rights->commande->lire; $genallowed=$user->rights->commande->lire;
$delallowed=$user->rights->commande->supprimer; $delallowed=$user->rights->commande->creer;
print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); print $formfile->showdocuments('massfilesarea_orders','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
} }

View File

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

View File

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

View File

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

View File

@@ -376,6 +376,8 @@ if (dol_strlen($search_dv_end) > 0) $param .= '&search_end_dvmonth=' . GETPOST
if ($search_req_nb) $param.='&amp;req_nb='.urlencode($search_req_nb); if ($search_req_nb) $param.='&amp;req_nb='.urlencode($search_req_nb);
if (GETPOST("thirdparty")) $param.='&amp;thirdparty='.urlencode(GETPOST("thirdparty")); if (GETPOST("thirdparty")) $param.='&amp;thirdparty='.urlencode(GETPOST("thirdparty"));
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.$optioncss;
if(!empty($search_conciliated) || $search_conciliated === 0) $param.='&search_conciliated='.$search_conciliated;
// Add $param from extra fields // Add $param from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {

View File

@@ -99,7 +99,7 @@ if ($action == 'add')
$object->owner_address = trim($_POST["owner_address"]); $object->owner_address = trim($_POST["owner_address"]);
$account_number = GETPOST('account_number','alpha'); $account_number = GETPOST('account_number','alpha');
if ($account_number <= 0) { $object->account_number = ''; } else { $object->account_number = $account_number; } if (empty($account_number) || $account_number == '-1') { $object->account_number = ''; } else { $object->account_number = $account_number; }
$fk_accountancy_journal = GETPOST('fk_accountancy_journal','int'); $fk_accountancy_journal = GETPOST('fk_accountancy_journal','int');
if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; } if ($fk_accountancy_journal <= 0) { $object->fk_accountancy_journal = ''; } else { $object->fk_accountancy_journal = $fk_accountancy_journal; }
@@ -656,7 +656,7 @@ else
print '<td>'; print '<td>';
if (! empty($conf->accounting->enabled)) { if (! empty($conf->accounting->enabled)) {
$accountingaccount = new AccountingAccount($db); $accountingaccount = new AccountingAccount($db);
$accountingaccount->fetch('',$object->account_number); $accountingaccount->fetch('',$object->account_number, 1);
print $accountingaccount->getNomUrl(0,1,1,'',1); print $accountingaccount->getNomUrl(0,1,1,'',1);
} else { } else {
@@ -845,11 +845,11 @@ else
// Ref // Ref
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>'; 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 // Label
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>'; 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 // Type
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>'; print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';

View File

@@ -74,7 +74,7 @@ $hookmanager->initHooks(array($contextpage));
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
$extralabels = $extrafields->fetch_name_optionals_label('bankaccount'); $extralabels = $extrafields->fetch_name_optionals_label('bank_account');
$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
// List of fields to search into when doing a "search in all" // List of fields to search into when doing a "search in all"
@@ -143,7 +143,7 @@ $title=$langs->trans('BankAccounts');
// Load array of financial accounts (opened by default) // Load array of financial accounts (opened by default)
$accounts = array(); $accounts = array();
$sql = "SELECT rowid, label, courant, rappro, account_number, fk_accountancy_journal, datec as date_creation, tms as date_update"; $sql = "SELECT b.rowid, b.label, b.courant, b.rappro, b.account_number, b.fk_accountancy_journal, b.datec as date_creation, b.tms as date_update";
// Add fields from extrafields // Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : ''); foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
// Add fields from hooks // Add fields from hooks
@@ -151,7 +151,7 @@ $parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint; $sql.=$hookmanager->resPrint;
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as b";
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bankcacount_extrafields as ef on (c.rowid = ef.fk_object)"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account_extrafields as ef on (b.rowid = ef.fk_object)";
$sql.= " WHERE entity IN (".getEntity('bank_account').")"; $sql.= " WHERE entity IN (".getEntity('bank_account').")";
if ($statut == 'opened') $sql.= " AND clos = 0"; if ($statut == 'opened') $sql.= " AND clos = 0";
if ($statut == 'closed') $sql.= " AND clos = 1"; if ($statut == 'closed') $sql.= " AND clos = 1";

View File

@@ -47,10 +47,11 @@ $langs->load("companies");
$langs->load("bills"); $langs->load("bills");
$action=GETPOST('action', 'alpha'); $action=GETPOST('action', 'alpha');
$id=GETPOST('account'); $id=GETPOST('account','int');
$ref=GETPOST('ref'); $ref=GETPOST('ref','alpha');
$dvid=GETPOST('dvid'); $dvid=GETPOST('dvid','alpha');
$numref=GETPOST('num'); $numref=GETPOST('num','alpha');
$ve=GETPOST("ve",'alpha');
// Security check // Security check
$fieldid = (! empty($ref)?$ref:$id); $fieldid = (! empty($ref)?$ref:$id);
@@ -95,6 +96,62 @@ if ($id > 0 || ! empty($ref))
// Initialize technical object to manage context to save list fields // Initialize technical object to manage context to save list fields
$contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id); $contextpage='banktransactionlist'.(empty($object->ref)?'':'-'.$object->id);
// Define number of receipt to show (current, previous or next one ?)
$found=false;
if ($_GET["rel"] == 'prev')
{
// Recherche valeur pour num = numero releve precedent
$sql = "SELECT DISTINCT(b.num_releve) as num";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve < '".$db->escape($numref)."'";
$sql.= " AND b.fk_account = ".$object->id;
$sql.= " ORDER BY b.num_releve DESC";
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$numrows = $db->num_rows($resql);
if ($numrows > 0)
{
$obj = $db->fetch_object($resql);
$numref = $obj->num;
$found=true;
}
}
}
elseif ($_GET["rel"] == 'next')
{
// Recherche valeur pour num = numero releve precedent
$sql = "SELECT DISTINCT(b.num_releve) as num";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve > '".$db->escape($numref)."'";
$sql.= " AND b.fk_account = ".$object->id;
$sql.= " ORDER BY b.num_releve ASC";
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$numrows = $db->num_rows($resql);
if ($numrows > 0)
{
$obj = $db->fetch_object($resql);
$numref = $obj->num;
$found=true;
}
}
}
else {
// On veut le releve num
$found=true;
}
$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,"; $sql = "SELECT b.rowid, b.dateo as do, b.datev as dv,";
$sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,"; $sql.= " b.amount, b.label, b.rappro, b.num_releve, b.num_chq, b.fk_type,";
$sql.= " b.fk_bordereau,"; $sql.= " b.fk_bordereau,";
@@ -104,7 +161,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ", ".MAIN_DB_PREFIX."bank as b"; $sql.= ", ".MAIN_DB_PREFIX."bank as b";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'bordereau_cheque as bc ON bc.rowid=b.fk_bordereau';
$sql.= " WHERE b.num_releve='".$db->escape($numref)."'"; $sql.= " WHERE b.num_releve='".$db->escape($numref)."'";
if (!isset($numref)) $sql.= " OR b.num_releve is null"; if (empty($numref)) $sql.= " OR b.num_releve is null";
$sql.= " AND b.fk_account = ".$object->id; $sql.= " AND b.fk_account = ".$object->id;
$sql.= " AND b.fk_account = ba.rowid"; $sql.= " AND b.fk_account = ba.rowid";
$sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day
@@ -420,58 +477,6 @@ else
/** /**
* Show list of bank statements * Show list of bank statements
*/ */
$ve=$_GET["ve"];
// Define number of receipt to show (current, previous or next one ?)
$found=false;
if ($_GET["rel"] == 'prev')
{
// Recherche valeur pour num = numero releve precedent
$sql = "SELECT DISTINCT(b.num_releve) as num";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve < '".$db->escape($numref)."'";
$sql.= " AND b.fk_account = ".$object->id;
$sql.= " ORDER BY b.num_releve DESC";
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$numrows = $db->num_rows($resql);
if ($numrows > 0)
{
$obj = $db->fetch_object($resql);
$numref = $obj->num;
$found=true;
}
}
}
elseif ($_GET["rel"] == 'next')
{
// Recherche valeur pour num = numero releve precedent
$sql = "SELECT DISTINCT(b.num_releve) as num";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql.= " WHERE b.num_releve > '".$db->escape($numref)."'";
$sql.= " AND b.fk_account = ".$object->id;
$sql.= " ORDER BY b.num_releve ASC";
dol_syslog("htdocs/compta/bank/releve.php", LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
$numrows = $db->num_rows($resql);
if ($numrows > 0)
{
$obj = $db->fetch_object($resql);
$numref = $obj->num;
$found=true;
}
}
}
else {
// On veut le releve num
$found=true;
}
$mesprevnext=''; $mesprevnext='';
$mesprevnext.='<div class="pagination"><ul>'; $mesprevnext.='<div class="pagination"><ul>';
@@ -713,6 +718,7 @@ else
dol_print_error($db); dol_print_error($db);
} }
} }
print "</td>"; print "</td>";
if ($objp->amount < 0) if ($objp->amount < 0)

View File

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

View File

@@ -135,7 +135,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,"; $sql.= " cs.rowid, cs.libelle, cs.fk_type as type, cs.periode, cs.date_ech, cs.amount as total,";
$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,"; $sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye, pc.num_paiement as num_payment, pc.fk_bank,";
$sql.= " pct.code as payment_code,"; $sql.= " pct.code as payment_code,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
$sql.= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as cs";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
@@ -256,7 +256,7 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
$sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,"; $sql = "SELECT pv.rowid, pv.amount, pv.label, pv.datev as dm, pv.fk_bank,";
$sql.= " pct.code as payment_code,"; $sql.= " pct.code as payment_code,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
$sql.= " FROM ".MAIN_DB_PREFIX."tva as pv"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as pv";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON pv.fk_bank = b.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";
@@ -470,7 +470,7 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read)
$sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,"; $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,";
$sql.= " pct.code as payment_code,"; $sql.= " pct.code as payment_code,";
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.accountancy_journal, ba.label as blabel"; $sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.fk_accountancy_journal, ba.label as blabel";
$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid";

View File

@@ -186,13 +186,17 @@ if (empty($reshook))
$qualified_for_stock_change = $object->hasProductsOrServices(1); $qualified_for_stock_change = $object->hasProductsOrServices(1);
} }
$result = $object->delete($user, 0, $idwarehouse); if ($object->is_erasable()) {
if ($result > 0) {
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php'); $result = $object->delete($user, 0, $idwarehouse);
exit(); if ($result > 0) {
} else { header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
setEventMessages($object->error, $object->errors, 'errors'); exit();
$action=''; } else {
setEventMessages($object->error, $object->errors, 'errors');
$action='';
}
} }
} }
@@ -214,6 +218,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@@ -401,7 +406,7 @@ if (empty($reshook))
//var_dump($object->getRemainToPay(0)); //var_dump($object->getRemainToPay(0));
//var_dump($discount->amount_ttc);exit; //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 // TODO Split the discount in 2 automatically
$error++; $error++;
@@ -485,6 +490,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
$model=$object->modelpdf; $model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@@ -571,6 +577,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
$model=$object->modelpdf; $model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@@ -636,7 +643,7 @@ if (empty($reshook))
$i = 0; $i = 0;
foreach ($object->lines as $line) foreach ($object->lines as $line)
{ {
if ($line->total_ht!=0) if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9
{ // no need to create discount if amount is null { // no need to create discount if amount is null
$amount_ht[$line->tva_tx] += $line->total_ht; $amount_ht[$line->tva_tx] += $line->total_ht;
$amount_tva[$line->tva_tx] += $line->total_tva; $amount_tva[$line->tva_tx] += $line->total_tva;
@@ -849,6 +856,12 @@ if (empty($reshook))
foreach($facture_source->lines as $line) foreach($facture_source->lines as $line)
{ {
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, 'fetch_optionals')) {
// load extrafields
$line->fetch_optionals();
}
// Reset fk_parent_line for no child products and special product // Reset fk_parent_line for no child products and special product
if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) { if (($line->product_type != 9 && empty($line->fk_parent_line)) || $line->product_type == 9) {
$fk_parent_line = 0; $fk_parent_line = 0;
@@ -1075,6 +1088,7 @@ if (empty($reshook))
$TTotalByTva = array(); $TTotalByTva = array();
foreach ($srcobject->lines as &$line) foreach ($srcobject->lines as &$line)
{ {
if(! empty($line->special_code)) continue;
$TTotalByTva[$line->tva_tx] += $line->total_ttc ; $TTotalByTva[$line->tva_tx] += $line->total_ttc ;
} }
@@ -1352,11 +1366,26 @@ if (empty($reshook))
$object->origin = $origin; $object->origin = $origin;
$object->origin_id = $originid; $object->origin_id = $originid;
foreach ($object->lines as &$line) foreach ($object->lines as $i => &$line)
{ {
$line->origin = $object->origin; $line->origin = $object->origin;
$line->origin_id = $line->id; $line->origin_id = $line->id;
$line->fetch_optionals($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;
}
}
}
} }
} }
@@ -1378,7 +1407,7 @@ if (empty($reshook))
$object->situation_counter = $object->situation_counter + 1; $object->situation_counter = $object->situation_counter + 1;
$id = $object->createFromCurrent($user); $id = $object->createFromCurrent($user);
if ($id <= 0) if ($id <= 0)
{ {
$mesg = $object->error; $mesg = $object->error;
} }
@@ -1411,6 +1440,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
$model=$object->modelpdf; $model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@@ -1588,6 +1618,9 @@ if (empty($reshook))
$pu_ttc = price($prodcustprice->lines[0]->price_ttc); $pu_ttc = price($prodcustprice->lines[0]->price_ttc);
$price_base_type = $prodcustprice->lines[0]->price_base_type; $price_base_type = $prodcustprice->lines[0]->price_base_type;
$tva_tx = $prodcustprice->lines[0]->tva_tx; $tva_tx = $prodcustprice->lines[0]->tva_tx;
if ($prodcustprice->lines[0]->default_vat_code && ! preg_match('/\(.*\)/', $tva_tx)) $tva_tx.= ' ('.$prodcustprice->lines[0]->default_vat_code.')';
$tva_npr = $prodcustprice->lines[0]->recuperableonly;
if (empty($tva_tx)) $tva_npr=0;
} }
} }
} }
@@ -1628,6 +1661,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
$desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; $desc = (! empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description;
@@ -1640,12 +1674,33 @@ if (empty($reshook))
// Add custom code and origin country into description // Add custom code and origin country into description
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) { if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
$tmptxt = '('; $tmptxt = '(';
if (! empty($prod->customcode)) // Define output language
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
if (! empty($prod->customcode) && ! empty($prod->country_code)) $outputlangs = $langs;
$tmptxt .= ' - '; $newlang = '';
if (! empty($prod->country_code)) if (empty($newlang) && GETPOST('lang_id','alpha'))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); $newlang = GETPOST('lang_id','alpha');
if (empty($newlang))
$newlang = $object->thirdparty->default_lang;
if (! empty($newlang)) {
$outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
}
if (! empty($prod->customcode))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
} else {
if (! empty($prod->customcode))
$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
if (! empty($prod->customcode) && ! empty($prod->country_code))
$tmptxt .= ' - ';
if (! empty($prod->country_code))
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
}
$tmptxt .= ')'; $tmptxt .= ')';
$desc = dol_concatdesc($desc, $tmptxt); $desc = dol_concatdesc($desc, $tmptxt);
} }
@@ -1696,6 +1751,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
$model=$object->modelpdf; $model=$object->modelpdf;
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@@ -1874,6 +1930,7 @@ if (empty($reshook))
if (! empty($newlang)) { if (! empty($newlang)) {
$outputlangs = new Translate("", $conf); $outputlangs = new Translate("", $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('products');
} }
$ret = $object->fetch($id); // Reload to get new records $ret = $object->fetch($id); // Reload to get new records
@@ -2510,10 +2567,10 @@ if ($action == 'create')
$desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3); $desc = $form->textwithpicto($text, $langs->transnoentities("InvoiceAvoirDesc"), 1, 'help', '', 0, 3);
print $desc; print $desc;
print '<div id="credit_note_options" class="clearboth">'; print '<div id="credit_note_options" class="clearboth">';
print '&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithPaymentRestAmount\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>"; print '&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithLines" id="invoiceAvoirWithLines" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithLines','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithLines">'.$langs->trans('invoiceAvoirWithLines')."</label>";
print '<br>&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="if($(this).is(\':checked\') ) { $(\'#radio_creditnote\').prop(\'checked\', true); $(\'#invoiceAvoirWithLines\').removeAttr(\'checked\'); }" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>"; print '<br>&nbsp;&nbsp;&nbsp; <input data-role="none" type="checkbox" name="invoiceAvoirWithPaymentRestAmount" id="invoiceAvoirWithPaymentRestAmount" value="1" onclick="$(\'#credit_note_options input[type=checkbox]\').not(this).prop(\'checked\', false);" '.(GETPOST('invoiceAvoirWithPaymentRestAmount','int')>0 ? 'checked':'').' /> <label for="invoiceAvoirWithPaymentRestAmount">'.$langs->trans('invoiceAvoirWithPaymentRestAmount')."</label>";
print '</div>'; print '</div>';
print '</div></div>'; print '</div></div>';
} }
@@ -2843,12 +2900,12 @@ else if ($id > 0 || ! empty($ref))
$resteapayer = 0; $resteapayer = 0;
$resteapayeraffiche = $resteapayer; $resteapayeraffiche = $resteapayer;
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { // Never use this
$filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filterabsolutediscount = "fk_facture_source IS NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
$filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice $filtercreditnote = "fk_facture_source IS NOT NULL"; // If we want deposit to be substracted to payments only and not to total of final invoice
} else { } else {
$filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%'))"; $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))";
$filtercreditnote = "fk_facture_source IS NOT NULL AND description NOT LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'"; $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
} }
$absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount); $absolute_discount = $soc->getAvailableDiscounts('', $filterabsolutediscount);
@@ -2871,9 +2928,9 @@ else if ($id > 0 || ! empty($ref))
// Confirmation de la conversion de l'avoir en reduc // Confirmation de la conversion de l'avoir en reduc
if ($action == 'converttoreduc') { if ($action == 'converttoreduc') {
if($object->type == 0) $type_fac = 'ExcessReceived'; if($object->type == Facture::TYPE_STANDARD) $type_fac = 'ExcessReceived';
elseif($object->type == 2) $type_fac = 'CreditNote'; elseif($object->type == Facture::TYPE_CREDIT_NOTE) $type_fac = 'CreditNote';
elseif($object->type == 3) $type_fac = 'Deposit'; elseif($object->type == Facture::TYPE_DEPOSIT) $type_fac = 'Deposit';
$text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac))); $text = $langs->trans('ConfirmConvertToReduc', strtolower($langs->transnoentities($type_fac)));
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
} }
@@ -4010,7 +4067,7 @@ else if ($id > 0 || ! empty($ref))
} }
} }
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid')) . '" method="POST"> print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#addline' : '#line_' . GETPOST('lineid')) . '" method="POST">
<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '"> <input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '"> <input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateligne') . '">
<input type="hidden" name="mode" value=""> <input type="hidden" name="mode" value="">
@@ -4291,8 +4348,8 @@ else if ($id > 0 || ! empty($ref))
$filename = dol_sanitizeFileName($object->ref); $filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref); $filedir = $conf->facture->dir_output . '/' . dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id; $urlsource = $_SERVER['PHP_SELF'] . '?facid=' . $object->id;
$genallowed = $user->rights->facture->creer; $genallowed = $user->rights->facture->lire;
$delallowed = $user->rights->facture->supprimer; $delallowed = $user->rights->facture->creer;
print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); print $formfile->showdocuments('facture', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
$somethingshown = $formfile->numoffiles; $somethingshown = $formfile->numoffiles;
@@ -4362,6 +4419,7 @@ else if ($id > 0 || ! empty($ref))
$outputlangs = new Translate('', $conf); $outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
$outputlangs->load('bills'); $outputlangs->load('bills');
$outputlangs->load('products');
} }
// Build document if it not exists // Build document if it not exists

View File

@@ -15,9 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
use Luracast\Restler\RestException; use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
/** /**
* API class for invoices * API class for invoices
@@ -75,6 +75,7 @@ class Invoices extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
$this->invoice->fetchObjectLinked();
return $this->_cleanObjectDatas($this->invoice); return $this->_cleanObjectDatas($this->invoice);
} }
@@ -210,6 +211,190 @@ class Invoices extends DolibarrApi
return $this->invoice->id; return $this->invoice->id;
} }
/**
* Get lines of an invoice
*
* @param int $id Id of invoice
*
* @url GET {id}/lines
*
* @return int
*/
function getLines($id) {
if(! DolibarrApiAccess::$user->rights->facture->lire) {
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->invoice->getLinesArray();
$result = array();
foreach ($this->invoice->lines as $line) {
array_push($result,$this->_cleanObjectDatas($line));
}
return $result;
}
/**
* Add a line to a given invoice
*
* @param int $id Id of invoice to update
* @param array $request_data InvoiceLine data
*
* @url POST {id}/lines
*
* @return int
*/
function postLine($id, $request_data = NULL) {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$request_data = (object) $request_data;
$updateRes = $this->invoice->addline(
$request_data->desc,
$request_data->subprice,
$request_data->qty,
$request_data->tva_tx,
$request_data->localtax1_tx,
$request_data->localtax2_tx,
$request_data->fk_product,
$request_data->remise_percent,
$request_data->date_start,
$request_data->date_end,
0,
$request_data->info_bits,
$request_data->fk_remise_except,
'HT',
0,
$request_data->product_type,
$request_data->rang,
$request_data->special_code,
$request_data->origin,
$request_data->origin_id,
$fk_parent_line,
$request_data->fk_fournprice,
$request_data->pa_ht,
$request_data->label,
$request_data->array_options,
$request_data->situation_percent,
$request_data->prev_id,
$request_data->fk_unit,
$request_data->multicurrency_subprice
);
if ($updateRes > 0) {
return $updateRes;
}
return false;
}
/**
* Update a line to a given invoice
*
* @param int $id Id of invoice to update
* @param int $lineid Id of line to update
* @param array $request_data InvoiceLine data
*
* @url PUT {id}/lines/{lineid}
*
* @return object
*/
function putLine($id, $lineid, $request_data = NULL) {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$request_data = (object) $request_data;
$updateRes = $this->invoice->updateline(
$lineid,
$request_data->desc,
$request_data->subprice,
$request_data->qty,
$request_data->remise_percent,
$request_data->date_start,
$request_data->date_end,
$request_data->tva_tx,
$request_data->localtax1_tx,
$request_data->localtax2_tx,
'HT',
$request_data->info_bits,
$request_data->product_type,
$request_data->fk_parent_line,
0,
$request_data->fk_fournprice,
$request_data->pa_ht,
$request_data->label,
$request_data->special_code,
$request_data->array_options,
$request_data->situation_percent,
$request_data->fk_unit,
$request_data->multicurrency_subprice
);
if ($updateRes > 0) {
$result = $this->get($id);
unset($result->line);
return $this->_cleanObjectDatas($result);
}
return false;
}
/**
* Delete a line to a given invoice
*
*
* @param int $id Id of invoice to update
* @param int $lineid Id of line to delete
*
* @url DELETE {id}/lines/{lineid}
*
* @return int
*/
function delLine($id, $lineid) {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}
$result = $this->invoice->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Invoice not found');
}
if( ! DolibarrApi::_checkAccessToResource('facture',$this->invoice->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$request_data = (object) $request_data;
$updateRes = $this->invoice->deleteline($lineid);
if ($updateRes > 0) {
return $this->get($id);
}
return false;
}
/** /**
* Update invoice * Update invoice
* *
@@ -277,9 +462,9 @@ class Invoices extends DolibarrApi
} }
/** /**
* Validate an order * Validate an invoice
* *
* @param int $id Order ID * @param int $id Invoice ID
* @param int $idwarehouse Warehouse ID * @param int $idwarehouse Warehouse ID
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* *

View File

@@ -201,19 +201,40 @@ class FactureRec extends CommonInvoice
} }
} }
// Add object linked if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) {
{ $this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
foreach($this->linked_objects as $origin => $origin_id) }
{
$ret = $this->add_object_linked($origin, $origin_id); // Add object linked
if (! $ret) if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
{ {
$this->error=$this->db->lasterror(); foreach($this->linked_objects as $origin => $tmp_origin_id)
$error++; {
} if (is_array($tmp_origin_id)) // New behaviour, if linked_object can have several links per type, so is something like array('contract'=>array(id1, id2, ...))
} {
} foreach($tmp_origin_id as $origin_id)
{
$ret = $this->add_object_linked($origin, $origin_id);
if (! $ret)
{
$this->error=$this->db->lasterror();
$error++;
}
}
}
else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1))
{
$origin_id = $tmp_origin_id;
$ret = $this->add_object_linked($origin, $origin_id);
if (! $ret)
{
$this->error=$this->db->lasterror();
$error++;
}
}
}
}
if ($error) if ($error)
{ {

View File

@@ -244,7 +244,7 @@ class Facture extends CommonInvoice
$this->brouillon = 1; $this->brouillon = 1;
if (empty($this->entity)) $this->entity = $conf->entity; if (empty($this->entity)) $this->entity = $conf->entity;
// Multicurrency (test on $this->multicurrency_tx because we sould take the default rate only if not using origin rate) // Multicurrency (test on $this->multicurrency_tx because we should take the default rate only if not using origin rate)
if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); if (!empty($this->multicurrency_code) && empty($this->multicurrency_tx)) list($this->fk_multicurrency,$this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code);
else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code); else $this->fk_multicurrency = MultiCurrency::getIdFromCode($this->db, $this->multicurrency_code);
if (empty($this->fk_multicurrency)) if (empty($this->fk_multicurrency))
@@ -442,6 +442,11 @@ class Facture extends CommonInvoice
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if (! $resql) $error++; if (! $resql) $error++;
if (! empty($this->linkedObjectsIds) && empty($this->linked_objects)) // To use new linkedObjectsIds instead of old linked_objects
{
$this->linked_objects = $this->linkedObjectsIds; // TODO Replace linked_objects with linkedObjectsIds
}
// Add object linked // Add object linked
if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects)) if (! $error && $this->id && is_array($this->linked_objects) && ! empty($this->linked_objects))
{ {
@@ -454,7 +459,7 @@ class Facture extends CommonInvoice
$ret = $this->add_object_linked($origin, $origin_id); $ret = $this->add_object_linked($origin, $origin_id);
if (! $ret) if (! $ret)
{ {
dol_print_error($this->db); $this->error=$this->db->lasterror();
$error++; $error++;
} }
} }
@@ -465,7 +470,7 @@ class Facture extends CommonInvoice
$ret = $this->add_object_linked($origin, $origin_id); $ret = $this->add_object_linked($origin, $origin_id);
if (! $ret) if (! $ret)
{ {
dol_print_error($this->db); $this->error=$this->db->lasterror();
$error++; $error++;
} }
} }
@@ -534,6 +539,15 @@ class Facture extends CommonInvoice
} }
$newinvoiceline->fk_parent_line=$fk_parent_line; $newinvoiceline->fk_parent_line=$fk_parent_line;
if($this->type === Facture::TYPE_REPLACEMENT && $newinvoiceline->fk_remise_except){
$discount = new DiscountAbsolute($this->db);
$discount->fetch($newinvoiceline->fk_remise_except);
$discountId = $soc->set_remise_except($discount->amount_ht, $user, $discount->description, $discount->tva_tx);
$newinvoiceline->fk_remise_except = $discountId;
}
$result=$newinvoiceline->insert(); $result=$newinvoiceline->insert();
// Defined the new fk_parent_line // Defined the new fk_parent_line
@@ -570,11 +584,15 @@ class Facture extends CommonInvoice
$fk_parent_line = 0; $fk_parent_line = 0;
} }
// Complete vat rate with code
$vatrate = $line->tva_tx;
if ($line->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$line->vat_src_code.')';
$result = $this->addline( $result = $this->addline(
$line->desc, $line->desc,
$line->subprice, $line->subprice,
$line->qty, $line->qty,
$line->tva_tx, $vatrate,
$line->localtax1_tx, $line->localtax1_tx,
$line->localtax2_tx, $line->localtax2_tx,
$line->fk_product, $line->fk_product,
@@ -930,7 +948,8 @@ class Facture extends CommonInvoice
{ {
$this->db->commit(); $this->db->commit();
return $this->id; return $this->id;
}
}
else else
{ {
$this->db->rollback(); $this->db->rollback();
@@ -980,6 +999,8 @@ class Facture extends CommonInvoice
$line->special_code = $object->lines[$i]->special_code; $line->special_code = $object->lines[$i]->special_code;
$line->fk_parent_line = $object->lines[$i]->fk_parent_line; $line->fk_parent_line = $object->lines[$i]->fk_parent_line;
$line->fk_unit = $object->lines[$i]->fk_unit; $line->fk_unit = $object->lines[$i]->fk_unit;
$line->date_start = $object->lines[$i]->date_start;
$line->date_end = $object->lines[$i]->date_end;
$line->fk_fournprice = $object->lines[$i]->fk_fournprice; $line->fk_fournprice = $object->lines[$i]->fk_fournprice;
$marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht);
@@ -2185,6 +2206,7 @@ class Facture extends CommonInvoice
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num)); else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
if ($result < 0) { if ($result < 0) {
$error++; $error++;
$this->error = $mouvP->error;
} }
} }
} }
@@ -2261,9 +2283,12 @@ class Facture extends CommonInvoice
$final = ($this->lines[$i]->situation_percent == 100); $final = ($this->lines[$i]->situation_percent == 100);
$i++; $i++;
} }
if ($final) {
$this->setFinal($user); if (empty($final)) $this->situation_final = 0;
} else $this->situation_final = 1;
$this->setFinal($user);
} }
} }
} }
@@ -2422,8 +2447,8 @@ class Facture extends CommonInvoice
* @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity * @param double $qty Quantity
* @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param double $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)')
* @param double $txlocaltax1 Local tax 1 rate (deprecated) * @param double $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside)
* @param double $txlocaltax2 Local tax 2 rate (deprecated) * @param double $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside)
* @param int $fk_product Id of predefined product/service * @param int $fk_product Id of predefined product/service
* @param double $remise_percent Percent of discount on line * @param double $remise_percent Percent of discount on line
* @param int $date_start Date start of service * @param int $date_start Date start of service
@@ -2487,6 +2512,7 @@ class Facture extends CommonInvoice
$remise_percent=price2num($remise_percent); $remise_percent=price2num($remise_percent);
$qty=price2num($qty); $qty=price2num($qty);
$pu_ht=price2num($pu_ht); $pu_ht=price2num($pu_ht);
$pu_ht_devise=price2num($pu_ht_devise);
$pu_ttc=price2num($pu_ttc); $pu_ttc=price2num($pu_ttc);
$pa_ht=price2num($pa_ht); $pa_ht=price2num($pa_ht);
$txtva=price2num($txtva); $txtva=price2num($txtva);
@@ -2638,6 +2664,11 @@ class Facture extends CommonInvoice
return -2; return -2;
} }
} }
else
{
dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR);
return -3;
}
} }
/** /**
@@ -2705,6 +2736,7 @@ class Facture extends CommonInvoice
$remise_percent = price2num($remise_percent); $remise_percent = price2num($remise_percent);
$qty = price2num($qty); $qty = price2num($qty);
$pu = price2num($pu); $pu = price2num($pu);
$pu_ht_devise = price2num($pu_ht_devise);
$pa_ht = price2num($pa_ht); $pa_ht = price2num($pa_ht);
$txtva = price2num($txtva); $txtva = price2num($txtva);
$txlocaltax1 = price2num($txlocaltax1); $txlocaltax1 = price2num($txlocaltax1);
@@ -2901,6 +2933,9 @@ class Facture extends CommonInvoice
$line->total_ttc = $tabprice[2]; $line->total_ttc = $tabprice[2];
$line->total_localtax1 = $tabprice[9]; $line->total_localtax1 = $tabprice[9];
$line->total_localtax2 = $tabprice[10]; $line->total_localtax2 = $tabprice[10];
$line->multicurrency_total_ht = $tabprice[16];
$line->multicurrency_total_tva = $tabprice[17];
$line->multicurrency_total_ttc = $tabprice[18];
$line->update($user); $line->update($user);
$this->update_price(1); $this->update_price(1);
$this->db->commit(); $this->db->commit();
@@ -4076,7 +4111,6 @@ class Facture extends CommonInvoice
$this->db->begin(); $this->db->begin();
$this->situation_final = 1;
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id; $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@@ -4800,7 +4834,7 @@ class FactureLigne extends CommonInvoiceLine
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) { if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql); $res = $this->db->fetch_array($resql);
return $res['situation_percent']; return floatval($res['situation_percent']);
} else { } else {
$this->error = $this->db->error(); $this->error = $this->db->error();
dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR); dol_syslog(get_class($this) . "::select Error " . $this->error, LOG_ERR);

View File

@@ -39,7 +39,7 @@ class FactureStats extends Stats
var $from; var $from;
var $field; var $field;
var $where; var $where;
/** /**
* Constructor * Constructor
@@ -56,8 +56,8 @@ class FactureStats extends Stats
$this->db = $db; $this->db = $db;
$this->socid = ($socid > 0 ? $socid : 0); $this->socid = ($socid > 0 ? $socid : 0);
$this->userid = $userid; $this->userid = $userid;
$this->cachefilesuffix = $mode; $this->cachefilesuffix = $mode;
if ($mode == 'customer') if ($mode == 'customer')
{ {
$object=new Facture($this->db); $object=new Facture($this->db);
@@ -84,8 +84,8 @@ class FactureStats extends Stats
$this->where.=" AND f.fk_soc = ".$this->socid; $this->where.=" AND f.fk_soc = ".$this->socid;
} }
if ($this->userid > 0) $this->where.=' AND f.fk_user_author = '.$this->userid; 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)"; 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)"; else $this->where.= " AND f.type IN (0,1,2,3,5)";
} }
@@ -195,7 +195,7 @@ class FactureStats extends Stats
return $this->_getAllByYear($sql); return $this->_getAllByYear($sql);
} }
/** /**
* Return nb, amount of predefined product for year * Return nb, amount of predefined product for year
* *
@@ -218,7 +218,7 @@ class FactureStats extends Stats
return $this->_getAllByProduct($sql); return $this->_getAllByProduct($sql);
} }
} }

View File

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

View File

@@ -4,6 +4,8 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -32,6 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
}
$langs->load('propal'); $langs->load('propal');
$langs->load('compta'); $langs->load('compta');
@@ -189,6 +194,6 @@ else
print $langs->trans("ErrorUnknown"); print $langs->trans("ErrorUnknown");
} }
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

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

View File

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

View File

@@ -93,6 +93,8 @@ $year = GETPOST('year','int');
$day_lim = GETPOST('day_lim','int'); $day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int'); $month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int'); $year_lim = GETPOST('year_lim','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');
$option = GETPOST('option'); $option = GETPOST('option');
if ($option == 'late') { if ($option == 'late') {
@@ -104,7 +106,7 @@ $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield",'alpha'); $sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha'); $sortorder = GETPOST("sortorder",'alpha');
$page = GETPOST("page",'int'); $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; $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 && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
if (! $sortorder) $sortorder='DESC'; if (! $sortorder) $sortorder='DESC';
@@ -552,17 +554,20 @@ if ($resql)
if ($search_societe) $param.='&search_societe=' .urlencode($search_societe); if ($search_societe) $param.='&search_societe=' .urlencode($search_societe);
if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale); if ($search_sale > 0) $param.='&search_sale=' .urlencode($search_sale);
if ($search_user > 0) $param.='&search_user=' .urlencode($search_user); 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_ht != '') $param.='&search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_vat != '') $param.='&search_montant_vat='.urlencode($search_montant_vat); 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_localtax1 != '') $param.='&search_montant_localtax1='.urlencode($search_montant_localtax1);
if ($search_montant_localtax2 != '') $param.='&search_montant_localtax2='.urlencode($search_montant_localtax2); 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_montant_ttc != '') $param.='&search_montant_ttc='.urlencode($search_montant_ttc);
if ($search_status != '') $param.='&search_status='.urlencode($search_status); if ($search_status != '') $param.='&search_status='.urlencode($search_status);
if ($search_paymentmode > 0) $param.='search_paymentmode='.urlencode($search_paymentmode); if ($search_paymentmode > 0) $param.='&search_paymentmode='.urlencode($search_paymentmode);
if ($show_files) $param.='&show_files=' .$show_files; if ($show_files) $param.='&show_files=' .$show_files;
if ($option) $param.="&option=".$option; if ($option) $param.="&option=".$option;
if ($optioncss != '') $param.='&optioncss='.$optioncss; if ($optioncss != '') $param.='&optioncss='.$optioncss;
if ($search_town)$param .= '&search_town='.urlencode($search_town);
if ($search_zip)$param .= '&search_zip='.urlencode($search_zip);
// Add $param from extra fields // Add $param from extra fields
foreach ($search_array_options as $key => $val) foreach ($search_array_options as $key => $val)
{ {
@@ -785,7 +790,8 @@ if ($resql)
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"), Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"), Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"), Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"), Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
Facture::TYPE_SITUATION=>$langs->trans("InvoiceSituation"),
); );
//$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order. //$listtype[Facture::TYPE_PROFORMA]=$langs->trans("InvoiceProForma"); // A proformat invoice is not an invoice but must be an order.
print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100'); print $form->selectarray('search_type', $listtype, $search_type, 1, 0, 0, '', 0, 0, 0, 'ASC', 'maxwidth100');
@@ -1008,6 +1014,9 @@ if ($resql)
$facturestatic->ref=$obj->ref; $facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type; $facturestatic->type=$obj->type;
$facturestatic->statut=$obj->fk_statut; $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->date_lim_reglement=$db->jdate($obj->datelimite);
$facturestatic->note_public=$obj->note_public; $facturestatic->note_public=$obj->note_public;
$facturestatic->note_private=$obj->note_private; $facturestatic->note_private=$obj->note_private;
@@ -1016,7 +1025,13 @@ if ($resql)
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); $totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed(); $totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits; $totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = $obj->total_ttc - $totalpay; $remaintopay = $facturestatic->total_ttc - $totalpay;
if($facturestatic->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1) {
$discount = new DiscountAbsolute($db);
$remaincreditnote = $discount->getAvailableDiscounts($obj->fk_soc, '', 'rc.fk_facture_source='.$facturestatic->id);
$remaintopay = -$remaincreditnote;
$totalpay = $facturestatic->total_ttc - $remaintopay;
}
print '<tr class="oddeven">'; print '<tr class="oddeven">';
if (! empty($arrayfields['f.facnumber']['checked'])) if (! empty($arrayfields['f.facnumber']['checked']))
@@ -1332,7 +1347,7 @@ if ($resql)
$filedir=$diroutputmassaction; $filedir=$diroutputmassaction;
$genallowed=$user->rights->facture->lire; $genallowed=$user->rights->facture->lire;
$delallowed=$user->rights->facture->lire; $delallowed=$user->rights->facture->creer;
print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); print $formfile->showdocuments('massfilesarea_invoices','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'');
} }

View File

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

View File

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

View File

@@ -84,7 +84,7 @@ dol_mkdir($dir);
$stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0)); $stats = new FactureStats($db, $socid, $mode, ($userid>0?$userid:0));
if ($mode == 'customer') if ($mode == 'customer')
{ {
if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')';
} }
if ($mode == 'supplier') if ($mode == 'supplier')
{ {
@@ -227,12 +227,13 @@ complete_head_from_modules($conf,$langs,null,$head,$h,$type);
dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1); dol_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
$tmp_companies = $form->select_thirdparty_list($socid,'socid',$filter,1, 0, 0, array(), '', 1); // We use select_thirdparty_list instead of select_company so we can use $filter and share same code for customer and supplier.
$tmp_companies = $form->select_thirdparty_list($socid, 'socid', $filter, 1, 0, 0, array(), '', 1);
//Array passed as an argument to Form::selectarray to build a proper select input //Array passed as an argument to Form::selectarray to build a proper select input
$companies = array(); $companies = array();
foreach ($tmp_companies as $value) { foreach ($tmp_companies as $value) {
$companies[$value['value']] = $value['label']; $companies[$value['key']] = $value['label'];
} }
print '<div class="fichecenter"><div class="fichethirdleft">'; print '<div class="fichecenter"><div class="fichethirdleft">';

View File

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

View File

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

View File

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

View File

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

View File

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

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