X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep303.php;h=b72e9db353f6cbd071edd9e0db23b702b8a2b486;hb=a2e0638b8caab0356ee8d39b5761745a5991fc2d;hp=2ac79f8d739f2e2e0c012fab2f95edfe1e608368;hpb=80dd97a37f674cc3691fa04af4c29607067566b2;p=fa-stable.git diff --git a/reporting/rep303.php b/reporting/rep303.php index 2ac79f8d..b72e9db3 100644 --- a/reporting/rep303.php +++ b/reporting/rep303.php @@ -34,7 +34,7 @@ function getTransactions($category, $location) $sql = "SELECT ".TB_PREF."stock_master.category_id, ".TB_PREF."stock_category.description AS cat_description, ".TB_PREF."stock_master.stock_id, - ".TB_PREF."stock_master.description, + ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.inactive, IF(".TB_PREF."stock_moves.stock_id IS NULL, '', ".TB_PREF."stock_moves.loc_code) AS loc_code, SUM(IF(".TB_PREF."stock_moves.stock_id IS NULL,0,".TB_PREF."stock_moves.qty)) AS QtyOnHand FROM (".TB_PREF."stock_master, @@ -44,9 +44,9 @@ function getTransactions($category, $location) WHERE ".TB_PREF."stock_master.category_id=".TB_PREF."stock_category.category_id AND (".TB_PREF."stock_master.mb_flag='B' OR ".TB_PREF."stock_master.mb_flag='M')"; if ($category != 0) - $sql .= " AND ".TB_PREF."stock_master.category_id = '$category'"; + $sql .= " AND ".TB_PREF."stock_master.category_id = ".db_escape($category); if ($location != 'all') - $sql .= " AND IF(".TB_PREF."stock_moves.stock_id IS NULL, '1=1',".TB_PREF."stock_moves.loc_code = '$location')"; + $sql .= " AND IF(".TB_PREF."stock_moves.stock_id IS NULL, '1=1',".TB_PREF."stock_moves.loc_code = ".db_escape($location).")"; $sql .= " GROUP BY ".TB_PREF."stock_master.category_id, ".TB_PREF."stock_category.description, ".TB_PREF."stock_master.stock_id, @@ -61,7 +61,7 @@ function getTransactions($category, $location) function print_stock_check() { - global $comp_path, $path_to_root, $pic_height, $pic_width; + global $path_to_root, $pic_height, $pic_width; $category = $_POST['PARAM_0']; $location = $_POST['PARAM_1']; @@ -87,7 +87,7 @@ function print_stock_check() if ($location == 'all') $loc = _('All'); else - $loc = $location; + $loc = get_location_name($location); if ($shortage) { $short = _('Yes'); @@ -126,7 +126,7 @@ function print_stock_check() $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); - $rep->Header(); + $rep->NewPage(); $res = getTransactions($category, $location); $catt = ''; @@ -139,7 +139,9 @@ function print_stock_check() $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); + $flag = get_mb_flag($trans['stock_id']); + if ($flag == 'M') + $onorder += get_on_worder_qty($trans['stock_id'], $loc_code); if ($shortage && $trans['QtyOnHand'] - $demandqty >= 0) continue; if ($catt != $trans['cat_description']) @@ -157,7 +159,7 @@ function print_stock_check() $rep->NewLine(); $dec = get_qty_dec($trans['stock_id']); $rep->TextCol(0, 1, $trans['stock_id']); - $rep->TextCol(1, 2, $trans['description']); + $rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1); $rep->AmountCol(2, 3, $trans['QtyOnHand'], $dec); if ($check) { @@ -174,13 +176,13 @@ function print_stock_check() } if ($pictures) { - $image = $comp_path .'/'. $user_comp . '/images/' + $image = company_path() . '/images/' . item_img_name($trans['stock_id']) . '.jpg'; if (file_exists($image)) { $rep->NewLine(); if ($rep->row - $pic_height < $rep->bottomMargin) - $rep->Header(); + $rep->NewPage(); $rep->AddImage($image, $rep->cols[1], $rep->row - $pic_height, 0, $pic_height); $rep->row -= $pic_height; $rep->NewLine();