当前位置: 首页>>代码示例>>PHP>>正文


PHP dol_nboflines_bis函数代码示例

本文整理汇总了PHP中dol_nboflines_bis函数的典型用法代码示例。如果您正苦于以下问题:PHP dol_nboflines_bis函数的具体用法?PHP dol_nboflines_bis怎么用?PHP dol_nboflines_bis使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dol_nboflines_bis函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _pagehead

 /**
  *  Show top header of page.
  *
  *  @param	PDF			&$pdf     		Object PDF
  *  @param  Object		$object     	Object to show
  *  @param  int	    	$showaddress    0=no, 1=yes
  *  @param  Translate	$outputlangs	Object lang for output
  *  @return	void
  */
 function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
 {
     global $langs, $conf, $mysoc;
     $outputlangs->load("main");
     $outputlangs->load("bills");
     $outputlangs->load("orders");
     $outputlangs->load("companies");
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     // Do not add the BACKGROUND as this is for suppliers
     //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
     $pdf->SetTextColor(0, 0, 60);
     $pdf->SetFont('', 'B', $default_font_size + 3);
     $posx = $this->page_largeur - $this->marge_droite - 100;
     $posy = $this->marge_haute;
     $pdf->SetXY($this->marge_gauche, $posy);
     // Logo
     /*
     		$logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
     		if ($mysoc->logo)
     		{
     			if (is_readable($logo))
     			{
     			    $height=pdf_getHeightForLogo($logo);
     			    $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);	// width=0 (auto)
     			}
     			else
     			{
     				$pdf->SetTextColor(200,0,0);
     				$pdf->SetFont('','B', $default_font_size - 2);
     				$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
     				$pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
     			}
     		}
     		else
     		{*/
     $text = $this->emetteur->name;
     $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
     //}
     $pdf->SetFont('', 'B', $default_font_size + 3);
     $pdf->SetXY($posx, $posy);
     $pdf->SetTextColor(0, 0, 60);
     $pdf->MultiCell(100, 4, $outputlangs->transnoentities("SupplierInvoice") . " " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
     $pdf->SetFont('', '', $default_font_size + 2);
     if ($object->ref_supplier) {
         $posy += 5;
         $pdf->SetXY($posx, $posy);
         $pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSupplier") . " : " . $object->ref_supplier, '', 'R');
     }
     $posy += 6;
     $pdf->SetXY($posx, $posy);
     if ($object->date) {
         $pdf->SetTextColor(0, 0, 60);
         $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date") . " : " . dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
     } else {
         $pdf->SetTextColor(255, 0, 0);
         $pdf->MultiCell(100, 4, strtolower($outputlangs->transnoentities("OrderToProcess")), '', 'R');
     }
     if ($showaddress) {
         // Sender properties
         $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur);
         // Show sender
         $posy = 42;
         $posx = $this->marge_gauche;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->page_largeur - $this->marge_droite - 80;
         }
         $hautcadre = 40;
         // Show sender frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom") . ":", 0, 'L');
         $pdf->SetXY($posx, $posy);
         $pdf->SetFillColor(230, 230, 230);
         $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
         $pdf->SetTextColor(0, 0, 60);
         // Show sender name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
         // Show sender information
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($this->emetteur->name, 44) * 4);
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
         // If BILLING contact defined on invoice, we use it
         $usecontact = false;
         $arrayidcontact = $object->getIdContact('internal', 'BILLING');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
//.........这里部分代码省略.........
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:pdf_canelle.modules.php

示例2: write_file


//.........这里部分代码省略.........
					//$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);

					$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
					$nexY = $pdf->GetY();

					$ref = pdf_getlineref($object, $i, $outputlangs);
					$pdf->SetXY (10, $curY);
					$pdf->MultiCell(20, 3, $ref, 0, 'C');

					$vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
					$pdf->SetXY (133, $curY);
					$pdf->MultiCell(12, 3, $vat_rate, 0, 'C');

					$qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
					$pdf->SetXY (145, $curY);
					$pdf->MultiCell(10, 3, $qty, 0, 'C');

					$up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
					$pdf->SetXY (156, $curY);
					$pdf->MultiCell(18, 3, $up_excl_tax, 0, 'R', 0);

					$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
					$pdf->SetXY (174, $curY);
					$pdf->MultiCell(26, 3, $total_excl_tax, 0, 'R', 0);

					$nexY+=2;    // Passe espace entre les lignes

					// cherche nombre de lignes a venir pour savoir si place suffisante
					if ($i < ($nblignes - 1) && empty($hidedesc))	// If it's not last line
					{
						//on recupere la description du produit suivant
						$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);
					}
					else	// If it's last line
					{
						$nblineFollowDesc = 0;
					}

					if (($nexY+$nblineFollowDesc) > ($tab_top+$tab_height) && $i < ($nblignes - 1))
					{
						$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);

						// New page
						$pdf->AddPage();
						$pagenb++;
						$this->_pagehead($pdf, $object, 0, $outputlangs);
						$pdf->SetFont('','', $default_font_size - 1);
						$pdf->MultiCell(0, 3, '');		// Set interline to 3
						$pdf->SetTextColor(0,0,0);

						$nexY = $tab_top + 8;
					}
				}

				$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);

				$bottomlasttab=$tab_top + $tab_height + 1;

				// Affiche zone infos
				$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);

				// Affiche zone totaux
				$tab2_top = 241;
				$tab2_lh = 4;
开发者ID:remyyounes,项目名称:dolibarr,代码行数:67,代码来源:pdf_edison.modules.php

示例3: _pagehead


//.........这里部分代码省略.........
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->nom;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->nom);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, $object->contact, $usecontact, 'target');
         // Show recipient
         $posy = 30;
         $posx = $this->page_largeur - $this->marge_droite - 100;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx + 2, $posy - 5);
         $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillTo") . ":", 0, 'L');
         $pdf->Rect($posx, $posy, 100, $hautcadre);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(96, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell(86, 4, $carac_client, 0, 'L');
     }
     /*
      * ref facture
      */
     $posy = 78;
     $pdf->SetFont('', 'B', $default_font_size + 2);
     $pdf->SetXY($this->marges['g'], $posy - 5);
     $pdf->SetTextColor(0, 0, 0);
     $title = $outputlangs->transnoentities("Invoice");
     if ($object->type == 1) {
         $title = $outputlangs->transnoentities("InvoiceReplacement");
     }
     if ($object->type == 2) {
         $title = $outputlangs->transnoentities("InvoiceAvoir");
     }
     if ($object->type == 3) {
         $title = $outputlangs->transnoentities("InvoiceDeposit");
     }
     if ($object->type == 4) {
         $title = $outputlangs->transnoentities("InvoiceProForma");
     }
     $pdf->MultiCell(100, 10, $title . ' ' . $outputlangs->transnoentities("Of") . ' ' . dol_print_date($object->date, "day", false, $outputlangs, true), '', 'L');
     $pdf->SetFont('', 'B', $default_font_size);
     $pdf->SetXY($this->marges['g'], $posy);
     $pdf->SetTextColor(22, 137, 210);
     $pdf->MultiCell(100, 10, $outputlangs->transnoentities("RefBill") . " : " . $outputlangs->transnoentities($object->ref), '', 'L');
     $pdf->SetTextColor(0, 0, 0);
     $objectidnext = $object->getIdReplacingInvoice('validated');
     if ($object->type == 0 && $objectidnext) {
         $objectreplacing = new Facture($this->db);
         $objectreplacing->fetch($objectidnext);
开发者ID:nrjacker4,项目名称:crm-php,代码行数:67,代码来源:pdf_oursin.modules.php

示例4: _pagehead


//.........这里部分代码省略.........
                     $text .= ' (' . $linkedobject->ref_client . ')';
                 }
                 $Yoff = $Yoff + 8;
                 $pdf->SetXY($this->page_largeur - $this->marge_droite - 100, $Yoff);
                 $pdf->MultiCell(100, 2, $outputlangs->transnoentities("RefOrder") . " : " . $outputlangs->transnoentities($text), 0, 'R');
                 $Yoff = $Yoff + 3;
                 $pdf->SetXY($this->page_largeur - $this->marge_droite - 60, $Yoff);
                 $pdf->MultiCell(60, 2, $outputlangs->transnoentities("OrderDate") . " : " . dol_print_date($linkedobject->date, "day", false, $outputlangs, true), 0, 'R');
             }
         }
         $posy = $Yoff;
     }
     // Show list of linked objects
     $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
     if ($showaddress) {
         // Sender properties
         $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur);
         // Show sender
         $posy = 42;
         $posx = $this->marge_gauche;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->page_largeur - $this->marge_droite - 80;
         }
         $hautcadre = 40;
         // Show sender frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom") . ":", 0, 'L');
         $pdf->SetXY($posx, $posy);
         $pdf->SetFillColor(230, 230, 230);
         $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
         $pdf->SetTextColor(0, 0, 60);
         // Show sender name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
         $posy = $pdf->getY();
         // Show sender information
         $pdf->SetXY($posx + 2, $posy);
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
         // Client destinataire
         $posy = 42;
         $posx = 102;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->MultiCell(80, 5, $outputlangs->transnoentities("DeliveryAddress") . ":", 0, 'L');
         // If SHIPPING contact defined on order, we use it
         $usecontact = false;
         $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->name;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->name);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, $usecontact ? $object->contact : '', $usecontact, 'target');
         // Show recipient
         $widthrecbox = 100;
         if ($this->page_largeur < 210) {
             $widthrecbox = 84;
         }
         // To work with US executive format
         $posy = 42;
         $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx + 2, $posy - 5);
         //$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":",0,'L');
         $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
     }
     $pdf->SetTextColor(0, 0, 60);
 }
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:101,代码来源:pdf_typhon.modules.php

示例5: _pagehead


//.........这里部分代码省略.........
     $title = $outputlangs->transnoentities("InterventionCard");
     $pdf->MultiCell(100, 4, $title, '', 'R');
     $pdf->SetFont('', 'B', $default_font_size + 2);
     $posy += 5;
     $pdf->SetXY($posx, $posy);
     $pdf->SetTextColor(0, 0, 60);
     $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref") . " : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
     $posy += 1;
     $pdf->SetFont('', '', $default_font_size);
     $posy += 4;
     $pdf->SetXY($posx, $posy);
     $pdf->SetTextColor(0, 0, 60);
     $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date") . " : " . dol_print_date($object->datec, "day", false, $outputlangs, true), '', 'R');
     if ($object->client->code_client) {
         $posy += 4;
         $pdf->SetXY($posx, $posy);
         $pdf->SetTextColor(0, 0, 60);
         $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode") . " : " . $outputlangs->transnoentities($object->client->code_client), '', 'R');
     }
     if ($showaddress) {
         // Sender properties
         $carac_emetteur = '';
         // Add internal contact of proposal if defined
         $arrayidcontact = $object->getIdContact('internal', 'INTERREPFOLL');
         if (count($arrayidcontact) > 0) {
             $object->fetch_user($arrayidcontact[0]);
             $carac_emetteur .= ($carac_emetteur ? "\n" : '') . $outputlangs->transnoentities("Name") . ": " . $outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)) . "\n";
         }
         $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client);
         // Show sender
         $posy = 42;
         $posx = $this->marge_gauche;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->page_largeur - $this->marge_droite - 80;
         }
         $hautcadre = 40;
         // Show sender frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->SetXY($posx, $posy);
         $pdf->SetFillColor(230, 230, 230);
         $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
         // Show sender name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetTextColor(0, 0, 60);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
         $posy = $pdf->getY();
         // Show sender information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy);
         $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
         // If CUSTOMER contact defined, we use it
         $usecontact = false;
         $arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->name;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->name);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, isset($object->contact) ? $object->contact : '', $usecontact, 'target');
         // Show recipient
         $widthrecbox = 100;
         if ($this->page_largeur < 210) {
             $widthrecbox = 84;
         }
         // To work with US executive format
         $posy = 42;
         $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx + 2, $posy - 5);
         $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
         $pdf->SetTextColor(0, 0, 0);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
     }
 }
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:101,代码来源:pdf_soleil.modules.php

示例6: _pagehead


//.........这里部分代码省略.........
         if ($result >= 0) {
             $pdf->SetFont('', '', $default_font_size - 2);
             $text = $linkedobject->ref;
             if ($linkedobject->ref_client) {
                 $text .= ' (' . $linkedobject->ref_client . ')';
             }
             $Yoff = $Yoff + 8;
             $pdf->SetXY($this->page_largeur - $this->marge_droite - 100, $Yoff);
             $pdf->MultiCell(100, 2, $outputlangs->transnoentities("RefOrder") . " : " . $outputlangs->transnoentities($text), 0, 'R');
             $Yoff = $Yoff + 3;
             $pdf->SetXY($this->page_largeur - $this->marge_droite - 60, $Yoff);
             $pdf->MultiCell(60, 2, $outputlangs->transnoentities("OrderDate") . " : " . dol_print_date($linkedobject->date, "day", false, $outputlangs, true), 0, 'R');
         }
     }
     if ($showaddress) {
         // Sender properties
         $carac_emetteur = '';
         // Add internal contact of origin element if defined
         $arrayidcontact = array();
         if (!empty($origin) && is_object($object->{$origin})) {
             $arrayidcontact = $object->{$origin}->getIdContact('internal', 'SALESREPFOLL');
         }
         if (count($arrayidcontact) > 0) {
             $object->fetch_user($arrayidcontact[0]);
             $carac_emetteur .= ($carac_emetteur ? "\n" : '') . $outputlangs->transnoentities("Name") . ": " . $outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)) . "\n";
         }
         $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->client);
         // Show sender
         $posx = $this->marge_gauche;
         $posy = 42;
         $hautcadre = 40;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->page_largeur - $this->marge_droite - 80;
         }
         // Show sender frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->MultiCell(66, 5, $outputlangs->transnoentities("Sender") . ":", 0, 'L');
         $pdf->SetXY($posx, $posy);
         $pdf->SetFillColor(230, 230, 230);
         $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
         // Show sender name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetTextColor(0, 0, 60);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(80, 3, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
         $posy = $pdf->getY();
         // Show sender information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy);
         $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
         // If SHIPPING contact defined, we use it
         $usecontact = false;
         $arrayidcontact = $object->{$origin}->getIdContact('external', 'SHIPPING');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->nom;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->nom);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, !empty($object->contact) ? $object->contact : null, $usecontact, 'targetwithdetails');
         // Show recipient
         $widthrecbox = 100;
         if ($this->page_largeur < 210) {
             $widthrecbox = 84;
         }
         // To work with US executive format
         $posy = 42;
         $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->MultiCell($widthrecbox, 4, $outputlangs->transnoentities("Recipient") . ":", 0, 'L');
         $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
         $pdf->SetTextColor(0, 0, 0);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
     }
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:101,代码来源:pdf_rouget.modules.php

示例7: pdf_pagefoot


//.........这里部分代码省略.........
    $line3 = "";
    // Juridical status
    if ($fromcompany->forme_juridique_code) {
        $line3 .= ($line3 ? " - " : "") . $outputlangs->convToOutputCharset(getFormeJuridiqueLabel($fromcompany->forme_juridique_code));
    }
    // Capital
    if ($fromcompany->capital) {
        $line3 .= ($line3 ? " - " : "") . $outputlangs->transnoentities("CapitalOf", $fromcompany->capital) . " " . $outputlangs->transnoentities("Currency" . $conf->currency);
    }
    // Prof Id 1
    if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || !$fromcompany->idprof2)) {
        $field = $outputlangs->transcountrynoentities("ProfId1", $fromcompany->country_code);
        if (preg_match('/\\((.*)\\)/i', $field, $reg)) {
            $field = $reg[1];
        }
        $line3 .= ($line3 ? " - " : "") . $field . ": " . $outputlangs->convToOutputCharset($fromcompany->idprof1);
    }
    // Prof Id 2
    if ($fromcompany->idprof2) {
        $field = $outputlangs->transcountrynoentities("ProfId2", $fromcompany->country_code);
        if (preg_match('/\\((.*)\\)/i', $field, $reg)) {
            $field = $reg[1];
        }
        $line3 .= ($line3 ? " - " : "") . $field . ": " . $outputlangs->convToOutputCharset($fromcompany->idprof2);
    }
    // Line 4 of company infos
    $line4 = "";
    // Prof Id 3
    if ($fromcompany->idprof3) {
        $field = $outputlangs->transcountrynoentities("ProfId3", $fromcompany->country_code);
        if (preg_match('/\\((.*)\\)/i', $field, $reg)) {
            $field = $reg[1];
        }
        $line4 .= ($line4 ? " - " : "") . $field . ": " . $outputlangs->convToOutputCharset($fromcompany->idprof3);
    }
    // Prof Id 4
    if ($fromcompany->idprof4) {
        $field = $outputlangs->transcountrynoentities("ProfId4", $fromcompany->country_code);
        if (preg_match('/\\((.*)\\)/i', $field, $reg)) {
            $field = $reg[1];
        }
        $line4 .= ($line4 ? " - " : "") . $field . ": " . $outputlangs->convToOutputCharset($fromcompany->idprof4);
    }
    // IntraCommunautary VAT
    if ($fromcompany->tva_intra != '') {
        $line4 .= ($line4 ? " - " : "") . $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
    $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 + (!empty($line1) ? 3 : 0) + (!empty($line2) ? 3 : 0) + (!empty($line3) ? 3 : 0) + (!empty($line4) ? 3 : 0);
    if ($line) {
        $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, $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 (!empty($line1)) {
        $pdf->SetFont('', 'B', 7);
        $pdf->SetXY($marge_gauche, -$posy);
        $pdf->MultiCell(200, 2, $line1, 0, 'C', 0);
        $posy -= 3;
        $pdf->SetFont('', '', 7);
    }
    if (!empty($line2)) {
        $pdf->SetFont('', 'B', 7);
        $pdf->SetXY($marge_gauche, -$posy);
        $pdf->MultiCell(200, 2, $line2, 0, 'C', 0);
        $posy -= 3;
        $pdf->SetFont('', '', 7);
    }
    if (!empty($line3)) {
        $pdf->SetXY($marge_gauche, -$posy);
        $pdf->MultiCell(200, 2, $line3, 0, 'C', 0);
    }
    if (!empty($line4)) {
        $posy -= 3;
        $pdf->SetXY($marge_gauche, -$posy);
        $pdf->MultiCell(200, 2, $line4, 0, 'C', 0);
    }
    // Show page nb only on iso languages (so default Helvetica font)
    if (pdf_getPDFFont($outputlangs) == 'Helvetica') {
        $pdf->SetXY(-20, -$posy);
        $pdf->MultiCell(11, 2, $pdf->PageNo() . '/' . $pdf->getAliasNbPages(), 0, 'R', 0);
        //print 'xxx'.$pdf->getAliasNbPages().'-'.$pdf->getAliasNumPage();exit;
    }
}
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:pdf.lib.php

示例8: _pagehead


//.........这里部分代码省略.........
         // if($object->fk_cash == '8')
         // 	$pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 <br>San Juan de Los Lagos, Jal.", 0, 'L');
         // if($object->fk_cash == '9' || $object->fk_cash == '10')
         // 	$pdf->MultiCell(80, 4, "Moreno Valley #199 <br>San Juan de los Lagos, Jal.<br>01(395) 785 3005", 0, 'L');
         if ($user->id == 1) {
             $pdf->MultiCell(80, 4, "Quinta Avenida #1001-B Fracc. La Agricultura Aguascalientes, Ags. 01(449) 917 3017", 0, 'L');
         }
         if ($user->id == 2) {
             $pdf->MultiCell(80, 4, "Quinta Avenida #1001-B Fracc. La Agricultura Aguascalientes, Ags. 01(449) 917 3017", 0, 'L');
         }
         if ($user->id == 16) {
             $pdf->MultiCell(80, 4, "Quinta Avenida #1001-B Fracc. La Agricultura Aguascalientes, Ags. 01(449) 917 3017", 0, 'L');
         }
         if ($user->id == 5) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 7) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 10) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 11) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 15) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 17) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 21) {
             $pdf->MultiCell(80, 4, "Carr. San Juan –Lagos Km 5.9 San Juan de Los Lagos, Jal.", 0, 'L');
         }
         if ($user->id == 8) {
             $pdf->MultiCell(80, 4, "Moreno Valley #199 San Juan de los Lagos, Jal. 01(395) 785 3005", 0, 'L');
         }
         if ($user->id == 14) {
             $pdf->MultiCell(80, 4, "Moreno Valley #199 San Juan de los Lagos, Jal. 01(395) 785 3005", 0, 'L');
         }
         if ($user->id == 13) {
             $pdf->MultiCell(80, 4, "Salida a Zacatecas Km. 4.5 Aguascalientes,Ags. 01(449) 973 1314", 0, 'L');
         }
         if ($user->id == 23) {
             $pdf->MultiCell(80, 4, "Salida a Zacatecas Km. 4.5 Aguascalientes,Ags. 01(449) 973 1314", 0, 'L');
         }
         if ($user->id == 12) {
             $pdf->MultiCell(80, 4, "Salida a San Luis Km. 1.9 Fracc. Asturias Aguascalientes, Ags. 01(449) 1458210", 0, 'L');
         }
         if ($user->id == 22) {
             $pdf->MultiCell(80, 4, "Salida a San Luis Km. 1.9 Fracc. Asturias Aguascalientes, Ags. 01(449) 1458210", 0, 'L');
         }
         // If CUSTOMER contact defined on order, we use it
         $usecontact = false;
         $arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->nom;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->nom);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, $usecontact ? $object->contact : '', $usecontact, 'target');
         // Show recipient
         $widthrecbox = 100;
         if ($this->page_largeur < 210) {
             $widthrecbox = 84;
         }
         // To work with US executive format
         $posy = 42;
         $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx + 2, $posy - 5);
         $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo") . ":", 0, 'L');
         $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
     }
     $pdf->SetTextColor(0, 0, 0);
 }
开发者ID:LionSystemsSolutions,项目名称:El-Canelo-ERP,代码行数:101,代码来源:pdf_einstein.modules.php

示例9: testDolNbOfLinesBis

    /**
     * testDolNbOfLinesBis
     *
     * @return boolean
     */
    public function testDolNbOfLinesBis()
    {
        // This is not a html string so nb of lines depends on \n
        $input="A string\nwith a é, &, < and > and bold tag.\nThird line";
        $after=dol_nboflines_bis($input,0);
        $this->assertEquals($after,3);

        // This is a html string so nb of lines depends on <br>
        $input="A string\nwith a é, &, < and > and <b>bold</b> tag.\nThird line";
        $after=dol_nboflines_bis($input,0);
        $this->assertEquals($after,1);

        // This is a html string so nb of lines depends on <br>
        $input="A string<br>with a é, &, < and > and <b>bold</b> tag.<br>Third line";
        $after=dol_nboflines_bis($input,0);
        $this->assertEquals($after,3);

        return true;
    }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:24,代码来源:FunctionsTest.php

示例10: write_file


//.........这里部分代码省略.........
             $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 = 50;
             $tab_height = 200;
             $tab_top_newpage = 40;
             $tab_height_newpage = 210;
             // Affiche notes
             if (!empty($object->note_public)) {
                 $pdf->SetFont('', '', $default_font_size - 1);
                 $pdf->writeHTMLCell(190, 3, $this->posxref - 1, $tab_top - 2, dol_htmlentitiesbr($object->note_public), 0, 1);
                 $nexY = $pdf->GetY();
                 $height_note = $nexY - ($tab_top - 2);
                 // Rect prend une longueur en 3eme param
                 $pdf->SetDrawColor(192, 192, 192);
                 $pdf->Rect($this->marge_gauche, $tab_top - 3, $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;
             $nexY = $tab_top + 7;
             // Boucle sur les lignes
             for ($i = 0; $i < $nblignes; $i++) {
                 $curY = $nexY;
                 // Description of ligne
                 $ref = $object->lines[$i]->ref;
                 $libelleline = $object->lines[$i]->label;
                 $progress = $object->lines[$i]->progress . '%';
                 $datestart = dol_print_date($object->lines[$i]->date_start, 'day');
                 $dateend = dol_print_date($object->lines[$i]->date_end, 'day');
                 $pdf->SetFont('', '', $default_font_size - 1);
                 // Dans boucle pour gerer multi-page
                 $pdf->SetXY($this->posxref, $curY);
                 $pdf->MultiCell(60, 3, $outputlangs->convToOutputCharset($ref), 0, 'L');
                 $pdf->SetXY($this->posxlabel, $curY);
                 $pdf->MultiCell(108, 3, $outputlangs->convToOutputCharset($libelleline), 0, 'L');
                 $pdf->SetXY($this->posxprogress, $curY);
                 $pdf->MultiCell(16, 3, $progress, 0, 'L');
                 $pdf->SetXY($this->posxdatestart, $curY);
                 $pdf->MultiCell(20, 3, $datestart, 0, 'L');
                 $pdf->SetXY($this->posxdateend, $curY);
                 $pdf->MultiCell(20, 3, $dateend, 0, 'L');
                 $pdf->SetFont('', '', $default_font_size - 1);
                 // On repositionne la police par defaut
                 $nexY = $pdf->GetY();
                 $nexY += 2;
                 // Passe espace entre les lignes
                 // Cherche nombre de lignes a venir pour savoir si place suffisante
                 if ($i < $nblignes - 1 && empty($hidedesc)) {
                     //on recupere la description du produit suivant
                     $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;
                 } else {
                     $nblineFollowDesc = 0;
                 }
                 if ($nexY + $nblineFollowDesc > $tab_top + $tab_height && $i < $nblignes - 1) {
                     $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
                     $this->_pagefoot($pdf, $object, $outputlangs);
                     // New page
                     $pdf->AddPage();
                     $pagenb++;
                     $this->_pagehead($pdf, $object, 0, $outputlangs);
                     $pdf->SetFont('', '', $default_font_size - 1);
                     $pdf->MultiCell(0, 3, '');
                     // Set interline to 3
                     $pdf->SetTextColor(0, 0, 0);
                     $tab_top = $tab_top_newpage;
                     $tab_height = $tab_height_newpage;
                     $nexY = $tab_top + 7;
                 }
             }
             // Show square
             $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
             $bottomlasttab = $tab_top + $tab_height + 1;
             /*
              * Pied de page
              */
             $this->_pagefoot($pdf, $object, $outputlangs);
             $pdf->AliasNbPages();
             $pdf->Close();
             $pdf->Output($file, 'F');
             if (!empty($conf->global->MAIN_UMASK)) {
                 @chmod($file, octdec($conf->global->MAIN_UMASK));
             }
             return 1;
             // Pas d'erreur
         } else {
             $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
             return 0;
         }
     }
     $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
     return 0;
 }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:pdf_baleine.modules.php

示例11: write_file


//.........这里部分代码省略.........
             $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 = 100;
             $tab_top_newpage = 50;
             $tab_height = 140;
             $tab_height_newpage = 190;
             $iniY = $tab_top + 7;
             $curY = $tab_top + 7;
             $nexY = $tab_top + 7;
             for ($i = 0; $i < $nblines; $i++) {
                 $curY = $nexY;
                 $pdf->SetFont('', '', $default_font_size - 1);
                 // Dans boucle pour gerer multi-page
                 // Description de la ligne produit
                 //$libelleproduitservice=pdf_getlinedesc($object,$i,$outputlangs);
                 pdf_writelinedesc($pdf, $object, $i, $outputlangs, 100, 3, 30, $curY, 1);
                 //$pdf->writeHTMLCell(100, 3, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1);
                 $pdf->SetFont('', '', $default_font_size - 1);
                 // Dans boucle pour gerer multi-page
                 $nexY = $pdf->GetY();
                 $pdf->SetXY(10, $curY);
                 $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->lines[$i]->tva_tx, 0, 'C');
                 $pdf->SetXY(145, $curY);
                 $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->lines[$i]->price), 0, 'R', 0);
                 // TODO Field not yet saved in database
                 //$pdf->SetXY(174, $curY );
                 //$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);
                 $nexY += 2;
                 // Passe espace entre les lignes
                 // Cherche nombre de lignes a venir pour savoir si place suffisante
                 if ($i < $nblines - 1 && empty($hidedesc)) {
                     //on recupere la description du produit suivant
                     $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;
                 } else {
                     $nblineFollowDesc = 0;
                 }
                 // Test if a new page is required
                 if ($pagenb == 1) {
                     $tab_top_in_current_page = $tab_top;
                     $tab_height_in_current_page = $tab_height;
                 } else {
                     $tab_top_in_current_page = $tab_top_newpage;
                     $tab_height_in_current_page = $tab_height_newpage;
                 }
                 if ($nexY + $nblineFollowDesc > $tab_top_in_current_page + $tab_height_in_current_page && $i < $nblines - 1) {
                     if ($pagenb == 1) {
                         $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
                     } else {
                         $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
                     }
                     $this->_pagefoot($pdf, $object, $outputlangs);
                     // New page
                     $pdf->AddPage();
                     $pagenb++;
                     $this->_pagehead($pdf, $object, 0, $outputlangs);
                     $pdf->SetFont('', '', $default_font_size - 1);
                     $pdf->MultiCell(0, 3, '');
                     // Set interline to 3
                     $pdf->SetTextColor(0, 0, 0);
                     $nexY = $tab_top_newpage + 7;
                 }
             }
             // Show square
             if ($pagenb == 1) {
                 $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
                 $bottomlasttab = $tab_top + $tab_height + 1;
             } else {
                 $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
                 $bottomlasttab = $tab_top_newpage + $tab_height_newpage + 1;
             }
             /*
              * Pied de page
              */
             $this->_pagefoot($pdf, $object, $outputlangs);
             $pdf->AliasNbPages();
             $pdf->Close();
             $pdf->Output($file, 'F');
             if (!empty($conf->global->MAIN_UMASK)) {
                 @chmod($file, octdec($conf->global->MAIN_UMASK));
             }
             return 1;
         }
     } else {
         $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR");
         return 0;
     }
 }
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:pdf_sirocco.modules.php

示例12: _pagehead

 /**
  *  Show top header of page.
  *
  *  @param	PDF			&$pdf     		Object PDF
  *  @param  Object		$object     	Object to show
  *  @param  int	    	$showaddress    0=no, 1=yes
  *  @param  Translate	$outputlangs	Object lang for output
  *  @param	object		$hookmanager	Hookmanager object
  *  @return	void
  */
 function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $hookmanager)
 {
     global $conf, $langs, $mysoc;
     $langs->load("orders");
     $default_font_size = pdf_getPDFFontSize($outputlangs);
     pdf_pagehead($pdf, $outputlangs, $this->page_hauteur);
     //Affiche le filigrane brouillon - Print Draft Watermark
     if ($object->statut == 0 && !empty($conf->global->COMMANDE_DRAFT_WATERMARK)) {
         pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur, 'mm', $conf->global->COMMANDE_DRAFT_WATERMARK);
     }
     $posy = $this->marge_haute;
     $pdf->SetXY($this->marge_gauche, $posy);
     // Logo
     $logo = $conf->mycompany->dir_output . '/logos/' . $this->emetteur->logo;
     if ($this->emetteur->logo) {
         if (is_readable($logo)) {
             $height = pdf_getHeightForLogo($logo);
             $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
             // width=0 (auto)
         } else {
             $pdf->SetTextColor(200, 0, 0);
             $pdf->SetFont('', 'B', $default_font_size - 2);
             $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L');
             $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
         }
     } else {
         $text = $this->emetteur->name;
         $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
     }
     if ($showaddress) {
         $posy = 40;
         $posx = $this->marge_gauche;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->page_largeur - $this->marge_droite - 80;
         }
         $hautcadre = 40;
         $pdf->SetXY($posx, $posy + 3);
         // Sender name
         $pdf->SetTextColor(0, 0, 60);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
         // Sender properties
         $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur);
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx, $posy + 7);
         $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
         // Client destinataire
         $client = new Societe($this->db);
         $client->fetch($object->socid);
         $object->client = $client;
         // If CUSTOMER contact defined on invoice, we use it
         $usecontact = false;
         $arrayidcontact = $object->getIdContact('external', 'CUSTOMER');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->nom;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->nom);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, $object->contact, $usecontact, 'target');
         // Show recipient
         $posy = 42;
         $posx = $this->page_largeur - $this->marge_droite - 100;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx + 2, $posy - 5);
         $pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillTo") . ":", 0, 'L');
         $pdf->Rect($posx, $posy, 100, $hautcadre);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(96, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell(86, 4, $carac_client, 0, 'L');
//.........这里部分代码省略.........
开发者ID:nrjacker4,项目名称:crm-php,代码行数:101,代码来源:pdf_edison.modules.php

示例13: _pagehead


//.........这里部分代码省略.........
         $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefSupplier") . " : " . $outputlangs->convToOutputCharset($object->ref_supplier), '', 'R');
     }
     $posy += 2;
     $pdf->SetFont('', '', $default_font_size - 1);
     $posy += 5;
     $pdf->SetXY($posx, $posy);
     if (!empty($object->date_commande)) {
         $pdf->SetTextColor(0, 0, 60);
         $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate") . " : " . dol_print_date($object->date_commande, "day", false, $outputlangs, true), '', 'R');
     } else {
         $pdf->SetTextColor(255, 0, 0);
         $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R');
     }
     $pdf->SetTextColor(0, 0, 60);
     $usehourmin = 'day';
     if (empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) {
         $usehourmin = 'dayhour';
     }
     if (!empty($object->date_livraison)) {
         $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned") . " : " . dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R');
     }
     $posy += 5;
     $pdf->SetTextColor(0, 0, 60);
     // Show list of linked objects
     $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
     if ($showaddress) {
         // Sender properties
         $carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->client);
         // Show sender
         $posy = 42;
         $posx = $this->marge_gauche;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->page_largeur - $this->marge_droite - 80;
         }
         $hautcadre = 40;
         // Show sender frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx, $posy - 5);
         $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom") . ":", 0, 'L');
         $pdf->SetXY($posx, $posy);
         $pdf->SetFillColor(230, 230, 230);
         $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
         $pdf->SetTextColor(0, 0, 60);
         // Show sender name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
         $posy = $pdf->getY();
         // Show sender information
         $pdf->SetXY($posx + 2, $posy);
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
         // If BILLING contact defined on order, we use it
         $usecontact = false;
         $arrayidcontact = $object->getIdContact('external', 'BILLING');
         if (count($arrayidcontact) > 0) {
             $usecontact = true;
             $result = $object->fetch_contact($arrayidcontact[0]);
         }
         // Recipient name
         if (!empty($usecontact)) {
             // On peut utiliser le nom de la societe du contact
             if (!empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
                 $socname = $object->contact->socname;
             } else {
                 $socname = $object->client->name;
             }
             $carac_client_name = $outputlangs->convToOutputCharset($socname);
         } else {
             $carac_client_name = $outputlangs->convToOutputCharset($object->client->name);
         }
         $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->client, $usecontact ? $object->contact : '', $usecontact, 'target');
         // Show recipient
         $widthrecbox = 100;
         if ($this->page_largeur < 210) {
             $widthrecbox = 84;
         }
         // To work with US executive format
         $posy = 42;
         $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
         if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
             $posx = $this->marge_gauche;
         }
         // Show recipient frame
         $pdf->SetTextColor(0, 0, 0);
         $pdf->SetFont('', '', $default_font_size - 2);
         $pdf->SetXY($posx + 2, $posy - 5);
         $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo") . ":", 0, 'L');
         $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
         // Show recipient name
         $pdf->SetXY($posx + 2, $posy + 3);
         $pdf->SetFont('', 'B', $default_font_size);
         $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
         // Show recipient information
         $pdf->SetFont('', '', $default_font_size - 1);
         $pdf->SetXY($posx + 2, $posy + 4 + dol_nboflines_bis($carac_client_name, 50) * 4);
         $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
     }
 }
开发者ID:ADDAdev,项目名称:Dolibarr,代码行数:101,代码来源:pdf_muscadet.modules.php

示例14: write_file


//.........这里部分代码省略.........
                 // Prix unitaire HT avant remise
                 $pdf->SetXY($this->posxup, $curY);
                 $pdf->MultiCell(20, 4, price($object->lines[$i]->subprice), 0, 'R', 0);
                 */
                 // Quantity
                 $pdf->SetXY($this->posxqty, $curY);
                 $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'R');
                 /*
                 // Remise sur ligne
                 $pdf->SetXY($this->posxdiscount, $curY);
                 if ($object->lines[$i]->remise_percent)
                 {
                 $pdf->MultiCell(14, 3, $object->lines[$i]->remise_percent."%", 0, 'R');
                 }
                 
                 // Total HT ligne
                 $pdf->SetXY($this->postotalht, $curY);
                 $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->lines[$i]->price * $object->lines[$i]->qty;
                 if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
                 $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 < $nblines - 1 && empty($hidedesc)) {
                     //on recupere la description du produit suivant
                     $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;
                 } else {
                     $nblineFollowDesc = 0;
                 }
                 // Test if a new page is required
                 if ($pagenb == 1) {
                     $tab_top_in_current_page = $tab_top;
                     $tab_height_in_current_page = $tab_height;
                 } else {
                     $tab_top_in_current_page = $tab_top_newpage;
                     $tab_height_in_current_page = $tab_height_newpage;
                 }
                 if ($nexY + $nblineFollowDesc > $tab_top_in_current_page + $tab_height_in_current_page && $i < $nblines - 1) {
                     if ($pagenb == 1) {
                         $this->_tableau($pdf, $tab_top, $tab_height + 20, $nexY, $outputlangs);
                     } else {
                         $this->_tableau($pdf, $tab_top_newpage, $tab_height_newpage, $nexY, $outputlangs);
                     }
                     $this->_pagefoot($pdf, $object, $outputlangs);
                     // New page
                     $pdf->AddPage();
                     $pagenb++;
                     $this->_pagehead($pdf, $object, 0, $outputlangs);
                     $pdf->SetFont('', '', $default_font_size - 1);
                     $pdf->MultiCell(0, 3, '');
                     // Set interline to 3
                     $pdf->SetTextColor(0, 0, 0);
                     $nexY = $tab_top_newpage + 7;
                 }
             }
             // Show square
             if ($pagenb == 1) {
                 $this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
开发者ID:nrjacker4,项目名称:crm-php,代码行数:67,代码来源:pdf_typhon.modules.php

示例15: write_file


//.........这里部分代码省略.........

				$pdf->SetFont('','', $default_font_size - 3);

				// New page
				$pdf->AddPage();
				$pagenb++;
				$this->_pagehead($pdf, $this->expe, $outputlangs);
				$pdf->SetFont('','', $default_font_size - 3);
				$pdf->MultiCell(0, 3, '');		// Set interline to 3
				$pdf->SetTextColor(0,0,0);

				//Initialisation des coordonnees
				$tab_top = 53;
				$tab_height = 70;
				$pdf->SetFillColor(240,240,240);
				$pdf->SetTextColor(0,0,0);
				$pdf->SetFont('','',  $default_font_size - 3);
				$pdf->SetXY (10, $tab_top + 5 );
				$iniY = $pdf->GetY();
				$curY = $pdf->GetY();
				$nexY = $pdf->GetY();
				//Generation du tableau
				$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);

				$nblignes = sizeof($object->lines);

				for ($i = 0 ; $i < $nblignes ; $i++)
				{
					// Description de la ligne produit

					//Creation des cases a cocher
					$pdf->rect(10+3, $curY+1, 3, 3);
					$pdf->rect(20+3, $curY+1, 3, 3);
					//Insertion de la reference du produit
					$pdf->SetXY (30, $curY+1 );
					$pdf->SetFont('','B', $default_font_size - 3);
					$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
					//Insertion du libelle
					$pdf->SetFont('','', $default_font_size - 3);
					$pdf->SetXY (50, $curY+1 );
                    //$libelleproduitservice=pdf_getlinedesc($object->$origin,$i,$outputlangs);
					$libelleproduitservice = pdf_writelinedesc($pdf,$object->$origin,$i,$outputlangs,90,3,50,$curY+1,1);
					//$pdf->writeHTMLCell(90, 3, 50, $curY+1, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 'L', 0);
					//Insertion de la quantite commandee
					$pdf->SetFont('','', $default_font_size - 3);
					$pdf->SetXY (140, $curY+1 );
					$pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0);
					//Insertion de la quantite a envoyer
					$pdf->SetFont('','', $default_font_size - 3);
					$pdf->SetXY (170, $curY+1 );
					$pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', 0);

					//Generation de la page 2
					$curY += (dol_nboflines_bis($libelleproduitservice,0,$outputlangs->charset_output)*3+1);
					$nexY = $curY;
					if ($nexY > ($tab_top+$tab_height-10) && $i < $nblignes - 1)
					{
						$this->_tableau($pdf, $tab_top, $tab_height, $nexY, $outputlangs);
						$this->_pagefoot($pdf, $object, $outputlangs);
						$pdf->AliasNbPages();

						$curY = $iniY;

						// New page
						$pdf->AddPage();
						$pagenb++;
						$this->_pagehead($pdf, $this->expe, $outputlangs);
						$pdf->MultiCell(0, 3, '');		// Set interline to 3
						$pdf->SetTextColor(0,0,0);
						$pdf->SetFont('','', $default_font_size - 3);
					}
				}
				//Insertion du pied de page
				$this->_pagefoot($pdf, $object, $outputlangs);

				$pdf->AliasNbPages();

				$pdf->Close();

				$pdf->Output($file,'F');
                if (! empty($conf->global->MAIN_UMASK))
                    @chmod($file, octdec($conf->global->MAIN_UMASK));

				return 1;
			}
			else
			{
				$this->error=$outputlangs->transnoentities("ErrorCanNotCreateDir",$dir);
				return 0;
			}
		}
		else
		{
			$this->error=$outputlangs->transnoentities("ErrorConstantNotDefined","EXP_OUTPUTDIR");
			return 0;
		}
		$this->error=$outputlangs->transnoentities("ErrorUnknown");
		return 0;   // Erreur par defaut

	}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:101,代码来源:pdf_expedition_merou.modules.php


注:本文中的dol_nboflines_bis函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。