Skip to content

Commit

Permalink
Added ledgerId, ledgerCode, and groupId, groupCode
Browse files Browse the repository at this point in the history
  • Loading branch information
azizbekxm committed Nov 29, 2024
1 parent 7eb0c3c commit 113e6cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions src/main/resources/templates/db_scripts/all_finance_data_view.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,27 @@ SELECT
'fundStatus', fund.jsonb ->>'fundStatus',
'fundTags', jsonb_build_object('tagList', fund.jsonb -> 'tags' -> 'tagList'),
'fundAcqUnitIds', fund.jsonb ->'acqUnitIds',
'ledgerId', ledger.id,
'ledgerCode', ledger.jsonb ->> 'code',
'budgetId', budget.id,
'budgetName', budget.jsonb ->>'name',
'budgetStatus', budget.jsonb ->>'budgetStatus',
'budgetInitialAllocation', budget.jsonb ->>'initialAllocation',
'budgetCurrentAllocation', budget.jsonb ->>'allocated',
'budgetAllowableExpenditure', budget.jsonb ->>'allowableExpenditure',
'budgetAllowableEncumbrance', budget.jsonb ->>'allowableEncumbrance',
'budgetAcqUnitIds', budget.jsonb ->'acqUnitIds'
'budgetAcqUnitIds', budget.jsonb ->'acqUnitIds',
'groupId', groups.id,
'groupCode', groups.jsonb ->> 'code'
) as jsonb
FROM ${myuniversity}_${mymodule}.fiscal_year
LEFT OUTER JOIN ${myuniversity}_${mymodule}.ledger
ON ledger.fiscalyearoneid = fiscal_year.id
ON ledger.fiscalyearoneid = fiscal_year.id
LEFT OUTER JOIN ${myuniversity}_${mymodule}.fund
ON fund.ledgerid = ledger.id
ON fund.ledgerid = ledger.id
LEFT OUTER JOIN ${myuniversity}_${mymodule}.budget
ON fund.id = budget.fundid;
ON fund.id = budget.fundid
LEFT OUTER JOIN ${myuniversity}_${mymodule}.group_fund_fiscal_year
ON fund.id = (group_fund_fiscal_year.jsonb ->> 'fundId')::uuid
LEFT OUTER JOIN ${myuniversity}_${mymodule}.groups
ON (group_fund_fiscal_year.jsonb ->> 'groupId')::uuid = groups.id;

0 comments on commit 113e6cc

Please sign in to comment.