Added extra select option in Stock Check Sheet.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 25 May 2009 15:06:31 +0000 (15:06 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 25 May 2009 15:06:31 +0000 (15:06 +0000)
CHANGELOG.txt
reporting/rep303.php
reporting/reports_main.php

index 071ab4c223f9b235d4e55fd7845e1afe4c5ec43d..3574c50be3fae91f005b3ebc100ba5dc60dc039d 100644 (file)
@@ -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.
index 4cf207ada706124f43cd2344bf92a6e5ccfe09d6..a1f70d85313a16276ed73a809cc82a87d6e3d1d4 100644 (file)
@@ -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']);
index 9eff484c08b228e1f33b0a0c70305600f34964cf..8b1e87c4de97928a6c65ecb6a7452f31c18c2573 100644 (file)
@@ -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'),