PostgreSQL: Create SQL statement/stored procedure

IN PROGRESS
Bids
1
Avg Bid (USD)
$8 / hr
Project Budget (USD)
$8 - $15 / hr

Project Description:
I need a stored procedure (in PLPgsql or SQL) or a pure SQL statement. The database schema is:

DROP TABLE IF EXISTS receipts;
CREATE TABLE receipts (
id SERIAL PRIMARY KEY,
entry_date DATE,
amount NUMERIC(20, 2) DEFAULT 0.00
);

DROP TABLE IF EXISTS bank_transactions;
CREATE TABLE bank_transactions (
id serial NOT NULL,
transaction_date DATE,
amount NUMERIC(20, 2)
);

The point of your procedure is to match any group of bank_transactions to any group of receipts or the other way around, so that the sum of the amount in a group equals the sum of the amount in the other group. For example the following two rows in receipts table will match a row in transactions with the amount 20.00:
10.00
10.00

One or more rows in receipts may match the sum of one or more rows in transactions, and the other way around. The output of your query or stored procedure should be in the following format:
array of ints of matching receipt ids array of ints of matching transaction ids
[1, 3, 8] [2,3,8]

The example data above means that the sum of receipts with ids 1, 3 and 8 match the sum of the transactions with ids 2, 3 and 8. Please use the array data type for this.

The price for this project is 20$ and the deadline is 2 days.

Please provide your GitHub.com username in your bid.

Hours of work: Unspecified Project Duration: < 1 week Skills required:
Database Administration, SQL
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$8 / hr
Hours: 12 hr/ week