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(7, 0);
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);
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;
172 $this->posxqty = 135;
173 $this->posxunit = 151;
176 $this->posxqty = 145;
177 $this->posxunit = 162;
180 $this->posxpicture = $this->posxup - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH);
181 if ($this->page_largeur < 210) {
182 $this->posxpicture -= 20;
184 $this->posxqty -= 20;
185 $this->posxunit -= 20;
186 $this->posxdiscount -= 20;
187 $this->postotalht -= 20;
190 $this->tva = array();
191 $this->tva_array = array();
192 $this->localtax1 = array();
193 $this->localtax2 = array();
194 $this->atleastoneratenotnull = 0;
195 $this->atleastonediscount = 0;
210 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
213 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
215 if (!is_object($outputlangs)) {
216 $outputlangs = $langs;
219 if (!empty($conf->global->MAIN_USE_FPDF)) {
220 $outputlangs->charset_output =
'ISO-8859-1';
224 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"supplier_proposal"));
227 if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK))) {
228 $this->watermark = $conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK;
231 $nblines = count($object->lines);
234 $realpatharray = array();
235 if (!empty($conf->global->MAIN_GENERATE_SUPPLIER_PROPOSAL_WITH_PICTURE)) {
236 for ($i = 0; $i < $nblines; $i++) {
237 if (empty($object->lines[$i]->fk_product)) {
242 $objphoto->fetch($object->lines[$i]->fk_product);
245 $pdir =
get_exdir($object->lines[$i]->fk_product, 2, 0, 0, $objphoto,
'product').$object->lines[$i]->fk_product.
"/photos/";
246 $dir = $conf->product->dir_output.
'/'.$pdir;
248 $pdir =
get_exdir(0, 0, 0, 0, $objphoto,
'product');
249 $dir = $conf->product->dir_output.
'/'.$pdir;
253 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
255 if ($obj[
'photo_vignette']) {
256 $filename = $obj[
'photo_vignette'];
258 $filename = $obj[
'photo'];
261 $filename = $obj[
'photo'];
263 $realpath = $dir.$filename;
268 $realpatharray[$i] = $realpath;
272 if (count($realpatharray) == 0) {
273 $this->posxpicture = $this->posxup;
276 if ($conf->supplier_proposal->dir_output) {
277 $object->fetch_thirdparty();
282 if ($object->specimen) {
283 $dir = $conf->supplier_proposal->dir_output;
284 $file = $dir.
"/SPECIMEN.pdf";
287 $dir = $conf->supplier_proposal->dir_output.
"/".$objectref;
288 $file = $dir.
"/".$objectref.
".pdf";
291 if (!file_exists($dir)) {
293 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
298 if (file_exists($dir)) {
300 if (!is_object($hookmanager)) {
301 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
304 $hookmanager->initHooks(array(
'pdfgeneration'));
305 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
307 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
312 $heightforinfotot = 50;
313 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
314 $heightforfooter = $this->marge_basse + 8;
315 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
316 $heightforfooter += 6;
318 $pdf->SetAutoPageBreak(1, 0);
320 if (class_exists(
'TCPDF')) {
321 $pdf->setPrintHeader(
false);
322 $pdf->setPrintFooter(
false);
326 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
327 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
328 $tplidx = $pdf->importPage(1);
333 $pdf->SetDrawColor(128, 128, 128);
335 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
336 $pdf->SetSubject($outputlangs->transnoentities(
"CommercialAsk"));
337 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
338 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
339 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"CommercialAsk").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
341 $pdf->SetCompression(
false);
344 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
347 for ($i = 0; $i < $nblines; $i++) {
348 if ($object->lines[$i]->remise_percent) {
349 $this->atleastonediscount++;
352 if (empty($this->atleastonediscount)) {
353 $delta = ($this->postotalht - $this->posxdiscount);
354 $this->posxpicture += $delta;
355 $this->posxup += $delta;
356 $this->posxqty += $delta;
357 $this->posxunit += $delta;
358 $this->posxdiscount += $delta;
364 if (!empty($tplidx)) {
365 $pdf->useTemplate($tplidx);
368 $top_shift = $this->
_pagehead($pdf, $object, 1, $outputlangs);
369 $pdf->SetFont(
'',
'', $default_font_size - 1);
370 $pdf->MultiCell(0, 3,
'');
371 $pdf->SetTextColor(0, 0, 0);
373 $tab_top = 90 + $top_shift;
374 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
377 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
378 if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE)) {
380 if (is_object($object->thirdparty)) {
381 $salereparray = $object->thirdparty->getSalesRepresentatives($user);
382 $salerepobj =
new User($this->
db);
383 $salerepobj->fetch($salereparray[0][
'id']);
384 if (!empty($salerepobj->signature)) {
385 $notetoshow =
dol_concatdesc($notetoshow, $salerepobj->signature);
397 $pdf->SetFont(
'',
'', $default_font_size - 1);
398 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($notetoshow), 0, 1);
399 $nexY = $pdf->GetY();
400 $height_note = $nexY - $tab_top;
403 $pdf->SetDrawColor(192, 192, 192);
404 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
406 $tab_top = $nexY + 6;
409 $iniY = $tab_top + 7;
410 $curY = $tab_top + 7;
411 $nexY = $tab_top + 7;
414 for ($i = 0; $i < $nblines; $i++) {
416 $pdf->SetFont(
'',
'', $default_font_size - 1);
417 $pdf->SetTextColor(0, 0, 0);
420 $imglinesize = array();
421 if (!empty($realpatharray[$i])) {
425 $pdf->setTopMargin($tab_top_newpage);
426 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
427 $pageposbefore = $pdf->getPage();
429 $showpricebeforepagebreak = 1;
431 $posYAfterDescription = 0;
434 if (!empty($imglinesize[
'width']) && !empty($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
435 $pdf->AddPage(
'',
'',
true);
436 if (!empty($tplidx)) {
437 $pdf->useTemplate($tplidx);
440 $this->
_pagehead($pdf, $object, 0, $outputlangs);
442 $pdf->setPage($pageposbefore + 1);
444 $curY = $tab_top_newpage;
447 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
448 $showpricebeforepagebreak = 1;
450 $showpricebeforepagebreak = 0;
454 if (!empty($imglinesize[
'width']) && !empty($imglinesize[
'height'])) {
455 $curX = $this->posxpicture - 1;
456 $pdf->Image($realpatharray[$i], $curX + (($this->posxup - $this->posxpicture - $imglinesize[
'width']) / 2), $curY, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
458 $posYAfterImage = $curY + $imglinesize[
'height'];
462 $curX = $this->posxdesc - 1;
464 $pdf->startTransaction();
465 if ($posYAfterImage > 0) {
466 $descWidth = $this->posxpicture - $curX;
468 $descWidth = $this->posxup - $curX;
470 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1);
472 $pageposafter = $pdf->getPage();
473 if ($pageposafter > $pageposbefore) {
474 $pdf->rollbackTransaction(
true);
475 $pageposafter = $pageposbefore;
477 $pdf->setPageOrientation(
'', 1, $heightforfooter);
478 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1);
480 $pageposafter = $pdf->getPage();
481 $posyafter = $pdf->GetY();
483 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
484 if ($i == ($nblines - 1)) {
485 $pdf->AddPage(
'',
'',
true);
486 if (!empty($tplidx)) {
487 $pdf->useTemplate($tplidx);
490 $this->
_pagehead($pdf, $object, 0, $outputlangs);
492 $pdf->setPage($pageposafter + 1);
497 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
498 $showpricebeforepagebreak = 1;
500 $showpricebeforepagebreak = 0;
505 $pdf->commitTransaction();
507 $posYAfterDescription = $pdf->GetY();
509 $nexY = $pdf->GetY();
510 $pageposafter = $pdf->getPage();
512 $pdf->setPage($pageposbefore);
513 $pdf->setTopMargin($this->marge_haute);
514 $pdf->setPageOrientation(
'', 1, 0);
517 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
518 $pdf->setPage($pageposafter);
519 $curY = $tab_top_newpage;
522 $pdf->SetFont(
'',
'', $default_font_size - 1);
526 $pdf->SetXY($this->posxqty, $curY);
527 $pdf->MultiCell($this->posxunit - $this->posxqty - 0.8, 4, $qty, 0,
'R');
531 $unit =
pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
532 $pdf->SetXY($this->posxunit, $curY);
533 $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0,
'L');
553 if (
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) {
554 $tvaligne = $object->lines[$i]->multicurrency_total_tva;
556 $tvaligne = $object->lines[$i]->total_tva;
559 $localtax1ligne = $object->lines[$i]->total_localtax1;
560 $localtax2ligne = $object->lines[$i]->total_localtax2;
561 $localtax1_rate = $object->lines[$i]->localtax1_tx;
562 $localtax2_rate = $object->lines[$i]->localtax2_tx;
563 $localtax1_type = $object->lines[$i]->localtax1_type;
564 $localtax2_type = $object->lines[$i]->localtax2_type;
566 if ($object->remise_percent) {
567 $tvaligne -= ($tvaligne * $object->remise_percent) / 100;
569 if ($object->remise_percent) {
570 $localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100;
572 if ($object->remise_percent) {
573 $localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100;
576 $vatrate = (string) $object->lines[$i]->tva_tx;
579 if ((!isset($localtax1_type) || $localtax1_type ==
'' || !isset($localtax2_type) || $localtax2_type ==
'')
580 && (!empty($localtax1_rate) || !empty($localtax2_rate))) {
582 $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] :
'';
583 $localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] :
'';
587 if ($localtax1_type && $localtax1ligne != 0) {
588 $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
590 if ($localtax2_type && $localtax2ligne != 0) {
591 $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
594 if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
599 if (!isset($this->tva[$vatrate])) {
600 $this->tva[$vatrate] = 0;
602 $this->tva[$vatrate] += $tvaligne;
603 $vatcode = $object->lines[$i]->vat_src_code;
604 if (empty($this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'])) {
605 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] = 0;
607 $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')] = array(
'vatrate'=>$vatrate,
'vatcode'=>$vatcode,
'amount'=> $this->tva_array[$vatrate.($vatcode ?
' ('.$vatcode.
')' :
'')][
'amount'] + $tvaligne);
609 if ($posYAfterImage > $posYAfterDescription) {
610 $nexY = $posYAfterImage;
614 if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
615 $pdf->setPage($pageposafter);
616 $pdf->SetLineStyle(array(
'dash'=>
'1,1',
'color'=>array(80, 80, 80)));
618 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
619 $pdf->SetLineStyle(array(
'dash'=>0));
625 while ($pagenb < $pageposafter) {
626 $pdf->setPage($pagenb);
628 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
630 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
632 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
634 $pdf->setPage($pagenb);
635 $pdf->setPageOrientation(
'', 1, 0);
637 $this->
_pagehead($pdf, $object, 0, $outputlangs);
639 if (!empty($tplidx)) {
640 $pdf->useTemplate($tplidx);
643 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
645 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
647 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
649 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
652 if (!empty($tplidx)) {
653 $pdf->useTemplate($tplidx);
657 $this->
_pagehead($pdf, $object, 0, $outputlangs);
664 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
665 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
667 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
668 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
672 $posy = $this->
_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
686 $this->
_pagefoot($pdf, $object, $outputlangs);
687 if (method_exists($pdf,
'AliasNbPages')) {
688 $pdf->AliasNbPages();
693 $pdf->Output($file,
'F');
696 $hookmanager->initHooks(array(
'pdfgeneration'));
697 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
699 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
701 $this->error = $hookmanager->error;
702 $this->errors = $hookmanager->errors;
705 if (!empty($conf->global->MAIN_UMASK)) {
706 @chmod($file, octdec($conf->global->MAIN_UMASK));
709 $this->result = array(
'fullpath'=>$file);
713 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
717 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"SUPPLIER_PROPOSAL_OUTPUTDIR");
755 $pdf->SetFont(
'',
'', $default_font_size - 1);
760 if (!empty($object->delivery_date)) {
761 $outputlangs->load(
"sendings");
762 $pdf->SetFont(
'',
'B', $default_font_size - 2);
763 $pdf->SetXY($this->marge_gauche, $posy);
764 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
765 $pdf->MultiCell(80, 4, $titre, 0,
'L');
766 $pdf->SetFont(
'',
'', $default_font_size - 2);
767 $pdf->SetXY($posxval, $posy);
768 $dlp =
dol_print_date($object->delivery_date,
"daytext",
false, $outputlangs,
true);
769 $pdf->MultiCell(80, 4, $dlp, 0,
'L');
771 $posy = $pdf->GetY() + 1;
773 $outputlangs->load(
"sendings");
774 $pdf->SetFont(
'',
'B', $default_font_size - 2);
775 $pdf->SetXY($this->marge_gauche, $posy);
776 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
777 $pdf->MultiCell(80, 4, $titre, 0,
'L');
778 $pdf->SetFont(
'',
'', $default_font_size - 2);
779 $pdf->SetXY($posxval, $posy);
781 $pdf->MultiCell(80, 4,
'', 0,
'L');
783 $posy = $pdf->GetY() + 1;
803 if (empty($conf->global->SUPPLIER_PROPOSAL_PDF_HIDE_PAYMENTTERMCOND) && ($object->cond_reglement_code || $object->cond_reglement)) {
804 $pdf->SetFont(
'',
'B', $default_font_size - 2);
805 $pdf->SetXY($this->marge_gauche, $posy);
806 $titre = $outputlangs->transnoentities(
"PaymentConditions").
':';
807 $pdf->MultiCell(80, 4, $titre, 0,
'L');
809 $pdf->SetFont(
'',
'', $default_font_size - 2);
810 $pdf->SetXY($posxval, $posy);
811 $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);
812 $lib_condition_paiement = str_replace(
'\n',
"\n", $lib_condition_paiement);
813 $pdf->MultiCell(80, 4, $lib_condition_paiement, 0,
'L');
815 $posy = $pdf->GetY() + 3;
818 if (!empty($conf->global->SUPPLIER_PROPOSAL_PDF_SHOW_PAYMENTTERMMODE)) {
820 if ($object->mode_reglement_code
821 && $object->mode_reglement_code !=
'CHQ'
822 && $object->mode_reglement_code !=
'VIR') {
823 $pdf->SetFont(
'',
'B', $default_font_size - 2);
824 $pdf->SetXY($this->marge_gauche, $posy - 2);
825 $titre = $outputlangs->transnoentities(
"PaymentMode").
':';
826 $pdf->MultiCell(80, 5, $titre, 0,
'L');
827 $pdf->SetFont(
'',
'', $default_font_size - 2);
828 $pdf->SetXY($posxval, $posy - 2);
829 $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);
830 $pdf->MultiCell(80, 5, $lib_mode_reg, 0,
'L');
832 $posy = $pdf->GetY() + 2;
836 if (empty($object->mode_reglement_code) || $object->mode_reglement_code ==
'CHQ') {
838 if (!empty($conf->global->FACTURE_CHQ_NUMBER)) {
839 $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
841 if ($conf->global->FACTURE_CHQ_NUMBER > 0) {
843 $account->fetch($conf->global->FACTURE_CHQ_NUMBER);
845 $pdf->SetXY($this->marge_gauche, $posy);
846 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
847 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $account->proprio), 0,
'L', 0);
848 $posy = $pdf->GetY() + 1;
850 if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) {
851 $pdf->SetXY($this->marge_gauche, $posy);
852 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
853 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0,
'L', 0);
854 $posy = $pdf->GetY() + 2;
857 if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
858 $pdf->SetXY($this->marge_gauche, $posy);
859 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
860 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $this->emetteur->name), 0,
'L', 0);
861 $posy = $pdf->GetY() + 1;
863 if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS)) {
864 $pdf->SetXY($this->marge_gauche, $posy);
865 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
866 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0,
'L', 0);
867 $posy = $pdf->GetY() + 2;
874 if (empty($object->mode_reglement_code) || $object->mode_reglement_code ==
'VIR') {
875 if (!empty($object->fk_bank) ||
getDolGlobalInt(
'FACTURE_RIB_NUMBER')) {
876 $bankid = (empty($object->fk_bank) ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_bank);
878 $account->fetch($bankid);
880 $curx = $this->marge_gauche;
883 $posy =
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
905 protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
908 global $conf, $mysoc;
913 $pdf->SetFont(
'',
'', $default_font_size - 1);
918 if ($this->page_largeur < 210) {
921 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
927 $pdf->SetFillColor(255, 255, 255);
928 $pdf->SetXY($col1x, $tab2_top);
929 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalHT"), 0,
'L', 1);
931 $total_ht = ((
isModEnabled(
"multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
932 $pdf->SetXY($col2x, $tab2_top);
933 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0,
'R', 1);
936 $pdf->SetFillColor(248, 248, 248);
938 $this->atleastoneratenotnull = 0;
939 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
940 $tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva[
'0.000']) && is_float($this->tva[
'0.000'])) ?
true :
false);
941 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull) {
947 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
948 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
952 foreach ($localtax_rate as $tvakey => $tvaval) {
957 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
960 if (preg_match(
'/\*/', $tvakey)) {
961 $tvakey = str_replace(
'*',
'', $tvakey);
962 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
964 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).
' ';
965 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
966 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
968 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
969 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
977 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
978 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
982 foreach ($localtax_rate as $tvakey => $tvaval) {
989 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
992 if (preg_match(
'/\*/', $tvakey)) {
993 $tvakey = str_replace(
'*',
'', $tvakey);
994 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
996 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).
' ';
997 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
998 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1000 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1001 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1007 foreach ($this->tva as $tvakey => $tvaval) {
1009 $this->atleastoneratenotnull++;
1012 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1015 if (preg_match(
'/\*/', $tvakey)) {
1016 $tvakey = str_replace(
'*',
'', $tvakey);
1017 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1019 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code).
' ';
1020 $totalvat .=
vatrate($tvakey, 1).$tvacompl;
1021 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1023 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1024 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1031 foreach ($this->localtax1 as $localtax_type => $localtax_rate) {
1032 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1036 foreach ($localtax_rate as $tvakey => $tvaval) {
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(
"TotalLT1", $mysoc->country_code).
' ';
1050 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1051 $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);
1061 foreach ($this->localtax2 as $localtax_type => $localtax_rate) {
1062 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1066 foreach ($localtax_rate as $tvakey => $tvaval) {
1072 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1075 if (preg_match(
'/\*/', $tvakey)) {
1076 $tvakey = str_replace(
'*',
'', $tvakey);
1077 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1079 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).
' ';
1081 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1082 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1084 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1085 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1093 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1094 $pdf->SetTextColor(0, 0, 60);
1095 $pdf->SetFillColor(224, 224, 224);
1096 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalTTC"), $useborder,
'L', 1);
1098 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1099 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_ttc, 0, $outputlangs), $useborder,
'R', 1);
1103 $pdf->SetTextColor(0, 0, 0);
1105 $resteapayer = $object->total_ttc - $deja_regle;
1106 if (!empty($object->paye)) {
1110 if ($deja_regle > 0) {
1113 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1114 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"AlreadyPaid"), 0,
'L', 0);
1116 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1117 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle, 0, $outputlangs), 0,
'R', 0);
1120 $pdf->SetTextColor(0, 0, 60);
1121 $pdf->SetFillColor(224, 224, 224);
1122 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1123 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay"), $useborder,
'L', 1);
1125 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1126 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
1128 $pdf->SetFont(
'',
'', $default_font_size - 1);
1129 $pdf->SetTextColor(0, 0, 0);
1133 return ($tab2_top + ($tab2_hl * $index));
1150 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency =
'')
1160 $currency = !empty($currency) ? $currency : $conf->currency;
1164 $pdf->SetTextColor(0, 0, 0);
1165 $pdf->SetFont(
'',
'', $default_font_size - 2);
1167 if (empty($hidetop)) {
1168 $titre = $outputlangs->transnoentities(
"AmountInCurrency", $outputlangs->transnoentitiesnoconv(
"Currency".$currency));
1169 $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
1170 $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
1173 if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
1174 $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));
1178 $pdf->SetDrawColor(128, 128, 128);
1179 $pdf->SetFont(
'',
'', $default_font_size - 1);
1182 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
1184 if (empty($hidetop)) {
1185 $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
1187 $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
1188 $pdf->MultiCell(108, 2, $outputlangs->transnoentities(
"Designation"),
'',
'L');
1191 $pdf->line($this->posxup + 1, $tab_top, $this->posxup + 1, $tab_top + $tab_height);
1192 if (empty($hidetop)) {
1193 $pdf->SetXY($this->posxup - 1, $tab_top + 1);
1194 $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities(
"PriceUHT"),
'',
'C');
1197 $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
1198 if (empty($hidetop)) {
1199 $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
1200 $pdf->MultiCell($this->posxunit - $this->posxqty - 1, 2, $outputlangs->transnoentities(
"Qty"),
'',
'C');
1204 $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
1205 if (empty($hidetop)) {
1206 $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
1207 $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities(
"Unit"),
'',
'C');
1211 $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
1212 if (empty($hidetop)) {
1213 if ($this->atleastonediscount) {
1214 $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
1215 $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities(
"ReductionShort"),
'',
'C');
1218 if ($this->atleastonediscount) {
1219 $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
1221 if (empty($hidetop)) {
1222 $pdf->SetXY($this->postotalht - 1, $tab_top + 1);
1223 $pdf->MultiCell(30, 2, $outputlangs->transnoentities(
"TotalHT"),
'',
'C');
1237 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
1239 global $conf, $langs;
1242 $outputlangs->loadLangs(array(
"main",
"bills",
"supplier_proposal",
"companies"));
1248 $pdf->SetTextColor(0, 0, 60);
1249 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1251 $posy = $this->marge_haute;
1252 $posx = $this->page_largeur - $this->marge_droite - 100;
1254 $pdf->SetXY($this->marge_gauche, $posy);
1258 if ($this->emetteur->logo) {
1259 $logodir = $conf->mycompany->dir_output;
1260 if (!empty($conf->mycompany->multidir_output[$object->entity])) {
1261 $logodir = $conf->mycompany->multidir_output[$object->entity];
1264 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
1266 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
1268 if (is_readable($logo)) {
1270 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
1272 $pdf->SetTextColor(200, 0, 0);
1273 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1274 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
1275 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
1278 $text = $this->emetteur->name;
1279 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0);
1283 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1284 $pdf->SetXY($posx, $posy);
1285 $pdf->SetTextColor(0, 0, 60);
1286 $title = $outputlangs->transnoentities(
"CommercialAsk");
1287 $pdf->MultiCell(100, 4, $title,
'',
'R');
1289 $pdf->SetFont(
'',
'B', $default_font_size);
1292 $pdf->SetXY($posx, $posy);
1293 $pdf->SetTextColor(0, 0, 60);
1294 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
1297 $pdf->SetFont(
'',
'', $default_font_size - 2);
1299 if ($object->ref_fourn) {
1301 $pdf->SetXY($posx, $posy);
1302 $pdf->SetTextColor(0, 0, 60);
1303 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"RefSupplier").
" : ".
dol_trunc($outputlangs->convToOutputCharset($object->ref_fourn), 65),
'',
'R');
1306 if ($object->thirdparty->code_fournisseur) {
1308 $pdf->SetXY($posx, $posy);
1309 $pdf->SetTextColor(0, 0, 60);
1310 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"SupplierCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_fournisseur),
'',
'R');
1314 if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) {
1315 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1316 if (count($arrayidcontact) > 0) {
1317 $usertmp =
new User($this->
db);
1318 $usertmp->fetch($arrayidcontact[0]);
1320 $pdf->SetXY($posx, $posy);
1321 $pdf->SetTextColor(0, 0, 60);
1322 $pdf->MultiCell(100, 3, $langs->trans(
"BuyerName").
" : ".$usertmp->getFullName($langs),
'',
'R');
1330 $current_y = $pdf->getY();
1331 $posy =
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3,
'R', $default_font_size);
1332 if ($current_y < $pdf->getY()) {
1333 $top_shift = $pdf->getY() - $current_y;
1338 $carac_emetteur =
'';
1340 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1341 if (count($arrayidcontact) > 0) {
1342 $object->fetch_user($arrayidcontact[0]);
1343 $labelbeforecontactname = ($outputlangs->transnoentities(
"FromContactName") !=
'FromContactName' ? $outputlangs->transnoentities(
"FromContactName") : $outputlangs->transnoentities(
"Name"));
1344 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$labelbeforecontactname.
": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
1347 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
1350 $posy = 42 + $top_shift;
1351 $posx = $this->marge_gauche;
1352 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
1353 $posx = $this->page_largeur - $this->marge_droite - 80;
1358 $pdf->SetTextColor(0, 0, 0);
1359 $pdf->SetFont(
'',
'', $default_font_size - 2);
1360 $pdf->SetXY($posx, $posy - 5);
1361 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"BillFrom"), 0,
'L');
1362 $pdf->SetXY($posx, $posy);
1363 $pdf->SetFillColor(230, 230, 230);
1364 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
1365 $pdf->SetTextColor(0, 0, 60);
1368 $pdf->SetXY($posx + 2, $posy + 3);
1369 $pdf->SetFont(
'',
'B', $default_font_size);
1370 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
1371 $posy = $pdf->getY();
1374 $pdf->SetXY($posx + 2, $posy);
1375 $pdf->SetFont(
'',
'', $default_font_size - 1);
1376 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
1380 $usecontact =
false;
1381 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
1382 if (count($arrayidcontact) > 0) {
1384 $result = $object->fetch_contact($arrayidcontact[0]);
1388 if (!empty($usecontact)) {
1389 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)))) {
1390 $socname = $object->contact;
1392 $socname = $object->thirdparty;
1395 $socname = $object->thirdparty;
1400 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact :
''), $usecontact,
'target', $object);
1404 if ($this->page_largeur < 210) {
1407 $posy = 42 + $top_shift;
1408 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1409 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
1410 $posx = $this->marge_gauche;
1414 $pdf->SetTextColor(0, 0, 0);
1415 $pdf->SetFont(
'',
'', $default_font_size - 2);
1416 $pdf->SetXY($posx + 2, $posy - 5);
1417 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillTo"), 0,
'L');
1418 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1421 $pdf->SetXY($posx + 2, $posy + 3);
1422 $pdf->SetFont(
'',
'B', $default_font_size);
1423 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
1426 $pdf->SetFont(
'',
'', $default_font_size - 1);
1427 $pdf->SetXY($posx + 2, $posy + 4 + (
dol_nboflines_bis($carac_client_name, 50) * 4));
1428 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
1431 $pdf->SetTextColor(0, 0, 0);
1445 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
1447 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
1448 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);
Class to manage bank accounts.
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
Classe mere des modeles de propale.
Class to manage products or services.
Class to manage Dolibarr users.
Class to generate PDF supplier proposal Aurore.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
__construct($db)
Constructor.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='')
Show table for lines.
_tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
Show total to pay.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
_tableau_versements(&$pdf, $object, $posy, $outputlangs)
Show payments table.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!function_exists('dolEscapeXML')) convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
Get type and rate of localtaxes for a particular vat rate/country of a thirdparty.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_nboflines_bis($text, $maxlinesize=0, $charset='UTF-8')
Return nb of lines of a formated text with and (WARNING: string must not have mixed and br sepa...
if(!defined( 'CSRFCHECK_WITH_TOKEN'))
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdf_getFormat(Translate $outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0)
Output line description into PDF.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='')
Show footer of page for PDF generation.
pdf_getlineunit($object, $i, $outputlangs, $hidedetails=0, $hookmanager=false)
Return line unit.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber=0, $default_font_size=10)
Show bank informations for PDF generation.
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null)
Return a string with full address formated for output on documents.
pdf_getlineqty($object, $i, $outputlangs, $hidedetails=0)
Return line quantity.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.