summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/modules/Reconciliaton.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/modules/Reconciliaton.sql b/sql/modules/Reconciliaton.sql
index 1dfc7d7e..2142a1fe 100644
--- a/sql/modules/Reconciliaton.sql
+++ b/sql/modules/Reconciliaton.sql
@@ -137,6 +137,8 @@ CREATE OR REPLACE FUNCTION reconciliation_correct_bank_charge (in_report_id int,
pending_entry pending_reports;
BEGIN
+ select into pending_entry from pending_reports where report_id = in_report_id and id = in_id;
+
IF NOT FOUND THEN
-- Raise an exception.
RAISE EXCEPTION "Cannot find entry with ID % in report %.", in_id, in_report_id;
@@ -164,6 +166,8 @@ CREATE OR REPLACE FUNCTION reconciliation_correct_unaccounted_charge (in_report_
note TEXT;
BEGIN
+ select into pending_entry from pending_reports where report_id = in_report_id and id = in_id;
+
IF NOT FOUND THEN
-- Raise an exception.
RAISE EXCEPTION "Cannot find entry with ID % in report %.", in_id, in_report_id;