Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Table Title for Excel Output #569

Merged
merged 5 commits into from
Aug 3, 2017
Merged

Conversation

GoFroggyRun
Copy link
Contributor

@GoFroggyRun GoFroggyRun commented Jun 20, 2017

Currently TaxBrain Excel output files do not include Table title. As demonstrated below:

screen shot 2017-06-20 at 6 14 37 pm

screen shot 2017-06-20 at 6 14 32 pm

This PR adds a function addTit, within ext.buttons.excelHtml5, to insert title information to excel output (excel button only, CSV and copy buttons have different logic and thus will be fixed separately). Selector is used to extract proper title names.

This PR generates excel files with title information included as follow:

screen shot 2017-06-20 at 6 05 33 pm

screen shot 2017-06-20 at 6 05 27 pm

Could you review? @MattHJensen @brittainhard

@GoFroggyRun
Copy link
Contributor Author

GoFroggyRun commented Jun 21, 2017

Commit a3c65cf and d6d6c11 allow table generated by Copy and CSV buttons to include titles.

Before the two commits, Copy button on TB would generate table that looks like:

    2017    2018    2019    2020    2021    2022    2023    2024    2025    2026
    Billions    Billions    Billions    Billions    Billions    Billions    Billions    Billions    Billions    Billions
Individual Income Tax Liability Change  0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Payroll Tax Liability Change    0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Combined Payroll and Individual Income Tax Liability Change 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Source: http://127.0.0.1:8000/taxbrain/40/        

or

    Tax Units with Tax Cut  Tax Units with Tax Increase Count   Average Tax Change  Total Tax Difference    Percent with Tax Increase   Percent with Tax Decrease   Share of Overall Change
    Thousands   Thousands   Thousands       Billions            
0-10%   0   0   17,779  0   0.0 0.0 0.0 0.0
10-20%  0   0   17,781  0   0.0 0.0 0.0 0.0
20-30%  0   0   17,780  0   0.0 0.0 0.0 0.0
30-40%  0   0   17,780  0   0.0 0.0 0.0 0.0
40-50%  0   0   17,781  0   0.0 0.0 0.0 0.0
50-60%  0   0   17,780  0   0.0 0.0 0.0 0.0
60-70%  0   0   17,780  0   0.0 0.0 0.0 0.0
70-80%  0   0   17,779  0   0.0 0.0 0.0 0.0
80-90%  0   0   17,781  0   0.0 0.0 0.0 0.0
90-100% 0   0   17,781  0   0.0 0.0 0.0 0.0
All 0   0   177,802 0   0.0 0   0   0.0
Source: http://127.0.0.1:8000/taxbrain/40/   

And right now, after the fix:

TOTAL LIABILITIES CHANGE BY CALENDAR YEAR (2017)
    2017    2018    2019    2020    2021    2022    2023    2024    2025    2026
    Billions    Billions    Billions    Billions    Billions    Billions    Billions    Billions    Billions    Billions
Individual Income Tax Liability Change  0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Payroll Tax Liability Change    0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Combined Payroll and Individual Income Tax Liability Change 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Source: http://127.0.0.1:8000/taxbrain/40/      

or

COMBINED PAYROLL AND INDIVIDUAL INCOME TAX: DIFFERENCE BETWEEN BASE AND USER PLANS BY EXPANDED INCOME BIN (2020)
    Tax Units with Tax Cut  Tax Units with Tax Increase Count   Average Tax Change  Total Tax Difference    Percent with Tax Increase   Percent with Tax Decrease   Share of Overall Change
    Thousands   Thousands   Thousands       Billions            
Less than 10    0   0   22,087  0   0.0 0.0 0.0 0.0
10-20   0   0   23,833  0   0.0 0.0 0.0 0.0
20-30   0   0   18,656  0   0.0 0.0 0.0 0.0
30-40   0   0   17,298  0   0.0 0.0 0.0 0.0
40-50   0   0   13,359  0   0.0 0.0 0.0 0.0
50-75   0   0   24,559  0   0.0 0.0 0.0 0.0
75-100  0   0   15,353  0   0.0 0.0 0.0 0.0
100-200 0   0   26,243  0   0.0 0.0 0.0 0.0
200-500 0   0   9,221   0   0.0 0.0 0.0 0.0
500-1000    0   0   1,357   0   0.0 0.0 0.0 0.0
1000+   0   0   710 0   0.0 0.0 0.0 0.0
All 0   0   177,802 0   0.0 0   0   0.0
Source: http://127.0.0.1:8000/taxbrain/40/          

Likewise, for CSV button, the generated data table will include title, as shown in the follow screenshots:

screen shot 2017-06-21 at 12 57 25 pm

screen shot 2017-06-21 at 12 57 19 pm

@brittainhard
Copy link
Contributor

LGTM, +1 for merging

@brittainhard
Copy link
Contributor

@GoFroggyRun can you handle these merge conflicts in this PR and the one in #564?

@GoFroggyRun
Copy link
Contributor Author

@brittainhard , thanks for the reminder, this PR is good to go.

@brittainhard brittainhard merged commit b8e07e3 into ospc-org:master Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants