[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3679] trunk/sql
- Subject: SF.net SVN: ledger-smb:[3679] trunk/sql
- From: ..hidden..
- Date: Tue, 23 Aug 2011 17:06:28 +0000
Revision: 3679
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3679&view=rev
Author: einhverfr
Date: 2011-08-23 17:06:28 +0000 (Tue, 23 Aug 2011)
Log Message:
-----------
Fixes to bulk payment routines to match acc_trans table structure
Modified Paths:
--------------
trunk/sql/modules/Payment.sql
Added Paths:
-----------
trunk/sql/upgrade/3679-drop-payment-function.sql
Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql 2011-08-22 23:23:44 UTC (rev 3678)
+++ trunk/sql/modules/Payment.sql 2011-08-23 17:06:28 UTC (rev 3679)
@@ -437,7 +437,7 @@
CREATE OR REPLACE FUNCTION payment_bulk_post
(in_transactions numeric[], in_batch_id int, in_source text, in_total numeric,
in_ar_ap_accno text, in_cash_accno text,
- in_payment_date date, in_account_class int, in_payment_type int,
+ in_payment_date date, in_account_class int,
in_exchangerate numeric, in_curr text)
RETURNS int AS
$$
@@ -492,7 +492,7 @@
EXECUTE $E$
INSERT INTO acc_trans
(trans_id, chart_id, amount, approved, voucher_id, transdate,
- source, payment_type)
+ source)
SELECT id,
case when $E$ || quote_literal(in_account_class) || $E$ = 1
THEN $E$ || t_cash_id || $E$
@@ -505,13 +505,13 @@
ELSE false END,
$E$ || t_voucher_id || $E$, $E$|| quote_literal(in_payment_date)
||$E$ , $E$ ||COALESCE(quote_literal(in_source), 'NULL') ||
- $E$ , $E$ || coalesce(quote_literal(in_payment_type), 'NULL') || $E$
+ $E$
FROM bulk_payments_in where amount <> 0 $E$;
EXECUTE $E$
INSERT INTO acc_trans
(trans_id, chart_id, amount, approved, voucher_id, transdate,
- source, payment_type)
+ source)
SELECT id,
case when $E$ || quote_literal(in_account_class) || $E$ = 1
THEN $E$ || t_ar_ap_id || $E$
@@ -524,7 +524,7 @@
ELSE false END,
$E$ || t_voucher_id || $E$, $E$|| quote_literal(in_payment_date)
||$E$ , $E$ ||COALESCE(quote_literal(in_source), 'null')
- ||$E$ , $E$ || coalesce(quote_literal(in_payment_type), 'NULL') || $E$
+ ||$E$
FROM bulk_payments_in where amount <> 0 $E$;
IF in_account_class = 1 THEN
Added: trunk/sql/upgrade/3679-drop-payment-function.sql
===================================================================
--- trunk/sql/upgrade/3679-drop-payment-function.sql (rev 0)
+++ trunk/sql/upgrade/3679-drop-payment-function.sql 2011-08-23 17:06:28 UTC (rev 3679)
@@ -0,0 +1,5 @@
+DROP FUNCTION payment_bulk_post
+(in_transactions numeric[], in_batch_id int, in_source text, in_total numeric,
+ in_ar_ap_accno text, in_cash_accno text,
+ in_payment_date date, in_account_class int, in_payment_type int,
+ in_exchangerate numeric, in_curr text);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.