Skip to content

Commit

Permalink
Fix united spending queries
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Jun 13, 2024
1 parent cd3fe54 commit cf575cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ export default [
{
text: "פירוט כל ההוצאות מסעיף זה ששולמו ב <period>",
query: ["with a as (",
"select year_paid as \"שנה\", entity_name as \"מקבל הכספים\", amount_paid as \"סך כולל\", support_title as \"תיאור\", 'תמיכה' as \"סוג ההוצאה\"",
"from supports_by_payment_year where budget_code like ':code%%' and amount_paid>0 and year_paid :period union",
"select min_year as \"שנה\", entity_name as \"מקבל הכספים\", executed as \"סך כולל\", purpose as \"תיאור\", 'רכש' as \"סוג ההוצאה\"",
"from contract_spending where budget_code like ':code%%' and executed > 0 and min_year :period)",
"select year_paid as \"שנה\", coalesce(entity_name, recipient) as \"מקבל הכספים\", amount_paid as \"סך כולל\", support_title as \"תיאור\", 'תמיכה' as \"סוג ההוצאה\"",
"from supports_by_payment_year where budget_code = ':code' and amount_paid>0 and year_paid :period union",
"select min_year as \"שנה\", coalesce(entity_name, supplier_name->>0) as \"מקבל הכספים\", executed as \"סך כולל\", purpose as \"תיאור\", 'רכש' as \"סוג ההוצאה\"",
"from contract_spending where budget_code = ':code' and executed > 0 and min_year :period)",
"select * from a order by \"שנה\" desc, \"סך כולל\" desc"
],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export default [
{
text: "פירוט כל ההוצאות מתקנה זו ששולמו ב <period>",
query: ["with a as (",
"select year_paid as \"שנה\", entity_name as \"מקבל הכספים\", amount_paid as \"סך כולל\", support_title as \"תיאור\", 'תמיכה' as \"סוג ההוצאה\"",
"select year_paid as \"שנה\", coalesce(entity_name, recipient) as \"מקבל הכספים\", amount_paid as \"סך כולל\", support_title as \"תיאור\", 'תמיכה' as \"סוג ההוצאה\"",
"from supports_by_payment_year where budget_code = ':code' and amount_paid>0 and year_paid :period union",
"select min_year as \"שנה\", entity_name as \"מקבל הכספים\", executed as \"סך כולל\", purpose as \"תיאור\", 'רכש' as \"סוג ההוצאה\"",
"select min_year as \"שנה\", coalesce(entity_name, supplier_name->>0) as \"מקבל הכספים\", executed as \"סך כולל\", purpose as \"תיאור\", 'רכש' as \"סוג ההוצאה\"",
"from contract_spending where budget_code = ':code' and executed > 0 and min_year :period)",
"select * from a order by \"שנה\" desc, \"סך כולל\" desc"
],
Expand Down

0 comments on commit cf575cc

Please sign in to comment.