projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7d30497
)
DataObjects/Core_curr_rate.php
author
Alan Knowles
<alan@roojs.com>
Mon, 5 Oct 2015 08:10:56 +0000
(16:10 +0800)
committer
Alan Knowles
<alan@roojs.com>
Mon, 5 Oct 2015 08:10:56 +0000
(16:10 +0800)
DataObjects/Core_curr_rate.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_curr_rate.php
b/DataObjects/Core_curr_rate.php
index
98dfa05
..
82f34b2
100644
(file)
--- a/
DataObjects/Core_curr_rate.php
+++ b/
DataObjects/Core_curr_rate.php
@@
-157,11
+157,19
@@
class Pman_Core_DataObjects_Core_curr_rate extends DB_DataObject
{
- $fr = $this->rate($from, $when)
+ $fr = $this->rate($from, $when);
+ $tr = $this->rate($to, $when);
+ if ($fr === false) {
+ $fr = 1;
+ }
+ if ($tr === false) {
+ $tr = 1;
+ }
+
//echo '<PRE>';print_R($this->rates);
- $base = (1.0 / $
this->rates[$from]
) * $val;
+ $base = (1.0 / $
fr
) * $val;
- return $t
his->rates[$to]
* $base;
+ return $t
r
* $base;
}