Fixing Get_domestic_price in rep301 and rep308. @boxygen.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 16 Jun 2019 06:55:00 +0000 (08:55 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Sun, 16 Jun 2019 06:55:00 +0000 (08:55 +0200)
reporting/rep301.php
reporting/rep308.php

index 4ef14f1ca9d4210d6f0129cfff93bb4b1b34db18..168b6e228104bea815dd9f44e609bac69fc27f90 100644 (file)
@@ -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;
 }      
 
index ba546b214a82ae4fd102430a04a07219e7cefc8d..84f43a79a04bf745d0ace6f436800134d22d3ade 100644 (file)
@@ -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;
 }