Postgres Automatically Generate Invoice