diff --git a/projects/budgetkey/src/app/item/items/item-soproc/item-social-service-gov-unit/tables.ts b/projects/budgetkey/src/app/item/items/item-soproc/item-social-service-gov-unit/tables.ts index 35a0f98..f12cca5 100644 --- a/projects/budgetkey/src/app/item/items/item-soproc/item-social-service-gov-unit/tables.ts +++ b/projects/budgetkey/src/app/item/items/item-soproc/item-social-service-gov-unit/tables.ts @@ -171,7 +171,7 @@ export const tableDefs = { name: 'הליכי רכש', query: ` with t as ( - select office || ' / ' || unit || ' / ' || subunit as org_unit, + select case when subunit is null then office || ' / ' || unit else office || ' / ' || unit || ' / ' || subunit end as org_unit, id, kind, name, jsonb_array_elements(tenders) as tenders from activities where :where and tenders is not null and tenders::text != 'null' diff --git a/projects/budgetkey/src/app/item/items/item-soproc/item-social-service/tables.ts b/projects/budgetkey/src/app/item/items/item-soproc/item-social-service/tables.ts index d8cfb4d..411f1c2 100644 --- a/projects/budgetkey/src/app/item/items/item-soproc/item-social-service/tables.ts +++ b/projects/budgetkey/src/app/item/items/item-soproc/item-social-service/tables.ts @@ -15,7 +15,7 @@ export const tableDefs = { name: 'הליכי רכש', query: ` with t as ( - select office || ' / ' || unit || ' / ' || subunit as org_unit, + select case when subunit is null then office || ' / ' || unit else office || ' / ' || unit || ' / ' || subunit end as org_unit, jsonb_array_elements(tenders) as tenders from activities where :where and tenders is not null and tenders::text != 'null' ), tt as (select tenders->>'tender_type_he' as tender_type_he,