summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-06-26 17:19:35 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-06-26 17:19:35 +0000
commit96f9480b7c2d8a62e34133d6dfd16f1dee23a330 (patch)
tree21a558ce33522442efc800ed449a6208dc8b9d62 /sql
parent671cadd48adad36accbd124f2aaa868111e2675d (diff)
Adding customer/vendor search capabilities to multiple payment interface.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2176 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql')
-rw-r--r--sql/modules/Payment.sql4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/modules/Payment.sql b/sql/modules/Payment.sql
index e7e962b0..2ab6cf69 100644
--- a/sql/modules/Payment.sql
+++ b/sql/modules/Payment.sql
@@ -142,7 +142,7 @@ CREATE TYPE payment_contact_invoice AS (
CREATE OR REPLACE FUNCTION payment_get_all_contact_invoices
(in_account_class int, in_business_id int, in_currency char(3),
in_date_from date, in_date_to date, in_batch_id int,
- in_ar_ap_accno text)
+ in_ar_ap_accno text, in_meta_number text)
RETURNS SETOF payment_contact_invoice AS
$$
DECLARE payment_item payment_contact_invoice;
@@ -215,6 +215,8 @@ BEGIN
AND p.due <> 0
AND a.amount <> a.paid
AND NOT a.on_hold
+ AND (in_meta_number IS NULL
+ OR in_meta_number = c.meta_number)
AND NOT (t.locked_by IS NOT NULL AND t.locked_by IN
(select "session_id" FROM "session"
WHERE users_id IN