29 require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_proposal/modules_supplier_proposal.php';
30 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
59 public $update_main_doc_field;
70 public $phpmin = array(5, 6);
76 public $version =
'dolibarr';
101 public $marge_droite;
127 global $conf, $langs, $mysoc;
130 $langs->loadLangs(array(
"main",
"bills"));
133 $this->
name =
"aurore";
134 $this->
description = $langs->trans(
'DocModelAuroreDescription');
135 $this->update_main_doc_field = 1;
140 $this->page_largeur = $formatarray[
'width'];
141 $this->page_hauteur = $formatarray[
'height'];
142 $this->format = array($this->page_largeur, $this->page_hauteur);
143 $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
144 $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
145 $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
146 $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
148 $this->option_logo = 1;
149 $this->option_tva = 1;
150 $this->option_modereg = 1;
151 $this->option_condreg = 1;
152 $this->option_multilang = 1;
153 $this->option_escompte = 1;
154 $this->option_credit_note = 1;
155 $this->option_freetext = 1;
156 $this->option_draft_watermark = 1;
157 $this->watermark =
'';
160 $this->emetteur = $mysoc;
161 if (empty($this->emetteur->country_code)) {
162 $this->emetteur->country_code = substr($langs->defaultlang, -2);
166 $this->posxdesc = $this->marge_gauche + 1;
167 $this->posxdiscount = 162;
168 $this->postotalht = 174;
170 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
171 $this->posxtva = 101;
173 $this->posxqty = 135;
174 $this->posxunit = 151;
176 $this->posxtva = 102;
178 $this->posxqty = 145;
179 $this->posxunit = 162;
182 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) || !empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) {
183 $this->posxup = $this->posxtva;
185 $this->posxpicture = $this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH);
186 if ($this->page_largeur < 210) {
187 $this->posxpicture -= 20;
188 $this->posxtva -= 20;
190 $this->posxqty -= 20;
191 $this->posxunit -= 20;
192 $this->posxdiscount -= 20;
193 $this->postotalht -= 20;
196 $this->tva = array();
197 $this->tva_array = array();
198 $this->localtax1 = array();
199 $this->localtax2 = array();
200 $this->atleastoneratenotnull = 0;
201 $this->atleastonediscount = 0;
216 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
219 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
221 if (!is_object($outputlangs)) {
222 $outputlangs = $langs;
225 if (!empty($conf->global->MAIN_USE_FPDF)) {
226 $outputlangs->charset_output =
'ISO-8859-1';
230 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"supplier_proposal"));
233 if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK))) {
234 $this->watermark = $conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK;
237 $nblines = count($object->lines);
240 $realpatharray = array();
241 if (!empty($conf->global->MAIN_GENERATE_SUPPLIER_PROPOSAL_WITH_PICTURE)) {
242 for ($i = 0; $i < $nblines; $i++) {
243 if (empty($object->lines[$i]->fk_product)) {
248 $objphoto->fetch($object->lines[$i]->fk_product);
250 if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) {
251 $pdir =
get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto,
'product').$object->lines[$i]->fk_product.
"/photos/";
252 $dir = $conf->product->dir_output.
'/'.$pdir;
254 $pdir =
get_exdir(0, 0, 0, 0, $objphoto,
'product');
255 $dir = $conf->product->dir_output.
'/'.$pdir;
259 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
260 if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES)) {
261 if ($obj[
'photo_vignette']) {
262 $filename = $obj[
'photo_vignette'];
264 $filename = $obj[
'photo'];
267 $filename = $obj[
'photo'];
269 $realpath = $dir.$filename;
274 $realpatharray[$i] = $realpath;
278 if (count($realpatharray) == 0) {
279 $this->posxpicture = $this->posxtva;
282 if ($conf->supplier_proposal->dir_output) {
283 $object->fetch_thirdparty();
288 if ($object->specimen) {
289 $dir = $conf->supplier_proposal->dir_output;
290 $file = $dir.
"/SPECIMEN.pdf";
293 $dir = $conf->supplier_proposal->dir_output.
"/".$objectref;
294 $file = $dir.
"/".$objectref.
".pdf";
297 if (!file_exists($dir)) {
299 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
304 if (file_exists($dir)) {
306 if (!is_object($hookmanager)) {
307 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
310 $hookmanager->initHooks(array(
'pdfgeneration'));
311 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
313 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
318 $heightforinfotot = 50;
319 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
320 $heightforfooter = $this->marge_basse + 8;
321 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
322 $heightforfooter += 6;
324 $pdf->SetAutoPageBreak(1, 0);
326 if (class_exists(
'TCPDF')) {
327 $pdf->setPrintHeader(
false);
328 $pdf->setPrintFooter(
false);
332 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
333 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
334 $tplidx = $pdf->importPage(1);
339 $pdf->SetDrawColor(128, 128, 128);
341 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
342 $pdf->SetSubject($outputlangs->transnoentities(
"CommercialAsk"));
343 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
344 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
345 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"CommercialAsk").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
346 if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) {
347 $pdf->SetCompression(
false);
350 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
353 for ($i = 0; $i < $nblines; $i++) {
354 if ($object->lines[$i]->remise_percent) {
355 $this->atleastonediscount++;
358 if (empty($this->atleastonediscount)) {
359 $delta = ($this->postotalht - $this->posxdiscount);
360 $this->posxpicture += $delta;
361 $this->posxtva += $delta;
362 $this->posxup += $delta;
363 $this->posxqty += $delta;
364 $this->posxunit += $delta;
365 $this->posxdiscount += $delta;
371 if (!empty($tplidx)) {
372 $pdf->useTemplate($tplidx);
375 $top_shift = $this->
_pagehead($pdf, $object, 1, $outputlangs);
376 $pdf->SetFont(
'',
'', $default_font_size - 1);
377 $pdf->MultiCell(0, 3,
'');
378 $pdf->SetTextColor(0, 0, 0);
380 $tab_top = 90 + $top_shift;
381 $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
384 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
385 if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) {
387 if (is_object($object->thirdparty)) {
388 $salereparray = $object->thirdparty->getSalesRepresentatives($user);
389 $salerepobj =
new User($this->
db);
390 $salerepobj->fetch($salereparray[0][
'id']);
391 if (!empty($salerepobj->signature)) {
392 $notetoshow =
dol_concatdesc($notetoshow, $salerepobj->signature);
398 $extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
399 if (!empty($extranote)) {
411 $pdf->SetFont(
'',
'', $default_font_size - 1);
412 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($notetoshow), 0, 1);
413 $nexY = $pdf->GetY();
414 $height_note = $nexY - $tab_top;
417 $pdf->SetDrawColor(192, 192, 192);
418 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
420 $tab_top = $nexY + 6;
423 $iniY = $tab_top + 7;
424 $curY = $tab_top + 7;
425 $nexY = $tab_top + 7;
428 for ($i = 0; $i < $nblines; $i++) {
430 $pdf->SetFont(
'',
'', $default_font_size - 1);
431 $pdf->SetTextColor(0, 0, 0);
434 $imglinesize = array();
435 if (!empty($realpatharray[$i])) {
439 $pdf->setTopMargin($tab_top_newpage);
440 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
441 $pageposbefore = $pdf->getPage();
443 $showpricebeforepagebreak = 1;
445 $posYAfterDescription = 0;
448 if (!empty($imglinesize[
'width']) && !empty($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
449 $pdf->AddPage(
'',
'',
true);
450 if (!empty($tplidx)) {
451 $pdf->useTemplate($tplidx);
453 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
454 $this->
_pagehead($pdf, $object, 0, $outputlangs);
456 $pdf->setPage($pageposbefore + 1);
458 $curY = $tab_top_newpage;
461 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
462 $showpricebeforepagebreak = 1;
464 $showpricebeforepagebreak = 0;
468 if (!empty($imglinesize[
'width']) && !empty($imglinesize[
'height'])) {
469 $curX = $this->posxpicture - 1;
470 $pdf->Image($realpatharray[$i], $curX + (($this->posxtva - $this->posxpicture - $imglinesize[
'width']) / 2), $curY, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
472 $posYAfterImage = $curY + $imglinesize[
'height'];
476 $curX = $this->posxdesc - 1;
478 $pdf->startTransaction();
479 if ($posYAfterImage > 0) {
480 $descWidth = $this->posxpicture - $curX;
482 $descWidth = $this->posxtva - $curX;
484 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1);
486 $pageposafter = $pdf->getPage();
487 if ($pageposafter > $pageposbefore) {
488 $pdf->rollbackTransaction(
true);
489 $pageposafter = $pageposbefore;
491 $pdf->setPageOrientation(
'', 1, $heightforfooter);
492 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1);
494 $pageposafter = $pdf->getPage();
495 $posyafter = $pdf->GetY();
497 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
498 if ($i == ($nblines - 1)) {
499 $pdf->AddPage(
'',
'',
true);
500 if (!empty($tplidx)) {
501 $pdf->useTemplate($tplidx);
503 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
504 $this->
_pagehead($pdf, $object, 0, $outputlangs);
506 $pdf->setPage($pageposafter + 1);
511 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
512 $showpricebeforepagebreak = 1;
514 $showpricebeforepagebreak = 0;
519 $pdf->commitTransaction();
521 $posYAfterDescription = $pdf->GetY();
523 $nexY = $pdf->GetY();
524 $pageposafter = $pdf->getPage();
526 $pdf->setPage($pageposbefore);
527 $pdf->setTopMargin($this->marge_haute);
528 $pdf->setPageOrientation(
'', 1, 0);
531 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
532 $pdf->setPage($pageposafter);
533 $curY = $tab_top_newpage;
536 $pdf->SetFont(
'',
'', $default_font_size - 1);
556 $pdf->SetXY($this->posxqty, $curY);
557 $pdf->MultiCell($this->posxunit - $this->posxqty - 0.8, 4, $qty, 0,
'R');
560 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
561 $unit =
pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
562 $pdf->SetXY($this->posxunit, $curY);
563 $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0,
'L');
583 if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
584 $tvaligne = $object->lines[$i]->multicurrency_total_tva;
586 $tvaligne = $object->lines[$i]->total_tva;
589 $localtax1ligne = $object->lines[$i]->total_localtax1;
590 $localtax2ligne = $object->lines[$i]->total_localtax2;
591 $localtax1_rate = $object->lines[$i]->localtax1_tx;
592 $localtax2_rate = $object->lines[$i]->localtax2_tx;
593 $localtax1_type = $object->lines[$i]->localtax1_type;
594 $localtax2_type = $object->lines[$i]->localtax2_type;
596 if ($object->remise_percent) {
597 $tvaligne -= ($tvaligne * $object->remise_percent) / 100;
599 if ($object->remise_percent) {
600 $localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100;
602 if ($object->remise_percent) {
603 $localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100;
606 $vatrate = (string) $object->lines[$i]->tva_tx;
609 if ((!isset($localtax1_type) || $localtax1_type ==
'' || !isset($localtax2_type) || $localtax2_type ==
'')
610 && (!empty($localtax1_rate) || !empty($localtax2_rate))) {
612 $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] :
'';
613 $localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] :
'';
617 if ($localtax1_type && $localtax1ligne != 0) {
618 $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
620 if ($localtax2_type && $localtax2ligne != 0) {
621 $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
624 if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
629 if (!isset($this->tva[$vatrate])) {
630 $this->tva[$vatrate] = 0;
632 $this->tva[$vatrate] += $tvaligne;
633 $vatcode = $object->lines[$i]->vat_src_code;
634 if (empty($this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'])) {
635 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] = 0;
637 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')] = array(
'vatrate'=>$vatrate,
'vatcode'=>$vatcode,
'amount'=> $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] + $tvaligne);
639 if ($posYAfterImage > $posYAfterDescription) {
640 $nexY = $posYAfterImage;
644 if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
645 $pdf->setPage($pageposafter);
646 $pdf->SetLineStyle(array(
'dash'=>
'1,1',
'color'=>array(80, 80, 80)));
648 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
649 $pdf->SetLineStyle(array(
'dash'=>0));
655 while ($pagenb < $pageposafter) {
656 $pdf->setPage($pagenb);
658 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
660 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
662 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
664 $pdf->setPage($pagenb);
665 $pdf->setPageOrientation(
'', 1, 0);
666 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
667 $this->
_pagehead($pdf, $object, 0, $outputlangs);
669 if (!empty($tplidx)) {
670 $pdf->useTemplate($tplidx);
673 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
675 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
677 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
679 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
682 if (!empty($tplidx)) {
683 $pdf->useTemplate($tplidx);
686 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
687 $this->
_pagehead($pdf, $object, 0, $outputlangs);
694 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
695 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
697 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
698 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
702 $posy = $this->
_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
716 $this->
_pagefoot($pdf, $object, $outputlangs);
717 if (method_exists($pdf,
'AliasNbPages')) {
718 $pdf->AliasNbPages();
723 $pdf->Output($file,
'F');
726 $hookmanager->initHooks(array(
'pdfgeneration'));
727 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
729 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
731 $this->error = $hookmanager->error;
732 $this->errors = $hookmanager->errors;
735 if (!empty($conf->global->MAIN_UMASK)) {
736 @chmod($file, octdec($conf->global->MAIN_UMASK));
739 $this->result = array(
'fullpath'=>$file);
743 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
747 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"SUPPLIER_PROPOSAL_OUTPUTDIR");
785 $pdf->SetFont(
'',
'', $default_font_size - 1);
790 if (!empty($object->delivery_date)) {
791 $outputlangs->load(
"sendings");
792 $pdf->SetFont(
'',
'B', $default_font_size - 2);
793 $pdf->SetXY($this->marge_gauche, $posy);
794 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
795 $pdf->MultiCell(80, 4, $titre, 0,
'L');
796 $pdf->SetFont(
'',
'', $default_font_size - 2);
797 $pdf->SetXY($posxval, $posy);
798 $dlp =
dol_print_date($object->delivery_date,
"daytext",
false, $outputlangs,
true);
799 $pdf->MultiCell(80, 4, $dlp, 0,
'L');
801 $posy = $pdf->GetY() + 1;
803 $outputlangs->load(
"sendings");
804 $pdf->SetFont(
'',
'B', $default_font_size - 2);
805 $pdf->SetXY($this->marge_gauche, $posy);
806 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
807 $pdf->MultiCell(80, 4, $titre, 0,
'L');
808 $pdf->SetFont(
'',
'', $default_font_size - 2);
809 $pdf->SetXY($posxval, $posy);
811 $pdf->MultiCell(80, 4,
'', 0,
'L');
813 $posy = $pdf->GetY() + 1;
833 if (empty($conf->global->SUPPLIER_PROPOSAL_PDF_HIDE_PAYMENTTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement)) {
834 $pdf->SetFont(
'',
'B', $default_font_size - 2);
835 $pdf->SetXY($this->marge_gauche, $posy);
836 $titre = $outputlangs->transnoentities(
"PaymentConditions").
':';
837 $pdf->MultiCell(80, 4, $titre, 0,
'L');
839 $pdf->SetFont(
'',
'', $default_font_size - 2);
840 $pdf->SetXY($posxval, $posy);
841 $lib_condition_paiement = $outputlangs->transnoentities(
"PaymentCondition".$object->cond_reglement_code) != (
'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities(
"PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
842 $lib_condition_paiement = str_replace(
'\n',
"\n", $lib_condition_paiement);
843 $pdf->MultiCell(80, 4, $lib_condition_paiement, 0,
'L');
845 $posy = $pdf->GetY() + 3;
848 if (!empty($conf->global->SUPPLIER_PROPOSAL_PDF_SHOW_PAYMENTTERMMODE)) {
850 if ($object->mode_reglement_code
851 && $object->mode_reglement_code !=
'CHQ'
852 && $object->mode_reglement_code !=
'VIR') {
853 $pdf->SetFont(
'',
'B', $default_font_size - 2);
854 $pdf->SetXY($this->marge_gauche, $posy - 2);
855 $titre = $outputlangs->transnoentities(
"PaymentMode").
':';
856 $pdf->MultiCell(80, 5, $titre, 0,
'L');
857 $pdf->SetFont(
'',
'', $default_font_size - 2);
858 $pdf->SetXY($posxval, $posy - 2);
859 $lib_mode_reg = $outputlangs->transnoentities(
"PaymentType".$object->mode_reglement_code) != (
'PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities(
"PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
860 $pdf->MultiCell(80, 5, $lib_mode_reg, 0,
'L');
862 $posy = $pdf->GetY() + 2;
866 if (empty($object->mode_reglement_code) || $object->mode_reglement_code ==
'CHQ') {
868 if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
869 $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
871 if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
873 $account->fetch($conf->global->FACTURE_CHQ_NUMBER);
875 $pdf->SetXY($this->marge_gauche, $posy);
876 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
877 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $account->proprio), 0,
'L', 0);
878 $posy = $pdf->GetY() + 1;
880 if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) {
881 $pdf->SetXY($this->marge_gauche, $posy);
882 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
883 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0,
'L', 0);
884 $posy = $pdf->GetY() + 2;
887 if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
888 $pdf->SetXY($this->marge_gauche, $posy);
889 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
890 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $this->emetteur->name), 0,
'L', 0);
891 $posy = $pdf->GetY() + 1;
893 if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) {
894 $pdf->SetXY($this->marge_gauche, $posy);
895 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
896 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0,
'L', 0);
897 $posy = $pdf->GetY() + 2;
904 if (empty($object->mode_reglement_code) || $object->mode_reglement_code ==
'VIR') {
905 if (!empty($object->fk_bank) || !empty($conf->global->FACTURE_RIB_NUMBER)) {
906 $bankid = (empty($object->fk_bank) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_bank);
908 $account->fetch($bankid);
910 $curx = $this->marge_gauche;
913 $posy =
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
935 protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
938 global $conf, $mysoc;
943 $pdf->SetFont(
'',
'', $default_font_size - 1);
948 if ($this->page_largeur < 210) {
951 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
957 $pdf->SetFillColor(255, 255, 255);
958 $pdf->SetXY($col1x, $tab2_top + 0);
959 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalHT"), 0,
'L', 1);
961 $pdf->SetXY($col2x, $tab2_top + 0);
962 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0,
'R', 1);
965 $pdf->SetFillColor(248, 248, 248);
967 $this->atleastoneratenotnull = 0;
968 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
969 $tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva[
'0.000']) && is_float($this->tva[
'0.000'])) ?
true :
false);
970 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull) {
976 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
977 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
981 foreach ($localtax_rate as $tvakey => $tvaval) {
986 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
989 if (preg_match(
'/\*/', $tvakey)) {
990 $tvakey = str_replace(
'*',
'', $tvakey);
991 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
993 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).
' ';
994 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
995 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
997 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
998 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1006 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1007 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
1011 foreach ($localtax_rate as $tvakey => $tvaval) {
1018 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1021 if (preg_match(
'/\*/', $tvakey)) {
1022 $tvakey = str_replace(
'*',
'', $tvakey);
1023 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1025 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).
' ';
1026 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1027 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1029 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1030 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1036 foreach ($this->tva as $tvakey => $tvaval) {
1038 $this->atleastoneratenotnull++;
1041 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1044 if (preg_match(
'/\*/', $tvakey)) {
1045 $tvakey = str_replace(
'*',
'', $tvakey);
1046 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1048 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code).
' ';
1049 $totalvat .=
vatrate($tvakey, 1).$tvacompl;
1050 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1052 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1053 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1060 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
1061 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1065 foreach ($localtax_rate as $tvakey => $tvaval) {
1070 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1073 if (preg_match(
'/\*/', $tvakey)) {
1074 $tvakey = str_replace(
'*',
'', $tvakey);
1075 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1077 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).
' ';
1079 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1080 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1081 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1082 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1090 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1091 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1095 foreach ($localtax_rate as $tvakey => $tvaval) {
1101 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1104 if (preg_match(
'/\*/', $tvakey)) {
1105 $tvakey = str_replace(
'*',
'', $tvakey);
1106 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1108 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).
' ';
1110 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1111 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1113 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1114 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1122 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1123 $pdf->SetTextColor(0, 0, 60);
1124 $pdf->SetFillColor(224, 224, 224);
1125 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalTTC"), $useborder,
'L', 1);
1127 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1128 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_ttc, 0, $outputlangs), $useborder,
'R', 1);
1132 $pdf->SetTextColor(0, 0, 0);
1134 $resteapayer = $object->total_ttc - $deja_regle;
1135 if (!empty($object->paye)) {
1139 if ($deja_regle > 0) {
1142 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1143 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"AlreadyPaid"), 0,
'L', 0);
1145 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1146 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle, 0, $outputlangs), 0,
'R', 0);
1165 $pdf->SetTextColor(0, 0, 60);
1166 $pdf->SetFillColor(224, 224, 224);
1167 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1168 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay"), $useborder,
'L', 1);
1170 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1171 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
1173 $pdf->SetFont(
'',
'', $default_font_size - 1);
1174 $pdf->SetTextColor(0, 0, 0);
1178 return ($tab2_top + ($tab2_hl * $index));
1195 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency =
'')
1205 $currency = !empty($currency) ? $currency : $conf->currency;
1209 $pdf->SetTextColor(0, 0, 0);
1210 $pdf->SetFont(
'',
'', $default_font_size - 2);
1212 if (empty($hidetop)) {
1213 $titre = $outputlangs->transnoentities(
"AmountInCurrency", $outputlangs->transnoentitiesnoconv(
"Currency".$currency));
1214 $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
1215 $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
1218 if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
1219 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5,
'F',
null, explode(
',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
1223 $pdf->SetDrawColor(128, 128, 128);
1224 $pdf->SetFont(
'',
'', $default_font_size - 1);
1227 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
1229 if (empty($hidetop)) {
1230 $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
1232 $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
1233 $pdf->MultiCell(108, 2, $outputlangs->transnoentities(
"Designation"),
'',
'L');
1236 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
1237 $pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height);
1239 if (empty($hidetop)) {
1240 $pdf->SetXY($this->posxtva - 5, $tab_top + 1);
1241 $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities(
"VAT"),
'',
'C');
1245 $pdf->line($this->posxup - 3, $tab_top, $this->posxup - 3, $tab_top + $tab_height);
1246 if (empty($hidetop)) {
1247 $pdf->SetXY($this->posxup - 1, $tab_top + 1);
1248 $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities(
"PriceUHT"),
'',
'C');
1251 $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
1252 if (empty($hidetop)) {
1253 $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
1254 $pdf->MultiCell($this->posxunit - $this->posxqty - 1, 2, $outputlangs->transnoentities(
"Qty"),
'',
'C');
1257 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
1258 $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
1259 if (empty($hidetop)) {
1260 $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
1261 $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities(
"Unit"),
'',
'C');
1265 $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
1266 if (empty($hidetop)) {
1267 if ($this->atleastonediscount) {
1268 $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
1269 $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities(
"ReductionShort"),
'',
'C');
1272 if ($this->atleastonediscount) {
1273 $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
1275 if (empty($hidetop)) {
1276 $pdf->SetXY($this->postotalht - 1, $tab_top + 1);
1277 $pdf->MultiCell(30, 2, $outputlangs->transnoentities(
"TotalHT"),
'',
'C');
1291 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
1293 global $conf, $langs;
1296 $outputlangs->loadLangs(array(
"main",
"bills",
"supplier_proposal",
"companies"));
1302 $pdf->SetTextColor(0, 0, 60);
1303 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1305 $posy = $this->marge_haute;
1306 $posx = $this->page_largeur - $this->marge_droite - 100;
1308 $pdf->SetXY($this->marge_gauche, $posy);
1311 if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) {
1312 if ($this->emetteur->logo) {
1313 $logodir = $conf->mycompany->dir_output;
1314 if (!empty($conf->mycompany->multidir_output[$object->entity])) {
1315 $logodir = $conf->mycompany->multidir_output[$object->entity];
1317 if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) {
1318 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
1320 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
1322 if (is_readable($logo)) {
1324 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
1326 $pdf->SetTextColor(200, 0, 0);
1327 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1328 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
1329 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
1332 $text = $this->emetteur->name;
1333 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
1337 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1338 $pdf->SetXY($posx, $posy);
1339 $pdf->SetTextColor(0, 0, 60);
1340 $title = $outputlangs->transnoentities(
"CommercialAsk");
1341 $pdf->MultiCell(100, 4, $title,
'',
'R');
1343 $pdf->SetFont(
'',
'B', $default_font_size);
1346 $pdf->SetXY($posx, $posy);
1347 $pdf->SetTextColor(0, 0, 60);
1348 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
1351 $pdf->SetFont(
'',
'', $default_font_size - 2);
1353 if ($object->ref_client) {
1355 $pdf->SetXY($posx, $posy);
1356 $pdf->SetTextColor(0, 0, 60);
1357 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".
dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65),
'',
'R');
1366 if ($object->thirdparty->code_fournisseur) {
1368 $pdf->SetXY($posx, $posy);
1369 $pdf->SetTextColor(0, 0, 60);
1370 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"SupplierCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_fournisseur),
'',
'R');
1374 if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) {
1375 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1376 if (count($arrayidcontact) > 0) {
1377 $usertmp =
new User($this->
db);
1378 $usertmp->fetch($arrayidcontact[0]);
1380 $pdf->SetXY($posx, $posy);
1381 $pdf->SetTextColor(0, 0, 60);
1382 $pdf->MultiCell(100, 3, $langs->trans(
"BuyerName").
" : ".$usertmp->getFullName($langs),
'',
'R');
1390 $current_y = $pdf->getY();
1391 $posy =
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3,
'R', $default_font_size);
1392 if ($current_y < $pdf->getY()) {
1393 $top_shift = $pdf->getY() - $current_y;
1398 $carac_emetteur =
'';
1400 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1401 if (count($arrayidcontact) > 0) {
1402 $object->fetch_user($arrayidcontact[0]);
1403 $labelbeforecontactname = ($outputlangs->transnoentities(
"FromContactName") !=
'FromContactName' ? $outputlangs->transnoentities(
"FromContactName") : $outputlangs->transnoentities(
"Name"));
1404 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$labelbeforecontactname.
": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
1407 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
1410 $posy = 42 + $top_shift;
1411 $posx = $this->marge_gauche;
1412 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
1413 $posx = $this->page_largeur - $this->marge_droite - 80;
1418 $pdf->SetTextColor(0, 0, 0);
1419 $pdf->SetFont(
'',
'', $default_font_size - 2);
1420 $pdf->SetXY($posx, $posy - 5);
1421 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"BillFrom"), 0,
'L');
1422 $pdf->SetXY($posx, $posy);
1423 $pdf->SetFillColor(230, 230, 230);
1424 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
1425 $pdf->SetTextColor(0, 0, 60);
1428 $pdf->SetXY($posx + 2, $posy + 3);
1429 $pdf->SetFont(
'',
'B', $default_font_size);
1430 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
1431 $posy = $pdf->getY();
1434 $pdf->SetXY($posx + 2, $posy);
1435 $pdf->SetFont(
'',
'', $default_font_size - 1);
1436 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
1440 $usecontact =
false;
1441 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
1442 if (count($arrayidcontact) > 0) {
1444 $result = $object->fetch_contact($arrayidcontact[0]);
1448 if (!empty($usecontact)) {
1449 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
1450 $socname = $object->contact;
1452 $socname = $object->thirdparty;
1455 $socname = $object->thirdparty;
1460 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact :
''), $usecontact,
'target', $object);
1464 if ($this->page_largeur < 210) {
1467 $posy = 42 + $top_shift;
1468 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1469 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
1470 $posx = $this->marge_gauche;
1474 $pdf->SetTextColor(0, 0, 0);
1475 $pdf->SetFont(
'',
'', $default_font_size - 2);
1476 $pdf->SetXY($posx + 2, $posy - 5);
1477 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillTo"), 0,
'L');
1478 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1481 $pdf->SetXY($posx + 2, $posy + 3);
1482 $pdf->SetFont(
'',
'B', $default_font_size);
1483 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
1486 $pdf->SetFont(
'',
'', $default_font_size - 1);
1487 $pdf->SetXY($posx + 2, $posy + 4 + (
dol_nboflines_bis($carac_client_name, 50) * 4));
1488 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
1491 $pdf->SetTextColor(0, 0, 0);
1505 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
1508 $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
1509 return pdf_pagefoot($pdf, $outputlangs,
'SUPPLIER_PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext, $this->page_largeur, $this->watermark);