Merged changes from stable branch up to 2.3.23.
[fa-stable.git] / reporting / rep202.php
index c3b1e87a41ec7c9f0323cb30ea437b845238fe94..0ea9e5f80f8ca6eb12ad07bb680f1ddc99c0d386 100644 (file)
@@ -38,7 +38,7 @@ function get_invoices($supplier_id, $to, $all=true)
        // Revomed allocated from sql
        if ($all)
        $value = "(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount)";
-    else       
+    else
        $value = "IF (".TB_PREF."supp_trans.type=".ST_SUPPINVOICE." OR ".TB_PREF."supp_trans.type=".ST_BANKDEPOSIT.", 
        (".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount - ".TB_PREF."supp_trans.alloc),
        (".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount + ".TB_PREF."supp_trans.alloc))";
@@ -72,7 +72,7 @@ function get_invoices($supplier_id, $to, $all=true)
 
 function print_aged_supplier_analysis()
 {
-    global $path_to_root, $systypes_array;
+    global $path_to_root, $systypes_array, $SysPrefs;
 
     $to = $_POST['PARAM_0'];
     $fromsupp = $_POST['PARAM_1'];
@@ -246,16 +246,15 @@ function print_aged_supplier_analysis()
        $rep->NewLine();
        if ($graphics)
        {
-               global $decseps, $graph_skin;
                $pg->x = array(_('Current'), $nowdue, $pastdue1, $pastdue2);
                $pg->title     = $rep->title;
                $pg->axis_x    = _("Days");
                $pg->axis_y    = _("Amount");
                $pg->graphic_1 = $to;
                $pg->type      = $graphics;
-               $pg->skin      = $graph_skin;
+               $pg->skin      = $SysPrefs->graph_skin;
                $pg->built_in  = false;
-               $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != ".");
+               $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != ".");
                $filename = company_path(). "/pdf_files/". uniqid("").".png";
                $pg->display($filename, true);
                $w = $pg->width / 1.5;
@@ -269,4 +268,3 @@ function print_aged_supplier_analysis()
     $rep->End();
 }
 
-?>