From 15abd76ef4a5e5f21d3efb7465036491b2c483e2 Mon Sep 17 00:00:00 2001 From: Faustin Date: Tue, 21 Jun 2022 20:04:35 +0200 Subject: [PATCH] NEW 21000 Added columns 'alias_name' on supplier propals list --- htdocs/supplier_proposal/list.php | 32 +++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 96f8a2b2cca..894c16cacf7 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -61,6 +61,7 @@ $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); +$search_societe_alias = GETPOST('search_societe_alias', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); @@ -168,6 +169,7 @@ $checkedtypetiers = 0; $arrayfields = array( 'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1), + 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0), @@ -224,6 +226,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_sale = ''; $search_ref = ''; $search_societe = ''; + $search_societe_alias = ''; $search_montant_ht = ''; $search_montant_vat = ''; $search_montant_ttc = ''; @@ -292,7 +295,7 @@ $sql = 'SELECT'; if ($sall || $search_product_category > 0 || $search_user > 0) { $sql = 'SELECT DISTINCT'; } -$sql .= ' s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; +$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; $sql .= ' sp.rowid, sp.note_public, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,'; @@ -363,6 +366,9 @@ if ($search_ref) { if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } +if ($search_societe_alias) { + $sql .= natural_search('s.name_alias', $search_societe_alias); +} if ($search_login) { $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login); } @@ -521,6 +527,9 @@ if ($resql) { if ($search_societe) { $param .= '&search_societe='.urlencode($search_societe); } + if ($search_societe_alias) { + $param .= '&search_societe_alias='.urlencode($search_societe_alias); + } if ($search_user > 0) { $param .= '&search_user='.urlencode($search_user); } @@ -677,6 +686,11 @@ if ($resql) { print ''; print ''; } + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print ''; + print ''; + } if (!empty($arrayfields['s.town']['checked'])) { print ''; } @@ -816,6 +830,9 @@ if ($resql) { if (!empty($arrayfields['s.nom']['checked'])) { print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['s.name_alias']['checked'])) { + print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder); + } if (!empty($arrayfields['s.town']['checked'])) { print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder); } @@ -904,6 +921,7 @@ if ($resql) { // Company $companystatic->id = $obj->socid; $companystatic->name = $obj->name; + $companystatic->name_alias = $obj->alias; $companystatic->client = $obj->client; $companystatic->code_client = $obj->code_client; @@ -942,7 +960,17 @@ if ($resql) { // Thirdparty if (!empty($arrayfields['s.nom']['checked'])) { print ''; - print $companystatic->getNomUrl(1, 'supplier'); + print $companystatic->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1); + print ''; + if (!$i) { + $totalarray['nbfield']++; + } + } + + // Alias + if (!empty($arrayfields['s.name_alias']['checked'])) { + print ''; + print $companystatic->name_alias; print ''; if (!$i) { $totalarray['nbfield']++;