X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep202.php;h=ce39dd8668a2cc403e017e84533c45acbebcf7ce;hb=6918bb5a9e5505ebdeb1abd93127a68db5ece8b6;hp=62d422c61d85a665860bd0bbebccfe3066134fa8;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/reporting/rep202.php b/reporting/rep202.php index 62d422c6..ce39dd86 100644 --- a/reporting/rep202.php +++ b/reporting/rep202.php @@ -107,27 +107,26 @@ function get_invoices($supplier_id, $to) function print_aged_supplier_analysis() { - global $path_to_root; + global $comp_path, $path_to_root; include_once($path_to_root . "reporting/includes/pdf_report.inc"); $to = $_POST['PARAM_0']; $fromsupp = $_POST['PARAM_1']; - $tosupp = $_POST['PARAM_2']; - $currency = $_POST['PARAM_3']; - $summaryOnly = $_POST['PARAM_4']; - $graphics = $_POST['PARAM_5']; - $comments = $_POST['PARAM_6']; + $currency = $_POST['PARAM_2']; + $summaryOnly = $_POST['PARAM_3']; + $graphics = $_POST['PARAM_4']; + $comments = $_POST['PARAM_5']; if ($graphics) { include_once($path_to_root . "reporting/includes/class.graphic.inc"); $pg = new graph(); } - if ($fromsupp == null) - $fromsupp = 0; - if ($tosupp == null) - $tosupp = 0; + if ($fromsupp == reserved_words::get_all_numeric()) + $from = _('All'); + else + $from = get_supplier_name($fromsupp); $dec = user_price_dec(); if ($summaryOnly == 1) @@ -156,8 +155,7 @@ function print_aged_supplier_analysis() $params = array( 0 => $comments, 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''), - 2 => array('text' => _('Supplier'), 'from' => get_supplier_name($fromsupp), - 'to' => get_supplier_name($tosupp)), + 2 => array('text' => _('Supplier'), 'from' => $from, 'to' => ''), 3 => array('text' => _('Currency'),'from' => $currency,'to' => ''), 4 => array('text' => _('Type'), 'from' => $summary,'to' => '')); @@ -178,8 +176,10 @@ function print_aged_supplier_analysis() $pastdue1 = $PastDueDays1 + 1 . "-" . $PastDueDays2 . " " . _('Days'); $pastdue2 = _('Over') . " " . $PastDueDays2 . " " . _('Days'); - $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers - WHERE supplier_id>=$fromsupp AND supplier_id<=$tosupp ORDER BY name"; + $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers "; + if ($fromsupp != reserved_words::get_all_numeric()) + $sql .= "WHERE supplier_id=$fromsupp "; + $sql .= "ORDER BY supp_name"; $result = db_query($sql, "The suppliers could not be retrieved"); while ($myrow=db_fetch($result)) @@ -268,7 +268,7 @@ function print_aged_supplier_analysis() $pg->built_in = false; $pg->fontfile = $path_to_root . "reporting/fonts/Vera.ttf"; $pg->latin_notation = ($decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()] != "."); - $filename = $path_to_root . "reporting/pdf_files/test.png"; + $filename = $comp_path.'/'.user_company(). "/pdf_files/test.png"; $pg->display($filename, true); $w = $pg->width / 1.5; $h = $pg->height / 1.5;