Skip to content

Commit

Permalink
Support related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Aug 14, 2024
1 parent b608d61 commit ca5b1e2
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 6 deletions.
48 changes: 47 additions & 1 deletion projects/budgetkey/src/app/item/items/base-org-item/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default [
"supporting_ministry AS \"משרד\",",
"request_type AS \"סוג תמיכה\",",
"support_title AS \"נושא\", ",
"'supports/' || budget_code || '/' || year_requested || '/' || recipient || '/' || request_type AS item_id, ",
"'supports/' || budget_code || '/' || year_requested || '/' || coalesce(entity_id, recipient) || '/' || request_type AS item_id, ",
"sum(amount_approved) as \"סה״כ אושר\",",
"sum(amount_paid) as \"סה״כ שולם\"",
"FROM raw_supports WHERE year_requested :period AND entity_id=':id' GROUP BY 1, 2, 3, 4, 5"],
Expand Down Expand Up @@ -166,6 +166,52 @@ export default [
scope: "הכל"
}
},
{
text: "הנושאים בהם קיבל הארגון תמיכה, עבור בקשות שאושרו ב <period>",
query: ["SELECT supporting_ministry as \"משרד\",",
"support_title AS \"נושא\", ",
"budget_code,",
"budget_code AS \"מספר תקנה\", ",
"sum(amount_approved) as \"סה״כ אושר\",",
"sum(amount_paid) as \"סה״כ שולם\",",
"min(year_requested) || '-' || max(year_requested) as \"תקופה\" ",
"FROM raw_supports WHERE year_requested :period AND entity_id = ':id' GROUP BY 1, 2, 3 ORDER BY 5 DESC nulls last"],
parameters: {
period: {
"כל השנים": ">0",
"2008": "=2008",
"2009": "=2009",
"2010": "=2010",
"2011": "=2011",
"2012": "=2012",
"2013": "=2013",
"2014": "=2014",
"2015": "=2015",
"2016": "=2016",
"2017": "=2017",
"2018": "=2018",
"2019": "=2019",
"2020": "=2020",
"2021": "=2021",
"2022": "=2022",
"2023": "=2023",
"2024": "=2024"
}
},
defaults: {
period: "כל השנים"
},
headers: [
"משרד",
"נושא",
"מספר תקנה:budget_code:search_term(budget_code)",
"סה״כ אושר:number",
"סה״כ שולם:number",
"תקופה"
]
},


{
text: " סיכום ההתקשרויות עם הארגון מ <period>",
query: ["SELECT sum(volume) AS \"סה״כ היקף\", ",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ export default [
"נושא",
"מספר תקנה:budget_code:search_term(budget_code)",
"סה״כ אושר:number",
"סה״כ שולם:number"
"סה״כ שולם:number",
"תקופה"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ export default [
"נושא",
"מספר תקנה:budget_code:search_term(budget_code)",
"סה״כ אושר:number",
"סה״כ שולם:number"
"סה״כ שולם:number",
"תקופה"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
</ng-container>

<ng-container class='textTemplate'>
<div>
<label class="field-label">
שנת אישור התמיכה
</label>
{{ item.year_requested }}
</div>
<ng-container *ngFor='let purpose of purposes'>
<div>
<label class="field-label">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export class ItemSupportsComponent implements OnChanges {
supportTitles.push(payment.support_title);
this.purposes.push({
support_title: payment.support_title,
supporting_ministry: payment.supporting_ministry,
budget_code: payment.budget_code,
supporting_ministry: payment.supporting_ministry || this.item.supporting_ministry,
budget_code: payment.budget_code || this.item.budget_code,
});
}
}
Expand Down
24 changes: 24 additions & 0 deletions projects/budgetkey/src/app/item/items/item-supports/questions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,29 @@ export default [
"סה״כ אושר:number",
"סה״כ שולם:number"
]
},
{
"text": "ארגונים נוספים שקיבלו תמיכה בנושא זה",
"query": [
"SELECT coalesce(entity_name, recipient) as \"מקבל התמיכה\", ",
"entity_id as \"מספר תאגיד\", ",
"entity_id, ",
"min(year_requested) || '-' || max(year_requested) as \"תקופה\", ",
"sum(amount_approved) as \"סה״כ אושר\", ",
"sum(amount_paid) as \"סה״כ שולם\" ",
"FROM raw_supports ",
"WHERE support_title=':support_title' ",
"AND request_type=':request_type' ",
"AND budget_code=':budget_code' ",
"GROUP BY 1, 2, 3 ",
"ORDER BY 5 DESC"
],
"headers": [
"מספר תאגיד",
"מקבל התמיכה:item_link(entity_id)",
"סה״כ אושר:number",
"סה״כ שולם:number",
"תקופה"
]
}
] as Question[];
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class SearchLinkComponent implements OnChanges {

ngOnChanges() {
let base = '//next.obudget.org';
this.href = `${base}/s/?q=${this.searchQuery}&dd=${this.searchType || 'all'}?theme=${this.globalSettings.themeId}`;
this.href = `${base}/s/?q=${this.searchQuery}&dd=${this.searchType || 'all'}&theme=${this.globalSettings.themeId}`;
}

}

0 comments on commit ca5b1e2

Please sign in to comment.