Fixes in sales reports to use debtor_trans.tax_included field instead of trans_tax_de...
[fa-stable.git] / reporting / includes / class.pdf.inc
index 0bf38d8f1756f9d0dc7532e6b76540d734a16a6a..9bc222d3eaa82ef13e0d5f65e58d0bdc9458af39 100644 (file)
@@ -79,21 +79,21 @@ class Cpdf extends FPDI {
        */
        function SetLang($code=null) 
        {
-               global $installed_languages, $dflt_lang, $path_to_root, $local_path_to_root;
+               global $installed_languages, $dflt_lang, $path_to_root, $local_path_to_root, $GetText;
 
                if (!$code)
                        $code = $dflt_lang;
 
                $lang = array_search_value($code, $installed_languages, 'code');
-               $_SESSION['get_text']->set_language($lang['code'], strtoupper($lang['encoding']));
+               $GetText->set_language($lang['code'], strtoupper($lang['encoding']));
 
                // $local_path_to_root is  set inside find_custom_file.
                // Select extension domain if po file is provided
                // otherwise use global translation.
                if (file_exists($local_path_to_root.'/lang/'.$lang['code'].'/LC_MESSAGES/'.$lang['code'].'.po'))
-                       $_SESSION['get_text']->add_domain($lang['code'], $local_path_to_root . "/lang");
+                       $GetText->add_domain($lang['code'], $local_path_to_root . "/lang");
                else
-                       $_SESSION['get_text']->add_domain($lang['code'], $path_to_root . "/lang", @$lang['version']);
+                       $GetText->add_domain($lang['code'], $path_to_root . "/lang", @$lang['version']);
                // re-read translated sys names.
                include($path_to_root.'/includes/sysnames.inc');
 
@@ -175,7 +175,14 @@ class Cpdf extends FPDI {
                                        default :               $fontname = "freesans5";        break;
                                }
                        }
-                       // else use built-in adobe fonts helvetica.
+                       elseif ($this->encoding === "ISO-8859-13")
+            {
+                switch ($this->l['a_meta_language'])
+                {
+                    default :        $fontname = "freesans13";     break;
+                }
+            }
+            // else use built-in adobe fonts helvetica.
                }
                $this->SetFont($fontname, $style);
        }
@@ -251,7 +258,7 @@ class Cpdf extends FPDI {
        * nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a
        * pretty crappy shape at 2, as we are approximating with bezier curves.
        */
-       function ellipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360,$close=1,$fill=0)
+       function ellipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360,$close=1,$fill=0, $dummy=null)
        {
                parent::Ellipse($x0, $y0, $r1, $r2, $angle, $astart. $afinish, ($close?'C':''), "", "", $nSeg);
        }