X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep301.php;h=57350d8c31793bf021643af01d983d92ee69ff5f;hb=d63ba7b7819e07a73cd1999cec249fc6f0b009fb;hp=e40b412818f6eedc6257c189ae72c0727fb80a65;hpb=c2b751f91d79c69bb802b1bff13a3c4bdecb87b0;p=fa-stable.git diff --git a/reporting/rep301.php b/reporting/rep301.php index e40b4128..57350d8c 100644 --- a/reporting/rep301.php +++ b/reporting/rep301.php @@ -30,7 +30,7 @@ print_inventory_valuation_report(); function get_domestic_price($myrow, $stock_id) { - if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT || $myrow['type'] == ST_INVADJUST) + if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT) { $price = $myrow['price']; if ($myrow['person_id'] > 0) @@ -91,30 +91,34 @@ function getTransactions($category, $location, $date) { $date = date2sql($date); + $dec = user_qty_dec(); $sql = "SELECT item.category_id, category.description AS cat_description, item.stock_id, item.units, item.description, item.inactive, move.loc_code, + units.decimals, SUM(move.qty) AS QtyOnHand, item.material_cost AS UnitCost, SUM(move.qty) * item.material_cost AS ItemTotal FROM " .TB_PREF."stock_master item," .TB_PREF."stock_category category," - .TB_PREF."stock_moves move + .TB_PREF."stock_moves move," + .TB_PREF."item_units units WHERE item.stock_id=move.stock_id AND item.category_id=category.category_id AND item.mb_flag<>'D' AND mb_flag <> 'F' AND move.tran_date <= '$date' + AND item.units=units.abbr GROUP BY item.category_id, category.description, "; if ($location != 'all') $sql .= "move.loc_code, "; $sql .= "item.stock_id, item.description - HAVING SUM(move.qty) != 0"; + HAVING ROUND(SUM(move.qty), IF(units.decimals <> -1, units.decimals, $dec)) != 0"; if ($category != 0) $sql .= " AND item.category_id = ".db_escape($category); if ($location != 'all')