From ce32829882c914ba537735b599b5bdcfc25739f8 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 25 May 2009 15:06:31 +0000 Subject: [PATCH] Added extra select option in Stock Check Sheet. --- CHANGELOG.txt | 3 ++- reporting/rep303.php | 27 +++++++++++++++++---------- reporting/reports_main.php | 1 + 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 071ab4c2..3574c50b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -26,8 +26,9 @@ $ /purchasing/includes/db/grn_db.inc $ /gl/includes/db/gl_db_accounts.inc $ /reporting/rep706.php $ /reporting/rep707.php -! Extra column in Stock Check Sheet, On Order +! Extra column in Stock Check Sheet, On Order and option for selecting Only Shortage. $ /reporting/rep303.php + /reporting/reports_main.php 23-May-2009 Janusz Dobrowolski # Fixed transaction table search update. diff --git a/reporting/rep303.php b/reporting/rep303.php index 4cf207ad..a1f70d85 100644 --- a/reporting/rep303.php +++ b/reporting/rep303.php @@ -67,8 +67,9 @@ function print_stock_check() $location = $_POST['PARAM_1']; $pictures = $_POST['PARAM_2']; $check = $_POST['PARAM_3']; - $comments = $_POST['PARAM_4']; - $destination = $_POST['PARAM_5']; + $shortage = $_POST['PARAM_4']; + $comments = $_POST['PARAM_5']; + $destination = $_POST['PARAM_6']; if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else @@ -87,24 +88,28 @@ function print_stock_check() $loc = _('All'); else $loc = $location; - + if ($shortage) + $short = _('Yes'); + else + $short = _('No'); if ($check) { $cols = array(0, 100, 250, 295, 345, 390, 445, 515); - $headers = array(_('Stock ID'), _('Description'), _('Quantity'), _('Check'), _('Demand'), _('Shortage'), _('On Order')); + $headers = array(_('Stock ID'), _('Description'), _('Quantity'), _('Check'), _('Demand'), _('Available'), _('On Order')); $aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right'); } else { $cols = array(0, 100, 250, 315, 380, 445, 515); - $headers = array(_('Stock ID'), _('Description'), _('Quantity'), _('Demand'), _('Shortage'), _('On Order')); + $headers = array(_('Stock ID'), _('Description'), _('Quantity'), _('Demand'), _('Available'), _('On Order')); $aligns = array('left', 'left', 'right', 'right', 'right', 'right'); } $params = array( 0 => $comments, 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), - 2 => array('text' => _('Location'), 'from' => $loc, 'to' => '')); + 2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''), + 3 => array('text' => _('Only Shortage'), 'from' => $short, 'to' => '')); if ($pictures) $user_comp = user_company(); @@ -121,6 +126,12 @@ function print_stock_check() $catt = ''; while ($trans=db_fetch($res)) { + $demandqty = get_demand_qty($trans['stock_id'], $loc_code); + $demandqty += get_demand_asm_qty($trans['stock_id'], $loc_code); + $onorder = get_on_porder_qty($trans['stock_id'], $loc_code); + $onorder += get_on_worder_qty($trans['stock_id'], $loc_code); + if ($shortage && $trans['QtyOnHand'] - $demandqty >= 0) + continue; if ($catt != $trans['cat_description']) { if ($catt != '') @@ -137,10 +148,6 @@ function print_stock_check() $loc_code = ""; else $loc_code = $trans['loc_code']; - $demandqty = get_demand_qty($trans['stock_id'], $loc_code); - $demandqty += get_demand_asm_qty($trans['stock_id'], $loc_code); - $onorder = get_on_porder_qty($trans['stock_id'], $loc_code); - $onorder += get_on_worder_qty($trans['stock_id'], $loc_code); $rep->NewLine(); $dec = get_qty_dec($trans['stock_id']); $rep->TextCol(0, 1, $trans['stock_id']); diff --git a/reporting/reports_main.php b/reporting/reports_main.php index 9eff484c..8b1e87c4 100644 --- a/reporting/reports_main.php +++ b/reporting/reports_main.php @@ -149,6 +149,7 @@ $reports->addReport(_('Inventory'),303,_('Stock &Check Sheets'), new ReportParam(_('Location'),'LOCATIONS'), new ReportParam(_('Show Pictures'),'YES_NO'), new ReportParam(_('Inventory Column'),'YES_NO'), + new ReportParam(_('Show Shortage'),'YES_NO'), new ReportParam(_('Comments'),'TEXTBOX'), new ReportParam(_('Destination'),'DESTINATION'))); $reports->addReport(_('Inventory'),304,_('Inventory &Sales Report'), -- 2.30.2