X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep305.php;h=6711d9b7f4257bb7f1a8e42b9432a671760a478f;hb=4b01b6447fcf5849486a8b048f06c1c8bbb13021;hp=56ec99cb068a5f63328d04fecd0cfcfc44cb127a;hpb=bfe84895e7476db30190858c8013a47ce0b4929c;p=fa-stable.git diff --git a/reporting/rep305.php b/reporting/rep305.php index 56ec99cb..6711d9b7 100644 --- a/reporting/rep305.php +++ b/reporting/rep305.php @@ -9,12 +9,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 2; +$page_security = 'SA_SUPPLIERANALYTIC'; // ---------------------------------------------------------------- // $ Revision: 2.0 $ // Creator: Joe Hunt // date_: 2005-05-19 -// Title: Inventory Planning +// Title: GRN Valuation Report // ---------------------------------------------------------------- $path_to_root=".."; @@ -33,18 +33,20 @@ function getTransactions($from, $to) { $from = date2sql($from); $to = date2sql($to); - $sql = "SELECT ".TB_PREF."grn_batch.delivery_date, ".TB_PREF."grn_batch.supplier_id, - ".TB_PREF."purch_order_details.*, - ".TB_PREF."stock_master.description - FROM ".TB_PREF."stock_master, - ".TB_PREF."purch_order_details, - ".TB_PREF."grn_batch - WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."purch_order_details.item_code - AND ".TB_PREF."grn_batch.purch_order_no=".TB_PREF."purch_order_details.order_no - AND ".TB_PREF."purch_order_details.quantity_received>0 - AND ".TB_PREF."grn_batch.delivery_date>='$from' - AND ".TB_PREF."grn_batch.delivery_date<='$to' - ORDER BY ".TB_PREF."stock_master.stock_id, ".TB_PREF."grn_batch.delivery_date"; + + $sql = "SELECT DISTINCT ".TB_PREF."grn_batch.supplier_id, + ".TB_PREF."purch_order_details.*, + ".TB_PREF."stock_master.description, ".TB_PREF."stock_master.inactive + FROM ".TB_PREF."stock_master, + ".TB_PREF."purch_order_details, + ".TB_PREF."grn_batch + WHERE ".TB_PREF."stock_master.stock_id=".TB_PREF."purch_order_details.item_code + AND ".TB_PREF."grn_batch.purch_order_no=".TB_PREF."purch_order_details.order_no + AND ".TB_PREF."purch_order_details.quantity_received>0 + AND ".TB_PREF."grn_batch.delivery_date>='$from' + AND ".TB_PREF."grn_batch.delivery_date<='$to' + ORDER BY ".TB_PREF."stock_master.stock_id, ".TB_PREF."grn_batch.delivery_date"; + return db_query($sql,"No transactions were returned"); } @@ -78,7 +80,7 @@ function print_grn_valuation() $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); - $rep->Header(); + $rep->NewPage(); $res = getTransactions($from, $to); $total = $qtotal = $grandtotal = 0.0; @@ -106,7 +108,7 @@ function print_grn_valuation() $rep->NewLine(); $rep->TextCol(0, 1, $trans['item_code']); - $rep->TextCol(1, 2, $trans['description']); + $rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1); $rep->TextCol(2, 3, $trans['order_no']); $qdec = get_qty_dec($trans['item_code']); $rep->AmountCol(3, 4, $trans['quantity_received'], $qdec);