From 6b30619eff8469a679e7c18a19b6df7091417128 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 9 Dec 2015 14:52:45 +0100 Subject: [PATCH] Fixed inventory reports that didn't know about our new Fixed Asset flag. --- reporting/rep104.php | 2 +- reporting/rep301.php | 2 +- reporting/rep304.php | 3 ++- reporting/rep305.php | 1 + reporting/rep307.php | 2 +- reporting/rep308.php | 2 +- reporting/rep309.php | 1 + 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/reporting/rep104.php b/reporting/rep104.php index bea243a8..4246e8e0 100644 --- a/reporting/rep104.php +++ b/reporting/rep104.php @@ -41,7 +41,7 @@ function fetch_items($category=0) WHERE item.category_id=category.category_id AND NOT item.inactive"; if ($category != 0) $sql .= " AND category.category_id = ".db_escape($category); - $sql .= " ORDER BY item.category_id, + $sql .= " AND item.mb_flag<> 'F' ORDER BY item.category_id, item.stock_id"; return db_query($sql,"No transactions were returned"); diff --git a/reporting/rep301.php b/reporting/rep301.php index 0c8ce806..403e4b4b 100644 --- a/reporting/rep301.php +++ b/reporting/rep301.php @@ -113,7 +113,7 @@ function getTransactions($category, $location, $date) .TB_PREF."stock_moves move WHERE item.stock_id=move.stock_id AND item.category_id=category.category_id - AND item.mb_flag<>'D' + AND item.mb_flag<>'D' AND mb_flag <> 'F' AND move.tran_date <= '$date' GROUP BY item.category_id, category.description, "; diff --git a/reporting/rep304.php b/reporting/rep304.php index a3a87dae..28297c58 100644 --- a/reporting/rep304.php +++ b/reporting/rep304.php @@ -62,7 +62,8 @@ function getTransactions($category, $location, $fromcust, $from, $to, $show_serv if (!$show_service) $sql .= " AND (item.mb_flag='B' OR item.mb_flag='M')"; - + else + $sql .= " AND item.mb_flag<>'F'"; if ($category != 0) $sql .= " AND item.category_id = ".db_escape($category); diff --git a/reporting/rep305.php b/reporting/rep305.php index 4cd9229d..a6f8a9bc 100644 --- a/reporting/rep305.php +++ b/reporting/rep305.php @@ -53,6 +53,7 @@ function getTransactions($from, $to) AND grn_line.qty_recd>0 AND grn.delivery_date>='$from' AND grn.delivery_date<='$to' + AND item.mb_flag <>'F' ORDER BY item.stock_id, grn.delivery_date"; return db_query($sql,"No transactions were returned"); diff --git a/reporting/rep307.php b/reporting/rep307.php index 19db4099..aee04a26 100644 --- a/reporting/rep307.php +++ b/reporting/rep307.php @@ -37,7 +37,7 @@ function fetch_items($category=0) units, cat.description FROM ".TB_PREF."stock_master stock LEFT JOIN ".TB_PREF."stock_category cat ON stock.category_id=cat.category_id - WHERE mb_flag <> 'D'"; + WHERE mb_flag <> 'D' AND mb_flag <>'F'"; if ($category != 0) $sql .= " AND cat.category_id = ".db_escape($category); $sql .= " ORDER BY stock.category_id, stock_id"; diff --git a/reporting/rep308.php b/reporting/rep308.php index 53f8195e..08b8e898 100644 --- a/reporting/rep308.php +++ b/reporting/rep308.php @@ -67,7 +67,7 @@ function fetch_items($category=0) stock.category_id,units, cat.description FROM ".TB_PREF."stock_master stock LEFT JOIN ".TB_PREF."stock_category cat ON stock.category_id=cat.category_id - WHERE mb_flag <> 'D'"; + WHERE mb_flag <> 'D' AND mb_flag <> 'F'"; if ($category != 0) $sql .= " AND cat.category_id = ".db_escape($category); $sql .= " ORDER BY stock.category_id, stock_id"; diff --git a/reporting/rep309.php b/reporting/rep309.php index b9c90bc4..f52dc22a 100644 --- a/reporting/rep309.php +++ b/reporting/rep309.php @@ -50,6 +50,7 @@ function getTransactions($category, $from, $to) AND trans.tran_date>='$from' AND trans.tran_date<='$to' AND line.quantity<>0 + AND item.mb_flag <>'F' AND line.debtor_trans_type = ".ST_SALESINVOICE; if ($category != 0) $sql .= " AND item.category_id = ".db_escape($category); -- 2.30.2