projects
/
xtuple
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0309307
)
Issue #23254:fix gain/loss calculation
author
garyhgohoos
<gary@xtuple.com>
Thu, 7 Aug 2014 13:33:33 +0000
(09:33 -0400)
committer
garyhgohoos
<gary@xtuple.com>
Thu, 7 Aug 2014 13:33:33 +0000
(09:33 -0400)
foundation-database/public/functions/postcashreceipt.sql
patch
|
blob
|
history
diff --git
a/foundation-database/public/functions/postcashreceipt.sql
b/foundation-database/public/functions/postcashreceipt.sql
index
b6f20b2
..
f132e8f
100644
(file)
--- a/
foundation-database/public/functions/postcashreceipt.sql
+++ b/
foundation-database/public/functions/postcashreceipt.sql
@@
-336,7
+336,8
@@
BEGIN
-- Post any gain/loss from the alternate currency exchange rate
IF (COALESCE(_p.cashrcpt_alt_curr_rate, 0.0) <> 0.0) THEN
- _exchGain := ROUND((_p.cashrcpt_curr_rate - _p.cashrcpt_alt_curr_rate) * _p.cashrcpt_amount_base, 2);
+ _exchGain := ROUND((_p.cashrcpt_amount / _p.cashrcpt_alt_curr_rate) -
+ (_p.cashrcpt_amount / _p.cashrcpt_curr_rate), 2);
IF (_exchGain <> 0) THEN
PERFORM insertIntoGLSeries( _sequence, 'A/R', 'CR',