X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep303.php;h=d9904bfc101b368d51663183b24f306e65438e1d;hb=931f50706c4dcc60c5a26c99d0837b7509277f78;hp=cc1eeec0215f967e31395a883843814250371d1b;hpb=e1ad4f3f77cb20f692185b0b5e493820c5fb7f77;p=fa-stable.git diff --git a/reporting/rep303.php b/reporting/rep303.php index cc1eeec0..d9904bfc 100644 --- a/reporting/rep303.php +++ b/reporting/rep303.php @@ -1,12 +1,12 @@ . ***********************************************************************/ $page_security = 'SA_ITEMSVALREP'; @@ -34,6 +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.units, ".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 @@ -61,7 +62,7 @@ function getTransactions($category, $location) function print_stock_check() { - global $comp_path, $path_to_root, $pic_height; + global $path_to_root, $pic_height; $category = $_POST['PARAM_0']; $location = $_POST['PARAM_1']; @@ -70,7 +71,8 @@ function print_stock_check() $shortage = $_POST['PARAM_4']; $no_zeros = $_POST['PARAM_5']; $comments = $_POST['PARAM_6']; - $destination = $_POST['PARAM_7']; + $destination = $_POST['PARAM_7']; + if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else @@ -93,7 +95,7 @@ function print_stock_check() { $short = _('Yes'); $available = _('Shortage'); - } + } else { $short = _('No'); @@ -103,15 +105,15 @@ function print_stock_check() else $nozeros = _('No'); if ($check) { - $cols = array(0, 100, 250, 295, 345, 390, 445, 515); - $headers = array(_('Stock ID'), _('Description'), _('Quantity'), _('Check'), _('Demand'), $available, _('On Order')); - $aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right'); + $cols = array(0, 75, 225, 250, 295, 345, 390, 445, 515); + $headers = array(_('Stock ID'), _('Description'), _('UOM'), _('Quantity'), _('Check'), _('Demand'), $available, _('On Order')); + $aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right'); } else { - $cols = array(0, 100, 250, 315, 380, 445, 515); - $headers = array(_('Stock ID'), _('Description'), _('Quantity'), _('Demand'), $available, _('On Order')); - $aligns = array('left', 'left', 'right', 'right', 'right', 'right'); + $cols = array(0, 75, 225, 250, 315, 380, 445, 515); + $headers = array(_('Stock ID'), _('Description'), _('UOM'), _('Quantity'), _('Demand'), $available, _('On Order')); + $aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right'); } @@ -126,11 +128,11 @@ function print_stock_check() else $user_comp = ""; - $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize()); + $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize()); - $rep->Font(); - $rep->Info($params, $cols, $headers, $aligns); - $rep->Header(); + $rep->Font(); + $rep->Info($params, $cols, $headers, $aligns); + $rep->NewPage(); $res = getTransactions($category, $location); $catt = ''; @@ -166,29 +168,30 @@ function print_stock_check() $dec = get_qty_dec($trans['stock_id']); $rep->TextCol(0, 1, $trans['stock_id']); $rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1); - $rep->AmountCol(2, 3, $trans['QtyOnHand'], $dec); + $rep->TextCol(2, 3, $trans['units']); + $rep->AmountCol(3, 4, $trans['QtyOnHand'], $dec); if ($check) { - $rep->TextCol(3, 4, "_________"); - $rep->AmountCol(4, 5, $demandqty, $dec); - $rep->AmountCol(5, 6, $trans['QtyOnHand'] - $demandqty, $dec); - $rep->AmountCol(6, 7, $onorder, $dec); + $rep->TextCol(4, 5, "_________"); + $rep->AmountCol(5, 6, $demandqty, $dec); + $rep->AmountCol(6, 7, $trans['QtyOnHand'] - $demandqty, $dec); + $rep->AmountCol(7, 8, $onorder, $dec); } else { - $rep->AmountCol(3, 4, $demandqty, $dec); - $rep->AmountCol(4, 5, $trans['QtyOnHand'] - $demandqty, $dec); - $rep->AmountCol(5, 6, $onorder, $dec); + $rep->AmountCol(4, 5, $demandqty, $dec); + $rep->AmountCol(5, 6, $trans['QtyOnHand'] - $demandqty, $dec); + $rep->AmountCol(6, 7, $onorder, $dec); } 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();