Skip to content

Commit

Permalink
Format disbursments with VAT in a summary card
Browse files Browse the repository at this point in the history
  • Loading branch information
Katy600 committed Jan 16, 2025
1 parent 66e1228 commit 526dbf4
Showing 1 changed file with 68 additions and 63 deletions.
131 changes: 68 additions & 63 deletions app/views/shared/_new_lgfs_disbursements.html.haml
Original file line number Diff line number Diff line change
@@ -1,91 +1,96 @@
%h3.govuk-heading-m
= t('.disbursements_gross')

= govuk_table do
= govuk_table_caption(class: 'govuk-visually-hidden') do
= t('.disbursements_caption')

= govuk_table_thead do
= govuk_table_row do
= govuk_table_th do
= t('.disbursement_type')

= govuk_table_th_numeric do
= t('.net_amount')

= govuk_table_th_numeric do
= t('.vat_amount')

= govuk_table_th_numeric do
= t('.gross_amount')

= govuk_table_tbody do
- present_collection(claim.disbursements.with_vat).each do |disbursement|
= govuk_table_row do
= govuk_table_td('data-label': t('.disbursement_type')) do
= disbursement.name

= govuk_table_td_numeric('data-label': t('.net_amount')) do
= disbursement.net_amount

= govuk_table_td_numeric('data-label': t('.vat')) do
= disbursement.vat_amount

= govuk_table_td_numeric('data-label': t('shared.gross_amount')) do
= disbursement.total

= govuk_table_tfoot do
= govuk_table_row do
= govuk_table_th(scope: 'row', 'data-label': t('shared.disbursement_type')) do
= t('shared.disbursements_gross')

= govuk_table_td_numeric('data-label': t('shared.net_amount')) do
= claim.disbursements_with_vat_net

= govuk_table_td_numeric('data-label': t('shared.vat')) do
= claim.disbursements_vat

= govuk_table_td_numeric('data-label': t('shared.gross_amount')) do
= claim.disbursements_with_vat_gross

- if claim.disbursements.without_vat.any?
%h3.govuk-heading-m
= t('shared.disbursements_no_vat')

.govuk-summary-card.custom-summary-card
.govuk-summary-card__title-wrapper
%h2.govuk-summary-card__title
= t('.disbursements_gross')
.govuk-summary-card__content
%dl.govuk-summary-list.new_summary
%div.govuk-summary-list__header
%div.govuk-summary-list__row
= govuk_table do
= govuk_table_caption(class: 'govuk-visually-hidden') do
= t('.disbursements_caption')

= govuk_table_thead do
= govuk_table_row do
= govuk_table_th do
= t('shared.disbursement_type')
= t('.disbursement_type')

= govuk_table_th_numeric do
= t('shared.net_amount')
= t('.net_amount')

= govuk_table_th_numeric do
= t('shared.gross_amount')
= t('.vat_amount')

= govuk_table_th_numeric do
= t('.gross_amount')

= govuk_table_tbody do
- present_collection(claim.disbursements.without_vat).each do |disbursement|
- present_collection(claim.disbursements.with_vat).each do |disbursement|
= govuk_table_row do
= govuk_table_td('data-label': t('shared.disbursement_type')) do
= govuk_table_td('data-label': t('.disbursement_type')) do
= disbursement.name

= govuk_table_td_numeric('data-label': t('shared.net_amount')) do
= govuk_table_td_numeric('data-label': t('.net_amount')) do
= disbursement.net_amount

= govuk_table_td_numeric('data-label': t('.vat')) do
= disbursement.vat_amount

= govuk_table_td_numeric('data-label': t('shared.gross_amount')) do
= disbursement.total

= govuk_table_tfoot do
= govuk_table_row do
= govuk_table_th(scope: 'row', 'data-label': t('shared.disbursement_type')) do
= t('shared.disbursements_no_vat')
= t('shared.disbursements_gross')

= govuk_table_td_numeric('data-label': t('shared.net_amount')) do
= claim.disbursements_without_vat_net
= claim.disbursements_with_vat_net

= govuk_table_td_numeric('data-label': t('shared.vat')) do
= claim.disbursements_vat

= govuk_table_td_numeric('data-label': t('shared.gross_amount')) do
= claim.disbursements_without_vat_gross
= claim.disbursements_with_vat_gross

- if claim.disbursements.without_vat.any?
%h3.govuk-heading-m
= t('shared.disbursements_no_vat')

= govuk_table do
= govuk_table_caption(class: 'govuk-visually-hidden') do
= t('.disbursements_caption')

= govuk_table_thead do
= govuk_table_row do
= govuk_table_th do
= t('shared.disbursement_type')

= govuk_table_th_numeric do
= t('shared.net_amount')

= govuk_table_th_numeric do
= t('shared.gross_amount')

= govuk_table_tbody do
- present_collection(claim.disbursements.without_vat).each do |disbursement|
= govuk_table_row do
= govuk_table_td('data-label': t('shared.disbursement_type')) do
= disbursement.name

= govuk_table_td_numeric('data-label': t('shared.net_amount')) do
= disbursement.net_amount

= govuk_table_td_numeric('data-label': t('shared.gross_amount')) do
= disbursement.total

= govuk_table_tfoot do
= govuk_table_row do
= govuk_table_th(scope: 'row', 'data-label': t('shared.disbursement_type')) do
= t('shared.disbursements_no_vat')

= govuk_table_td_numeric('data-label': t('shared.net_amount')) do
= claim.disbursements_without_vat_net

= govuk_table_td_numeric('data-label': t('shared.gross_amount')) do
= claim.disbursements_without_vat_gross

0 comments on commit 526dbf4

Please sign in to comment.