killtdj

Query Laporan Mutasi Saldo

Aug 24th, 2021 (edited)
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     "stmt"."id" AS "id",
  3.     "stmt"."reference" AS "reference",
  4.     "brnc"."id" AS "branchId",
  5.     "user"."username" AS "userNik",
  6.     "jrn"."transaction_date" AS "transactionDate",
  7.     "stmt"."type" AS "type",
  8.     "stmt"."source_type" AS "sourceType",
  9.     "brnc"."branch_name" AS "branchName",
  10.     "brnc"."branch_code" AS "branchCode",
  11.     "user"."first_name" AS "userFirstName",
  12.     "user"."last_name" AS "userLastName",
  13.     "coa"."code" AS "coaCode",
  14.     "coa"."name" AS "coaName",
  15.     "jrni"."partner_name" AS "partnerName",
  16.     "jrni"."partner_code" AS "partnerCode",
  17.     "jrni"."debit" AS "debit",
  18.     "jrni"."credit" AS "credit"
  19. FROM
  20.     "account_statement" "stmt"
  21.     LEFT JOIN "branch" "brnc" ON "brnc"."id" = "stmt"."branch_id"
  22.     LEFT JOIN "users" "user" ON "user"."id" = "stmt"."update_user_id"
  23.     LEFT JOIN "journal" "jrn" ON "jrn"."reference" = "stmt"."reference"
  24.     LEFT JOIN "journal_item" "jrni" ON "jrn"."id" = "jrni"."journal_id"
  25.     LEFT JOIN "account_coa" "coa" ON "coa"."id" = "jrni"."coa_id"
  26. WHERE
  27.     "stmt"."is_deleted" = 'false'
  28.     AND "stmt"."branch_id" IN ( '142648ab-9624-4a7a-a4b4-2f1c51e648d7' )
  29.     AND "jrn"."state" IN ( 'approved_by_ss_spv_ho', 'approved_by_tax', 'posted' )
  30.     AND "jrn"."transaction_date" > '2021-08-20'
  31.     AND "jrn"."transaction_date" < '2021-08-25'
  32. ORDER BY
  33.     "stmt"."transaction_date" DESC
Add Comment
Please, Sign In to add comment