From: Joe Hunt Date: Sun, 16 Jun 2019 06:55:00 +0000 (+0200) Subject: Fixing Get_domestic_price in rep301 and rep308. @boxygen. X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=936e862fe67af1b6113aee0d727eb86e7f021cc1 Fixing Get_domestic_price in rep301 and rep308. @boxygen. --- diff --git a/reporting/rep301.php b/reporting/rep301.php index 4ef14f1c..168b6e22 100644 --- a/reporting/rep301.php +++ b/reporting/rep301.php @@ -30,20 +30,15 @@ print_inventory_valuation_report(); function get_domestic_price($myrow, $stock_id) { - if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT) + $price = $myrow['price']; + if ($myrow['person_id'] > 0) { - $price = $myrow['price']; - if ($myrow['person_id'] > 0) - { - // Do we have foreign currency? - $supp = get_supplier($myrow['person_id']); - $currency = $supp['curr_code']; - $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date'])); - $price /= $ex_rate; - } - } - else - $price = $myrow['standard_cost']; // Item Adjustments just have the real cost + // Do we have foreign currency? + $supp = get_supplier($myrow['person_id']); + $currency = $supp['curr_code']; + $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date'])); + $price /= $ex_rate; + } return $price; } diff --git a/reporting/rep308.php b/reporting/rep308.php index ba546b21..84f43a79 100644 --- a/reporting/rep308.php +++ b/reporting/rep308.php @@ -32,20 +32,15 @@ inventory_movements(); function get_domestic_price($myrow, $stock_id) { - if ($myrow['type'] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT) + $price = $myrow['price']; + if ($myrow['person_id'] > 0) { - $price = $myrow['price']; - if ($myrow['person_id'] > 0) - { - // Do we have foreign currency? - $supp = get_supplier($myrow['person_id']); - $currency = $supp['curr_code']; - $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date'])); - $price /= $ex_rate; - } - } - else - $price = $myrow['standard_cost']; // Item Adjustments just have the real cost + // Do we have foreign currency? + $supp = get_supplier($myrow['person_id']); + $currency = $supp['curr_code']; + $ex_rate = get_exchange_rate_to_home_currency($currency, sql2date($myrow['tran_date'])); + $price /= $ex_rate; + } return $price; }