X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep201.php;h=8131e164e1daa6eb9450a6e437bf982878068987;hb=063c5f22068dbbd6adccacaf5bd0f66b2eda8e4f;hp=567d12f17825d8e049739d70c30732a87a5e7171;hpb=e1ad4f3f77cb20f692185b0b5e493820c5fb7f77;p=fa-stable.git diff --git a/reporting/rep201.php b/reporting/rep201.php index 567d12f1..8131e164 100644 --- a/reporting/rep201.php +++ b/reporting/rep201.php @@ -90,13 +90,15 @@ function print_supplier_balances() $currency = $_POST['PARAM_3']; $no_zeros = $_POST['PARAM_4']; $comments = $_POST['PARAM_5']; - $destination = $_POST['PARAM_6']; + $orientation = $_POST['PARAM_6']; + $destination = $_POST['PARAM_7']; if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else include_once($path_to_root . "/reporting/includes/pdf_report.inc"); - if ($fromsupp == ALL_NUMERIC) + $orientation = ($orientation ? 'L' : 'P'); + if ($fromsupp == ALL_TEXT) $supp = _('All'); else $supp = get_supplier_name($fromsupp); @@ -126,17 +128,19 @@ function print_supplier_balances() 3 => array( 'text' => _('Currency'),'from' => $currency, 'to' => ''), 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => '')); - $rep = new FrontReport(_('Supplier Balances'), "SupplierBalances", user_pagesize()); + $rep = new FrontReport(_('Supplier Balances'), "SupplierBalances", user_pagesize(), 9, $orientation); + if ($orientation == 'L') + recalculate_cols($cols); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); - $rep->Header(); + $rep->NewPage(); $total = array(); $grandtotal = array(0,0,0,0); $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers"; - if ($fromsupp != ALL_NUMERIC) + if ($fromsupp != ALL_TEXT) $sql .= " WHERE supplier_id=".db_escape($fromsupp); $sql .= " ORDER BY supp_name"; $result = db_query($sql, "The customers could not be retrieved"); @@ -175,7 +179,7 @@ function print_supplier_balances() $rep->Line($rep->row + 4); while ($trans=db_fetch($res)) { - if ($no_zeros && $trans['TotalAmount'] == 0 && $trans['Allocated'] == 0) continue; + if ($no_zeros && floatcmp(abs($trans['TotalAmount']), $trans['Allocated']) == 0) continue; $rep->NewLine(1, 2); $rep->TextCol(0, 1, $systypes_array[$trans['type']]); $rep->TextCol(1, 2, $trans['reference']);