X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=reporting%2Frep102.php;h=92b56466b7cbd7f7dfdf0f6c734032d5f8b27749;hb=1c257d9ff0bfe6452423acdb8358e26bd3ce7f43;hp=95d267c352f02b8b0d73759922331b4fc57089a4;hpb=f44132511cc91b83f20f91af0625d4b112b4c26e;p=fa-stable.git diff --git a/reporting/rep102.php b/reporting/rep102.php index 95d267c3..92b56466 100644 --- a/reporting/rep102.php +++ b/reporting/rep102.php @@ -67,14 +67,14 @@ function print_aged_customer_analysis() { global $path_to_root, $systypes_array, $SysPrefs; - $to = $_POST['PARAM_0']; - $fromcust = $_POST['PARAM_1']; - $currency = $_POST['PARAM_2']; - $show_all = $_POST['PARAM_3']; + $to = $_POST['PARAM_0']; + $fromcust = $_POST['PARAM_1']; + $currency = $_POST['PARAM_2']; + $show_all = $_POST['PARAM_3']; $summaryOnly = $_POST['PARAM_4']; - $no_zeros = $_POST['PARAM_5']; - $graphics = $_POST['PARAM_6']; - $comments = $_POST['PARAM_7']; + $no_zeros = $_POST['PARAM_5']; + $graphics = $_POST['PARAM_6']; + $comments = $_POST['PARAM_7']; $orientation = $_POST['PARAM_8']; $destination = $_POST['PARAM_9']; if ($destination) @@ -85,7 +85,7 @@ function print_aged_customer_analysis() if ($graphics) { include_once($path_to_root . "/reporting/includes/class.graphic.inc"); - $pg = new graph(); + $pg = new chart($graphics); } if ($fromcust == ALL_TEXT) @@ -204,7 +204,7 @@ function print_aged_customer_analysis() } foreach ($trans as $i => $value) - $trans[$i] *= $rate; + $trans[$i] = (float)$trans[$i] * $rate; $str = array($trans["Balance"] - $trans["Due"], $trans["Due"]-$trans["Overdue1"], $trans["Overdue1"]-$trans["Overdue2"], @@ -225,28 +225,30 @@ function print_aged_customer_analysis() $rep->fontSize += 2; $rep->TextCol(0, 3, _('Grand Total')); $rep->fontSize -= 2; + $serie = array(); for ($i = 0; $i < count($total); $i++) { $rep->AmountCol($i + 3, $i + 4, $total[$i], $dec); if ($graphics && $i < count($total) - 1) { - $pg->y[$i] = abs($total[$i]); + $serie[] = abs($total[$i]); } } $rep->Line($rep->row - 8); if ($graphics) { - $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 = $SysPrefs->graph_skin; - $pg->built_in = false; + $pg->setStream('png'); + $pg->addSerie(_('Balances'), $serie); + $pg->setLabels(array(_('Current'), $nowdue, $pastdue1, $pastdue2)); + $pg->setTitle($rep->title); + $pg->setXTitle(_("Days")); + $pg->setYTitle(_("Amount")); + $pg->setDTitle(number_format2($total[4])); + $pg->setValues(true); $pg->latin_notation = ($SysPrefs->decseps[user_dec_sep()] != "."); - $filename = company_path(). "/pdf_files/". uniqid("").".png"; - $pg->display($filename, true); + $filename = company_path(). "/pdf_files/". random_id().".png"; + $pg->display($filename); + //sleep(5); $w = $pg->width / 1.5; $h = $pg->height / 1.5; $x = ($rep->pageWidth - $w) / 2;