From b9893bde1d1c85af11d9dd9cfd6e251cdf8ad7c6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Jun 2018 18:26:37 +0200 Subject: [PATCH 01/11] Fix: avoid Warning: A non-numeric value encountered --- htdocs/product/composition/card.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 2167f15a7e5..7656cdd8f72 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 @@ -369,18 +369,23 @@ if ($id > 0 || ! empty($ref)) } 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 ''; - 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 ''; // Best selling price $pricesell=$productstatic->price; if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - $pricesell='Variable'; + //$pricesell='Variable'; FIXME A non-numeric value encountered } $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); $totalsell+=$totallinesell; From 2c927dba013e469ffd753442ba51401b000d25c4 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Jun 2018 18:33:22 +0200 Subject: [PATCH 02/11] Fix: wrong var name "shownav" --- htdocs/product/traduction.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 = '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 From e1db5ab43354180aaac72b4b7946732b51eb7a1d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 19 Jun 2018 19:56:39 +0200 Subject: [PATCH 04/11] Fix: wrong field name, use "type" instead "llx_c_type_fees" --- htdocs/install/mysql/migration/7.0.0-8.0.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 be14a0af0e4..3e1062a4dba 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 @@ -94,7 +94,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; From 9fa9a716d50eb92e667e16cf30f3ca45ee92a82c Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 23 May 2018 11:11:33 +0200 Subject: [PATCH 05/11] FIX: pdf: overlap when linked elements and incoterms/public note displayed + port PR #8155 into supplier docs & contracts --- .../commande/doc/pdf_einstein.modules.php | 20 +++------- .../contract/doc/pdf_strato.modules.php | 13 ++----- .../modules/facture/doc/pdf_crabe.modules.php | 20 +++------- .../modules/propale/doc/pdf_azur.modules.php | 20 +++------- .../pdf/pdf_canelle.modules.php | 37 +++++++++---------- .../pdf/pdf_muscadet.modules.php | 35 +++++++++--------- .../doc/pdf_aurore.modules.php | 30 +++++++-------- 7 files changed, 68 insertions(+), 107 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 9fecdc277b5..334b9f0c12f 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -301,18 +301,14 @@ class pdf_einstein extends ModelePDFCommandes $tab_top = 90+$top_shift; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); - $tab_height = 130-$top_shift; - $tab_height_newpage = 150; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift; // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -323,8 +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 += 4; + $tab_top = $nexY+6+$height_incoterms; } } @@ -343,10 +338,10 @@ class pdf_einstein extends ModelePDFCommandes } if ($notetoshow) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -354,12 +349,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_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $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 77904beac0b..59c04c29413 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -214,16 +214,14 @@ class pdf_strato extends ModelePDFContract $tab_top = 90; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; // Affiche notes if (! empty($object->note_public)) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -231,12 +229,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_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $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 88a47095b8c..1e4c4840d24 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -338,18 +338,14 @@ class pdf_crabe extends ModelePDFFactures $tab_top = 90+$top_shift; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); - $tab_height = 130-$top_shift; - $tab_height_newpage = 150; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift; // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -360,8 +356,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 += 4; + $tab_top = $nexY+6+$height_incoterms; } } @@ -380,10 +375,10 @@ class pdf_crabe extends ModelePDFFactures } if ($notetoshow) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -391,12 +386,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_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $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 03d0db86d8f..4048a19b1fd 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -337,18 +337,14 @@ class pdf_azur extends ModelePDFPropales $tab_top = 90+$top_shift; $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); - $tab_height = 130-$top_shift; - $tab_height_newpage = 150; - if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $tab_height_newpage -= $top_shift; // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -359,8 +355,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 += 4; + $tab_top = $nexY+6+$height_incoterms; } } @@ -387,10 +382,10 @@ class pdf_azur extends ModelePDFPropales } if ($notetoshow) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -398,12 +393,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_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $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 11951e90207..c84c76e0ad7 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -260,24 +260,21 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90+$top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -288,18 +285,17 @@ 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 += 4; + $tab_top = $nexY+6+$height_incoterms; } } // Affiche notes if (! empty($object->note_public)) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -307,12 +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_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; @@ -1080,8 +1071,14 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $posy+=1; $pdf->SetTextColor(0,0,60); + $top_shift = 0; // Show list of linked objects + $current_y = $pdf->getY(); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) + { + $top_shift = $pdf->getY() - $current_y; + } if ($showaddress) { @@ -1098,7 +1095,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy=42; + $posy=42+$top_shift; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; @@ -1150,7 +1147,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Show recipient $widthrecbox=100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; + $posy=42+$top_shift; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; @@ -1173,6 +1170,8 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } + + return $top_shift; } /** 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 b70a299fa03..f3a102307ec 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -272,24 +272,21 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90+$top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); // Incoterm - $height_incoterms = 0; if ($conf->incoterm->enabled) { $desc_incoterms = $object->getIncotermsForPDF(); if ($desc_incoterms) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($desc_incoterms), 0, 1); @@ -300,18 +297,17 @@ 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 += 4; + $tab_top = $nexY+6+$height_incoterms; } } // Affiche notes if (! empty($object->note_public)) { - $tab_top = 88 + $height_incoterms; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -319,13 +315,8 @@ 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_note+1); - $tab_height = $tab_height - $height_note; $tab_top = $nexY+6; } - else - { - $height_note=0; - } $iniY = $tab_top + 7; $curY = $tab_top + 7; @@ -1130,8 +1121,14 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $posy+=1; $pdf->SetTextColor(0,0,60); + $top_shift = 0; // Show list of linked objects + $current_y = $pdf->getY(); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) + { + $top_shift = $pdf->getY() - $current_y; + } if ($showaddress) { @@ -1148,7 +1145,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy=42; + $posy=42+$top_shift; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; @@ -1200,7 +1197,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Show recipient $widthrecbox=100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; + $posy=42+$top_shift; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; @@ -1223,6 +1220,8 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($posx+2,$posy); $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); } + + return $top_shift; } /** 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 a6457dd7a2e..60a0b4808cc 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -289,15 +289,13 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->AddPage(); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; - $this->_pagehead($pdf, $object, 1, $outputlangs); + $top_shift = $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('','', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0,0,0); - $tab_top = 90; - $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10); - $tab_height = 130; - $tab_height_newpage = 150; + $tab_top = 90+$top_shift; + $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42+$top_shift:10); // Affiche notes $notetoshow=empty($object->note_public)?'':$object->note_public; @@ -314,10 +312,10 @@ class pdf_aurore extends ModelePDFSupplierProposal } if ($notetoshow) { - $tab_top = 88; + $tab_top -= 2; $pdf->SetFont('','', $default_font_size - 1); - $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); + $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top-1, dol_htmlentitiesbr($notetoshow), 0, 1); $nexY = $pdf->GetY(); $height_note=$nexY-$tab_top; @@ -325,12 +323,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_height = $tab_height - $height_note; - $tab_top = $nexY+6; - } - else - { - $height_note=0; + $tab_top = $nexY+6+$height_note; } $iniY = $tab_top + 7; @@ -1300,8 +1293,14 @@ class pdf_aurore extends ModelePDFSupplierProposal $posy+=2; + $top_shift = 0; // Show list of linked objects + $current_y = $pdf->getY(); $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); + if ($current_y < $pdf->getY()) + { + $top_shift = $pdf->getY() - $current_y; + } if ($showaddress) { @@ -1319,7 +1318,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty); // Show sender - $posy=42; + $posy=42+$top_shift; $posx=$this->marge_gauche; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; $hautcadre=40; @@ -1373,7 +1372,7 @@ class pdf_aurore extends ModelePDFSupplierProposal // Show recipient $widthrecbox=100; if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format - $posy=42; + $posy=42+$top_shift; $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; @@ -1396,6 +1395,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } $pdf->SetTextColor(0,0,0); + return $top_shift; } /** From babc99465c06f3990cb68835800b8dab39a7f317 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 20 Jun 2018 09:45:01 +0200 Subject: [PATCH 06/11] FIX PR #8841 --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 4 ++-- htdocs/core/modules/contract/doc/pdf_strato.modules.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 4 ++-- .../core/modules/supplier_invoice/pdf/pdf_canelle.modules.php | 4 ++-- .../core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 334b9f0c12f..5d4f3a0577f 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; } } @@ -349,7 +349,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 59c04c29413..19d378e7f1b 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -229,7 +229,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 1e4c4840d24..3f6bf2d891a 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -356,7 +356,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; } } @@ -386,7 +386,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 4048a19b1fd..537291e7d74 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -355,7 +355,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; } } @@ -393,7 +393,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 c84c76e0ad7..7a7cf619856 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 f3a102307ec..6b7f4b740ec 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -297,7 +297,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 60a0b4808cc..a7d391e6dcf 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -323,7 +323,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; From a6151ee11efb13c6695b77c4d5980b6afbdf60fb Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 20 Jun 2018 12:10:25 +0200 Subject: [PATCH 07/11] add minute to duration services add minute for duration description (more compliant thant 0,166667h for billing services by minute --- htdocs/product/card.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 '' . $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]) : '')." "; From f4bfd8704d65fd42807462020d35b3601f2b2f73 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 21 Jun 2018 10:21:18 +0200 Subject: [PATCH 08/11] Sync rfc2307 group membership from LDAP With rfc2307 LDAP scheme, group members are listed in the memberUid attribute, as simple uid, not as full DN like rfc2307bis, or AD-style groups --- scripts/user/sync_groups_ldap2dolibarr.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 45b960878ab..cb745d9aff3 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -186,8 +186,13 @@ if ($result >= 0) foreach($ldapgroup[$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS] as $key => $userdn) { if($key === 'count') continue; if(empty($userList[$userdn])) { // Récupération de l'utilisateur - $userFilter = explode(',', $userdn); - $userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS); + // Schéma rfc2307: les membres sont listés dans l'attribut memberUid sous form de login uniquement + if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS === 'memberUid'){ + $userKey = array($userdn); + } else { // Pour les autres schémas, les membres sont listés sous forme de DN complets + $userFilter = explode(',', $userdn); + $userKey = $ldap->getAttributeValues('('.$userFilter[0].')', $conf->global->LDAP_KEY_USERS); + } if(!is_array($userKey)) continue; $fuser = new User($db); From da2f07c8486b527e163067756a2e437c81b52d4c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Jun 2018 15:01:45 +0200 Subject: [PATCH 09/11] clean and update code --- htdocs/ftp/admin/ftpclient.php | 2 -- htdocs/ftp/index.php | 3 +-- htdocs/hrm/admin/admin_establishment.php | 2 -- htdocs/imports/class/import.class.php | 1 - htdocs/imports/import.php | 9 ++------- htdocs/imports/index.php | 7 ++----- 6 files changed, 5 insertions(+), 19 deletions(-) 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); From 45451f08b02ca6eaaca77bde406ad0333860ad88 Mon Sep 17 00:00:00 2001 From: dolibarr95 <24292300+dolibarr95@users.noreply.github.com> Date: Fri, 22 Jun 2018 12:25:14 +0200 Subject: [PATCH 10/11] Add rights check Add rights check when edit parcel informations(weight, tracking...) of a shipping --- htdocs/expedition/card.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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; From 6f1101a2d60f80d5dce685ef284aea5e0998ab5f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Jun 2018 15:51:26 +0200 Subject: [PATCH 11/11] Update card.php --- htdocs/product/composition/card.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 7656cdd8f72..70f14f9edf5 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -342,6 +342,7 @@ if ($id > 0 || ! empty($ref)) $class='pair'; + $totalsell=0; if (count($prods_arbo)) { foreach($prods_arbo as $value) @@ -374,7 +375,7 @@ if ($id > 0 || ! empty($ref)) $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'); + $totalline=price2num($value['nb'] * ($fourn_unitprice * (1 - $fourn_remise_percent/100) - $fourn_remise), 'MT'); $total+=$totalline; print ''; // Stock
'.$langs->trans("AvailableFormats").'
'.img_picto_common($model->getDriverLabelForKey($key),$model->getPictoForKey($key)).''; @@ -385,12 +386,17 @@ if ($id > 0 || ! empty($ref)) $pricesell=$productstatic->price; if (! empty($conf->global->PRODUIT_MULTIPRICES)) { - //$pricesell='Variable'; FIXME A non-numeric value encountered + $pricesell='Variable'; + } + else + { + $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); + $totalsell+=$totallinesell; } - $totallinesell=price2num($value['nb'] * ($pricesell), 'MT'); - $totalsell+=$totallinesell; 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 '