Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #84 from cds-snc/task/update-review-numbers
Browse files Browse the repository at this point in the history
update values on review page
  • Loading branch information
katedee authored Jul 23, 2019
2 parents 1574dfa + 336b6c6 commit ea0ad76
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 35 deletions.
46 changes: 19 additions & 27 deletions api/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@
"netIncome": {
"name": "Net Income",
"line": 236,
"amount": 20000.00
"amount": 19305.10
},
"taxableIncome": {
"name": "Taxable Income",
"line": 260,
"amount": 5000.00
"amount": 19305.10
}
},
"taxes": {
"federal": {
"name": "Net Federal tax",
"amount": 1998.00,
"amount": 1060.00,
"line": 420
},
"provincial": {
"name": "Net Provincial tax",
"amount": 1106.00,
"name": "Net Ontario tax",
"amount": 533.00,
"line": 428
},
"CPP": {
Expand Down Expand Up @@ -93,7 +93,6 @@
"disabilityClaim": null,
"disabilityAmount": {
"name": "Disability",
"line": 316,
"amount": 0.00
},
"rrspClaim": null,
Expand All @@ -104,7 +103,6 @@
},
"ageAmount": {
"name": "Age Amount",
"line": 301,
"amount": 7500.00
},
"rrspAmount": 0,
Expand All @@ -115,27 +113,23 @@
"pensionIncomeClaim": null,
"pensionIncomeClaimAmount": {
"name": "Pension",
"line": 314,
"amount": 700.00
},
"childcareClaim": null,
"childcareAmount": {
"name": "Childcare Expenses",
"line": 214,
"amount": 1517.94
"amount": 0.00
},
"singleParentClaim": null,
"dependentDisabilityClaim": null,
"medicalExpenseClaim": null,
"medicalExpenseClaimAmount": {
"name": "Medical Expenses",
"line": 331,
"multiLine": "330/331",
"amount": 1227.34
"line": 330,
"amount": 0.00
},
"amountsFromSpouse": {
"name": "Amounts transfered from spouse",
"line": 326,
"amount": 0.00
},
"politicalContributionClaim": null,
Expand All @@ -154,32 +148,30 @@
"climateActionIncentiveIsRural": null
},
"refund": {
"Total Payable": {
"totalPayable": {
"name": "Total Payable",
"line": 435,
"amount": 0.00
"amount": 1593.00
},
"Total Deducted": {
"totalDeducted": {
"name": "Total Deducted",
"line": 437,
"amount": 0.00
"amount": 2312.88
},
"Total Credits": {
"totalCredits": {
"name": "Total Credits",
"line": 482,
"amount": 2500.00
},
"Total Refund": {
"totalRefund": {
"name": "Total Refund",
"line": 484,
"amount": 3200.00
"amount": 719.88
}
},
"benefits": {
"Canada child benefit": 6639.00,
"Climate action incentive": 0.00,
"GST/HSTC": 0.00,
"Trillium": 300.00,
"totalBenefits": 6939.00
"Climate action incentive": 154.00,
"GST/HSTC": 440.00,
"Ontario Trillium Benefit": 307.92,
"totalBenefits": 901.92
}
}
12 changes: 5 additions & 7 deletions views/confirmation/review.pug
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ block variables
-var incomes = hasData(data, 'financial.incomes') ? data.financial.incomes : {}
-var taxes = hasData(data, 'financial.taxes') ? data.financial.taxes : {}
-var refund = hasData(data, 'refund') ? data.refund : {}
-var totalRefund = hasData(data, 'refund.totalRefund') ? data.refund.totalRefund : 0
-var refundLines = sortByLineNumber(data.deductions, taxes, incomes, refund)
-var count = 1;

Expand All @@ -25,7 +26,7 @@ block content
thead
tr
th.breakdown-table__heading #{__('Your annual benefits')}
th.breakdown-table__heading $#{currencyFilter(totalBenefits, 0)}
th.breakdown-table__heading $#{currencyFilter(totalBenefits)}
tbody
tr
th(colspan="2").breakdown-table__subheading #{__('Detailed breakdown of benefits')}
Expand All @@ -44,19 +45,16 @@ block content
thead
tr
th.breakdown-table__heading #{__('Your projected refund')}
th.breakdown-table__heading +$#{currencyFilter(totalBenefits, 0)}
th.breakdown-table__heading +$#{currencyFilter(totalRefund.amount)}
tbody
tr
th(colspan="2").breakdown-table__subheading #{__('Detailed breakdown of benefits')}
th(colspan="2").breakdown-table__subheading #{__('Detailed breakdown of tax refund')}
each refundLine in refundLines
-var lineNumber = refundLine.multiLine ? refundLine.multiLine : refundLine.line

//- do I like this space-row thing right now? no
//- but until our date and how we sort these lines is more solid, it lives
tr(
class={
['breakdown-table__summary-row space-row']: refundLine.name === "Total Refund",
['space-row']: count === 5 || count === 8 || count === 11 || count === 13
['space-row']: count === 4 || count === 5 || count === 6 || count === 8
}
)
td #{__(`${refundLine.name} (${lineNumber})`)}
Expand Down
2 changes: 1 addition & 1 deletion views/financial/income.pug
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ block content

each tax in taxes
tr
td #{__(`${tax.name} deduction`)}
td #{__(`${tax.name.replace('Net ', '')} deduction`)}
td $#{currencyFilter(tax.amount)}

tr.breakdown-table__summary-row
Expand Down

0 comments on commit ea0ad76

Please sign in to comment.