diff --git a/budgetportal/models.py b/budgetportal/models.py index 2aa07e76d..4d3445028 100644 --- a/budgetportal/models.py +++ b/budgetportal/models.py @@ -1159,6 +1159,7 @@ def get_expenditure_time_series_summary(self): 'phase': phase, }) + missing_phases_count = {} found = False for fiscal_year in financial_year_starts: for fiscal_phase in EXPENDITURE_TIME_SERIES_PHASES: @@ -1175,10 +1176,64 @@ def get_expenditure_time_series_summary(self): 'phase': fiscal_phase, 'amount': None, }) + if fiscal_year not in missing_phases_count: + missing_phases_count[fiscal_year] = 1 + else: + missing_phases_count[fiscal_year] += 1 expenditure['base_financial_year'] = FinancialYear.slug_from_year_start(str(base_year)) + # Generate notices if applicable + no_data_for_years = [] + no_dept_for_years = [] + notices = [] + for year, count in missing_phases_count.items(): + # 8 because 4 phases real and nominal + if count != 8: + # All phases for a given year must be missing before starting any checks + continue + single_year_cuts = [ + openspending_api.get_adjustment_kind_ref() + ':' + '"Total"', + openspending_api.get_financial_year_ref() + ':' + year, + ] + single_year_budget_results = openspending_api.aggregate( + cuts=single_year_cuts) + + if single_year_budget_results['cells']: + if single_year_budget_results['cells'][0]['value.sum'] > 0: + # dept did not exist, since there is data for other departments + no_dept_for_years.append(year) + else: + # no data for this fiscal year, so data hasn't been published yet + no_data_for_years.append(year) + else: + # no data for this fiscal year, so data hasn't been published yet + no_data_for_years.append(year) + + if no_data_for_years: + notice_string = 'Please note that the data for' + index = 1 + for year in no_data_for_years: + if len(no_data_for_years) == 1: + notice_string += ' {}'.format(year) + elif len(no_data_for_years) == 2: + notice_string += ' {} and {}'.format(year, no_data_for_years[index]) + break + elif index == len(no_data_for_years)-1: + notice_string += ' {}'.format(year) + elif index == len(no_data_for_years): + notice_string += ' and {}'.format(year) + else: + notice_string += ' {},'.format(year) + index += 1 + notice_string += ' has not been published on vulekamali.' + notices.append(notice_string) + + if no_dept_for_years: + notices.append('This department did not exist for some years displayed.') + return { + 'notices': notices, 'expenditure': expenditure, 'dataset_detail_page': dataset.get_url_path(), } @@ -1190,7 +1245,8 @@ def get_expenditure_time_series_summary(self): def get_expenditure_time_series_by_programme(self): financial_year_start = self.get_financial_year().get_starting_year() financial_year_start_int = int(financial_year_start) - financial_year_starts = [str(y) for y in xrange(financial_year_start_int - 3, financial_year_start_int + 1)] + year_ints = xrange(financial_year_start_int - 3, financial_year_start_int + 1) + financial_year_starts = [str(y) for y in year_ints] programmes = {} @@ -1241,6 +1297,7 @@ def get_expenditure_time_series_by_programme(self): }) found = False + missing_phases_count = {} for fiscal_year in financial_year_starts: for fiscal_phase in EXPENDITURE_TIME_SERIES_PHASES: for program in programmes: @@ -1256,9 +1313,39 @@ def get_expenditure_time_series_by_programme(self): 'phase': fiscal_phase, 'amount': None, }) + if fiscal_year not in missing_phases_count: + missing_phases_count[fiscal_year] = {program: 1} + else: + if program not in missing_phases_count[fiscal_year].keys(): + missing_phases_count[fiscal_year][program] = 1 + else: + missing_phases_count[fiscal_year][program] += 1 + + no_prog_for_years = False + notices = [] + for year, progs in missing_phases_count.items(): + if no_prog_for_years: break + for p, count in progs.items(): + if no_prog_for_years: break + if count == 4: + single_year_cuts = [ + openspending_api.get_adjustment_kind_ref() + ':' + '"Total"', + openspending_api.get_financial_year_ref() + ':' + year, + ] + single_year_budget_results = openspending_api.aggregate( + cuts=single_year_cuts) + + if single_year_budget_results['cells']: + if single_year_budget_results['cells'][0]['value.sum'] > 0: + # prog did not exist, since there is data for other programmes + no_prog_for_years = True + + if no_prog_for_years: + notices.append('One or more programmes did not exist for some years displayed.') return { - 'programmes': programmes.values(), + 'notices': notices, + 'programmes': sorted(programmes.values()), 'dataset_detail_page': dataset.get_url_path(), } else: diff --git a/budgetportal/openspending.py b/budgetportal/openspending.py index a213d9fd7..d345154f1 100644 --- a/budgetportal/openspending.py +++ b/budgetportal/openspending.py @@ -80,7 +80,7 @@ def aggregate(self, cuts=None, drilldowns=None, order=None): aggregate_result.elapsed.microseconds / 1000) aggregate_result.raise_for_status() aggregate_result = aggregate_result.json() - if aggregate_result['total_cell_count'] > PAGE_SIZE: + if len(aggregate_result['cells']) > PAGE_SIZE: raise Exception( "More cells than expected - perhaps we should start paging" ) diff --git a/budgetportal/tests/test_data/budget_and_actual.json b/budgetportal/tests/test_data/budget_and_actual.json new file mode 100644 index 000000000..a8287dbf7 --- /dev/null +++ b/budgetportal/tests/test_data/budget_and_actual.json @@ -0,0 +1,2656 @@ +{ + "test_cells_data_complete": [ + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28726061000, + "_count": 557, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Audit Outcome", + "vote_number.department": "National Treasury", + "value.sum": 28690816280, + "_count": 558, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Final Appropriation", + "vote_number.department": "National Treasury", + "value.sum": 29005061000, + "_count": 566, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 26957304000.0, + "_count": 685, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28471417000, + "_count": 565, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Audit Outcome", + "vote_number.department": "National Treasury", + "value.sum": 28199783365, + "_count": 155, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Final Appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28471416900, + "_count": 157, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28471417000.0, + "_count": 684, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 40584306000, + "_count": 568, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Audit Outcome", + "vote_number.department": "National Treasury", + "value.sum": 39792071170, + "_count": 503, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Final Appropriation", + "vote_number.department": "National Treasury", + "value.sum": 40484306000, + "_count": 559, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 30799220000.0, + "_count": 820, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 29710233000, + "_count": 536, + "financial_year.financial_year": 2018 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 29358390000.0, + "_count": 882, + "financial_year.financial_year": 2018 + } + ], + "test_cells_data_missing_2018": [ + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28726061000, + "_count": 557, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Audit Outcome", + "vote_number.department": "National Treasury", + "value.sum": 28690816280, + "_count": 558, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Final Appropriation", + "vote_number.department": "National Treasury", + "value.sum": 29005061000, + "_count": 566, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 26957304000.0, + "_count": 685, + "financial_year.financial_year": 2015 + }, + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28471417000, + "_count": 565, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Audit Outcome", + "vote_number.department": "National Treasury", + "value.sum": 28199783365, + "_count": 155, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Final Appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28471416900, + "_count": 157, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 28471417000.0, + "_count": 684, + "financial_year.financial_year": 2016 + }, + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 40584306000, + "_count": 568, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Audit Outcome", + "vote_number.department": "National Treasury", + "value.sum": 39792071170, + "_count": 503, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Final Appropriation", + "vote_number.department": "National Treasury", + "value.sum": 40484306000, + "_count": 559, + "financial_year.financial_year": 2017 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 30799220000.0, + "_count": 820, + "financial_year.financial_year": 2017 + } + ], + "test_cells_only_2018": [ + { + "budget_phase.budget_phase": "Adjusted appropriation", + "vote_number.department": "National Treasury", + "value.sum": 29710233000, + "_count": 536, + "financial_year.financial_year": 2018 + }, + { + "budget_phase.budget_phase": "Main appropriation", + "vote_number.department": "National Treasury", + "value.sum": 29358390000.0, + "_count": 882, + "financial_year.financial_year": 2018 + } + ], + "program_test_cells_complete": [ + { + "_count": 164, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 363629000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 69, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3264890000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3962941000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 525742590000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 77, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 135387000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 107, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 807090000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4562062000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 40, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3254926000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 80, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 266104000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 9334439000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 10, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 2774593000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 169, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 375582000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 63, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 3264294000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 3967698000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 526636137000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 78, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 131290000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 108, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 774494280, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4562062000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 3546134000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 82, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 262577000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 9334439000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 2472246000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 167, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 386645000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 68, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 3265171000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 3967741000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 525742590000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 80, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 132730000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 109, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 783753000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4562062000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 3547662000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 85, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 268889000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 9334439000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 2755969000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 193, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 366665000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 87, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 3116930000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 7, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 3962941000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 519893814000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 92, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 133892000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 122, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 751362000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4542805000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 49, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 1247442000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 94, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 256965000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 9434439000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 35, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 3143863000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 165, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 467416000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 78, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 113129000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4462642000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 570833034000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 72, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 150161000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 107, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 1216758000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4812487000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 45, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4977977000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 78, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 294483000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 9363676000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 10, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 2612688000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 31, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 436312954, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 21, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 110146309, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 3, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4400158875, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 570197128000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 22, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 151181509, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 26, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 1209857964, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4812487000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 24, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4955752630, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 281778217, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 9363676000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 3, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 2478431907, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 30, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 464415800, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 113129000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 3, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4462642000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 570833034000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 156561100, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 25, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 1251758000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4812487000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 24, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4961628000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 294483000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 9363676000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 2590637000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 196, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 412661000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 90, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 107211000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 6, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4173242000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 569787416000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 87, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 146070000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 127, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 849854000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4812487000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 50, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5039068000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 93, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 286955000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 10009151000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 32, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 2634718000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 170, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 439071000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 72, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 10100312000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4835002000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 616714049000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 75, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 163991000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 109, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 1079146000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5005639000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5831388000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 81, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 303046000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 10218198000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 10, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 2608513000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 153, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 437869000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 56, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 10089761000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4618088000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 616347785000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 69, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 151860000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 100, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 885832697, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 5105639000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 39, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 5469838473, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 69, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 288635000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 10218198000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 2526350000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 163, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 445620000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 71, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 10100312000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4648202000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 616714049000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 76, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 163991000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 111, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 1000846000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 5105639000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 5940689000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 81, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 302296000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 10218198000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 2558513000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 203, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 414310000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 208, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 102355000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4835002000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 615856815000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 95, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 139649000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 128, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 1087876000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5005639000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 54, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5836761000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 92, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 286103000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 10218198000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 32, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 2873327000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 161, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 473819000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 61, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 101585000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5163796000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 664004032000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 72, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 152770000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 103, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 1194148000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4763533000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 38, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5542776000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 80, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 298047000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 9007217000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 11, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3012542000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 198, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 484733000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 210, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 110418000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5163796000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 663014110000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 90, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 141009000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 126, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 1196622000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4763533000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 50, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5402120000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 170, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 290101000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 9007217000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 30, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 2798841000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + } + ], + "program_test_cells_missing_2018_revenue_admin": [ + { + "_count": 164, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 363629000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 69, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3264890000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3962941000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 525742590000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 77, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 135387000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 107, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 807090000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4562062000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 40, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3254926000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 80, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 266104000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 9334439000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 10, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 2774593000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 169, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 375582000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 63, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 3264294000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 3967698000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 526636137000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 78, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 131290000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 108, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 774494280, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4562062000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 3546134000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 82, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 262577000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 9334439000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 2472246000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 167, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 386645000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 68, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 3265171000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 3967741000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 525742590000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 80, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 132730000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 109, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 783753000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4562062000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 3547662000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 85, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 268889000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 9334439000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 2755969000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 193, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 366665000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 87, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 3116930000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 7, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 3962941000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 519893814000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 92, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 133892000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 122, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 751362000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4542805000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 49, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 1247442000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 94, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 256965000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 9434439000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 35, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 3143863000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2015 + }, + { + "_count": 165, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 467416000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 78, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 113129000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4462642000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 570833034000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 72, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 150161000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 107, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 1216758000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4812487000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 45, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4977977000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 78, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 294483000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 9363676000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 10, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 2612688000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 31, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 436312954, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 21, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 110146309, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 3, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4400158875, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 570197128000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 22, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 151181509, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 26, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 1209857964, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4812487000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 24, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4955752630, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 281778217, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 9363676000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 3, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 2478431907, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 30, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 464415800, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 113129000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 3, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4462642000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 570833034000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 156561100, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 25, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 1251758000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4812487000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 24, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4961628000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 23, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 294483000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 9363676000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 2590637000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 196, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 412661000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 90, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 107211000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 6, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4173242000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 569787416000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 87, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 146070000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 127, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 849854000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4812487000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 50, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5039068000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 93, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 286955000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 10009151000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 32, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 2634718000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2016 + }, + { + "_count": 170, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 439071000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 72, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 10100312000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4835002000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 616714049000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 75, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 163991000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 109, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 1079146000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5005639000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5831388000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 81, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 303046000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 10218198000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 10, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 2608513000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 153, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 437869000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 56, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 10089761000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 4618088000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 616347785000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 69, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 151860000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 100, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 885832697, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 5105639000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 39, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 5469838473, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 69, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 288635000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 10218198000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Audit Outcome", + "value.sum": 2526350000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 163, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 445620000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 71, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 10100312000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 4648202000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 616714049000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 76, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 163991000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 111, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 1000846000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 5105639000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 41, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 5940689000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 81, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 302296000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 10218198000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 9, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Final Appropriation", + "value.sum": 2558513000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 203, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 414310000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 208, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 102355000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4835002000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 615856815000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 95, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 139649000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 128, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 1087876000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5005639000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 54, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5836761000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 92, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 286103000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 1, + "programme_number.programme": "Revenue Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 10218198000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 32, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 2873327000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2017 + }, + { + "_count": 161, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 473819000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 61, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 101585000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5163796000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 664004032000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 72, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 152770000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 103, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 1194148000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 4763533000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 38, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 5542776000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 80, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 298047000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 11, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Adjusted appropriation", + "value.sum": 3012542000, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 198, + "programme_number.programme": "Administration", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 484733000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 210, + "programme_number.programme": "Asset and Liability Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 110418000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 5, + "programme_number.programme": "Civil and Military Pensions, Contributions to Funds and Other Benefits", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5163796000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 4, + "programme_number.programme": "Direct charge against the National Revenue Fund", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 663014110000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 90, + "programme_number.programme": "Economic Policy, Tax, Financial Regulation and Research", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 141009000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 126, + "programme_number.programme": "Financial Accounting and Supply Chain Management Systems", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 1196622000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 2, + "programme_number.programme": "Financial Intelligence and State Security", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 4763533000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 50, + "programme_number.programme": "International Financial Relations", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 5402120000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 170, + "programme_number.programme": "Public Finance and Budget Management", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 290101000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + }, + { + "_count": 30, + "programme_number.programme": "Technical Support and Development Finance", + "budget_phase.budget_phase": "Main appropriation", + "value.sum": 2798841000.0, + "vote_number.department": "National Treasury", + "financial_year.financial_year": 2018 + } + ] +} \ No newline at end of file diff --git a/budgetportal/tests/test_department.py b/budgetportal/tests/test_department.py index 72922ac95..019ab6802 100644 --- a/budgetportal/tests/test_department.py +++ b/budgetportal/tests/test_department.py @@ -11,10 +11,15 @@ from budgetportal import models from django.test import TestCase from mock import Mock +import json + +with open('budgetportal/tests/test_data/budget_and_actual.json', 'r') as mock_data: + mock_data = json.load(mock_data) class AdjustedBudgetMissingTestCase(TestCase): """Unit tests of adjusted budget data summary for a department""" + def setUp(self): year = FinancialYear(slug="2030-31") sphere = Sphere(financial_year=year, name="A sphere") @@ -32,8 +37,9 @@ def test_missing_dataset(self): self.assertEqual(self.department.get_adjusted_budget_summary(), None) -class AdjustedBudgetOpenSpendingtMissingTestCase(TestCase): +class AdjustedBudgetOpenSpendingMissingTestCase(TestCase): """Unit tests of adjusted budget data summary for a department""" + def setUp(self): year = FinancialYear(slug="2030-31") sphere = Sphere(financial_year=year, name="A sphere") @@ -55,6 +61,7 @@ def test_missing_openspending_dataset(self): class AdjustedBudgetTestCase(TestCase): """Unit tests of adjusted budget data summary for a department""" + def setUp(self): year = FinancialYear(slug="2030-31") sphere = Sphere(financial_year=year, name="A sphere") @@ -101,3 +108,106 @@ def test_adjustment(self): result = self.department.get_adjusted_budget_summary() self.assertEqual(result['total_change']['amount'], 11) self.assertEqual(result['total_change']['percentage'], 11) + + +class BudgetedAndActualExpenditureProgrammeTestCase(TestCase): + """Unit tests of budgeted and actual expenditure summary for a department""" + + def setUp(self): + self.mock_data = mock_data + year = FinancialYear(slug="2018-19") + sphere = Sphere(financial_year=year, name="A sphere") + government = Government(sphere=sphere, name="A government") + self.department = Department( + government=government, + name="Fake", + vote_number=1, + is_vote_primary=True, + intro="", + ) + mock_dataset = Mock() + self.mock_openspending_api = Mock() + self.mock_openspending_api.get_adjustment_kind_ref = Mock(return_value='adjustment_kind_ref') + self.mock_openspending_api.get_phase_ref = Mock(return_value='budget_phase.budget_phase') + self.mock_openspending_api.get_programme_name_ref = Mock(return_value='programme_number.programme') + self.mock_openspending_api.get_department_name_ref = Mock(return_value='department_name_ref') + self.mock_openspending_api.get_financial_year_ref = Mock(return_value="financial_year.financial_year") + self.mock_openspending_api.aggregate = Mock(return_value={'cells': [{'value.sum': 1, '_count': 0}]}) + self.mock_openspending_api.filter_dept = Mock(return_value={'cells': self.mock_data['program_test_cells_complete']}) + self.mock_openspending_api.aggregate_url = Mock + mock_dataset.get_openspending_api = Mock(return_value=self.mock_openspending_api) + self.department.get_expenditure_time_series_dataset = Mock(return_value=mock_dataset) + self.department.get_financial_year = Mock(return_value=year) + + def test_no_cells_null_response(self): + self.mock_openspending_api.filter_dept = Mock(return_value={'cells': []}) + result = self.department.get_expenditure_time_series_by_programme() + self.assertEqual(result, None) + + def test_complete_data_no_notices(self): + result = self.department.get_expenditure_time_series_by_programme() + self.assertEqual(result['notices'], []) + + def test_missing_data_prog_did_not_exist(self): + """ Here we feed an incomplete set of cells and expect it to tell us that the department did not exist + (removed 2018 data) """ + self.mock_openspending_api.aggregate = Mock(return_value={'cells': [{'value.sum': 1, '_count': 0}]}) + self.mock_openspending_api.filter_dept = Mock(return_value={'cells': self.mock_data['program_test_cells_missing_2018_revenue_admin']}) + result = self.department.get_expenditure_time_series_by_programme() + self.assertEqual(result['notices'], ['One or more programmes did not exist for some years displayed.']) + + +class BudgetedAndActualExpenditureSummaryTestCase(TestCase): + """Unit tests of budgeted and actual expenditure summary for a department""" + + def setUp(self): + self.mock_data = mock_data + year = FinancialYear(slug="2018-19") + sphere = Sphere(financial_year=year, name="A sphere") + government = Government(sphere=sphere, name="A government") + self.department = Department( + government=government, + name="Fake", + vote_number=1, + is_vote_primary=True, + intro="", + ) + mock_dataset = Mock() + self.mock_openspending_api = Mock() + self.mock_openspending_api.get_adjustment_kind_ref = Mock(return_value='adjustment_kind_ref') + self.mock_openspending_api.get_phase_ref = Mock(return_value='budget_phase.budget_phase') + self.mock_openspending_api.get_programme_name_ref = Mock + self.mock_openspending_api.get_department_name_ref = Mock(return_value='department_name_ref') + self.mock_openspending_api.get_financial_year_ref = Mock(return_value="financial_year.financial_year") + self.mock_openspending_api.aggregate = Mock(return_value={'cells': [{'value.sum': 1, '_count': 0}]}) + self.mock_openspending_api.filter_dept = Mock(return_value={'cells': []}) + self.mock_openspending_api.filter_by_ref_exclusion = Mock + self.mock_openspending_api.aggregate_by_three_ref = Mock(return_value=self.mock_data['test_cells_data_complete']) + self.mock_openspending_api.aggregate_url = Mock + mock_dataset.get_openspending_api = Mock(return_value=self.mock_openspending_api) + self.department.get_expenditure_time_series_dataset = Mock(return_value=mock_dataset) + self.department.get_financial_year = Mock(return_value=year) + + def test_no_cells_null_response(self): + self.mock_openspending_api.aggregate_by_three_ref = Mock(return_value=[]) + result = self.department.get_expenditure_time_series_summary() + self.assertEqual(result, None) + + def test_complete_data_no_notices(self): + result = self.department.get_expenditure_time_series_summary() + self.assertEqual(result['notices'], []) + + def test_missing_data_not_published(self): + """ Here we feed an incomplete set of cells and expect it to tell us that 2018 data has not been published """ + self.mock_openspending_api.aggregate = Mock(return_value={'cells': [{'value.sum': 0, '_count': 0}]}) + self.mock_openspending_api.aggregate_by_three_ref = Mock(return_value=self.mock_data['test_cells_data_missing_2018']) + result = self.department.get_expenditure_time_series_summary() + self.assertEqual(result['notices'], ['Please note that the data for 2018 has not been published on vulekamali.']) + + def test_missing_data_dept_did_not_exist(self): + """ Here we feed an incomplete set of cells and expect it to tell us that the department did not exist + (removed 2018 data) """ + self.mock_openspending_api.aggregate = Mock(return_value={'cells': [{'value.sum': 1, '_count': 0}]}) + self.mock_openspending_api.aggregate_by_three_ref = Mock(return_value=self.mock_data['test_cells_data_missing_2018']) + result = self.department.get_expenditure_time_series_summary() + self.assertEqual(result['notices'], ['This department did not exist for some years displayed.'])