diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index fd60a6a84a4..709b246602b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -200,6 +200,7 @@ $fieldstosearchall = array( 'f.ref_client'=>'RefCustomer', 'f.note_public'=>'NotePublic', 's.nom'=>"ThirdParty", + 's.code_client'=>"CustomerCodeShort", 's.name_alias'=>"AliasNameShort", 's.zip'=>"Zip", 's.town'=>"Town", @@ -222,6 +223,7 @@ $arrayfields = array( 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(!isModEnabled('project') ? 0 : 1), 'position'=>41), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), + 's.code_client'=>array('label'=>"CustomerCodeShort", 'checked'=>1, 'position'=>52), 's2.nom'=>array('label'=>'ParentCompany', 'position'=>32, 'checked'=>0), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), 's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>60), @@ -574,7 +576,7 @@ $sql .= ' f.datef, f.date_valid, f.date_lim_reglement as datelimite, f.module_so $sql .= ' f.paye as paye, f.fk_statut, f.close_code,'; $sql .= ' f.datec as date_creation, f.tms as date_update, f.date_closing as date_closing,'; $sql .= ' f.retained_warranty, f.retained_warranty_date_limit, f.situation_final, f.situation_cycle_ref, f.situation_counter,'; -$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.code_client as code_client, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta as code_compta_client, s.code_compta_fournisseur,'; $sql .= " s.parent as fk_parent,"; $sql .= " s2.nom as name2,"; $sql .= ' typent.code as typent_code,'; @@ -687,6 +689,9 @@ if (empty($arrayfields['s.name_alias']['checked']) && $search_company) { if ($search_parent_name) { $sql .= natural_search('s2.nom', $search_parent_name); } +if ($search_company_code_client) { + $sql .= natural_search('s.code_client', $search_company_code_client); +} if ($search_town) { $sql .= natural_search('s.town', $search_town); } @@ -1402,6 +1407,10 @@ if ($resql) { print ''; print ''; } + // Customer Code + if (!empty($arrayfields['s.code_client']['checked'])) { + print '