[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3180] trunk/sql/modules/Company.sql
- Subject: SF.net SVN: ledger-smb:[3180] trunk/sql/modules/Company.sql
- From: ..hidden..
- Date: Wed, 25 May 2011 04:47:51 +0000
Revision: 3180
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3180&view=rev
Author: einhverfr
Date: 2011-05-25 04:47:51 +0000 (Wed, 25 May 2011)
Log Message:
-----------
Committing patch 2970168, sales tax
Modified Paths:
--------------
trunk/sql/modules/Company.sql
Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql 2011-05-25 04:43:58 UTC (rev 3179)
+++ trunk/sql/modules/Company.sql 2011-05-25 04:47:51 UTC (rev 3180)
@@ -153,22 +153,20 @@
BEGIN
SELECT * FROM entity_credit_account into eca WHERE id = in_credit_id;
-
IF eca.entity_class = 1 then
- DELETE FROM customertax WHERE customer_id = in_credit_id;
+ DELETE FROM vendortax WHERE vendor_id = in_credit_id;
FOR iter in array_lower(in_tax_ids, 1) .. array_upper(in_tax_ids, 1)
LOOP
- INSERT INTO customertax (customer_id, chart_id)
+ INSERT INTO vendortax (vendor_id, chart_id)
values (in_credit_id, in_tax_ids[iter]);
END LOOP;
ELSIF eca.entity_class = 2 then
- DELETE FROM vendortax WHERE vendor_id = in_credit_id;
+ DELETE FROM customertax WHERE customer_id = in_credit_id;
FOR iter in array_lower(in_tax_ids, 1) .. array_upper(in_tax_ids, 1)
LOOP
- INSERT INTO vendortax (vendor_id, chart_id)
+ INSERT INTO customertax (customer_id, chart_id)
values (in_credit_id, in_tax_ids[iter]);
END LOOP;
-
ELSE
RAISE EXCEPTION 'Wrong entity class or credit account not found!';
END IF;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.