diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 91e496d998c..56eb8beeca7 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -673,7 +673,7 @@ if ($resql)
print '';
print '
| ';
print '';
- $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1);
+ $form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')), 'operation', '1,2', 2, 1);
print ' | ';
print '';
print '';
@@ -852,7 +852,7 @@ if ($resql)
if (! empty($arrayfields['type']['checked']))
{
print ' | ';
- $form->select_types_paiements(empty($search_type)?'':$search_type, 'search_type', '', 2, 0, 1, 0, 1, 'maxwidth100');
+ $form->select_types_paiements(empty($search_type)?'':$search_type, 'search_type', '', 2, 1, 1, 0, 1, 'maxwidth100');
print ' | ';
}
if (! empty($arrayfields['b.num_chq']['checked']))
diff --git a/htdocs/compta/bank/various_payment/index.php b/htdocs/compta/bank/various_payment/index.php
index d52cbeb7595..41c0baa61d5 100644
--- a/htdocs/compta/bank/various_payment/index.php
+++ b/htdocs/compta/bank/various_payment/index.php
@@ -187,7 +187,7 @@ if ($result)
// Type
print '';
- $form->select_types_paiements($typeid,'typeid','',0,0,1,16);
+ $form->select_types_paiements($typeid,'typeid','',0,1,1,16);
print ' | ';
// Account
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 6cd80d8dff6..0a2b9f72d60 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -419,19 +419,19 @@ if ($resql)
// Date invoice
if (! empty($arrayfields['f.date_last_gen']['checked']))
{
- print '';
- if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
- print '';
- $formother->select_year($search_year?$search_year:-1,'search_year',1, 20, 5);
+ print ' | ';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
+ print '';
+ $formother->select_year($search_year?$search_year:-1,'search_year',1, 20, 5, 0, 0, '', 'witdhauto valignmiddle');
print ' | ';
}
// Date next generation
if (! empty($arrayfields['f.date_when']['checked']))
{
- print '';
- if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
- print '';
- $formother->select_year($search_year_date_when?$search_year_date_when:-1,'search_year_date_when',1, 20, 5);
+ print ' | ';
+ if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '';
+ print '';
+ $formother->select_year($search_year_date_when?$search_year_date_when:-1,'search_year_date_when',1, 20, 5, 0, 0, '', 'witdhauto valignmiddle');
print ' | ';
}
// Extra fields
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index c09621db71c..8319f42bd97 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -756,7 +756,7 @@ if ($resql)
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '';
- $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
+ $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
print ' | ';
}
if (! empty($arrayfields['f.total_ht']['checked']))
@@ -775,14 +775,14 @@ if ($resql)
}
if (! empty($arrayfields['f.total_localtax1']['checked']))
{
- // Amount
+ // Localtax1
print '';
print '';
print ' | ';
}
if (! empty($arrayfields['f.total_localtax2']['checked']))
{
- // Amount
+ // Localtax2
print '';
print '';
print ' | ';
diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php
index 47cafad0f0a..f911636a7ef 100644
--- a/htdocs/compta/salaries/index.php
+++ b/htdocs/compta/salaries/index.php
@@ -179,7 +179,7 @@ if ($result)
print ' | ';
// Type
print '';
- $form->select_types_paiements($typeid,'typeid','',0,0,1,16);
+ $form->select_types_paiements($typeid,'typeid','',0,1,1,16);
print ' | ';
// Account
if (! empty($conf->banque->enabled))
diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php
index 66099cd63db..27e314762f8 100644
--- a/htdocs/compta/tva/reglement.php
+++ b/htdocs/compta/tva/reglement.php
@@ -173,7 +173,7 @@ if ($result)
print '';
// Type
print '';
- $form->select_types_paiements($typeid,'typeid','',0,0,1,16);
+ $form->select_types_paiements($typeid,'typeid','',0,1,1,16);
print ' | ';
// Account
if (! empty($conf->banque->enabled))
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 7b74fc05850..61d21cec7e8 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3100,7 +3100,7 @@ class Form
* @param string $morecss Add more CSS on select tag
* @return void
*/
- function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
+ function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
{
global $langs,$user;
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 083967935fa..f48f3d2c01d 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -655,7 +655,7 @@ if ($resql)
if (! empty($arrayfields['f.fk_mode_reglement']['checked']))
{
print '';
- $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 0, 1, 10);
+ $form->select_types_paiements($search_paymentmode, 'search_paymentmode', '', 0, 1, 1, 10);
print ' | ';
}
if (! empty($arrayfields['f.total_ht']['checked']))
diff --git a/htdocs/install/mysql/data/llx_c_paiement.sql b/htdocs/install/mysql/data/llx_c_paiement.sql
index 49da0b37952..2e459cd12a7 100644
--- a/htdocs/install/mysql/data/llx_c_paiement.sql
+++ b/htdocs/install/mysql/data/llx_c_paiement.sql
@@ -30,13 +30,12 @@
-- Types paiement
--
-insert into llx_c_paiement (id,code,libelle,type,active) values ( 1, '', '-', 2,1);
+insert into llx_c_paiement (id,code,libelle,type,active) values ( 1, 'TIP', 'TIP', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 2, 'VIR', 'Transfer', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 3, 'PRE', 'Debit order', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 4, 'LIQ', 'Cash', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 6, 'CB', 'Credit card', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 7, 'CHQ', 'Cheque', 2,1);
-insert into llx_c_paiement (id,code,libelle,type,active) values ( 8, 'TIP', 'TIP', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values (50, 'VAD', 'Online payment', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values (51, 'TRA', 'Traite', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values (52, 'LCR', 'LCR', 2,0);
diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
index 4b224477940..2b2bb6949d5 100644
--- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
+++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql
@@ -71,6 +71,7 @@ ALTER TABLE llx_expensereport_det ADD COLUMN docnumber varchar(128) after fk_exp
ALTER TABLE llx_website_page ADD COLUMN aliasalt varchar(255) after pageurl;
-- Add missing keys and primary key
+DELETE FROM llx_c_paiement WHERE code = '' or code = '-' or id = 0;
ALTER TABLE llx_c_paiement DROP INDEX uk_c_paiement;
ALTER TABLE llx_c_paiement ADD UNIQUE INDEX uk_c_paiement_code(entity, code);
ALTER TABLE llx_c_paiement CHANGE COLUMN id id INTEGER AUTO_INCREMENT PRIMARY KEY;