X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep301.php;h=5ad1735cb31cb5d2630ca1a0207ce6b4d79a775f;hb=40da959b32eb27fcb0422207a284eed13cc27d7e;hp=56398b710b2c4302c2127c253936bfd073837458;hpb=46c5f7a65a7659a44ae8254c63152074363d3987;p=fa-stable.git diff --git a/reporting/rep301.php b/reporting/rep301.php index 56398b71..5ad1735c 100644 --- a/reporting/rep301.php +++ b/reporting/rep301.php @@ -28,8 +28,9 @@ include_once($path_to_root . "/inventory/includes/db/items_category_db.inc"); print_inventory_valuation_report(); -function getTransactions($category, $location) +function getTransactions($category, $location, $date) { + $date = date2sql($date); $sql = "SELECT ".TB_PREF."stock_master.category_id, ".TB_PREF."stock_category.description AS cat_description, ".TB_PREF."stock_master.stock_id, @@ -44,6 +45,8 @@ function getTransactions($category, $location) ".TB_PREF."stock_moves WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."stock_moves.stock_id AND ".TB_PREF."stock_master.category_id=".TB_PREF."stock_category.category_id + AND ".TB_PREF."stock_master.mb_flag<>'D' + AND ".TB_PREF."stock_moves.tran_date <= '$date' GROUP BY ".TB_PREF."stock_master.category_id, ".TB_PREF."stock_category.description, "; if ($location != 'all') @@ -68,11 +71,13 @@ function print_inventory_valuation_report() { global $path_to_root; - $category = $_POST['PARAM_0']; - $location = $_POST['PARAM_1']; - $detail = $_POST['PARAM_2']; - $comments = $_POST['PARAM_3']; - $destination = $_POST['PARAM_4']; + $date = $_POST['PARAM_0']; + $category = $_POST['PARAM_1']; + $location = $_POST['PARAM_2']; + $detail = $_POST['PARAM_3']; + $comments = $_POST['PARAM_4']; + $orientation = $_POST['PARAM_5']; + $destination = $_POST['PARAM_6']; if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else @@ -80,6 +85,7 @@ function print_inventory_valuation_report() $detail = !$detail; $dec = user_price_dec(); + $orientation = ($orientation ? 'L' : 'P'); if ($category == ALL_NUMERIC) $category = 0; if ($category == 0) @@ -101,16 +107,18 @@ function print_inventory_valuation_report() $aligns = array('left', 'left', 'left', 'right', 'right', 'right'); $params = array( 0 => $comments, - 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), - 2 => array('text' => _('Location'), 'from' => $loc, 'to' => '')); - - $rep = new FrontReport(_('Inventory Valuation Report'), "InventoryValReport", user_pagesize()); + 1 => array('text' => _('End Date'), 'from' => $date, 'to' => ''), + 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), + 3 => array('text' => _('Location'), 'from' => $loc, 'to' => '')); + $rep = new FrontReport(_('Inventory Valuation Report'), "InventoryValReport", user_pagesize(), 9, $orientation); + if ($orientation == 'L') + recalculate_cols($cols); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); $rep->NewPage(); - $res = getTransactions($category, $location); + $res = getTransactions($category, $location, $date); $total = $grandtotal = 0.0; $catt = ''; while ($trans=db_fetch($res))