From 7a0ec2d831b2f4f83f519622736a7acde14b500e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 May 2015 23:56:42 +0200 Subject: [PATCH] Prototype with datatables works now also ith jmobile. Add field fifo and lifo into product table. --- dev/ansible/README.md | 2 +- htdocs/core/class/html.form.class.php | 14 +++++------ htdocs/core/lib/functions.lib.php | 24 +++++++++---------- .../install/mysql/migration/3.7.0-3.8.0.sql | 3 +++ htdocs/install/mysql/tables/llx_product.sql | 4 +++- htdocs/theme/eldy/style.css.php | 9 +++++++ 6 files changed, 35 insertions(+), 21 deletions(-) diff --git a/dev/ansible/README.md b/dev/ansible/README.md index aeed9fc6983..e498ebc3340 100644 --- a/dev/ansible/README.md +++ b/dev/ansible/README.md @@ -3,7 +3,7 @@ This is a quick tutorial: * Install ansible: -> apt-get install +> apt-get install ansible * Add ip of server to manage into /etc/ansible/hosts diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3a9c716dd7a..09c3fab6be7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4701,15 +4701,15 @@ class Form * To add a particular filter on select, you must set $object->next_prev_filter to SQL criteria. * * @param object $object Object to show - * @param string $paramid Name of parameter to use to name the id into the URL link - * @param string $morehtml More html content to output just before the nav bar + * @param string $paramid Name of parameter to use to name the id into the URL link + * @param string $morehtml More html content to output just before the nav bar * @param int $shownav Show Condition (navigation is shown if value is 1) - * @param string $fieldid Nom du champ en base a utiliser pour select next et previous - * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous - * @param string $morehtmlref Code html supplementaire a afficher apres ref - * @param string $moreparam More param to add in nav link url. + * @param string $fieldid Nom du champ en base a utiliser pour select next et previous + * @param string $fieldref Nom du champ objet ref (object->ref) a utiliser pour select next et previous + * @param string $morehtmlref Code html supplementaire a afficher apres ref + * @param string $moreparam More param to add in nav link url. * @param int $nodbprefix Do not include DB prefix to forge table name - * @return string Portion HTML avec ref + boutons nav + * @return string Portion HTML avec ref + boutons nav */ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ce5e7bbf33d..800542e4787 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -740,7 +740,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p else $isactive=false; - if ($i <=$limittoshow || $isactive ) + if ($i <= $limittoshow || $isactive ) { $out.='
'; if (isset($links[$i][2]) && $links[$i][2] == 'image') @@ -774,13 +774,13 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p if (isset($links[$i][2]) && $links[$i][2] == 'image') { if (!empty($links[$i][0])) - $outmore.=''.$links[$i][1].''."\n"; + $outmore.=''.$links[$i][1].''."\n"; else - $outmore.=''.$links[$i][1].''."\n"; + $outmore.=''.$links[$i][1].''."\n"; } else if (! empty($links[$i][1])) - $outmore.=''.$links[$i][1].''."\n"; + $outmore.=''.$links[$i][1].''."\n"; $outmore.='
'; } @@ -789,7 +789,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p if ($displaytab > $limittoshow) { - $tabsname=str_replace ("@", "", $picto); + $tabsname=str_replace("@", "", $picto); $out.='
'; $out.=''.$langs->trans("More").'...'; $out.='
'.$outmore.'
'; @@ -2822,34 +2822,34 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so if ($cpt>=1) { - $pagelist.= ''; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page=0'.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">1'; if ($cpt >= 2) $pagelist.='
  • ...
  • '; } do { if ($cpt==$page) { - $pagelist.= ''; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="active"':'data-role="button"').'>'.($page+1).''; } else { - $pagelist.= ''; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.$cpt.$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.($cpt+1).''; } $cpt++; } while ($cpt < $nbpages && $cpt<=$page+$maxnbofpage); if ($cpt<$nbpages) { - if ($cpt<$nbpages-1) $pagelist.= ''; - $pagelist.= ''; + if ($cpt<$nbpages-1) $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="inactive"':'data-role="button"').'>...'; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'':'data-role="button" ').'href="'.$file.'?page='.($nbpages-1).$options.'&sortfield='.$sortfield.'&sortorder='.$sortorder.'">'.$nbpages.''; } } else { - $pagelist.= '"; + $pagelist.= 'dol_use_jmobile)?' class="pagination"':'').'>dol_use_jmobile)?'class="active"':'data-role="button"').'>'.($page+1).""; } } - print_fleche_navigation($page,$file,$options,$nextpage,$pagelist,$morehtml); + print_fleche_navigation($page,$file,$options,$nextpage,$pagelist,$morehtml); // output the div and ul for previous/last completed with page numbers into $pagelist print ''; print ''."\n"; diff --git a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql index c44fa88c49c..130ff59791c 100755 --- a/htdocs/install/mysql/migration/3.7.0-3.8.0.sql +++ b/htdocs/install/mysql/migration/3.7.0-3.8.0.sql @@ -123,7 +123,10 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_supplier_price_expressio ALTER TABLE llx_product ADD COLUMN fk_price_expression integer DEFAULT NULL; ALTER TABLE llx_product_price ADD COLUMN fk_price_expression integer DEFAULT NULL; +ALTER TABLE llx_product ADD COLUMN fifo double(24,8) after pmp; +ALTER TABLE llx_product ADD COLUMN lifo double(24,8) after fifo; + --create table for user conf of printing driver CREATE TABLE llx_printing ( diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 5abbdcdde97..22006040327 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -71,7 +71,9 @@ create table llx_product volume float DEFAULT NULL, volume_units tinyint DEFAULT NULL, stock integer, -- Current physical stock (dernormalized field) - pmp double(24,8) DEFAULT 0 NOT NULL, + pmp double(24,8) DEFAULT 0 NOT NULL, -- To store valuation of stock calculated using average price method, for this product + fifo double(24,8), -- To store valuation of stock calculated using fifo method, for this product + lifo double(24,8), -- To store valuation of stock calculated using lifo method, for this product canvas varchar(32) DEFAULT NULL, finished tinyint DEFAULT NULL, hidden tinyint DEFAULT 0, -- Not used. Deprecated. diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 3d272f0aaf8..c9ff2ac3f3f 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3232,6 +3232,15 @@ table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1 { background-image: none; } +div.dataTables_length { + float: right !important; + padding-left: 8px; +} +div.dataTables_length select { + background: #fff; +} + + /* ============================================================================== */ /* Select2 */ /* ============================================================================== */