diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 7606f272f5b..14e0f6cc155 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -319,7 +319,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6+$height_incoterms; + $tab_top = $nexY+6; } } @@ -353,7 +353,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_top = $nexY+6+$height_note; + $tab_top = $nexY+6; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index e1a7640ec62..9fa86d24a19 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -228,7 +228,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_top = $nexY+6+$height_note; + $tab_top = $nexY+6; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index f3bc84533ca..6c8fcf2f07e 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -384,7 +384,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6+$height_incoterms; + $tab_top = $nexY+6; } } @@ -418,7 +418,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_top = $nexY+6+$height_note; + $tab_top = $nexY+6; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 758a11cf439..6e72e757fb6 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -357,7 +357,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6+$height_incoterms; + $tab_top = $nexY+6; } } @@ -399,7 +399,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_top = $nexY+6+$height_note; + $tab_top = $nexY+6; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 2ddff657b3d..37e0cf64f15 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -285,7 +285,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6+$height_incoterms; + $tab_top = $nexY+6; } } @@ -303,7 +303,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_top = $nexY+6+$height_note; + $tab_top = $nexY+6; } $iniY = $tab_top + 7; diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 3de234821e1..8b84f428bde 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -335,7 +335,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_incoterms+1); - $tab_top = $nexY+6+$height_incoterms; + $tab_top = $nexY+6; } } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index f61cb0ecdd7..bca4ae8425f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -388,7 +388,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetDrawColor(192,192,192); $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1); - $tab_top = $nexY+6+$height_note; + $tab_top = $nexY+6; } $iniY = $tab_top + 7; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c9e86e95619..ab860ced2e9 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -503,12 +503,16 @@ if (empty($reshook)) } // Action update - else if ($action == 'settracking_number' || $action == 'settracking_url' - || $action == 'settrueWeight' - || $action == 'settrueWidth' - || $action == 'settrueHeight' - || $action == 'settrueDepth' - || $action == 'setshipping_method_id') + else if ( + ($action == 'settracking_number' + || $action == 'settracking_url' + || $action == 'settrueWeight' + || $action == 'settrueWidth' + || $action == 'settrueHeight' + || $action == 'settrueDepth' + || $action == 'setshipping_method_id') + && $user->rights->expedition->creer + ) { $error=0; diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php index 9a8ada55de5..ee7acc9070d 100644 --- a/htdocs/ftp/admin/ftpclient.php +++ b/htdocs/ftp/admin/ftpclient.php @@ -234,8 +234,6 @@ else $idrss = $reg[0]; //print "x".join(',',$reg)."=".$obj->name."=".$idrss; - $var=true; - print "
"; print ''; print ''; diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 9881b89c6f1..943d4fa94e1 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -509,7 +509,6 @@ else } $nboflines=count($contents); - $var=true; $rawlisthasfailed=false; $i=0; while ($i < $nboflines && $i < 1000) @@ -553,7 +552,7 @@ else } - print ''; + print ''; // Name print ''; $newsection=$section.(preg_match('@[\\\/]$@',$section)?'':'/').$file; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 415bcf8fcbd..996ddd58ed3 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -98,8 +98,6 @@ if ($result) print_liste_field_titre("Status",$_SERVER["PHP_SELF"],"e.status","","",'align="right"',$sortfield,$sortorder); print "\n"; - $var=true; - if ($num > 0) { $establishmentstatic=new Establishment($db); diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index 2235812bae8..f8754193515 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -71,7 +71,6 @@ class Import dol_syslog(get_class($this)."::load_arrays user=".$user->id." filter=".$filter); - $var=true; $i=0; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 0aa5ee35aa2..64e44aca793 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -440,7 +440,6 @@ if ($step == 2 && $datatoimport) print ''; $filetoimport=''; - $var=true; // Add format informations and link to download example print '
'; @@ -556,14 +555,12 @@ if ($step == 3 && $datatoimport) print ''; $filetoimport=''; - $var=true; print ''; //print ''; // Input file name box - $var=false; print '
'.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'
'.$langs->trans("FileWithDataToImport").'
'; print '     '; $out = (empty($conf->global->MAIN_UPLOAD_DOC)?' disabled':''); @@ -907,13 +904,12 @@ if ($step == 4 && $datatoimport) // List of targets fields $height=24; $i = 0; - $var=true; $mandatoryfieldshavesource=true; print ''; foreach($fieldstarget as $code=>$label) { - print ''; + print ''; $i++; $entity=(! empty($objimport->array_import_entities[0][$code])?$objimport->array_import_entities[0][$code]:$objimport->array_import_icon[0]); @@ -1128,7 +1124,7 @@ if ($step == 4 && $datatoimport) print ''; print ''; print ''; - $var=false; + print ''; print ''; print ''; //print ''; print ''; -$val=true; + if (count($import->array_import_code)) { foreach ($import->array_import_code as $key => $value) { - $val=!$val; - print '
'.$langs->trans("ImportModelName").' 
'; print ''; @@ -1144,7 +1140,6 @@ if ($step == 4 && $datatoimport) { $num = $db->num_rows($resql); $i = 0; - $var=false; while ($i < $num) { diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php index 207055c6ce8..ed391d65292 100644 --- a/htdocs/imports/index.php +++ b/htdocs/imports/index.php @@ -60,13 +60,12 @@ print ''.$langs->trans("Module").''.$langs->trans("ImportableDatas").' 
'; + print '
'; print img_object($import->array_import_module[$key]->getName(),$import->array_import_module[$key]->picto).' '; print $import->array_import_module[$key]->getName(); print ''; @@ -108,7 +107,6 @@ print '
'; // List of available import format -$var=true; print ''; print ''; print ''; @@ -122,7 +120,6 @@ $liste=$model->liste_modeles($db); foreach($liste as $key) { - print ''; print ''; $text=$model->getDriverDescForKey($key); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 247e38d2218..05fc5defcee 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -97,7 +97,8 @@ delete from llx_usergroup_rights where fk_id not in (select id from llx_rights_d ALTER TABLE llx_inventory ADD COLUMN fk_product integer DEFAULT NULL; ALTER TABLE llx_inventory MODIFY COLUMN fk_warehouse integer DEFAULT NULL; -ALTER TABLE llx_c_type_fees ADD COLUMN llx_c_type_fees integer DEFAULT 0; +ALTER TABLE llx_c_type_fees DROP COLUMN llx_c_type_fees; +ALTER TABLE llx_c_type_fees ADD COLUMN type integer DEFAULT 0; ALTER TABLE llx_product_fournisseur_price DROP COLUMN unitcharges; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 03cfbc7f841..dc7d0d5a452 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1033,7 +1033,8 @@ else if ($type == 1) { print ''; - $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) - $product_fourn->fourn_remise), 'MT'); + // For avoid a non-numeric value + $fourn_unitprice = (!empty($product_fourn->fourn_unitprice)?$product_fourn->fourn_unitprice:0); + $fourn_remise_percent = (!empty($product_fourn->fourn_remise_percent)?$product_fourn->fourn_remise_percent:0); + $fourn_remise = (!empty($product_fourn->fourn_remise)?$product_fourn->fourn_remise:0); + + $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); $total+=$totalline; print ''; // Best selling price @@ -382,10 +388,15 @@ if ($id > 0 || ! empty($ref)) { $pricesell='Variable'; } - $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); - $totalsell+=$totallinesell; + else + { + $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); + $totalsell+=$totallinesell; + } print ''; // Stock diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 4bade1db2cf..959f2377d9d 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Raphaël Doursenaud * @@ -57,6 +57,7 @@ $page = GETPOST("page",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; // Load sale and categ filters diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 7b82408cfc0..b4d14ef1231 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Ferran Marcet @@ -61,6 +61,7 @@ $page = GETPOST("page",'int'); if (! $sortfield) $sortfield="p.ref"; if (! $sortorder) $sortorder="ASC"; $limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page ; // Load sale and categ filters diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index e8900d51bb4..c96e1c0f025 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2007 Rodolphe Quiedeville * Copyright (C) 2010-2012 Destailleur Laurent * Copyright (C) 2014 Henry Florian @@ -205,7 +205,7 @@ $linkback = '
'.$langs->trans("AvailableFormats").'
'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).'
' . $langs->trans("Duration") . '  '; - print ''.$langs->trans("Hour").' '; + print ''.$langs->trans("Minute").' '; + print ''.$langs->trans("Hour").' '; print ''.$langs->trans("Day").' '; print ''.$langs->trans("Week").' '; print ''.$langs->trans("Month").' '; @@ -1401,6 +1402,8 @@ else // Duration print '
'.$langs->trans("Duration").''; print '  '; + print 'duration_unit=='i'?' checked':'').'>'.$langs->trans("Minute"); + print '  '; print 'duration_unit=='h'?' checked':'').'>'.$langs->trans("Hour"); print '  '; print 'duration_unit=='d'?' checked':'').'>'.$langs->trans("Day"); @@ -1807,11 +1810,11 @@ else print '
'.$langs->trans("Duration").''.$object->duration_value.' '; if ($object->duration_value > 1) { - $dur=array("h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); + $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years")); } else if ($object->duration_value > 0) { - $dur=array("h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); + $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year")); } print (! empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." "; diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 2167f15a7e5..70f14f9edf5 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2001-2007 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005 Eric Seigne - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Raphaël Doursenaud @@ -342,6 +342,7 @@ if ($id > 0 || ! empty($ref)) $class='pair'; + $totalsell=0; if (count($prods_arbo)) { foreach($prods_arbo as $value) @@ -369,11 +370,16 @@ if ($id > 0 || ! empty($ref)) } print ''; - print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($product_fourn->fourn_unitprice,'','',0,0,-1,$conf->currency)); + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($fourn_unitprice,'','',0,0,-1,$conf->currency)); print ''; - print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : '').price($pricesell,'','',0,0,-1,$conf->currency)); + print ($notdefined?'':($value['nb']> 1 ? $value['nb'].'x' : ''); + if (is_numeric($pricesell)) print price($pricesell,'','',0,0,-1,$conf->currency)); + else print $langs->trans($pricesell); print '