[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[4223] branches/1.3/sql/modules/Payment.sql
- Subject: SF.net SVN: ledger-smb:[4223] branches/1.3/sql/modules/Payment.sql
- From: ..hidden..
- Date: Sat, 17 Dec 2011 10:24:01 +0000
Revision: 4223
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4223&view=rev
Author: ehuelsmann
Date: 2011-12-17 10:24:00 +0000 (Sat, 17 Dec 2011)
Log Message:
-----------
Align remainder of Payment.sql with Perl code which does
"($form{vc} eq 'customer'\) \? 'buy' : 'sell'", effectively inverting
column selection.
Modified Paths:
--------------
branches/1.3/sql/modules/Payment.sql
Modified: branches/1.3/sql/modules/Payment.sql
===================================================================
--- branches/1.3/sql/modules/Payment.sql 2011-12-17 08:58:12 UTC (rev 4222)
+++ branches/1.3/sql/modules/Payment.sql 2011-12-17 10:24:00 UTC (rev 4223)
@@ -707,7 +707,7 @@
-- We need to know the exchangerate of this transaction
IF (current_exchangerate = 1 ) THEN
old_exchangerate := 1;
- ELSIF (in_account_class = 1) THEN
+ ELSIF (in_account_class = 2) THEN
SELECT buy INTO old_exchangerate
FROM exchangerate e
JOIN ap a on (a.transdate = e.transdate )
@@ -936,7 +936,7 @@
IF default_currency = in_currency THEN
RETURN 1;
END IF;
- IF in_account_class = 1 THEN
+ IF in_account_class = 2 THEN
SELECT buy INTO out_exrate
FROM exchangerate
WHERE transdate = in_date AND curr = in_currency;
@@ -1176,14 +1176,14 @@
FROM exchangerate
WHERE transdate = in_date;
IF current_exrate.transdate = in_date THEN
- IF in_account_class = 1 THEN
+ IF in_account_class = 2 THEN
UPDATE exchangerate set buy = in_exchangerate where transdate = in_date;
ELSE
UPDATE exchangerate set sell = in_exchangerate where transdate = in_date;
END IF;
RETURN 0;
ELSE
- IF in_account_class = 1 THEN
+ IF in_account_class = 2 THEN
INSERT INTO exchangerate (curr, transdate, buy) values (in_currency, in_date, in_exchangerate);
ELSE
INSERT INTO exchangerate (curr, transdate, sell) values (in_currency, in_date, in_exchangerate);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.