Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- "stmt"."id" AS "id",
- "stmt"."reference" AS "reference",
- "brnc"."id" AS "branchId",
- "user"."username" AS "userNik",
- "jrn"."transaction_date" AS "transactionDate",
- "stmt"."type" AS "type",
- "stmt"."source_type" AS "sourceType",
- "brnc"."branch_name" AS "branchName",
- "brnc"."branch_code" AS "branchCode",
- "user"."first_name" AS "userFirstName",
- "user"."last_name" AS "userLastName",
- "coa"."code" AS "coaCode",
- "coa"."name" AS "coaName",
- "jrni"."partner_name" AS "partnerName",
- "jrni"."partner_code" AS "partnerCode",
- "jrni"."debit" AS "debit",
- "jrni"."credit" AS "credit"
- FROM
- "account_statement" "stmt"
- LEFT JOIN "branch" "brnc" ON "brnc"."id" = "stmt"."branch_id"
- LEFT JOIN "users" "user" ON "user"."id" = "stmt"."update_user_id"
- LEFT JOIN "journal" "jrn" ON "jrn"."reference" = "stmt"."reference"
- LEFT JOIN "journal_item" "jrni" ON "jrn"."id" = "jrni"."journal_id"
- LEFT JOIN "account_coa" "coa" ON "coa"."id" = "jrni"."coa_id"
- WHERE
- "stmt"."is_deleted" = 'false'
- AND "stmt"."branch_id" IN ( '142648ab-9624-4a7a-a4b4-2f1c51e648d7' )
- AND "jrn"."state" IN ( 'approved_by_ss_spv_ho', 'approved_by_tax', 'posted' )
- AND "jrn"."transaction_date" > '2021-08-20'
- AND "jrn"."transaction_date" < '2021-08-25'
- ORDER BY
- "stmt"."transaction_date" DESC
Add Comment
Please, Sign In to add comment