diff --git a/ChangeLog b/ChangeLog index cd74d69d172..29cb2362393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,21 +40,22 @@ For users: - New: Add Maghreb regions and departments. - New: A more responsive desgin for statistic box of home page. - Qual: Implement same rule for return value of all command line scripts (0 when success, <>0 if error). -- New: [ task #1005 ] Adapting to Spanish legislation bill numbering -- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode -- New: [ task #1014 ] Add option to recursivly add parent category -- New: [ task #1016 ] Can define a specific numbering for deposits -- New: [ task #918 ] Stock replenishment -- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count -- New: Add pdf link into supplier invoice list and supplier order list -- New: Genrate auto the PDF for supplier invoice -- New: Add category into filter webservice thirdparty method getListOfThirdParties -- New: Allow to define margin or mark rate during quoting, ordering, invoicing -- New: User permissions on margin module -- New: Add ref supplier into muscadet model +- New: [ task #1005 ] Adapting to Spanish legislation bill numbering. +- New: [ task #1011 ] Now supplier order and invoice deal with payment terms and mode. +- New: [ task #1014 ] Add option to recursivly add parent category. +- New: [ task #1016 ] Can define a specific numbering for deposits. +- New: [ task #918 ] Stock replenishment. +- Fix: [ bug #992 ] Proforma invoices don't have a separated numeric count. +- New: Add pdf link into supplier invoice list and supplier order list. +- New: Genrate auto the PDF for supplier invoice. +- New: Add category into filter webservice thirdparty method getListOfThirdParties. +- New: Allow to define margin or mark rate during quoting, ordering, invoicing. +- New: User permissions on margin module. +- New: Add ref supplier into muscadet model. - New: Can use tag {mm} before {yy} even when there is a reset into numbering masks. -- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables -- New: [ task #923 ] Localtax support for ODT templates +- New: [ task #1060 ] Register fields localtax(1|2)_type into details tables. +- New: [ task #923 ] Localtax support for ODT templates. +- New: [ task #90 ] Barcode search. For translators: - Qual: Normalized sort order of all languages files with english reference files. diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index e8c4df08280..9cf708b1510 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -58,6 +58,7 @@ print '
'; * Search area */ $rowspan=2; +if (! empty($conf->barcode->enabled)) $rowspan++; print '
'; print ''; print ''; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 97b18be18d3..f27de1eb33a 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -41,6 +41,7 @@ $result = restrictedArea($user,'societe',$socid,''); $search_nom=trim(GETPOST("search_nom")); $search_nom_only=trim(GETPOST("search_nom_only")); $search_all=trim(GETPOST("search_all")); +$sbarcode=trim(GETPOST("sbarcode")); $search_town=trim(GETPOST("search_town")); $socname=trim(GETPOST("socname")); $search_idprof1=trim(GETPOST('search_idprof1')); @@ -70,7 +71,7 @@ $pagenext = $page + 1; * Actions */ -// Recherche +// special search if ($mode == 'search') { $search_nom=$socname; @@ -122,7 +123,11 @@ if ($mode == 'search') if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")"; if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1"; if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0"; - + if (!empty($conf->barcode->enabled)) + { + $sql.= "AND s.barcode LIKE '".$db->escape($crit)."'"; + } + $result=$db->query($sql); if ($result) { @@ -158,6 +163,7 @@ if (GETPOST("button_removefilter_x")) $search_sale=''; $socname=""; $search_nom=""; + $sbarcode=""; $search_town=""; $search_idprof1=''; $search_idprof2=''; @@ -185,7 +191,7 @@ if ($socname) */ $title=$langs->trans("ListOfThirdParties"); -$sql = "SELECT s.rowid, s.nom as name, s.town, s.datec, s.datea,"; +$sql = "SELECT s.rowid, s.nom as name, s.barcode, s.town, s.datec, s.datea,"; $sql.= " st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; $sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) @@ -250,6 +256,7 @@ if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idprof if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")"; if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1"; if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0"; +if (!empty($conf->barcode->enabled) && $sbarcode) $sql.= " AND s.barcode LIKE '%".$db->escape($sbarcode)."%'"; //print $sql; // Count total nb of records @@ -270,6 +277,7 @@ if ($resql) $i = 0; $params = "&socname=".$socname."&search_nom=".$search_nom."&search_town=".$search_town; + $params.= ($sbarcode?"&sbarcode=".$sbarcode:""); $params.= '&search_idprof1='.$search_idprof1; $params.= '&search_idprof2='.$search_idprof2; $params.= '&search_idprof3='.$search_idprof3; @@ -328,6 +336,7 @@ if ($resql) // Lines of titles print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$params,"",$sortfield,$sortorder); + if (! empty($conf->barcode->enabled)) print_liste_field_titre($langs->trans("BarCode"), $_SERVER["PHP_SELF"], "s.barcode",$param,'','',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.town","",$params,'',$sortfield,$sortorder); print_liste_field_titre($form->textwithpicto($langs->trans("ProfId1Short"),$textprofid[1],1,0),$_SERVER["PHP_SELF"],"s.siren","",$params,'class="nowrap"',$sortfield,$sortorder); print_liste_field_titre($form->textwithpicto($langs->trans("ProfId2Short"),$textprofid[2],1,0),$_SERVER["PHP_SELF"],"s.siret","",$params,'class="nowrap"',$sortfield,$sortorder); @@ -344,24 +353,33 @@ if ($resql) print ''; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; print ''; - print ''; + // Barcode + if (! empty($conf->barcode->enabled)) + { + print ''; + } + // Town + print ''; // IdProf1 print ''; // IdProf2 print ''; // IdProf3 print ''; // IdProf4 print ''; // Type (customer/prospect/supplier) print '"; + print "\n"; + // Barcode + if (! empty($conf->barcode->enabled)) + { + print ''; + } print "\n"; print "\n"; print "\n";
'; + print ''; + print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; @@ -387,7 +405,8 @@ if ($resql) { $obj = $db->fetch_object($resql); $var=!$var; - print "
"; + print "
"; $companystatic->id=$obj->rowid; $companystatic->name=$obj->name; $companystatic->canvas=$obj->canvas; @@ -395,6 +414,11 @@ if ($resql) $companystatic->status=$obj->status; print $companystatic->getNomUrl(1,'',100); print "'.$objp->barcode.'".$obj->town."".$obj->idprof1."".$obj->idprof2."