X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep201.php;h=3a6f1cff9497265b3d73ffa70cc2eca9be8578b5;hb=de148378f0ada5ab90a8dbd63cf7c54adf65b6c9;hp=3b6e64f571649206a46b9b25a703f3806352ce00;hpb=da8311619dd73feae101d246a1957b972e00cbd2;p=fa-stable.git diff --git a/reporting/rep201.php b/reporting/rep201.php index 3b6e64f5..3a6f1cff 100644 --- a/reporting/rep201.php +++ b/reporting/rep201.php @@ -48,14 +48,13 @@ function print_supplier_balances() $to = $_POST['PARAM_0']; $fromsupp = $_POST['PARAM_1']; - $tosupp = $_POST['PARAM_2']; - $currency = $_POST['PARAM_3']; - $comments = $_POST['PARAM_4']; + $currency = $_POST['PARAM_2']; + $comments = $_POST['PARAM_3']; - 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 ($currency == reserved_words::get_all()) @@ -75,8 +74,7 @@ function print_supplier_balances() $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' => '')); $rep = new FrontReport(_('Supplier Balances'), "SupplierBalances.pdf", user_pagesize()); @@ -88,8 +86,10 @@ function print_supplier_balances() $total = array(); $grandtotal = array(); - $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers - WHERE supplier_id>=$fromsupp AND supplier_id<=$tosupp ORDER BY supp_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 customers could not be retrieved"); while ($myrow=db_fetch($result))