diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index aea09f73124..1cc09394023 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -61,31 +61,22 @@ $pagenext = $page + 1; if (! $sortorder) { $sortorder=($filter=='outofdate'?"DESC":"ASC"); } if (! $sortfield) { $sortfield=($filter=='outofdate'?"d.datefin":"d.lastname"); } -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers -{ - $search=""; - $search_ref=""; - $search_lastname=""; - $search_firstname=""; - $search_login=""; - $type=""; - $search_email=""; - $search_categ=""; - $catid=""; - $sall=""; -} - // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('memberlist')); $extrafields = new ExtraFields($db); +// fetch optionals attributes and labels +$extralabels = $extrafields->fetch_name_optionals_label('member'); +$search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); + // List of fields to search into when doing a "search in all" $fieldstosearchall = array( 'd.rowid'=>'Ref', //'d.ref'=>'Ref', 'd.lastname'=>'Lastname', 'd.firstname'=>'Firstname', - 'd.societe'=>"Company", + 'd.login'=>'Login', + 'd.societe'=>"Company", 'd.email'=>'EMail', 'd.address'=>'Address', 'd.zip'=>'Zip', @@ -93,7 +84,67 @@ $fieldstosearchall = array( 'd.note_public'=>'NotePublic', 'd.note_private'=>'NotePrivate', ); - +$arrayfields=array( + 'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), + 'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1), + 'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1), + 'd.societe'=>array('label'=>$langs->trans("Company"), 'checked'=>1), + 'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1), + 'd.morphy'=>array('label'=>$langs->trans("MorPhy"), 'checked'=>1), + 't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1), + 'd.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1), + 'd.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0), + 'd.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0), + 'd.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0), + 'd.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0), + 'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0), + 'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500), + 'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), + 'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), + 'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000) +); +// Extra fields +if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) +{ + foreach($extrafields->attribute_label as $key => $val) + { + $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>$extrafields->attribute_perms[$key]); + } +} + +/* + * Actions + */ + +if (GETPOST('cancel')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction')) { $massaction=''; } + +$parameters=array('socid'=>$socid); +$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'); + +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + +// Purge search criteria +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +{ + $search=""; + $search_ref=""; + $search_lastname=""; + $search_firstname=""; + $search_login=""; + $search_company=""; + $type=""; + $search_email=""; + $search_address=""; + $search_zip=""; + $search_town=""; + $search_morphy=""; + $search_categ=""; + $catid=""; + $sall=""; +} + /* * View @@ -140,10 +191,25 @@ if ($search_login) $sql.= natural_search("d.login", $search_login); if ($search_email) $sql.= natural_search("d.email", $search_email); if ($filter == 'uptodate') $sql.=" AND datefin >= '".$db->idate($now)."'"; if ($filter == 'outofdate') $sql.=" AND (datefin IS NULL OR datefin < '".$db->idate($now)."')"; + +// Add where from extra fields +foreach ($search_array_options as $key => $val) +{ + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + $typ=$extrafields->attribute_type[$tmpkey]; + $mode=0; + if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric + if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit))) + { + $sql .= natural_search('ef.'.$tmpkey, $crit, $mode); + } +} // 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); // Count total nb of records with no order and no limits @@ -190,11 +256,25 @@ if ($resql) if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($statut != "") $param.="&statut=".$statut; if ($search_nom) $param.="&search_nom=".$search_nom; - if ($search_login) $param.="&search_login=".$search_login; - if ($search_email) $param.="&search_email=".$search_email; - if ($filter) $param.="&filter=".$filter; - if ($type > 0) $param.="&type=".$type; - if ($optioncss != '') $param.='&optioncss='.$optioncss; + if ($search_firstname) $param.="&search_firstname=".$search_firstname; + if ($search_lastname) $param.="&search_lastname=".$search_lastname; + if ($search_login) $param.="&search_login=".$search_login; + if ($search_email) $param.="&search_email=".$search_email; + if ($search_company) $param.="&search_company=".$search_company; + if ($search_zip) $param.="&search_zip=".$search_zip; + if ($search_town) $param.="&search_town=".$search_town; + if ($filter) $param.="&filter=".$filter; + if ($type > 0) $param.="&type=".$type; + if ($optioncss != '') $param.='&optioncss='.$optioncss; + // Add $param from extra fields + foreach ($search_array_options as $key => $val) + { + $crit=$val; + $tmpkey=preg_replace('/search_options_/','',$key); + if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); + } + + //$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); print '
'; if ($optioncss != '') print ''; @@ -222,42 +302,70 @@ if ($resql) $moreforfilter.=$formother->select_categories(Categorie::TYPE_MEMBER,$search_categ,'search_categ',1); $moreforfilter.=''; } + $parameters=array(); + $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook + if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; + else $moreforfilter = $hookmanager->resPrint; if (! empty($moreforfilter)) { print '
'; print $moreforfilter; - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - print '
'; + print ''; } - print ''; + $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; + $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields + + print '
'."\n"; print ''; if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { print ''; } - print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"d.rowid",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Name")." / ".$langs->trans("Company"),$_SERVER["PHP_SELF"],"d.lastname",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Login"),$_SERVER["PHP_SELF"],"d.login",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"t.libelle",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Person"),$_SERVER["PHP_SELF"],"d.morphy",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"d.email",$param,"","",$sortfield,$sortorder); - - $parameters=array(); + if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.company','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'],$_SERVER["PHP_SELF"],'d.login','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'],$_SERVER["PHP_SELF"],'d.morphy','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'],$_SERVER["PHP_SELF"],'t.libelle','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'],$_SERVER["PHP_SELF"],'d.address','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'],$_SERVER["PHP_SELF"],'d.zip','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'],$_SERVER["PHP_SELF"],'d.town','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.email']['checked'])) print_liste_field_titre($arrayfields['d.email']['label'],$_SERVER["PHP_SELF"],'d.email','',$param,'',$sortfield,$sortorder); + if (! empty($arrayfields['d.datefin']['checked'])) print_liste_field_titre($arrayfields['d.datefin']['label'],$_SERVER["PHP_SELF"],'d.datefin','',$param,'',$sortfield,$sortorder); + // Extra fields + if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key => $val) + { + if (! empty($arrayfields["ef.".$key]['checked'])) + { + $align=$extrafields->getAlignFlag($key); + print_liste_field_titre($extralabels[$key],$_SERVER["PHP_SELF"],"ef.".$key,"",$param,($align?'align="'.$align.'"':''),$sortfield,$sortorder); + } + } + } + // Hook fields + $parameters=array('arrayfields'=>$arrayfields); $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - - print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans(""),$_SERVER["PHP_SELF"],"",$param,"",'width="60" align="center"',$sortfield,$sortorder); - print "\n"; + if (! empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'],$_SERVER["PHP_SELF"],"d.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'],$_SERVER["PHP_SELF"],"d.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); + if (! empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'],$_SERVER["PHP_SELF"],"d.statut","",$param,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="right"',$sortfield,$sortorder,'maxwidthsearch '); + print "\n"; // Line for filters fields print ''; - print ''; + // Ref + if (! empty($arrayfields['c.ref']['checked'])) + { + print ''; + } print ''; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index bad7fdbd4bf..811e7320385 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -127,7 +127,7 @@ $arrayfields=array( 'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'c.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) + 'c.facture'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) ); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 4b4031b497d..b481a7e1f60 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -126,6 +126,7 @@ AssociatedProductsAbility=Activate the package feature AssociatedProducts=Package product AssociatedProductsNumber=Number of products composing this package product ParentProductsNumber=Number of parent packaging product +ParentProducts=Parent products IfZeroItIsNotAVirtualProduct=If 0, this product is not a package product IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any package product EditAssociate=Associate @@ -291,6 +292,7 @@ DefaultPrice=Default price ComposedProductIncDecStock=Increase/Decrease stock on parent change ComposedProduct=Sub-product MinSupplierPrice=Minimum supplier price +MinCustomerPrice=Minimum customer price DynamicPriceConfiguration=Dynamic price configuration DynamicPriceDesc=On product card, with this module enabled, you should be able to set mathematic functions to calculate Customer or Supplier prices. Such function can use all mathematic operators, some constants and variables. You can set here the variables you want to be able and if the variable need an automatic update, the external URL to use to ask Dolibarr to update automaticaly the value. AddVariable=Add Variable diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index 759c3c54fc5..f64d7c2de1b 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -10,9 +10,12 @@ ListOfSuppliers=List of suppliers ShowSupplier=Show supplier OrderDate=Order date BuyingPrice=Buying price -BuyingPriceMin=Minimum buying price -BuyingPriceMinShort=Min buying price +BuyingPriceMin=Minimum purchase price +BuyingPriceMinShort=Min purchase price +SellingPriceMinShort=Min sell price TotalBuyingPriceMin=Total of subproducts buying prices +TotalBuyingPriceMinShort=Total of subproducts purchase prices +TotalSellingPriceMinShort=Total of subproducts sell prices SomeSubProductHaveNoPrices=Some sub-products have no price defined AddSupplierPrice=Add supplier price ChangeSupplierPrice=Change supplier price diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 784ce9791cc..68dfea68be7 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2980,9 +2980,10 @@ class Product extends CommonObject * * @param int $id Id of product to search childs of * @param int $firstlevelonly Return only direct child + * @param int $level Level of recursing call (start to 1) * @return array Prod */ - function getChildsArbo($id, $firstlevelonly=0) + function getChildsArbo($id, $firstlevelonly=0, $level=1) { $sql = "SELECT p.rowid, p.label as label, pa.qty as qty, pa.fk_product_fils as id, p.fk_product_type, pa.incdec"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; @@ -2991,13 +2992,18 @@ class Product extends CommonObject $sql.= " AND pa.fk_product_pere = ".$id; $sql.= " AND pa.fk_product_fils != ".$id; // This should not happens, it is to avoid infinite loop if it happens - dol_syslog(get_class($this).'::getChildsArbo', LOG_DEBUG); + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level, LOG_DEBUG); + + // Protection against infinite loop + if ($level > 30) return array(); + $res = $this->db->query($sql); if ($res) { $prods = array(); while ($rec = $this->db->fetch_array($res)) { + // TODO Add check to not add ne record if already added $prods[$rec['rowid']]= array( 0=>$rec['id'], 1=>$rec['qty'], @@ -3009,7 +3015,7 @@ class Product extends CommonObject //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); if (empty($firstlevelonly)) { - $listofchilds=$this->getChildsArbo($rec['id']); + $listofchilds=$this->getChildsArbo($rec['id'], 0, $level + 1); foreach($listofchilds as $keyChild => $valueChild) { $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; @@ -3034,10 +3040,12 @@ class Product extends CommonObject */ function get_sousproduits_arbo() { - $parent = $this->getParent(); + //$parent = $this->getParent(); + $parent[$this->label]=array(0 => $this->id); + foreach($parent as $key => $value) // key=label, value[0]=id { - foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) + foreach($this->getChildsArbo($value[0]) as $keyChild => $valueChild) // Warning. getChildsArbo can gell getChildsArbo recursively. { $parent[$key][$keyChild] = $valueChild; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index f4b3f575eba..25195f6c167 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -190,25 +190,10 @@ if ($id > 0 || ! empty($ref)) */ if ($user->rights->produit->lire || $user->rights->service->lire) { + dol_banner_tab($object, 'ref', '', ($user->societe_id?0:1), 'ref'); + print '
 
 '; + print ''; + print ''; print '
'; - print ""; - - $nblignes=6; - if ($object->isProduct() && ! empty($conf->stock->enabled)) $nblignes++; - if ($object->isService()) $nblignes++; - - // Reference - print ''; - - print ''; - - // Label - print ''; - print ''; - // Nature if($object->type!=Product::TYPE_SERVICE) { @@ -265,7 +250,7 @@ if ($id > 0 || ! empty($ref)) print load_fiche_titre($langs->trans("ProductParentList"),'','').'
'; print '
'.$langs->trans("Ref").''; - print $form->showrefnav($object,'ref','',1,'ref'); - print '
'.$langs->trans("Label").''.$object->label.'
'; print ''; - print ''; + print ''; print ''; print ''; print ''; @@ -323,6 +308,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; + print ''; if (! empty($conf->stock->enabled)) print ''; print ''; print ''; @@ -334,10 +320,7 @@ if ($id > 0 || ! empty($ref)) { foreach($prods_arbo as $value) { - $productstatic->id=$value['id']; - $productstatic->type=$value['type']; - $productstatic->label=$value['label']; - $productstatic->entity=$value['entity']; + $productstatic->fetch($value['id']); if ($value['level'] <= 1) { @@ -345,7 +328,6 @@ if ($id > 0 || ! empty($ref)) print ''; $notdefined=0; - $productstatic->ref=$value['ref']; $nb_of_subproduct = $value['nb']; print ''; @@ -355,7 +337,7 @@ if ($id > 0 || ! empty($ref)) print ''; + // Best selling price + $pricesell=$productstatic->price; + if (! empty($conf->global->PRODUIT_MULTIPRICES)) + { + $pricesell='Variable'; + } + $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); + $totalsell+=$totallinesell; + print ''; + // Stock if (! empty($conf->stock->enabled)) print ''; // Real stock @@ -416,7 +411,7 @@ if ($id > 0 || ! empty($ref)) // Minimum buying price print ''; print ''; + // Minimum selling price + print ''; + + print ''; + // Stock if (! empty($conf->stock->enabled)) print ''; @@ -464,24 +469,22 @@ if ($id > 0 || ! empty($ref)) print load_fiche_titre($langs->trans("ProductToAddSearch"),'',''); print ''; - print '
'.$langs->trans('ParentProduct').''.$langs->trans('ParentProducts').''.$langs->trans('Label').''.$langs->trans('Qty').''.$langs->trans('ComposedProduct').''.$langs->trans('Label').''.$langs->trans('MinSupplierPrice').''.$langs->trans('MinCustomerPrice').''.$langs->trans('Stock').''.$langs->trans('Qty').''.$langs->trans('ComposedProductIncDecStock').'
'.$productstatic->getNomUrl(1,'composition').''; if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0) { - print '   '.$langs->trans("BuyingPriceMinShort").': '; + print $langs->trans("BuyingPriceMinShort").': '; if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(0,0); else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; } } @@ -363,10 +345,23 @@ if ($id > 0 || ! empty($ref)) $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT'); $total+=$totalline; + print ''; print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency)); print ''; + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($pricesell,'','',0,0,-1,$conf->currency)); + print ''.$value['stock'].''; - print $langs->trans("TotalBuyingPriceMin"); + print $langs->trans("TotalBuyingPriceMinShort"); print ''; @@ -424,6 +419,16 @@ if ($id > 0 || ! empty($ref)) print ($atleastonenotdefined?'':price($total,'','',0,0,-1,$conf->currency)); print ''; + print $langs->trans("TotalSellingPriceMinShort"); + print ''; + if ($atleastonenotdefined) print $langs->trans("Unknown").' ('.$langs->trans("SomeSubProductHaveNoPrices").')'; + print ($atleastonenotdefined?'':price($totalsell,'','',0,0,-1,$conf->currency)); + print ' 
'; - print ''; - print ''; + print '
'; + print ''; + print $langs->trans("KeywordFilter").': '; + print '   '; + print '
'; if (! empty($conf->categorie->enabled)) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - print ''; - print ''; + print '
'.$langs->trans("CategoryFilter").': '; + print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'  
'; } - print '
'; - print ''; - print $langs->trans("KeywordFilter").'   '; - print ''; print ''; print ''; - print ''; - print ''; - print '
'.$langs->trans("CategoryFilter").'   '.$form->select_all_categories(Categorie::TYPE_PRODUCT, $parent).'
'; + print '
'; + print ''; + print '
'; print '
'; } @@ -494,7 +497,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - print ''; + print '
'; print ''; print '
'.$langs->trans("ComposedProduct").''; print ''.$langs->trans("Label").''; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 4e9d0b1ed18..b352e25a724 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -519,14 +519,15 @@ if ($resql) $moreforfilter.=$formother->select_categories('customer',$search_categ,'search_categ',1); $moreforfilter.=''; } - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user, 0, 1, 'maxwidth300'); - $moreforfilter.='
'; - } + } + + // If the user can view prospects other than his' + if ($user->rights->societe->client->voir || $socid) + { + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('SalesRepresentatives'). ': '; + $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user, 0, 1, 'maxwidth300'); + $moreforfilter.='
'; } if ($type == 'f') {