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;
}
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;
}