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

SF.net SVN: ledger-smb:[3083] trunk



Revision: 3083
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3083&view=rev
Author:   einhverfr
Date:     2010-10-03 23:50:11 +0000 (Sun, 03 Oct 2010)

Log Message:
-----------

* Payment fixes post-multicurrency-addition
* Database load error fixes
* customer/vendor saving syntax error fix
* Fix to ensure 1099 stuff gets loaded on database creation

Modified Paths:
--------------
    trunk/sql/Pg-database.sql
    trunk/sql/modules/Company.sql
    trunk/sql/modules/LOADORDER
    trunk/sql/modules/Payment.sql
    trunk/t/40-dbsetup.t

Modified: trunk/sql/Pg-database.sql
===================================================================
--- trunk/sql/Pg-database.sql	2010-10-02 00:03:19 UTC (rev 3082)
+++ trunk/sql/Pg-database.sql	2010-10-03 23:50:11 UTC (rev 3083)
@@ -37,8 +37,8 @@
   account_id int not null references account(id), 
   amount numeric not null,
   id serial not null unique,
-  debits NUMERIC;
-  credits NUMERIC;
+  debits NUMERIC,
+  credits NUMERIC,
   primary key (end_date, account_id)
 );
 

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2010-10-02 00:03:19 UTC (rev 3082)
+++ trunk/sql/modules/Company.sql	2010-10-03 23:50:11 UTC (rev 3083)
@@ -42,7 +42,7 @@
                        WHERE meta_number = in_meta_number
                       UNION ALL
                       SELECT * from entity_credit_account
-                       WHERE meta_number ec IS NULL) ec ON (ec.entity_id = e.id)
+                       WHERE meta_number IS NULL) ec ON (ec.entity_id = e.id)
 		LEFT JOIN business b ON (ec.business_id = b.id)
 		WHERE ec.entity_class = in_account_class
 			AND (c.id IN (select company_id FROM company_to_contact

Modified: trunk/sql/modules/LOADORDER
===================================================================
--- trunk/sql/modules/LOADORDER	2010-10-02 00:03:19 UTC (rev 3082)
+++ trunk/sql/modules/LOADORDER	2010-10-03 23:50:11 UTC (rev 3083)
@@ -19,3 +19,5 @@
 Voucher.sql
 admin.sql
 Reconciliation.sql
+TaxForm.sql
+1099_reports.sql

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2010-10-02 00:03:19 UTC (rev 3082)
+++ trunk/sql/modules/Payment.sql	2010-10-03 23:50:11 UTC (rev 3083)
@@ -494,7 +494,9 @@
 		t_voucher_id := currval('voucher_id_seq');
 	END IF;
 
-	SELECT string_to_array(value, ':') from defaults where setting_key = 'curr';
+	SELECT string_to_array(value, ':') into t_currs 
+          from defaults 
+         where setting_key = 'curr';
 
         IF (in_curr IS NULL OR in_curr = t_currs[0]) THEN
                 t_exchangerate := 1;
@@ -528,7 +530,7 @@
 			WHEN $E$ || quote_literal(in_account_class) || $E$ = 2 
 			THEN $E$ || t_ar_ap_id || $E$
 			ELSE -1 END, 
-		amount * t_exchangerate,
+		amount * $E$|| quote_literal(t_exchangerate) || $E$,
 		CASE 
 			WHEN $E$|| t_voucher_id || $E$ IS NULL THEN true
 			ELSE false END,
@@ -547,7 +549,7 @@
 			WHEN $E$ || quote_literal(in_account_class) || $E$ = 2 
 			THEN $E$ || t_cash_id || $E$
 			ELSE -1 END, 
-		amount * -1 * t_exchangerate,
+		amount * -1 * $E$|| quote_literal(t_exchangerate) || $E$,
 		CASE 
 			WHEN $E$|| t_voucher_id || $E$ IS NULL THEN true
 			ELSE false END,

Modified: trunk/t/40-dbsetup.t
===================================================================
--- trunk/t/40-dbsetup.t	2010-10-02 00:03:19 UTC (rev 3082)
+++ trunk/t/40-dbsetup.t	2010-10-03 23:50:11 UTC (rev 3083)
@@ -20,7 +20,7 @@
 }
 
 if ($run_tests){
-	plan tests => 33;
+	plan tests => 35;
 	$ENV{PGDATABASE} = $ENV{LSMB_NEW_DB};
 }
 


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