X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep306.php;h=9dc886a10bea22481318af64bae8e8ac0e9f1ae6;hb=36823b0fc61d0b2bcffb5d6fbdcc8b1714e8c9c9;hp=5aa110418b524a7fa52910f58c8e8a68cfea47c8;hpb=4158930d4c9563173ff14f5586df4574e40516f5;p=fa-stable.git diff --git a/reporting/rep306.php b/reporting/rep306.php index 5aa11041..9dc886a1 100644 --- a/reporting/rep306.php +++ b/reporting/rep306.php @@ -9,7 +9,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 'SA_SALESANALYTIC'; +$page_security = 'SA_SUPPLIERANALYTIC'; // ---------------------------------------------------------------- // $ Revision: 2.0 $ // Creator: Joe Hunt @@ -39,7 +39,6 @@ function getTransactions($category, $location, $fromsupp, $item, $from, $to) item.description, item.inactive, move.loc_code, supplier.supplier_id , IF(ISNULL(grn.rate), credit.rate, grn.rate) ex_rate, - supplier.supplier_id, supplier.supp_name AS supplier_name, move.tran_date, move.qty AS qty, @@ -86,10 +85,7 @@ function get_supp_inv_reference($supplier_id, $stock_id, $date) AND trans.tran_date=".db_escape($date); $result = db_query($sql,"No transactions were returned"); $row = db_fetch_row($result); - if (isset($row[0])) - return $row[0]; - else - return ''; + return is_array($row) ? $row[0] : ''; } //---------------------------------------------------------------------------------------------------- @@ -225,9 +221,7 @@ function print_inventory_purchase() } $curr = get_supplier_currency($trans['supplier_id']); - //$rate = get_exchange_rate_from_home_currency($curr, sql2date($trans['tran_date'])); - $rate = $trans['ex_rate']; - $trans['price'] *= $rate; + $trans['price'] *= $trans['ex_rate']; $rep->NewLine(); $trans['supp_reference'] = get_supp_inv_reference($trans['supplier_id'], $trans['stock_id'], $trans['tran_date']); $rep->fontSize -= 2; @@ -269,7 +263,7 @@ function print_inventory_purchase() $rep->NewLine(); $rep->NewLine(); $total_supp = $total_qty = 0.0; - $supplier_name = $trans['supplier_name']; + $supplier_name = isset($trans['supplier_name']) ? $trans['supplier_name'] : ""; } } if ($supplier_name != '')