diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 5199bea76a0..af67bd8107b 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -135,7 +135,7 @@ $checkedtypetiers=0; $arrayfields=array( 'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), 'p.ref_client'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1), - 'pr.ref'=>array('label'=>$langs->trans("Project"), 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)), + 'pr.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index e79e28c934a..84898930ed9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -72,6 +72,7 @@ $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha'); $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_type=GETPOST('search_type','int'); +$search_project=GETPOST('search_project','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_montant_vat=GETPOST('search_montant_vat','alpha'); @@ -151,6 +152,7 @@ $arrayfields=array( 'f.type'=>array('label'=>$langs->trans("Type"), 'checked'=>0), 'f.date'=>array('label'=>$langs->trans("DateInvoice"), 'checked'=>1), 'f.date_lim_reglement'=>array('label'=>$langs->trans("DateDue"), 'checked'=>1), + 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), @@ -362,7 +364,8 @@ $sql.= ' f.datec as date_creation, f.tms as date_update,'; $sql.= ' s.rowid as socid, s.nom as name, s.email, 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.= " typent.code as typent_code,"; $sql.= " state.code_departement as state_code, state.nom as state_name,"; -$sql.= " country.code as country_code"; +$sql.= " country.code as country_code,"; +$sql.= " p.rowid as project_id, p.ref as project_ref"; // We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0) // TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field. if (! $sall) $sql.= ', SUM(pf.amount) as dynamount_payed'; @@ -381,6 +384,7 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab if (! $sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiement_facture as pf ON pf.fk_facture = f.rowid'; if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as pd ON f.rowid=pd.fk_facture'; if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; +$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; // We'll need this table joined to the select in order to filter by sale if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; if ($search_user > 0) @@ -488,7 +492,8 @@ if (! $sall) $sql.= ' s.rowid, s.nom, s.email, s.town, s.zip, s.fk_pays, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,'; $sql.= ' typent.code,'; $sql.= ' state.code_departement, state.nom,'; - $sql.= ' country.code'; + $sql.= ' country.code,'; + $sql.= " p.rowid, p.ref"; foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by { @@ -714,12 +719,12 @@ if ($resql) // Project if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -838,6 +843,7 @@ if ($resql) if (! empty($arrayfields['f.type']['checked'])) print_liste_field_titre($arrayfields['f.type']['label'],$_SERVER["PHP_SELF"],'f.type','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['f.date']['checked'])) print_liste_field_titre($arrayfields['f.date']['label'],$_SERVER['PHP_SELF'],'f.datef','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'],$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER['PHP_SELF'],"p.ref",'',$param,'',$sortfield,$sortorder); 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.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); @@ -864,6 +870,8 @@ if ($resql) print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; + $projectstatic=new Project($db); + if ($num > 0) { $i=0; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 9e806fc3f86..31d6ba2f183 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -151,7 +151,7 @@ $arrayfields=array( 'f.label'=>array('label'=>$langs->trans("Label"), 'checked'=>0), 'f.datef'=>array('label'=>$langs->trans("DateInvoice"), 'checked'=>1), 'f.date_lim_reglement'=>array('label'=>$langs->trans("DateDue"), 'checked'=>1), - 'p.ref'=>array('label'=>$langs->trans("Project"), 'checked'=>0), + 'p.ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1), @@ -619,12 +619,12 @@ if ($resql) // Project if (! empty($arrayfields['p.ref']['checked'])) { - print ''; + print ''; } // Thirpdarty if (! empty($arrayfields['s.nom']['checked'])) { - print ''; + print ''; } // Town if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -744,7 +744,7 @@ if ($resql) if (! empty($arrayfields['f.label']['checked'])) print_liste_field_titre($arrayfields['f.label']['label'],$_SERVER['PHP_SELF'],"f.libelle,f.rowid",'',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['f.datef']['checked'])) print_liste_field_titre($arrayfields['f.datef']['label'],$_SERVER['PHP_SELF'],'f.datef,f.rowid','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['f.date_lim_reglement']['checked'])) print_liste_field_titre($arrayfields['f.date_lim_reglement']['label'],$_SERVER['PHP_SELF'],"f.date_lim_reglement",'',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER['PHP_SELF'],"p.ref",'',$param,'align="center"',$sortfield,$sortorder); + if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER['PHP_SELF'],"p.ref",'',$param,'',$sortfield,$sortorder); 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.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 69038535669..b3b92387309 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -4595,7 +4595,7 @@ dl.dropdown { position:absolute; top:2px; list-style:none; - max-height: 270px; + max-height: 264px; overflow: auto; } .dropdown span.value { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 3cb7ae4d7a9..ef5350421b6 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -4605,7 +4605,7 @@ dl.dropdown { position:absolute; top:2px; list-style:none; - max-height: 270px; + max-height: 264px; overflow: auto; } .dropdown span.value {