summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UI/payments/payments_filter.html14
-rw-r--r--sql/modules/Payment.sql4
2 files changed, 17 insertions, 1 deletions
diff --git a/UI/payments/payments_filter.html b/UI/payments/payments_filter.html
index c92a57c2..ab8ae7a2 100644
--- a/UI/payments/payments_filter.html
+++ b/UI/payments/payments_filter.html
@@ -58,6 +58,20 @@
</div>
<?lsmb END ?>
+<?lsmb IF account_class == 1 ?>
+<?lsmb vendor_customer_code = text("Vendor Number") # " ?>
+<?lsmb ELSIF account_class == 2 ?>
+<?lsmb vendor_customer_code = text("Customer Number") # " ?>
+<?lsmb END ?>
+
+<?lsmb PROCESS input element_data = {
+ name = "meta_number"
+ type = "text"
+ value = meta_number
+ label = vendor_customer_code
+ size = '15'
+} ?>
+
<?lsmb IF businesses ?>
<div id = "payments-filter-businesses" class="input">
<label for="businesses"><?lsmb text('Business Class') ?></label>
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