diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php index 7937431c42c..b45fd6aa971 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php @@ -98,7 +98,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder { $object->fetch_thirdparty(); - $nblignes = sizeof($object->lignes); + $nblines = sizeof($object->lines); $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/receipt"; @@ -180,7 +180,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $curY = $tab_top + 7; $nexY = $tab_top + 7; - for ($i = 0 ; $i < $nblignes ; $i++) + for ($i = 0 ; $i < $nblines ; $i++) { $curY = $nexY; @@ -196,22 +196,22 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetXY (10, $curY ); - $pdf->MultiCell(20, 3, $outputlangs->convToOutputCharset($object->lignes[$i]->ref), 0, 'C'); + $pdf->MultiCell(20, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'C'); // \TODO Field not yet saved in database //$pdf->SetXY (133, $curY ); - //$pdf->MultiCell(10, 5, $object->lignes[$i]->tva_tx, 0, 'C'); + //$pdf->MultiCell(10, 5, $object->lines[$i]->tva_tx, 0, 'C'); $pdf->SetXY (145, $curY ); - $pdf->MultiCell(10, 3, $object->lignes[$i]->qty_shipped, 0, 'C'); + $pdf->MultiCell(10, 3, $object->lines[$i]->qty_shipped, 0, 'C'); // \TODO Field not yet saved in database //$pdf->SetXY (156, $curY ); - //$pdf->MultiCell(20, 3, price($object->lignes[$i]->price), 0, 'R', 0); + //$pdf->MultiCell(20, 3, price($object->lines[$i]->price), 0, 'R', 0); // \TODO Field not yet saved in database //$pdf->SetXY (174, $curY ); - //$total = price($object->lignes[$i]->price * $object->lignes[$i]->qty_shipped); + //$total = price($object->lines[$i]->price * $object->lines[$i]->qty_shipped); //$pdf->MultiCell(26, 3, $total, 0, 'R', 0); $pdf->line(10, $curY-1, 200, $curY-1); @@ -220,10 +220,10 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $nexY+=2; // Passe espace entre les lignes // Cherche nombre de lignes a venir pour savoir si place suffisante - if ($i < ($nblignes - 1)) // If it's not last line + if ($i < ($nblines - 1)) // If it's not last line { //on recupere la description du produit suivant - $follow_descproduitservice = $object->lignes[$i+1]->desc; + $follow_descproduitservice = $object->lines[$i+1]->desc; //on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres) $nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4); } diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php index 3c214a210e2..468080774b8 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php @@ -121,7 +121,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { $object->fetch_thirdparty(); - $nblignes = sizeof($object->lignes); + $nblines = sizeof($object->lines); $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->expedition->dir_output."/receipt"; @@ -190,7 +190,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Positionne $this->atleastonediscount si on a au moins une remise for ($i = 0 ; $i < $nblignes ; $i++) { - if ($object->lignes[$i]->remise_percent) + if ($object->lines[$i]->remise_percent) { $this->atleastonediscount++; } @@ -238,7 +238,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $nexY = $tab_top + 7; // Boucle sur les lignes - for ($i = 0 ; $i < $nblignes ; $i++) + for ($i = 0 ; $i < $nblines ; $i++) { $curY = $nexY; @@ -255,41 +255,41 @@ class pdf_typhon extends ModelePDFDeliveryOrder /* // TVA $pdf->SetXY ($this->posxtva, $curY); - $pdf->MultiCell(10, 4, ($object->lignes[$i]->tva_tx < 0 ? '*':'').abs($object->lignes[$i]->tva_tx), 0, 'R'); + $pdf->MultiCell(10, 4, ($object->lines[$i]->tva_tx < 0 ? '*':'').abs($object->lines[$i]->tva_tx), 0, 'R'); // Prix unitaire HT avant remise $pdf->SetXY ($this->posxup, $curY); - $pdf->MultiCell(20, 4, price($object->lignes[$i]->subprice), 0, 'R', 0); + $pdf->MultiCell(20, 4, price($object->lines[$i]->subprice), 0, 'R', 0); */ // Quantity $pdf->SetXY ($this->posxqty, $curY); - $pdf->MultiCell(30, 3, $object->lignes[$i]->qty_shipped, 0, 'R'); + $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'R'); /* // Remise sur ligne $pdf->SetXY ($this->posxdiscount, $curY); - if ($object->lignes[$i]->remise_percent) + if ($object->lines[$i]->remise_percent) { - $pdf->MultiCell(14, 3, $object->lignes[$i]->remise_percent."%", 0, 'R'); + $pdf->MultiCell(14, 3, $object->lines[$i]->remise_percent."%", 0, 'R'); } // Total HT ligne $pdf->SetXY ($this->postotalht, $curY); - $total = price($object->lignes[$i]->price * $object->lignes[$i]->qty); + $total = price($object->lines[$i]->price * $object->lines[$i]->qty); $pdf->MultiCell(23, 3, $total, 0, 'R', 0); // Collecte des totaux par valeur de tva // dans le tableau tva["taux"]=total_tva - $tvaligne=$object->lignes[$i]->price * $object->lignes[$i]->qty; + $tvaligne=$object->lines[$i]->price * $object->lines[$i]->qty; if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100; - $this->tva[ (string)$object->lignes[$i]->tva_tx ] += $tvaligne; + $this->tva[ (string)$object->lines[$i]->tva_tx ] += $tvaligne; */ $nexY+=2; // Passe espace entre les lignes // Cherche nombre de lignes a venir pour savoir si place suffisante - if ($i < ($nblignes - 1)) // If it's not last line + if ($i < ($nblines - 1)) // If it's not last line { //on recupere la description du produit suivant - $follow_descproduitservice = $object->lignes[$i+1]->desc; + $follow_descproduitservice = $object->lines[$i+1]->desc; //on compte le nombre de ligne afin de verifier la place disponible (largeur de ligne 52 caracteres) $nblineFollowDesc = (dol_nboflines_bis($follow_descproduitservice,52,$outputlangs->charset_output)*4); } diff --git a/htdocs/includes/modules/rapport/pdf_paiement.class.php b/htdocs/includes/modules/rapport/pdf_paiement.class.php index 1b3e1da2f49..2875a974e90 100644 --- a/htdocs/includes/modules/rapport/pdf_paiement.class.php +++ b/htdocs/includes/modules/rapport/pdf_paiement.class.php @@ -141,11 +141,11 @@ class pdf_paiement $result = $this->db->query($sql); if ($result) { - $lignes = $this->db->num_rows($result); + $lines = $this->db->num_rows($result); $i = 0; $var=True; - while ($i < $lignes) + while ($i < $lines) { $objp = $this->db->fetch_object($result); $var=!$var; @@ -167,9 +167,9 @@ class pdf_paiement dol_print_error($this->db); } - $pages = intval($lignes / $this->line_per_page); + $pages = intval($lines / $this->line_per_page); - if (($lignes % $this->line_per_page)>0) + if (($lines % $this->line_per_page)>0) { $pages++; } diff --git a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 45e71b25524..b1c83f57f90 100755 --- a/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/includes/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -239,7 +239,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Unit price before discount $pdf->SetXY ($this->posxup, $curY); - $pdf->MultiCell(18, 3, price($object->lines[$i]->pu_ht), 0, 'R', 0); + $pdf->MultiCell(20, 3, price($object->lines[$i]->pu_ht), 0, 'R', 0); // Quantity $pdf->SetXY ($this->posxqty, $curY); diff --git a/htdocs/lib/pdf.lib.php b/htdocs/lib/pdf.lib.php index a1c1b1aa864..f9240f50a5f 100644 --- a/htdocs/lib/pdf.lib.php +++ b/htdocs/lib/pdf.lib.php @@ -372,7 +372,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass global $conf,$user; $outputlangs->load("dict"); - $ligne=''; + $line=''; // Line of free text if (! empty($conf->global->$paramfreetext)) @@ -387,92 +387,92 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass ); $newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray,$outputlangs,$object); - $ligne.=$outputlangs->convToOutputCharset($newfreetext); + $line.=$outputlangs->convToOutputCharset($newfreetext); } // First line of company infos // Juridical status - $ligne1=""; + $line1=""; if ($fromcompany->forme_juridique_code) { - $ligne1.=($ligne1?" - ":"").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code)); + $line1.=($line1?" - ":"").$outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code)); } // Capital if ($fromcompany->capital) { - $ligne1.=($ligne1?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->monnaie); + $line1.=($line1?" - ":"").$outputlangs->transnoentities("CapitalOf",$fromcompany->capital)." ".$outputlangs->transnoentities("Currency".$conf->monnaie); } // Prof Id 1 if ($fromcompany->idprof1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->idprof2)) { $field=$outputlangs->transcountrynoentities("ProfId1",$fromcompany->pays_code); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; - $ligne1.=($ligne1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1); + $line1.=($line1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof1); } // Prof Id 2 if ($fromcompany->idprof2) { $field=$outputlangs->transcountrynoentities("ProfId2",$fromcompany->pays_code); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; - $ligne1.=($ligne1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof2); + $line1.=($line1?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof2); } // Second line of company infos - $ligne2=""; + $line2=""; // Prof Id 3 if ($fromcompany->idprof3) { $field=$outputlangs->transcountrynoentities("ProfId3",$fromcompany->pays_code); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; - $ligne2.=($ligne2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3); + $line2.=($line2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof3); } // Prof Id 4 if ($fromcompany->idprof4) { $field=$outputlangs->transcountrynoentities("ProfId4",$fromcompany->pays_code); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; - $ligne2.=($ligne2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4); + $line2.=($line2?" - ":"").$field.": ".$outputlangs->convToOutputCharset($fromcompany->idprof4); } // IntraCommunautary VAT if ($fromcompany->tva_intra != '') { - $ligne2.=($ligne2?" - ":"").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra); + $line2.=($line2?" - ":"").$outputlangs->transnoentities("VATIntraShort").": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra); } $pdf->SetFont('','',7); $pdf->SetDrawColor(224,224,224); // On positionne le debut du bas de page selon nbre de lignes de ce bas de page - $nbofligne=dol_nboflines_bis($ligne,0,$outputlangs->charset_output); - //print 'nbofligne='.$nbofligne; exit; - //print 'e'.$ligne.'t'.dol_nboflines($ligne);exit; - $posy=$marge_basse + ($nbofligne*3) + ($ligne1?3:0) + ($ligne2?3:0); + $nbofline=dol_nboflines_bis($line,0,$outputlangs->charset_output); + //print 'nbofline='.$nbofline; exit; + //print 'e'.$line.'t'.dol_nboflines($line);exit; + $posy=$marge_basse + ($nbofline*3) + ($line1?3:0) + ($line2?3:0); - if ($ligne) // Free text + if ($line) // Free text { $pdf->SetXY($marge_gauche,-$posy); $width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. if ($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT) { $width=200; $align='C'; } - $pdf->MultiCell($width, 3, $ligne, 0, $align, 0); - $posy-=($nbofligne*3); // 6 of ligne + 3 of MultiCell + $pdf->MultiCell($width, 3, $line, 0, $align, 0); + $posy-=($nbofline*3); // 6 of ligne + 3 of MultiCell } $pdf->SetY(-$posy); $pdf->line($marge_gauche, $page_hauteur-$posy, 200, $page_hauteur-$posy); $posy--; - if ($ligne1) + if ($line1) { $pdf->SetXY($marge_gauche,-$posy); - $pdf->MultiCell(200, 2, $ligne1, 0, 'C', 0); + $pdf->MultiCell(200, 2, $line1, 0, 'C', 0); } - if ($ligne2) + if ($line2) { $posy-=3; $pdf->SetXY($marge_gauche,-$posy); - $pdf->MultiCell(200, 2, $ligne2, 0, 'C', 0); + $pdf->MultiCell(200, 2, $line2, 0, 'C', 0); } // Show page nb only on iso languages diff --git a/htdocs/lib/viewfiles.lib.php b/htdocs/lib/viewfiles.lib.php index a192a0ce1f5..f444b9d0a96 100644 --- a/htdocs/lib/viewfiles.lib.php +++ b/htdocs/lib/viewfiles.lib.php @@ -53,13 +53,13 @@ function viewCsvFileContent($file_to_include='',$max_rows=0) $count = 0; print '
| '.$ligne[$i].' | '; + print ''.$line[$i].' | '; } print '
| '; - print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle; - if ($ligne->description) print nl2br($ligne->description); + print ''.img_object($langs->trans("ShowProduct"),"product").' '.$product->ref.' - '.$product->libelle; + if ($line->description) print nl2br($line->description); print ' | '; } else { - print "".nl2br($ligne->description)." | \n"; + print "".nl2br($line->description)." | \n"; } - print ''.$ligne->qty.' | '; + print ''.$line->qty.' | '; /* * */ print ''; - $quantite_livree = $commande->livraisons[$ligne->id]; + $quantite_livree = $commande->livraisons[$line->id]; print $quantite_livree;; print ' | '; - $quantite_commandee = $ligne->qty; + $quantite_commandee = $line->qty; $quantite_a_livrer = $quantite_commandee - $quantite_livree; if ($conf->stock->enabled) @@ -331,7 +331,7 @@ if ($_GET["action"] == 'create') // Quantite a livrer print ''; - print ''; + print ''; print ''; print ' | '; @@ -349,7 +349,7 @@ if ($_GET["action"] == 'create') { // Quantite a livrer print ''; - print ''; + print ''; print ''; print ' | '; } @@ -498,7 +498,7 @@ else * Lignes produits */ - $num_prod = sizeof($delivery->lignes); + $num_prod = sizeof($delivery->lines); $i = 0; $total = 0; print '
| ';
// Affiche ligne produit
- $text = '';
- if ($delivery->lignes[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
+ $text = '';
+ if ($delivery->lines[$i]->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
else $text.= img_object($langs->trans('ShowProduct'),'product');
- $text.= ' '.$delivery->lignes[$i]->ref.'';
- $text.= ' - '.$delivery->lignes[$i]->label;
- $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($delivery->lignes[$i]->description));
+ $text.= ' '.$delivery->lines[$i]->ref.'';
+ $text.= ' - '.$delivery->lines[$i]->label;
+ $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($delivery->lines[$i]->description));
//print $description;
print $html->textwithtooltip($text,$description,3,'','',$i);
- print_date_range($delivery->lignes[$i]->date_start,$delivery->lignes[$i]->date_end);
+ print_date_range($delivery->lines[$i]->date_start,$delivery->lines[$i]->date_end);
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
- print ($delivery->lignes[$i]->description && $delivery->lignes[$i]->description!=$delivery->lignes[$i]->label)?' '.dol_htmlentitiesbr($delivery->lignes[$i]->description):''; + print ($delivery->lines[$i]->description && $delivery->lines[$i]->description!=$delivery->lines[$i]->label)?' '.dol_htmlentitiesbr($delivery->lines[$i]->description):''; } } else { print " | "; - if ($delivery->lignes[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); + if ($delivery->lines[$i]->fk_product_type==1) $text = img_object($langs->trans('Service'),'service'); else $text = img_object($langs->trans('Product'),'product'); - print $text.' '.nl2br($delivery->lignes[$i]->description); + print $text.' '.nl2br($delivery->lines[$i]->description); print_date_range($objp->date_start,$objp->date_end); print " | \n"; } - print ''.$delivery->lignes[$i]->qty_asked.' | '; - print ''.$delivery->lignes[$i]->qty_shipped.' | '; + print ''.$delivery->lines[$i]->qty_asked.' | '; + print ''.$delivery->lines[$i]->qty_shipped.' | '; print "