| Total Complexity | 176 |
| Total Lines | 1323 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like pdf_muscadet often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use pdf_muscadet, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 42 | class pdf_muscadet extends ModelePDFSuppliersOrders |
||
| 43 | { |
||
| 44 | /** |
||
| 45 | * @var DoliDb Database handler |
||
| 46 | */ |
||
| 47 | public $db; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @var string model name |
||
| 51 | */ |
||
| 52 | public $name; |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @var string model description (short text) |
||
| 56 | */ |
||
| 57 | public $description; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @var string document type |
||
| 61 | */ |
||
| 62 | public $type; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @var array Minimum version of PHP required by module. |
||
| 66 | * e.g.: PHP ≥ 5.5 = array(5, 5) |
||
| 67 | */ |
||
| 68 | public $phpmin = array(5, 5); |
||
| 69 | |||
| 70 | /** |
||
| 71 | * Dolibarr version of the loaded document |
||
| 72 | * @var string |
||
| 73 | */ |
||
| 74 | public $version = 'dolibarr'; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var int page_largeur |
||
| 78 | */ |
||
| 79 | public $page_largeur; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @var int page_hauteur |
||
| 83 | */ |
||
| 84 | public $page_hauteur; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @var array format |
||
| 88 | */ |
||
| 89 | public $format; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @var int marge_gauche |
||
| 93 | */ |
||
| 94 | public $marge_gauche; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @var int marge_droite |
||
| 98 | */ |
||
| 99 | public $marge_droite; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @var int marge_haute |
||
| 103 | */ |
||
| 104 | public $marge_haute; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @var int marge_basse |
||
| 108 | */ |
||
| 109 | public $marge_basse; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * Issuer |
||
| 113 | * @var Societe object that emits |
||
| 114 | */ |
||
| 115 | public $emetteur; |
||
| 116 | |||
| 117 | |||
| 118 | /** |
||
| 119 | * Constructor |
||
| 120 | * |
||
| 121 | * @param DoliDB $db Database handler |
||
| 122 | */ |
||
| 123 | public function __construct($db) |
||
| 124 | { |
||
| 125 | global $conf, $langs, $mysoc; |
||
| 126 | |||
| 127 | // Load translation files required by the page |
||
| 128 | $langs->loadLangs(array("main", "bills")); |
||
| 129 | |||
| 130 | $this->db = $db; |
||
| 131 | $this->name = "muscadet"; |
||
| 132 | $this->description = $langs->trans('SuppliersCommandModel'); |
||
| 133 | |||
| 134 | // Dimension page pour format A4 |
||
| 135 | $this->type = 'pdf'; |
||
| 136 | $formatarray=pdf_getFormat(); |
||
| 137 | $this->page_largeur = $formatarray['width']; |
||
| 138 | $this->page_hauteur = $formatarray['height']; |
||
| 139 | $this->format = array($this->page_largeur,$this->page_hauteur); |
||
| 140 | $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; |
||
| 141 | $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; |
||
| 142 | $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10; |
||
| 143 | $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10; |
||
| 144 | |||
| 145 | $this->option_logo = 1; // Affiche logo |
||
| 146 | $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION |
||
| 147 | $this->option_modereg = 1; // Affiche mode reglement |
||
| 148 | $this->option_condreg = 1; // Affiche conditions reglement |
||
| 149 | $this->option_codeproduitservice = 1; // Affiche code produit-service |
||
| 150 | $this->option_multilang = 1; // Dispo en plusieurs langues |
||
| 151 | $this->option_escompte = 0; // Affiche si il y a eu escompte |
||
| 152 | $this->option_credit_note = 0; // Support credit notes |
||
| 153 | $this->option_freetext = 1; // Support add of a personalised text |
||
| 154 | $this->option_draft_watermark = 1; // Support add of a watermark on drafts |
||
| 155 | |||
| 156 | $this->franchise=!$mysoc->tva_assuj; |
||
| 157 | |||
| 158 | // Get source company |
||
| 159 | $this->emetteur=$mysoc; |
||
| 160 | if (empty($this->emetteur->country_code)) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default, if was not defined |
||
| 161 | |||
| 162 | // Define position of columns |
||
| 163 | $this->posxdesc=$this->marge_gauche+1; |
||
| 164 | $this->posxdiscount=162; |
||
| 165 | $this->postotalht=174; |
||
| 166 | |||
| 167 | if ($conf->global->PRODUCT_USE_UNITS) |
||
| 168 | { |
||
| 169 | $this->posxtva=95; |
||
| 170 | $this->posxup=114; |
||
| 171 | $this->posxqty=132; |
||
| 172 | $this->posxunit=147; |
||
| 173 | } else { |
||
| 174 | $this->posxtva=110; |
||
| 175 | $this->posxup=126; |
||
| 176 | $this->posxqty=145; |
||
| 177 | $this->posxunit=162; |
||
| 178 | } |
||
| 179 | |||
| 180 | if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) $this->posxup = $this->posxtva; // posxtva is picture position reference |
||
| 181 | $this->posxpicture=$this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH)?20:$conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH); // width of images |
||
| 182 | if ($this->page_largeur < 210) // To work with US executive format |
||
| 183 | { |
||
| 184 | $this->posxpicture-=20; |
||
| 185 | $this->posxtva-=20; |
||
| 186 | $this->posxup-=20; |
||
| 187 | $this->posxqty-=20; |
||
| 188 | $this->posxunit-=20; |
||
| 189 | $this->posxdiscount-=20; |
||
| 190 | $this->postotalht-=20; |
||
| 191 | } |
||
| 192 | |||
| 193 | $this->tva=array(); |
||
| 194 | $this->localtax1=array(); |
||
| 195 | $this->localtax2=array(); |
||
| 196 | $this->atleastoneratenotnull=0; |
||
| 197 | $this->atleastonediscount=0; |
||
| 198 | } |
||
| 199 | |||
| 200 | |||
| 201 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
||
| 202 | /** |
||
| 203 | * Function to build pdf onto disk |
||
| 204 | * |
||
| 205 | * @param CommandeFournisseur $object Id of object to generate |
||
| 206 | * @param Translate $outputlangs Lang output object |
||
| 207 | * @param string $srctemplatepath Full path of source filename for generator using a template file |
||
| 208 | * @param int $hidedetails Do not show line details |
||
| 209 | * @param int $hidedesc Do not show desc |
||
| 210 | * @param int $hideref Do not show ref |
||
| 211 | * @return int 1=OK, 0=KO |
||
| 212 | */ |
||
| 213 | public function write_file($object, $outputlangs = '', $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0) |
||
| 702 | } |
||
| 703 | } |
||
| 704 | |||
| 705 | |||
| 706 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
||
| 707 | /** |
||
| 708 | * Show payments table |
||
| 709 | * |
||
| 710 | * @param PDF $pdf Object PDF |
||
| 711 | * @param CommandeFournisseur $object Object order |
||
| 712 | * @param int $posy Position y in PDF |
||
| 713 | * @param Translate $outputlangs Object langs for output |
||
| 714 | * @return int <0 if KO, >0 if OK |
||
| 715 | */ |
||
| 716 | private function _tableau_versements(&$pdf, $object, $posy, $outputlangs) |
||
| 717 | { |
||
| 718 | // phpcs:enable |
||
| 719 | } |
||
| 720 | |||
| 721 | |||
| 722 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
||
| 723 | /** |
||
| 724 | * Show miscellaneous information (payment mode, payment term, ...) |
||
| 725 | * |
||
| 726 | * @param PDF $pdf Object PDF |
||
| 727 | * @param CommandeFournisseur $object Object to show |
||
| 728 | * @param int $posy Y |
||
| 729 | * @param Translate $outputlangs Langs object |
||
| 730 | * @return integer |
||
| 731 | */ |
||
| 732 | private function _tableau_info(&$pdf, $object, $posy, $outputlangs) |
||
| 733 | { |
||
| 734 | // phpcs:enable |
||
| 735 | global $conf; |
||
| 736 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
||
| 737 | |||
| 738 | // If France, show VAT mention if not applicable |
||
| 739 | if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) |
||
| 740 | { |
||
| 741 | $pdf->SetFont('', 'B', $default_font_size - 2); |
||
| 742 | $pdf->SetXY($this->marge_gauche, $posy); |
||
| 743 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); |
||
| 744 | |||
| 745 | $posy=$pdf->GetY()+4; |
||
| 746 | } |
||
| 747 | |||
| 748 | $posxval=52; |
||
| 749 | |||
| 750 | // Show payments conditions |
||
| 751 | if (!empty($object->cond_reglement_code) || $object->cond_reglement) |
||
| 752 | { |
||
| 753 | $pdf->SetFont('', 'B', $default_font_size - 2); |
||
| 754 | $pdf->SetXY($this->marge_gauche, $posy); |
||
| 755 | $titre = $outputlangs->transnoentities("PaymentConditions").':'; |
||
| 756 | $pdf->MultiCell(80, 4, $titre, 0, 'L'); |
||
| 757 | |||
| 758 | $pdf->SetFont('', '', $default_font_size - 2); |
||
| 759 | $pdf->SetXY($posxval, $posy); |
||
| 760 | $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); |
||
| 761 | $lib_condition_paiement=str_replace('\n', "\n", $lib_condition_paiement); |
||
| 762 | $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); |
||
| 763 | |||
| 764 | $posy=$pdf->GetY()+3; |
||
| 765 | } |
||
| 766 | |||
| 767 | // Show payment mode |
||
| 768 | if (!empty($object->mode_reglement_code)) |
||
| 769 | { |
||
| 770 | $pdf->SetFont('', 'B', $default_font_size - 2); |
||
| 771 | $pdf->SetXY($this->marge_gauche, $posy); |
||
| 772 | $titre = $outputlangs->transnoentities("PaymentMode").':'; |
||
| 773 | $pdf->MultiCell(80, 5, $titre, 0, 'L'); |
||
| 774 | |||
| 775 | $pdf->SetFont('', '', $default_font_size - 2); |
||
| 776 | $pdf->SetXY($posxval, $posy); |
||
| 777 | $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); |
||
| 778 | $pdf->MultiCell(80, 5, $lib_mode_reg, 0, 'L'); |
||
| 779 | |||
| 780 | $posy=$pdf->GetY()+2; |
||
| 781 | } |
||
| 782 | |||
| 783 | |||
| 784 | return $posy; |
||
| 785 | } |
||
| 786 | |||
| 787 | // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps |
||
| 788 | /** |
||
| 789 | * Show total to pay |
||
| 790 | * |
||
| 791 | * @param PDF $pdf Object PDF |
||
| 792 | * @param Facture $object Object invoice |
||
| 793 | * @param int $deja_regle Montant deja regle |
||
| 794 | * @param int $posy Position depart |
||
| 795 | * @param Translate $outputlangs Objet langs |
||
| 796 | * @return int Position pour suite |
||
| 797 | */ |
||
| 798 | private function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) |
||
| 799 | { |
||
| 800 | // phpcs:enable |
||
| 801 | global $conf,$mysoc; |
||
| 802 | |||
| 803 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
||
| 804 | |||
| 805 | $tab2_top = $posy; |
||
| 806 | $tab2_hl = 4; |
||
| 807 | $pdf->SetFont('', '', $default_font_size - 1); |
||
| 808 | |||
| 809 | // Tableau total |
||
| 810 | $col1x = 120; $col2x = 170; |
||
| 811 | if ($this->page_largeur < 210) // To work with US executive format |
||
| 812 | { |
||
| 813 | $col2x-=20; |
||
| 814 | } |
||
| 815 | $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); |
||
| 816 | |||
| 817 | $useborder=0; |
||
| 818 | $index = 0; |
||
| 819 | |||
| 820 | // Total HT |
||
| 821 | $pdf->SetFillColor(255, 255, 255); |
||
| 822 | $pdf->SetXY($col1x, $tab2_top + 0); |
||
| 823 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); |
||
| 824 | |||
| 825 | $total_ht = (($conf->multicurrency->enabled && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); |
||
| 826 | $pdf->SetXY($col2x, $tab2_top + 0); |
||
| 827 | $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (! empty($object->remise)?$object->remise:0)), 0, 'R', 1); |
||
| 828 | |||
| 829 | // Show VAT by rates and total |
||
| 830 | $pdf->SetFillColor(248, 248, 248); |
||
| 831 | |||
| 832 | $this->atleastoneratenotnull=0; |
||
| 833 | foreach($this->tva as $tvakey => $tvaval) |
||
| 834 | { |
||
| 835 | if ($tvakey > 0) // On affiche pas taux 0 |
||
| 836 | { |
||
| 837 | $this->atleastoneratenotnull++; |
||
| 838 | |||
| 839 | $index++; |
||
| 840 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 841 | |||
| 842 | $tvacompl=''; |
||
| 843 | |||
| 844 | if (preg_match('/\*/', $tvakey)) |
||
| 845 | { |
||
| 846 | $tvakey=str_replace('*', '', $tvakey); |
||
| 847 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
||
| 848 | } |
||
| 849 | |||
| 850 | $totalvat =$outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; |
||
| 851 | $totalvat.=vatrate($tvakey, 1).$tvacompl; |
||
| 852 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
||
| 853 | |||
| 854 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 855 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); |
||
| 856 | } |
||
| 857 | } |
||
| 858 | if (! $this->atleastoneratenotnull) // If no vat at all |
||
| 859 | { |
||
| 860 | $index++; |
||
| 861 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 862 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); |
||
| 863 | |||
| 864 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 865 | $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); |
||
| 866 | |||
| 867 | // Total LocalTax1 |
||
| 868 | if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0) |
||
| 869 | { |
||
| 870 | $index++; |
||
| 871 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 872 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); |
||
| 873 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 874 | $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); |
||
| 875 | } |
||
| 876 | |||
| 877 | // Total LocalTax2 |
||
| 878 | if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0) |
||
| 879 | { |
||
| 880 | $index++; |
||
| 881 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 882 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); |
||
| 883 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 884 | $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); |
||
| 885 | } |
||
| 886 | } |
||
| 887 | else |
||
| 888 | { |
||
| 889 | //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') |
||
| 890 | //{ |
||
| 891 | //Local tax 1 |
||
| 892 | foreach($this->localtax1 as $localtax_type => $localtax_rate) |
||
| 893 | { |
||
| 894 | if (in_array((string) $localtax_type, array('2','4','6'))) continue; |
||
| 895 | |||
| 896 | foreach($localtax_rate as $tvakey => $tvaval) |
||
| 897 | { |
||
| 898 | if ($tvakey != 0) // On affiche pas taux 0 |
||
| 899 | { |
||
| 900 | //$this->atleastoneratenotnull++; |
||
| 901 | |||
| 902 | $index++; |
||
| 903 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 904 | |||
| 905 | $tvacompl=''; |
||
| 906 | if (preg_match('/\*/', $tvakey)) |
||
| 907 | { |
||
| 908 | $tvakey=str_replace('*', '', $tvakey); |
||
| 909 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
||
| 910 | } |
||
| 911 | $totalvat =$outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; |
||
| 912 | $totalvat.=vatrate(abs($tvakey), 1).$tvacompl; |
||
| 913 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
||
| 914 | |||
| 915 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 916 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); |
||
| 917 | } |
||
| 918 | } |
||
| 919 | } |
||
| 920 | |||
| 921 | //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') |
||
| 922 | //{ |
||
| 923 | //Local tax 2 |
||
| 924 | foreach($this->localtax2 as $localtax_type => $localtax_rate) |
||
| 925 | { |
||
| 926 | if (in_array((string) $localtax_type, array('2','4','6'))) continue; |
||
| 927 | |||
| 928 | foreach($localtax_rate as $tvakey => $tvaval) |
||
| 929 | { |
||
| 930 | if ($tvakey != 0) // On affiche pas taux 0 |
||
| 931 | { |
||
| 932 | //$this->atleastoneratenotnull++; |
||
| 933 | |||
| 934 | $index++; |
||
| 935 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 936 | |||
| 937 | $tvacompl=''; |
||
| 938 | if (preg_match('/\*/', $tvakey)) |
||
| 939 | { |
||
| 940 | $tvakey=str_replace('*', '', $tvakey); |
||
| 941 | $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; |
||
| 942 | } |
||
| 943 | $totalvat =$outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; |
||
| 944 | $totalvat.=vatrate(abs($tvakey), 1).$tvacompl; |
||
| 945 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); |
||
| 946 | |||
| 947 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 948 | $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); |
||
| 949 | } |
||
| 950 | } |
||
| 951 | } |
||
| 952 | } |
||
| 953 | |||
| 954 | // Total TTC |
||
| 955 | $index++; |
||
| 956 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 957 | $pdf->SetTextColor(0, 0, 60); |
||
| 958 | $pdf->SetFillColor(224, 224, 224); |
||
| 959 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); |
||
| 960 | |||
| 961 | $total_ttc = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; |
||
| 962 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 963 | $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); |
||
| 964 | $pdf->SetFont('', '', $default_font_size - 1); |
||
| 965 | $pdf->SetTextColor(0, 0, 0); |
||
| 966 | |||
| 967 | $creditnoteamount=0; |
||
| 968 | $depositsamount=0; |
||
| 969 | //$creditnoteamount=$object->getSumCreditNotesUsed(); |
||
| 970 | //$depositsamount=$object->getSumDepositsUsed(); |
||
| 971 | //print "x".$creditnoteamount."-".$depositsamount;exit; |
||
| 972 | $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); |
||
| 973 | if (! empty($object->paye)) $resteapayer=0; |
||
| 974 | |||
| 975 | if ($deja_regle > 0) |
||
| 976 | { |
||
| 977 | // Already paid + Deposits |
||
| 978 | $index++; |
||
| 979 | |||
| 980 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 981 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); |
||
| 982 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 983 | $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); |
||
| 984 | |||
| 985 | $index++; |
||
| 986 | $pdf->SetTextColor(0, 0, 60); |
||
| 987 | $pdf->SetFillColor(224, 224, 224); |
||
| 988 | $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
||
| 989 | $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); |
||
| 990 | |||
| 991 | $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
||
| 992 | $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); |
||
| 993 | |||
| 994 | $pdf->SetFont('', '', $default_font_size - 1); |
||
| 995 | $pdf->SetTextColor(0, 0, 0); |
||
| 996 | } |
||
| 997 | |||
| 998 | $index++; |
||
| 999 | return ($tab2_top + ($tab2_hl * $index)); |
||
| 1000 | } |
||
| 1001 | |||
| 1002 | /** |
||
| 1003 | * Show table for lines |
||
| 1004 | * |
||
| 1005 | * @param PDF $pdf Object PDF |
||
| 1006 | * @param string $tab_top Top position of table |
||
| 1007 | * @param string $tab_height Height of table (rectangle) |
||
| 1008 | * @param int $nexY Y (not used) |
||
| 1009 | * @param Translate $outputlangs Langs object |
||
| 1010 | * @param int $hidetop Hide top bar of array |
||
| 1011 | * @param int $hidebottom Hide bottom bar of array |
||
| 1012 | * @param string $currency Currency code |
||
| 1013 | * @return void |
||
| 1014 | */ |
||
| 1015 | private function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '') |
||
| 1016 | { |
||
| 1017 | global $conf; |
||
| 1018 | |||
| 1019 | // Force to disable hidetop and hidebottom |
||
| 1020 | $hidebottom=0; |
||
| 1021 | if ($hidetop) $hidetop=-1; |
||
| 1022 | |||
| 1023 | $currency = !empty($currency) ? $currency : $conf->currency; |
||
| 1024 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
||
| 1025 | |||
| 1026 | // Amount in (at tab_top - 1) |
||
| 1027 | $pdf->SetTextColor(0, 0, 0); |
||
| 1028 | $pdf->SetFont('', '', $default_font_size - 2); |
||
| 1029 | |||
| 1030 | if (empty($hidetop)) |
||
| 1031 | { |
||
| 1032 | $titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency)); |
||
| 1033 | $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); |
||
| 1034 | $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); |
||
| 1035 | |||
| 1036 | //$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230'; |
||
| 1037 | if (! empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) $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)); |
||
| 1038 | } |
||
| 1039 | |||
| 1040 | $pdf->SetDrawColor(128, 128, 128); |
||
| 1041 | $pdf->SetFont('', '', $default_font_size - 1); |
||
| 1042 | |||
| 1043 | // Output Rect |
||
| 1044 | $this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param |
||
| 1045 | |||
| 1046 | if (empty($hidetop)) |
||
| 1047 | { |
||
| 1048 | $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param |
||
| 1049 | |||
| 1050 | $pdf->SetXY($this->posxdesc-1, $tab_top+1); |
||
| 1051 | $pdf->MultiCell(108, 2, $outputlangs->transnoentities("Designation"), '', 'L'); |
||
| 1052 | } |
||
| 1053 | |||
| 1054 | if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) |
||
| 1055 | { |
||
| 1056 | $pdf->line($this->posxtva, $tab_top, $this->posxtva, $tab_top + $tab_height); |
||
| 1057 | if (empty($hidetop)) |
||
| 1058 | { |
||
| 1059 | $pdf->SetXY($this->posxtva-3, $tab_top+1); |
||
| 1060 | $pdf->MultiCell($this->posxup-$this->posxtva+3, 2, $outputlangs->transnoentities("VAT"), '', 'C'); |
||
| 1061 | } |
||
| 1062 | } |
||
| 1063 | |||
| 1064 | $pdf->line($this->posxup, $tab_top, $this->posxup, $tab_top + $tab_height); |
||
| 1065 | if (empty($hidetop)) |
||
| 1066 | { |
||
| 1067 | $pdf->SetXY($this->posxup-1, $tab_top+1); |
||
| 1068 | $pdf->MultiCell($this->posxqty-$this->posxup-1, 2, $outputlangs->transnoentities("PriceUHT"), '', 'C'); |
||
| 1069 | } |
||
| 1070 | |||
| 1071 | $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); |
||
| 1072 | if (empty($hidetop)) |
||
| 1073 | { |
||
| 1074 | $pdf->SetXY($this->posxqty-1, $tab_top+1); |
||
| 1075 | $pdf->MultiCell($this->posxunit-$this->posxqty-1, 2, $outputlangs->transnoentities("Qty"), '', 'C'); |
||
| 1076 | } |
||
| 1077 | |||
| 1078 | if($conf->global->PRODUCT_USE_UNITS) { |
||
| 1079 | $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height); |
||
| 1080 | if (empty($hidetop)) { |
||
| 1081 | $pdf->SetXY($this->posxunit - 1, $tab_top + 1); |
||
| 1082 | $pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("Unit"), '', 'C'); |
||
| 1083 | } |
||
| 1084 | } |
||
| 1085 | |||
| 1086 | $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); |
||
| 1087 | if (empty($hidetop)) |
||
| 1088 | { |
||
| 1089 | if ($this->atleastonediscount) |
||
| 1090 | { |
||
| 1091 | $pdf->SetXY($this->posxdiscount-1, $tab_top+1); |
||
| 1092 | $pdf->MultiCell($this->postotalht-$this->posxdiscount+1, 2, $outputlangs->transnoentities("ReductionShort"), '', 'C'); |
||
| 1093 | } |
||
| 1094 | } |
||
| 1095 | |||
| 1096 | if ($this->atleastonediscount) |
||
| 1097 | { |
||
| 1098 | $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height); |
||
| 1099 | } |
||
| 1100 | if (empty($hidetop)) |
||
| 1101 | { |
||
| 1102 | $pdf->SetXY($this->postotalht-1, $tab_top+1); |
||
| 1103 | $pdf->MultiCell(30, 2, $outputlangs->transnoentities("TotalHTShort"), '', 'C'); |
||
| 1104 | } |
||
| 1105 | } |
||
| 1106 | |||
| 1107 | /** |
||
| 1108 | * Show top header of page. |
||
| 1109 | * |
||
| 1110 | * @param PDF $pdf Object PDF |
||
| 1111 | * @param CommandeFournisseur $object Object to show |
||
| 1112 | * @param int $showaddress 0=no, 1=yes |
||
| 1113 | * @param Translate $outputlangs Object lang for output |
||
| 1114 | * @return void |
||
| 1115 | */ |
||
| 1116 | private function _pagehead(&$pdf, $object, $showaddress, $outputlangs) |
||
| 1117 | { |
||
| 1118 | global $langs, $conf, $mysoc; |
||
| 1119 | |||
| 1120 | // Load translation files required by the page |
||
| 1121 | $outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings")); |
||
| 1122 | |||
| 1123 | $default_font_size = pdf_getPDFFontSize($outputlangs); |
||
| 1124 | |||
| 1125 | // Do not add the BACKGROUND as this is for suppliers |
||
| 1126 | //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); |
||
| 1127 | |||
| 1128 | //Affiche le filigrane brouillon - Print Draft Watermark |
||
| 1129 | /*if($object->statut==0 && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) ) |
||
| 1130 | { |
||
| 1131 | pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK); |
||
| 1132 | }*/ |
||
| 1133 | //Print content |
||
| 1134 | |||
| 1135 | $pdf->SetTextColor(0, 0, 60); |
||
| 1136 | $pdf->SetFont('', 'B', $default_font_size + 3); |
||
| 1137 | |||
| 1138 | $posx=$this->page_largeur-$this->marge_droite-100; |
||
| 1139 | $posy=$this->marge_haute; |
||
| 1140 | |||
| 1141 | $pdf->SetXY($this->marge_gauche, $posy); |
||
| 1142 | |||
| 1143 | // Logo |
||
| 1144 | $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo; |
||
| 1145 | if ($this->emetteur->logo) |
||
| 1146 | { |
||
| 1147 | if (is_readable($logo)) |
||
| 1148 | { |
||
| 1149 | $height=pdf_getHeightForLogo($logo); |
||
| 1150 | $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto) |
||
| 1151 | } |
||
| 1152 | else |
||
| 1153 | { |
||
| 1154 | $pdf->SetTextColor(200, 0, 0); |
||
| 1155 | $pdf->SetFont('', 'B', $default_font_size - 2); |
||
| 1156 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound", $logo), 0, 'L'); |
||
| 1157 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToModuleSetup"), 0, 'L'); |
||
| 1158 | } |
||
| 1159 | } |
||
| 1160 | else |
||
| 1161 | { |
||
| 1162 | $text=$this->emetteur->name; |
||
| 1163 | $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L'); |
||
| 1164 | } |
||
| 1165 | |||
| 1166 | $pdf->SetFont('', 'B', $default_font_size + 3); |
||
| 1167 | $pdf->SetXY($posx, $posy); |
||
| 1168 | $pdf->SetTextColor(0, 0, 60); |
||
| 1169 | $title=$outputlangs->transnoentities("SupplierOrder")." ".$outputlangs->convToOutputCharset($object->ref); |
||
| 1170 | $pdf->MultiCell(100, 3, $title, '', 'R'); |
||
| 1171 | $posy+=1; |
||
| 1172 | |||
| 1173 | if ($object->ref_supplier) |
||
| 1174 | { |
||
| 1175 | $posy+=4; |
||
| 1176 | $pdf->SetFont('', 'B', $default_font_size); |
||
| 1177 | $pdf->SetXY($posx, $posy); |
||
| 1178 | $pdf->SetTextColor(0, 0, 60); |
||
| 1179 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefSupplier")." : " . $outputlangs->convToOutputCharset($object->ref_supplier), '', 'R'); |
||
| 1180 | $posy+=1; |
||
| 1181 | } |
||
| 1182 | |||
| 1183 | $pdf->SetFont('', '', $default_font_size -1); |
||
| 1184 | |||
| 1185 | if (! empty($conf->global->PDF_SHOW_PROJECT)) |
||
| 1186 | { |
||
| 1187 | $object->fetch_projet(); |
||
| 1188 | if (! empty($object->project->ref)) |
||
| 1189 | { |
||
| 1190 | $posy+=4; |
||
| 1191 | $pdf->SetXY($posx, $posy); |
||
| 1192 | $langs->load("projects"); |
||
| 1193 | $pdf->SetTextColor(0, 0, 60); |
||
| 1194 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Project")." : " . (empty($object->project->ref)?'':$object->projet->ref), '', 'R'); |
||
| 1195 | } |
||
| 1196 | } |
||
| 1197 | |||
| 1198 | if (! empty($object->date_commande)) |
||
| 1199 | { |
||
| 1200 | $posy+=5; |
||
| 1201 | $pdf->SetXY($posx, $posy); |
||
| 1202 | $pdf->SetTextColor(0, 0, 60); |
||
| 1203 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande, "day", false, $outputlangs, true), '', 'R'); |
||
| 1204 | } |
||
| 1205 | else |
||
| 1206 | { |
||
| 1207 | $posy+=5; |
||
| 1208 | $pdf->SetXY($posx, $posy); |
||
| 1209 | $pdf->SetTextColor(255, 0, 0); |
||
| 1210 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R'); |
||
| 1211 | } |
||
| 1212 | |||
| 1213 | $pdf->SetTextColor(0, 0, 60); |
||
| 1214 | $usehourmin='day'; |
||
| 1215 | if (!empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin='dayhour'; |
||
| 1216 | if (! empty($object->date_livraison)) |
||
| 1217 | { |
||
| 1218 | $posy+=4; |
||
| 1219 | $pdf->SetXY($posx-90, $posy); |
||
| 1220 | $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison, $usehourmin, false, $outputlangs, true), '', 'R'); |
||
| 1221 | } |
||
| 1222 | |||
| 1223 | if ($object->thirdparty->code_fournisseur) |
||
| 1224 | { |
||
| 1225 | $posy+=4; |
||
| 1226 | $pdf->SetXY($posx, $posy); |
||
| 1227 | $pdf->SetTextColor(0, 0, 60); |
||
| 1228 | $pdf->MultiCell(100, 3, $outputlangs->transnoentities("SupplierCode")." : " . $outputlangs->transnoentities($object->thirdparty->code_fournisseur), '', 'R'); |
||
| 1229 | } |
||
| 1230 | |||
| 1231 | // Get contact |
||
| 1232 | if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) |
||
| 1233 | { |
||
| 1234 | $arrayidcontact=$object->getIdContact('internal', 'SALESREPFOLL'); |
||
| 1235 | if (count($arrayidcontact) > 0) |
||
| 1236 | { |
||
| 1237 | $usertmp=new User($this->db); |
||
| 1238 | $usertmp->fetch($arrayidcontact[0]); |
||
| 1239 | $posy+=4; |
||
| 1240 | $pdf->SetXY($posx, $posy); |
||
| 1241 | $pdf->SetTextColor(0, 0, 60); |
||
| 1242 | $pdf->MultiCell(100, 3, $langs->trans("BuyerName")." : ".$usertmp->getFullName($langs), '', 'R'); |
||
| 1243 | } |
||
| 1244 | } |
||
| 1245 | |||
| 1246 | $posy+=1; |
||
| 1247 | $pdf->SetTextColor(0, 0, 60); |
||
| 1248 | |||
| 1249 | $top_shift = 0; |
||
| 1250 | // Show list of linked objects |
||
| 1251 | $current_y = $pdf->getY(); |
||
| 1252 | $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size); |
||
| 1253 | if ($current_y < $pdf->getY()) |
||
| 1254 | { |
||
| 1255 | $top_shift = $pdf->getY() - $current_y; |
||
| 1256 | } |
||
| 1257 | |||
| 1258 | if ($showaddress) |
||
| 1259 | { |
||
| 1260 | // Sender properties |
||
| 1261 | $carac_emetteur=''; |
||
| 1262 | // Add internal contact of proposal if defined |
||
| 1263 | $arrayidcontact=$object->getIdContact('internal', 'SALESREPFOLL'); |
||
| 1264 | if (count($arrayidcontact) > 0) |
||
| 1265 | { |
||
| 1266 | $object->fetch_user($arrayidcontact[0]); |
||
| 1267 | $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs))."\n"; |
||
| 1268 | } |
||
| 1269 | |||
| 1270 | $carac_emetteur .= pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object); |
||
| 1271 | |||
| 1272 | // Show sender |
||
| 1273 | $posy=42+$top_shift; |
||
| 1274 | $posx=$this->marge_gauche; |
||
| 1275 | if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80; |
||
| 1276 | $hautcadre=40; |
||
| 1277 | |||
| 1278 | // Show sender frame |
||
| 1279 | $pdf->SetTextColor(0, 0, 0); |
||
| 1280 | $pdf->SetFont('', '', $default_font_size - 2); |
||
| 1281 | $pdf->SetXY($posx, $posy-5); |
||
| 1282 | $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); |
||
| 1283 | $pdf->SetXY($posx, $posy); |
||
| 1284 | $pdf->SetFillColor(230, 230, 230); |
||
| 1285 | $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); |
||
| 1286 | $pdf->SetTextColor(0, 0, 60); |
||
| 1287 | |||
| 1288 | // Show sender name |
||
| 1289 | $pdf->SetXY($posx+2, $posy+3); |
||
| 1290 | $pdf->SetFont('', 'B', $default_font_size); |
||
| 1291 | $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L'); |
||
| 1292 | $posy=$pdf->getY(); |
||
| 1293 | |||
| 1294 | // Show sender information |
||
| 1295 | $pdf->SetXY($posx+2, $posy); |
||
| 1296 | $pdf->SetFont('', '', $default_font_size - 1); |
||
| 1297 | $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L'); |
||
| 1298 | |||
| 1299 | |||
| 1300 | // If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER' |
||
| 1301 | $usecontact=false; |
||
| 1302 | $arrayidcontact=$object->getIdContact('external', 'CUSTOMER'); |
||
| 1303 | if (count($arrayidcontact) > 0) |
||
| 1304 | { |
||
| 1305 | $usecontact=true; |
||
| 1306 | $result=$object->fetch_contact($arrayidcontact[0]); |
||
| 1307 | } |
||
| 1308 | |||
| 1309 | //Recipient name |
||
| 1310 | // On peut utiliser le nom de la societe du contact |
||
| 1311 | if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) { |
||
| 1312 | $thirdparty = $object->contact; |
||
| 1313 | } else { |
||
| 1314 | $thirdparty = $object->thirdparty; |
||
| 1315 | } |
||
| 1316 | |||
| 1317 | $carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs); |
||
| 1318 | |||
| 1319 | $carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact?$object->contact:''), $usecontact, 'target', $object); |
||
| 1320 | |||
| 1321 | // Show recipient |
||
| 1322 | $widthrecbox=100; |
||
| 1323 | if ($this->page_largeur < 210) $widthrecbox=84; // To work with US executive format |
||
| 1324 | $posy=42+$top_shift; |
||
| 1325 | $posx=$this->page_largeur-$this->marge_droite-$widthrecbox; |
||
| 1326 | if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche; |
||
| 1327 | |||
| 1328 | // Show recipient frame |
||
| 1329 | $pdf->SetTextColor(0, 0, 0); |
||
| 1330 | $pdf->SetFont('', '', $default_font_size - 2); |
||
| 1331 | $pdf->SetXY($posx+2, $posy-5); |
||
| 1332 | $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo").":", 0, 'L'); |
||
| 1333 | $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre); |
||
| 1334 | |||
| 1335 | // Show recipient name |
||
| 1336 | $pdf->SetXY($posx+2, $posy+3); |
||
| 1337 | $pdf->SetFont('', 'B', $default_font_size); |
||
| 1338 | $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L'); |
||
| 1339 | |||
| 1340 | $posy = $pdf->getY(); |
||
| 1341 | |||
| 1342 | // Show recipient information |
||
| 1343 | $pdf->SetFont('', '', $default_font_size - 1); |
||
| 1344 | $pdf->SetXY($posx+2, $posy); |
||
| 1345 | $pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L'); |
||
| 1346 | } |
||
| 1347 | |||
| 1348 | return $top_shift; |
||
| 1349 | } |
||
| 1350 | |||
| 1351 | /** |
||
| 1352 | * Show footer of page. Need this->emetteur object |
||
| 1353 | * |
||
| 1354 | * @param PDF $pdf PDF |
||
| 1355 | * @param CommandeFournisseur $object Object to show |
||
| 1356 | * @param Translate $outputlangs Object lang for output |
||
| 1357 | * @param int $hidefreetext 1=Hide free text |
||
| 1358 | * @return int Return height of bottom margin including footer text |
||
| 1359 | */ |
||
| 1360 | private function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0) |
||
| 1365 | } |
||
| 1366 | } |
||
| 1367 |