-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from unicef/develop
Develop
- Loading branch information
Showing
86 changed files
with
495 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ nav: | |
- setup | ||
- glossary.md | ||
- tmp.md | ||
- Tutorials: tutorials |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
nav: | ||
- index.md | ||
- Creating a simple report: simple.md | ||
- Creating a Template Report for a bank: banks.md | ||
- Generate a report from a list of HH: hh.md | ||
- Payment report using a template: payment_r.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
# Creating a Template Report for a Bank in Belarus | ||
|
||
|
||
1\. Navigate to [https://reporting-hope-dev.unitst.org/admin/](https://reporting-hope-dev.unitst.org/admin/) | ||
|
||
|
||
2\. Scroll down to "Queries" | ||
|
||
![Image](../_screenshots/ascreenshot35.jpeg) | ||
|
||
|
||
3\. Click on "ADD QUERY" | ||
|
||
![Image](../_screenshots/ascreenshot36.jpeg) | ||
|
||
|
||
4\. Add "Belarus" to country office field | ||
|
||
![Image](../_screenshots/ascreenshot37.jpeg) | ||
|
||
|
||
5\. Fill in the name of the query "Template for a bank" | ||
|
||
|
||
6\. Paste this code in order to get the required information. | ||
|
||
```python | ||
from django.db.models import ExpressionWrapper, F, DecimalField | ||
households=list(conn.select_related( | ||
"head_of_household", | ||
"business_area", | ||
"parent", | ||
"household" | ||
).filter( | ||
business_area__slug="belarus", | ||
parent__unicef_id="PP-0630-24-00000017" | ||
).values( | ||
"entitlement_quantity", | ||
"head_of_household__given_name", | ||
"head_of_household__given_name", | ||
"head_of_household__family_name", | ||
"head_of_household__middle_name", | ||
"head_of_household__sex", | ||
"household__address", | ||
"head_of_household__phone_no", | ||
"household__unicef_id" | ||
).annotate( | ||
commission=ExpressionWrapper((F('entitlement_quantity')*5/100)*1.20, output_field=DecimalField(decimal_places=2) )) | ||
) | ||
result = [] | ||
for household in households: | ||
address_no_spaces = household["household__address"].replace(" ", "") | ||
household["locality"] = address_no_spaces[:29] | ||
household["street_name"] = address_no_spaces[30:59] | ||
result.append(household) | ||
``` | ||
![Image](../_screenshots/ascreenshot38.jpeg) | ||
|
||
|
||
7\. We will produce a report based on the Payments made recently in Belarus. So, we chose the **Payment**, table as target of our report. | ||
|
||
![Image](../_screenshots/ascreenshot39.jpeg) | ||
|
||
|
||
8\. Save and continue editing. | ||
|
||
![Image](../_screenshots/ascreenshot40.jpeg) | ||
|
||
|
||
9\. Click "Queue" button to generate the data. | ||
|
||
![Image](../_screenshots/ascreenshot41.jpeg) | ||
|
||
|
||
10\. Click "DATASETS" to preview the results and ensure things are correct | ||
|
||
![Image](../_screenshots/ascreenshot42.jpeg) | ||
|
||
|
||
11\. We now need to create a formater as requested by the bank. This will allow us to produce a text file that ressemble the one we required by our bank. Navigate to ***Home>Power*** Query and slick "**Add**" on the formater row | ||
|
||
![Image](../_screenshots/ascreenshot43.jpeg) | ||
|
||
|
||
12\. Give the template a name "Template for a bank in Belarus" | ||
|
||
|
||
13\. Click here. | ||
|
||
![Image](../_screenshots/ascreenshot44.jpeg) | ||
|
||
|
||
14\. In the code area, paste the following html code: | ||
```html | ||
<table></table> | ||
``` | ||
|
||
|
||
15\. Select the "text/html" option for the hile type since we want a simple html file. Save. | ||
|
||
![Image](../_screenshots/ascreenshot45.jpeg) | ||
|
||
|
||
16\. Go back to the **Menu > Power Query** and add a Report Configuration | ||
|
||
![Image](../_screenshots/ascreenshot46.jpeg) | ||
|
||
|
||
17\. Don't forget to chose the country office the report belongs to. Chose the report title and the appropriate query. | ||
|
||
![Image](../_screenshots/ascreenshot47.jpeg) | ||
|
||
|
||
18\. Click "Template for a bank in Belarus" as formatter and move it to the **Chosen formatters.** | ||
|
||
![Image](../_screenshots/ascreenshot48.jpeg) | ||
|
||
|
||
19\. Click "Choose" | ||
|
||
![Image](../_screenshots/ascreenshot49.jpeg) | ||
|
||
|
||
20\. Save. | ||
|
||
![Image](../_screenshots/ascreenshot50.jpeg) | ||
|
||
|
||
21\. And "Queue" in order to generate the requested template | ||
|
||
![Image](../_screenshots/ascreenshot51.jpeg) | ||
|
||
|
||
22\. Click "VIEW ON SITE" if you want to look at the result. | ||
|
||
![Image](../_screenshots/ascreenshot52.jpeg) | ||
|
||
|
||
23\. Click "view" | ||
|
||
![Image](../_screenshots/ascreenshot53.jpeg) | ||
|
||
|
||
24\. Click "Template Report For Bank" | ||
|
||
![Image](../_screenshots/ascreenshot54.jpeg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Generate a report on information related to a list of households | ||
|
||
|
||
1\. Navigate to [https://reporting-hope-dev.unitst.org/admin/](https://reporting-hope-dev.unitst.org/admin/) | ||
|
||
|
||
2\. Click "Add" | ||
|
||
![Image](../_screenshots/ascreenshot25.jpeg) | ||
|
||
|
||
3\. Type "Information in a list of Households" in the name field | ||
|
||
|
||
4\. Click the target field and select "Household" | ||
|
||
![Image](../_screenshots/ascreenshot26.jpeg) | ||
|
||
|
||
5\. Switch to tab "Add query | HOPE Reporting site admin" | ||
|
||
|
||
6\. | ||
```python | ||
hh_list= [ | ||
"HH-23-0271.6128", | ||
"HH-23-0271.6129", | ||
".......", | ||
"HH-24-2546.2547" | ||
] | ||
result=list(conn.filter(unicef_id__in=hh_list).values("unicef_id", "program__name", "registration_data_import__name")) | ||
``` | ||
we paste the list in the hh_list variable and filter the query for Households in that list. | ||
|
||
![Image](../_screenshots/ascreenshot27.jpeg) | ||
|
||
|
||
7\. Click this button. | ||
|
||
![Image](../_screenshots/ascreenshot28.jpeg) | ||
|
||
|
||
8\. Click "Queue" | ||
|
||
![Image](../_screenshots/ascreenshot29.jpeg) | ||
|
||
|
||
9\. Click "DATASETS" | ||
|
||
![Image](../_screenshots/ascreenshot31.jpeg) | ||
|
||
|
||
10\. Click "[ABSTRACT] Information in a list of Households" | ||
|
||
![Image](../_screenshots/ascreenshot32.jpeg) | ||
|
||
|
||
11\. Click "PREVIEW", you can view the data | ||
|
||
![Image](../_screenshots/ascreenshot34.jpeg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Tutorial | ||
|
||
HOPE users can create reports by retrieving data from the HOPE database. | ||
|
||
At the core of this data retrieval process lies the utilization of [**Python**](https://www.python.org/) and [**Django**](https://www.djangoproject.com/) code. These programming languages provide the necessary tools to extract and manipulate data from the database, enabling the creation of reports that are both informative and visually appealing. | ||
|
||
To gain a comprehensive understanding of the available data within the Hope Database, it is essential to refer to the GitHub repository at this [link](https://github.com/unicef/hope-country-report/blob/develop/src/hope_country_report/apps/hope/models/_inspect.py) . | ||
|
||
![Image](../_screenshots/Pasted_image1.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# Generate Payment Plans Report from a template | ||
|
||
1\. Navigate to <https://reporting-hope-dev.unitst.org/admin/> | ||
|
||
|
||
2\. Add a query | ||
|
||
![Image](../_screenshots/ascreenshot55.jpeg) | ||
|
||
|
||
3\. In the **Parent** field, you have to chose the report template that you want to use. It has to be using the Parameters so that you can substitute new ones. The target and code fields _must be empty_ but the country and Parent fields must be all set. | ||
|
||
![Image](../_screenshots/ascreenshot56.jpeg) | ||
|
||
|
||
4\. Delete anything in the code field `result=conn.all()` | ||
|
||
![Image](../_screenshots/ascreenshot57.jpeg) | ||
|
||
|
||
5\. Click this dropdown for the parametrizer. | ||
|
||
![Image](../_screenshots/ascreenshot58.jpeg) | ||
|
||
|
||
6\. You can chose any parameter or create one by clicking on the "+" sign. | ||
|
||
![Image](../_screenshots/ascreenshot59.jpeg) | ||
|
||
|
||
7\. Chose a name and a country. | ||
|
||
![Image](../_screenshots/ascreenshot60.jpeg) | ||
|
||
|
||
8\. Fill the value field with the correct json information: | ||
|
||
```json | ||
{"payment_plan": ["PP-4140-24-00000056", "PP-4140-24-00000055", "PP-4140-24-00000049", "PP-4140-24-00000046"], "business_area": ["syria"]} | ||
``` | ||
|
||
![Image](../_screenshots/ascreenshot61.jpeg) | ||
|
||
|
||
9\. Save the parameters | ||
|
||
![Image](../_screenshots/ascreenshot62.jpeg) | ||
|
||
|
||
10\. Click this button. | ||
|
||
![Image](../_screenshots/ascreenshot63.jpeg) | ||
|
||
|
||
11\. Click "Info on Payment plans (Payment plan list report)" | ||
|
||
![Image](../_screenshots/ascreenshot64.jpeg) | ||
|
||
|
||
12\. Click "Queue" | ||
|
||
![Image](../_screenshots/ascreenshot65.jpeg) | ||
|
||
|
||
13\. Go back and we create the report configurations | ||
|
||
![Image](../_screenshots/ascreenshot66.jpeg) | ||
|
||
|
||
14\. Select the country | ||
|
||
![Image](../_screenshots/ascreenshot67.jpeg) | ||
|
||
|
||
15\. Click "Info on Payment plans (Payment plan list report)" as the query | ||
|
||
![Image](../_screenshots/ascreenshot68.jpeg) | ||
|
||
|
||
16\. Chose the report to be available as Excel and html file | ||
|
||
![Image](../_screenshots/ascreenshot69.jpeg) | ||
|
||
|
||
17\. you can chose to limit access to or notify "[dzzzdzzzz@unicef.org](mailto:dzzzzzzzz@unicef.org)" | ||
|
||
![Image](../_screenshots/ascreenshot70.jpeg) | ||
|
||
|
||
18\. Click the "Compress" field if you want the report to be available as a compressed file. | ||
|
||
![Image](../_screenshots/ascreenshot71.jpeg) | ||
|
||
|
||
19\. Save and continue editing, and queue the report. | ||
|
||
![Image](../_screenshots/ascreenshot72.jpeg) | ||
|
||
|
||
20\. Click "VIEW ON SITE" to view the result | ||
|
||
![Image](../_screenshots/ascreenshot73.jpeg) | ||
|
||
|
||
21\. Click "view" | ||
|
||
![Image](../_screenshots/ascreenshot74.jpeg) | ||
|
||
|
||
22\. Click "Report For Payment Plans In Syriapp-4140-24-00000056_Syria" | ||
|
||
![Image](../_screenshots/ascreenshot75.jpeg) | ||
|
||
|
Oops, something went wrong.