[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[4239] branches/1.3/sql/modules/Payment.sql



Revision: 4239
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4239&view=rev
Author:   ehuelsmann
Date:     2011-12-26 11:12:06 +0000 (Mon, 26 Dec 2011)
Log Message:
-----------
Payment.sql: Decommission FX_gain and FX_loss setting_keys.

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-26 09:40:33 UTC (rev 4238)
+++ branches/1.3/sql/modules/Payment.sql	2011-12-26 11:12:06 UTC (rev 4239)
@@ -700,14 +700,12 @@
 
        IF (fx_gain_loss_amount < 0) THEN
            INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source)
-            VALUES ((select id from account JOIN defaults ON accno = value
-                     WHERE setting_key = 'FX_gain'),
+            VALUES ((select value::int from defaults WHERE setting_key = 'fxgain_accno_id'),
                     fx_gain_loss_amount, in_transaction_id[out_count], in_datepaid, coalesce(in_approved, true),
                     in_source[out_count]);
         ELSIF (fx_gain_loss_amount > 0) THEN
             INSERT INTO acc_trans (chart_id, amount, trans_id, transdate, approved, source)
-            VALUES ((select id from account JOIN defaults ON accno = value
-                     WHERE setting_key = 'FX_loss'),
+            VALUES ((select value::int from defaults WHERE setting_key = 'fxloss_accno_id'),
                     fx_gain_loss_amount, in_transaction_id[out_count], in_datepaid, coalesce(in_approved, true),
                     in_source[out_count]);
         END IF; 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.