diff --git a/app/views/case_workers/claims/show.html.haml b/app/views/case_workers/claims/show.html.haml index b5ed639214..5841e064c0 100644 --- a/app/views/case_workers/claims/show.html.haml +++ b/app/views/case_workers/claims/show.html.haml @@ -7,4 +7,4 @@ = render 'warnings/injection_warnings_summary', claim: claim = render partial: 'shared/claim_header', locals: { claim: claim } - = render partial: 'shared/claim_accordion', locals: { claim: claim, status_disabled: false } + = render partial: 'shared/new_claim_accordion', locals: { claim: claim, status_disabled: false } diff --git a/app/views/case_workers/court_data/_defendant.html.haml b/app/views/case_workers/court_data/_defendant.html.haml index 8d9790b211..80f7e016c8 100644 --- a/app/views/case_workers/court_data/_defendant.html.haml +++ b/app/views/case_workers/court_data/_defendant.html.haml @@ -15,31 +15,31 @@ %li.govuk-summary-card__action = govuk_link_to t('.court_data_link'), "#{ENV.fetch('VIEW_COURT_DATA_URL', nil)}/laa_references/new?id=#{defendant.hmcts.id}&urn=#{case_number}", target: :_blank .govuk-summary-card__content - %dl.govuk-summary-list - .govuk-summary-list__row + .govuk-summary-list + %dl.govuk-summary-list__row %dt.govuk-summary-list__key = t('.name') %dd.govuk-summary-list__value = defendant.hmcts.name - .govuk-summary-list__row + %dl.govuk-summary-list__row %dt.govuk-summary-list__key = t('.maat_reference') %dd.govuk-summary-list__value = defendant.maat_reference - if defendant.hmcts.start.present? - .govuk-summary-list__row + %dl.govuk-summary-list__row %dt.govuk-summary-list__key = t('.start_date') %dd.govuk-summary-list__value = defendant.hmcts.start.strftime(Settings.date_format) - if defendant.hmcts.end.present? - .govuk-summary-list__row + %dl.govuk-summary-list__row %dt.govuk-summary-list__key = t('.end_date') %dd.govuk-summary-list__value = defendant.hmcts.end.strftime(Settings.date_format) - if defendant.hmcts.contract_number.present? - .govuk-summary-list__row + %dl.govuk-summary-list__row %dt.govuk-summary-list__key = t('.contract_number') %dd.govuk-summary-list__value diff --git a/app/views/shared/_new_additional_information.html.haml b/app/views/shared/_new_additional_information.html.haml new file mode 100644 index 0000000000..b42eb5fb80 --- /dev/null +++ b/app/views/shared/_new_additional_information.html.haml @@ -0,0 +1,7 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('shared.new_claim_accordion.additional_information') + + .govuk-summary-card__content + = format_multiline(claim.additional_information) diff --git a/app/views/shared/_new_agfs_fee_details.html.haml b/app/views/shared/_new_agfs_fee_details.html.haml new file mode 100644 index 0000000000..4388d28697 --- /dev/null +++ b/app/views/shared/_new_agfs_fee_details.html.haml @@ -0,0 +1,90 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('common.fees') + .govuk-summary-card__content + = govuk_table do + = govuk_table_caption(class: 'govuk-visually-hidden') do + = t('.fees.caption') + = govuk_table_thead do + = govuk_table_row do + = govuk_table_th do + = t('.fee_category') + = govuk_table_th do + = t('.fee_type') + - unless claim.interim? + = govuk_table_th_numeric do + = t('.quantity') + = govuk_table_th_numeric do + = t('.rate') + = govuk_table_th_numeric do + = t('.net_amount') + = govuk_table_tbody do + - present_collection(claim.fees.select(&:present?).sort_by(&:position)).each do |fee| + = govuk_table_row do + = govuk_table_td('data-label': t('.fee_category')) do + = fee.fee_type&.fee_category_name || 'n/a' + %br/ + - if fee.fee_type.unique_code.eql?('BABAF') + - if fee.first_day_of_trial + = t('.first_day_of_trial') + %br/ + = fee.first_day_of_trial + %br/ + %br/ + - if fee.retrial_started_at + = t('.retrial_started_at') + %br/ + = fee.retrial_started_at + %br/ + %br/ + - if fee.dates_attended.any? + - if fee.fee_type.unique_code.eql?('BABAF') + = t(fee.claim.case_type.name.split(' ').collect(&:capitalize).join.underscore, scope: "external_users.claims.basic_fees.basic_fee_fields_primary.date_label") + - else + = t('.dates_attended') + %br/ + = fee.dates_attended_delimited_string + %br/ + %br/ + - if fee.date? + = t('.date') + = fee.date + = govuk_table_td('data-label': t('.fee_type')) do + = fee.fee_type&.description || 'n/a' + - if fee.sub_type.present? + %p + = "#{t('.fee_subtype')}: #{fee.sub_type.description}" + - if fee.case_uplift? + %br + = "#{t('.case_numbers')}: #{fee.case_numbers}" + - unless claim.interim? + = govuk_table_td_numeric('data-label': t('.quantity')) do + = fee.quantity + = govuk_table_td_numeric('data-label': t('.rate')) do + = fee.rate + = govuk_table_td_numeric('data-label': t('.net_amount')) do + = fee.amount + + = govuk_table(class: 'govuk-table--custom govuk-!-margin-bottom-0') do + = govuk_table_thead do + = govuk_table_row do + = govuk_table_th do + = t('shared.description') + = govuk_table_th_numeric do + = t('shared.net_amount') + = govuk_table_th_numeric do + = t('shared.vat') + = govuk_table_th_numeric do + = t('shared.gross_amount') + + = govuk_table_tbody do + = govuk_table_row(class: 'govuk-table__row--no-bottom-border') do + = govuk_table_td('data-label': t('shared.description')) do + = t('shared.summary.fees_total') + = govuk_table_td_numeric('data-label': t('shared.net_amount')) do + = claim.fees_total + = govuk_table_td_numeric('data-label': t('shared.vat')) do + = claim.fees_vat + = govuk_table_td_numeric('data-label': t('shared.gross_amount')) do + = claim.fees_gross diff --git a/app/views/shared/_new_certification.html.haml b/app/views/shared/_new_certification.html.haml new file mode 100644 index 0000000000..5aeef783a0 --- /dev/null +++ b/app/views/shared/_new_certification.html.haml @@ -0,0 +1,16 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('.certification_box_title') + + .govuk-summary-card__content + = govuk_table do + = govuk_table_tbody do + = govuk_table_row(class: 'no-border-bottom') do + = govuk_table_th(scope: 'row') { t('.instructed_heading') } + = govuk_table_td { claim.external_user.name } + + - if @claim.agfs? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.certification_reason') } + = govuk_table_td { claim.certification.certification_type.name rescue '' } diff --git a/app/views/shared/_new_claim.html.haml b/app/views/shared/_new_claim.html.haml new file mode 100644 index 0000000000..e5411c87e5 --- /dev/null +++ b/app/views/shared/_new_claim.html.haml @@ -0,0 +1,33 @@ +- if claim.certification.present? + = render partial: 'shared/new_certification', locals: { claim: claim } + +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('shared.claim.claim_type') + + .govuk-summary-card__content + = govuk_table do + = govuk_table_tbody do + = render partial: 'shared/new_claim_and_case_type_details', locals: { claim: claim } + + - if claim.agfs? && claim.case_type.present? && claim.requires_cracked_dates? + = render partial: 'shared/new_claim_cracked_trial_details', locals: { claim: claim } + + - if claim.case_type && claim.case_concluded_at + = render partial: 'shared/new_claim_case_concluded_at_details', locals: { claim: claim } + + - if claim.lgfs? && claim.interim? && !claim.interim_fee.nil? + = render partial: 'shared/new_claim_interim_details', locals: { claim: claim } + + - if claim.transfer? + = render partial: 'shared/new_claim_transfer_details', locals: { claim: claim } + + - if claim&.requires_trial_dates? + = render partial: 'shared/new_claim_trial_details', locals: { claim: claim } + + - if claim&.requires_retrial_dates? + = render partial: 'shared/new_claim_retrial_details', locals: { claim: claim } + + - if claim.main_hearing_date + = render partial: 'shared/new_main_hearing_date_details', locals: { claim: claim } diff --git a/app/views/shared/_new_claim_accordion.html.haml b/app/views/shared/_new_claim_accordion.html.haml new file mode 100644 index 0000000000..ece87376b8 --- /dev/null +++ b/app/views/shared/_new_claim_accordion.html.haml @@ -0,0 +1,45 @@ +#claim-accordion + .govuk-grid-row + .govuk-grid-column-one-half + %h2.govuk-heading-m + = t('.h2_messages') + + .govuk-grid-column-one-half + - if current_user.persona.is_a?(CaseWorker) + .other-claims + - if claim_ids.present? && claim_ids.include?(@claim.id) + = t('shared.position_and_count', position: claim_position_and_count) + + - unless last_claim? + = next_claim_link 'Next claim >'.html_safe, class: 'next-claim' + + = render partial: 'shared/claim_history', locals: { claim: claim } + = render partial: 'shared/claim_status', locals: { claim: claim, disabled: status_disabled } + + %h2.govuk-heading-l + = t('.h2_basic_info') + .js-accordion__panel + = render partial: 'shared/new_claim', locals: { claim: claim, hide_totals: true } + + - if claim.defendants.any? + %h2.govuk-heading-l + = t('.h2_defendant_details') + .js-accordion__panel + = render partial: 'shared/new_claim_defendants', locals: { defendants: claim.defendants } + -else + = render partial: 'shared/new_defendant_details', locals: { claim: claim } + - unless claim.fixed_fee_case? + = render partial: 'shared/offence_details/new_summary', locals: { claim: claim } + + %h2.govuk-heading-l + = t('.h2_evidence') + .js-accordion__panel + = render partial: 'shared/new_evidence_list', locals: { claim: claim } + + %h2.govuk-heading-l + = t('.h2_summary') + .js-accordion__panel.fees-summary + - if claim.agfs? + = render partial: 'shared/new_summary_agfs', locals: { claim: claim } + - else + = render partial: 'shared/new_summary_lgfs', locals: { claim: claim } diff --git a/app/views/shared/_new_claim_and_case_type_details.html.haml b/app/views/shared/_new_claim_and_case_type_details.html.haml new file mode 100644 index 0000000000..42b0673483 --- /dev/null +++ b/app/views/shared/_new_claim_and_case_type_details.html.haml @@ -0,0 +1,66 @@ +- unless claim.providers_ref.blank? + = govuk_table_row do + = govuk_table_th(scope: 'row', class: 'summary-page-table-two-row') { t('.provider_reference') } + = govuk_table_td { claim.providers_ref } + +- unless claim.draft? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.claim_submitted') } + = govuk_table_td { claim.submitted_at } + +- if claim.case_workers.any? && current_user_is_caseworker? && current_user.persona.admin? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.assignee') } + = govuk_table_td { claim.case_worker_names } + +- if @claim.lgfs? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('common.external_user.claim_creator') } + = govuk_table_td { claim.creator.name } + +- if @claim.agfs? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t("common.external_user.#{@claim.external_user_type}") } + = govuk_table_td { claim.external_user.name } + = govuk_table_row do + = govuk_table_th(scope: 'row') { t("common.external_user.category.#{@claim.external_user_type}") } + = govuk_table_td { claim.advocate_category } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("common.external_user.account_number.#{@claim.external_user_type}") } + = govuk_table_td { claim.supplier_number } + +- if claim.court + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('common.crown_court') } + = govuk_table_td { claim.court.name } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t('.case_num') } + = govuk_table_td do + = claim.case_number + %span.unique-id-small + = claim.unique_id + +- if claim.transfer_court.present? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('common.transfer_court') } + = govuk_table_td { claim.transfer_court.name } + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('common.transfer_case_number') } + = govuk_table_td { claim.transfer_case_number } + +- if claim.case_stage + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.case_stage') } + = govuk_table_td { claim.case_stage&.description } + +- if claim.display_case_type? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.case_type') } + = govuk_table_td { claim.case_type&.name } + +- if claim.discontinuance? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('common.prosecution_evidence') } + = govuk_table_td { t(claim.prosecution_evidence?.class) } diff --git a/app/views/shared/_new_claim_case_concluded_at_details.html.haml b/app/views/shared/_new_claim_case_concluded_at_details.html.haml new file mode 100644 index 0000000000..6b34921032 --- /dev/null +++ b/app/views/shared/_new_claim_case_concluded_at_details.html.haml @@ -0,0 +1,2 @@ += govuk_table_th(scope: 'row') { t('external_users.claims.case_details.case_concluded_date.case_concluded_at') } += govuk_table_td { claim.case_concluded_at } diff --git a/app/views/shared/_new_claim_cracked_trial_details.html.haml b/app/views/shared/_new_claim_cracked_trial_details.html.haml new file mode 100644 index 0000000000..49c9404a98 --- /dev/null +++ b/app/views/shared/_new_claim_cracked_trial_details.html.haml @@ -0,0 +1,24 @@ +- cracked_trial_detail_translations = 'external_users.claims.case_details.cracked_trial_fields' + +- trial_cracked_at_third_key = '' +- if claim.hardship? + - trial_cracked_at_third_key = t("#{cracked_trial_detail_translations}.trial_cracked_at_third.hardship") +- else + - trial_cracked_at_third_key = t("#{cracked_trial_detail_translations}.trial_cracked_at_third.default") + + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{cracked_trial_detail_translations}.trial_fixed_notice_at") } + = govuk_table_td { claim.trial_fixed_notice_at.strftime(Settings.date_format) rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{cracked_trial_detail_translations}.trial_fixed_at") } + = govuk_table_td { claim.trial_fixed_at.strftime(Settings.date_format) rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{cracked_trial_detail_translations}.trial_cracked_at") } + = govuk_table_td { claim.trial_cracked_at.strftime(Settings.date_format) rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { trial_cracked_at_third_key } + = govuk_table_td { claim.trial_cracked_at_third.humanize rescue '' } diff --git a/app/views/shared/_new_claim_defendant_details.html.haml b/app/views/shared/_new_claim_defendant_details.html.haml new file mode 100644 index 0000000000..9fa9746430 --- /dev/null +++ b/app/views/shared/_new_claim_defendant_details.html.haml @@ -0,0 +1,37 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = "#{t('.title_defendant')} #{index}" + + .govuk-summary-card__content + = govuk_table do + = govuk_table_tbody do + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.first_name') } + = govuk_table_td { defendant.first_name } + + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.last_name') } + = govuk_table_td { defendant.last_name } + + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.date_of_birth') } + = govuk_table_td { defendant.date_of_birth.strftime(Settings.date_format) rescue '' } + + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('.order_of_judicial_apportionment') } + = govuk_table_td { defendant.order_for_judicial_apportionment == true ? t('global_yes') : t('global_no') } + + - if defendant.representation_orders.any? + - defendant.representation_orders.each_with_index do |representation_order, index| + = govuk_table_row do + = govuk_table_th(scope: 'row') { "#{t('.reporders')} #{index + 1}" } + = govuk_table_td do + %p + %span= representation_order.representation_order_date.strftime(Settings.date_format) rescue '' + %p + %span= t('.maat_reference') + = representation_order.maat_reference + + - else + = govuk_inset_text(t('.no_reporder')) diff --git a/app/views/shared/_new_claim_defendants.html.haml b/app/views/shared/_new_claim_defendants.html.haml new file mode 100644 index 0000000000..b2c84e0b6d --- /dev/null +++ b/app/views/shared/_new_claim_defendants.html.haml @@ -0,0 +1,2 @@ +- defendants.each_with_index do | defendant, index | + = render partial: 'shared/new_claim_defendant_details', locals: { defendant: present(defendant, CaseWorkers::DefendantPresenter), index: index += 1 } diff --git a/app/views/shared/_new_claim_interim_details.html.haml b/app/views/shared/_new_claim_interim_details.html.haml new file mode 100644 index 0000000000..6b30e11deb --- /dev/null +++ b/app/views/shared/_new_claim_interim_details.html.haml @@ -0,0 +1,48 @@ +- fee = present(claim.interim_fee) += govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.fee_type') } + = govuk_table_td { fee.fee_type.description } + +- if fee.is_interim_warrant? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.warrant_fee.date_issued') } + = govuk_table_td { fee.warrant_issued_date } + +- if fee.warrant_executed_date.present? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.warrant_fee.date_executed') } + = govuk_table_td { fee.warrant_executed_date } +- else + - unless fee.is_disbursement? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.ppe_total') } + = govuk_table_td { fee.quantity } + + - if fee.is_effective_pcmh? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.effective_pcmh_date') } + = govuk_table_td { fee.effective_pcmh_date } + + - if fee.is_trial_start? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.trial_start') } + = govuk_table_td { fee.first_day_of_trial } + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.estimated_trial_length') } + = govuk_table_td { fee.estimated_trial_length } + + - if fee.is_retrial_start? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.retrial_start') } + = govuk_table_td { fee.retrial_started_at } + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.estimated_retrial_length') } + = govuk_table_td { fee.retrial_estimated_length } + + - if fee.is_retrial_new_solicitor? + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.legal_aid_transfer_date') } + = govuk_table_td { fee.legal_aid_transfer_date } + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('shared.summary.trial_concluded_at') } + = govuk_table_td { fee.trial_concluded_at } diff --git a/app/views/shared/_new_claim_retrial_details.html.haml b/app/views/shared/_new_claim_retrial_details.html.haml new file mode 100644 index 0000000000..2cb65f40b8 --- /dev/null +++ b/app/views/shared/_new_claim_retrial_details.html.haml @@ -0,0 +1,20 @@ += govuk_table_row do + = govuk_table_th(scope: 'row') { t('.retrial_started_at') } + = govuk_table_td { claim&.retrial_started_at&.strftime(Settings.date_format) } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t('.retrial_estimated_length') } + = govuk_table_td { claim&.retrial_estimated_length } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t('.retrial_actual_length') } + = govuk_table_td { claim&.retrial_actual_length } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t('.retrial_concluded_at') } + = govuk_table_td { claim&.retrial_concluded_at&.strftime(Settings.date_format) } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t('.retrial_reduction') } + = govuk_table_td { claim&.retrial_reduction? ? 'Yes' : 'No' } + diff --git a/app/views/shared/_new_claim_transfer_details.html.haml b/app/views/shared/_new_claim_transfer_details.html.haml new file mode 100644 index 0000000000..b58eeec623 --- /dev/null +++ b/app/views/shared/_new_claim_transfer_details.html.haml @@ -0,0 +1,18 @@ +- trial_detail_translations = 'external_users.claims.case_details.trial_detail_fields' + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.first_day_of_trial") } + = govuk_table_td { claim.first_day_of_trial.strftime(Settings.date_format) rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.estimated_trial_length") } + = govuk_table_td { claim.estimated_trial_length rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.actual_trial_length") } + = govuk_table_td { claim.estimated_trial_length rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.trial_concluded_at") } + = govuk_table_td { claim.trial_concluded_at.strftime(Settings.date_format) rescue '' } + diff --git a/app/views/shared/_new_claim_trial_details.html.haml b/app/views/shared/_new_claim_trial_details.html.haml new file mode 100644 index 0000000000..08a374a1d6 --- /dev/null +++ b/app/views/shared/_new_claim_trial_details.html.haml @@ -0,0 +1,17 @@ +- trial_detail_translations = 'external_users.claims.case_details.trial_detail_fields' + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.first_day_of_trial") } + = govuk_table_td { claim.first_day_of_trial.strftime(Settings.date_format) rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.estimated_trial_length") } + = govuk_table_td { claim.estimated_trial_length rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.actual_trial_length") } + = govuk_table_td { claim.estimated_trial_length rescue '' } + += govuk_table_row do + = govuk_table_th(scope: 'row') { t("#{trial_detail_translations}.trial_concluded_at") } + = govuk_table_td { claim.trial_concluded_at.strftime(Settings.date_format) rescue '' } diff --git a/app/views/shared/_new_defendant_details.html.haml b/app/views/shared/_new_defendant_details.html.haml new file mode 100644 index 0000000000..c1e04cfb78 --- /dev/null +++ b/app/views/shared/_new_defendant_details.html.haml @@ -0,0 +1,4 @@ += govuk_table_row do + = govuk_table_td do + %p.govuk-body + = t('.no_defendant') diff --git a/app/views/shared/_new_evidence_checklist.html.haml b/app/views/shared/_new_evidence_checklist.html.haml new file mode 100644 index 0000000000..5494c24e2b --- /dev/null +++ b/app/views/shared/_new_evidence_checklist.html.haml @@ -0,0 +1,11 @@ +- unless @claim.evidence_checklist_ids.empty? + .govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title= (t('shared.evidence_checklist.caption')) + .govuk-summary-card__content + %dl.govuk-summary-list + = govuk_summary_list do + %ul(class="govuk-!-margin-0") + - DocType.find_by_ids(@claim.evidence_checklist_ids).each do |dt| + %div + = dt.name diff --git a/app/views/shared/_new_evidence_list.html.haml b/app/views/shared/_new_evidence_list.html.haml new file mode 100644 index 0000000000..cc633efed9 --- /dev/null +++ b/app/views/shared/_new_evidence_list.html.haml @@ -0,0 +1,28 @@ += render partial: 'shared/new_evidence_checklist' + +- if current_user_persona_is?(CaseWorker) && @claim.documents.none? + %p.govuk-body + = t('.no_documents_uploaded') + +- else + .govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title=t('.existing_evidence') + = govuk_link_to t('shared.download_all_html', context: t('.existing_evidence')), download_zip_case_workers_claim_path(@claim), class: 'govuk-!-font-weight-bold' + .govuk-summary-card__content + = govuk_table do + = govuk_table_thead do + = govuk_table_row do + = govuk_table_th { t('.name_of_file') } + = govuk_table_th_numeric { t('.file_size') } + = govuk_table_th_numeric { t('.date_added') } + + = govuk_table_tbody do + - @claim.documents.includes(:document_blob, :converted_preview_document_attachment).each do |document| + = govuk_table_row do + = govuk_table_td { govuk_link_to document.document_file_name, download_document_path(document) } + = govuk_table_td_numeric { number_to_human_size(document.document_file_size) } + = govuk_table_td_numeric { document.created_at.strftime(Settings.date_format) } + +- if claim.additional_information.present? + = render partial: 'shared/new_additional_information', locals: { claim: claim } diff --git a/app/views/shared/_new_lgfs_disbursements.html.haml b/app/views/shared/_new_lgfs_disbursements.html.haml new file mode 100644 index 0000000000..0349a33047 --- /dev/null +++ b/app/views/shared/_new_lgfs_disbursements.html.haml @@ -0,0 +1,51 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('.disbursements_gross') + .govuk-summary-card__content + = govuk_table(class: 'govuk-table--custom govuk-!-margin-bottom-0') 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(class: 'govuk-table__row--no-bottom-border') 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 diff --git a/app/views/shared/_new_lgfs_fee_details.html.haml b/app/views/shared/_new_lgfs_fee_details.html.haml new file mode 100644 index 0000000000..e5dda95695 --- /dev/null +++ b/app/views/shared/_new_lgfs_fee_details.html.haml @@ -0,0 +1,74 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('common.fees') + .govuk-summary-card__content + = govuk_table(class: 'govuk-!-margin-bottom-2') do + = govuk_table_caption(class: 'govuk-visually-hidden') do + = t('.fees.caption') + + = govuk_table_thead do + = govuk_table_row do + = govuk_table_th do + = t('.fee_category') + + = govuk_table_th do + = t('.fee_type') + + - if claim.display_days? + = govuk_table_th_numeric do + = claim.transfer? ? t('.days_claimed') : t('.actual_trial_length') + + = govuk_table_th_numeric do + = claim.fixed_fee_case? ? t('.quantity') : 'PPE' + + - if claim.fixed_fee_case? + = govuk_table_th_numeric do + = t('.rate') + + = govuk_table_th_numeric do + = t('.amount') + + = govuk_table_tbody do + - present_collection(claim.fees.select(&:present?).sort_by(&:position)).each do |fee| + = govuk_table_row do + = govuk_table_td('data-label': t('.fee_category')) do + = fee.fee_type&.fee_category_name || fee.not_applicable + - if fee.dates_attended.any? + %br + = t('.dates_attended') + = fee.dates_attended_delimited_string + - if fee.date? + %br + = t('.date') + = fee.date + + = govuk_table_td('data-label': t('.fee_type')) do + = fee.fee_type&.description || fee.not_applicable + - if fee.sub_type.present? + %br + = "#{t('.fee_subtype')}: #{fee.sub_type.description}" + - if fee.case_uplift? + %br + = "(#{t('.case_numbers')}: #{fee.case_numbers})" + + - if claim.display_days? + = govuk_table_td_numeric('data-label': claim.transfer? ? t('.days_claimed') : t('.actual_trial_length')) do + = fee.days_claimed + + = govuk_table_td_numeric('data-label': claim.fixed_fee_case? ? t('.quantity') : 'PPE') do + = fee.quantity + + - if claim.fixed_fee_case? + = govuk_table_td_numeric('data-label': t('.rate')) do + = fee.rate + + = govuk_table_td_numeric('data-label': t('.amount')) do + = fee.amount + + .govuk-summary-list + %dl.govuk-summary-list__row.total-fees + %dt.govuk-summary-list__key.total-fees + = t('.fees_total') + %dd.govuk-summary-list__value + = claim.fees_total diff --git a/app/views/shared/_new_main_hearing_date_details.html.haml b/app/views/shared/_new_main_hearing_date_details.html.haml new file mode 100644 index 0000000000..74bdf15bcc --- /dev/null +++ b/app/views/shared/_new_main_hearing_date_details.html.haml @@ -0,0 +1,3 @@ += govuk_table_row do + = govuk_table_th { t('common.main_hearing_date') } + = govuk_table_td { claim.main_hearing_date&.strftime(Settings.date_format) } diff --git a/app/views/shared/_new_summary_agfs.html.haml b/app/views/shared/_new_summary_agfs.html.haml new file mode 100644 index 0000000000..649736eff5 --- /dev/null +++ b/app/views/shared/_new_summary_agfs.html.haml @@ -0,0 +1,19 @@ +-# AGFS fees accordion content +- present(@claim) do |claim| + - if @claim.fees_total == 0 + %p.govuk-body + = t('shared.summary.no_values.fees') + + - else + = render partial: 'shared/new_agfs_fee_details', locals: { claim: claim } + + - if claim.final? && claim.interim_claim_info.present? + = render partial:'shared/new_warrant_fees_details', locals: { claim: claim } + + - if claim.expenses.empty? + %h3.govuk-heading-m + = t('common.expenses') + %p.govuk-body + = t('shared.summary.no_values.expenses') + - else + = render partial: 'shared/summary/new_expenses', locals: { claim: claim } diff --git a/app/views/shared/_new_summary_lgfs.html.haml b/app/views/shared/_new_summary_lgfs.html.haml new file mode 100644 index 0000000000..38dad65e34 --- /dev/null +++ b/app/views/shared/_new_summary_lgfs.html.haml @@ -0,0 +1,32 @@ +- present(@claim) do |claim| + - if @claim.fees_total == 0 + %p.govuk-body + = t('shared.summary.no_values.fees') + + - else + = render partial: 'shared/new_lgfs_fee_details', locals: { claim: claim } + + - if claim.final? && claim.interim_claim_info.present? + = render partial:'shared/new_warrant_fees_details', locals: { claim: claim } + + - if claim.expenses.empty? + %h3.govuk-heading-m + = t('common.expenses') + + %p.govuk-body + = t('shared.summary.no_values.expenses') + - else + = render partial: 'shared/summary/new_expenses', locals: { claim: claim } + + - if claim.can_have_disbursements? + - if claim.disbursements.empty? + %h3.govuk-heading-m + = t('common.disbursements') + + %p.govuk-body + = t('shared.summary.no_values.disbursements') + + - else + - if claim.disbursements.with_vat.any? + = render partial: 'shared/new_lgfs_disbursements', locals: { claim: claim } + diff --git a/app/views/shared/_new_warrant_fees_details.html.haml b/app/views/shared/_new_warrant_fees_details.html.haml new file mode 100644 index 0000000000..8b2f9afe9e --- /dev/null +++ b/app/views/shared/_new_warrant_fees_details.html.haml @@ -0,0 +1,20 @@ +- present(claim.interim_claim_info) do |info| + - if info.warrant_fee_paid? + .govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('.fields.warrant_fee') + + .govuk-summary-card__content + %span.govuk-visually-hidden + = t('.fees.caption') + + = govuk_table do + = govuk_table_tbody do + = govuk_table_row do + = govuk_table_th { t('.fields.date_issued') } + = govuk_table_td { info.warrant_issued_date.strftime('%d %B %Y') } + + = govuk_table_row do + = govuk_table_th { t('.fields.date_executed') } + = govuk_table_td { info.warrant_executed_date.strftime('%d %B %Y') } diff --git a/app/views/shared/offence_details/_new_default_summary.html.haml b/app/views/shared/offence_details/_new_default_summary.html.haml new file mode 100644 index 0000000000..9bcbfb6387 --- /dev/null +++ b/app/views/shared/offence_details/_new_default_summary.html.haml @@ -0,0 +1,11 @@ +- claim_fields = %i[external_users claims case_details fields] + += govuk_table do + = govuk_table_tbody do + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('offence_category', scope: claim_fields) } + = govuk_table_td { claim.offence ? claim.offence.description : t('general.not_provided') } + + = govuk_table_row do + = govuk_table_th(scope: 'row') { t('offence_class', scope: claim_fields) } + = govuk_table_td { claim.offence ? claim.offence.offence_class : t('general.not_provided') } diff --git a/app/views/shared/offence_details/_new_fee_reform_summary.html.haml b/app/views/shared/offence_details/_new_fee_reform_summary.html.haml new file mode 100644 index 0000000000..ade8c979ca --- /dev/null +++ b/app/views/shared/offence_details/_new_fee_reform_summary.html.haml @@ -0,0 +1,20 @@ +- claim_fields = %i[external_users claims offence_details fields] + += govuk_table do + = govuk_table_row do + = govuk_table_th { t('offence_class', scope: claim_fields) } + = govuk_table_td do + = claim.offence&.offence_category ? claim.offence.offence_category.description : t('general.not_provided') + + = govuk_table_row do + = govuk_table_th { t('offence_band', scope: claim_fields) } + = govuk_table_td do + = claim.offence&.offence_band ? claim.offence.offence_band.description : t('general.not_provided') + + = govuk_table_row do + = govuk_table_th { t('offence_category', scope: claim_fields) } + = govuk_table_td do + = claim.offence ? claim.offence.description : t('general.not_provided') + + + diff --git a/app/views/shared/offence_details/_new_summary.html.haml b/app/views/shared/offence_details/_new_summary.html.haml new file mode 100644 index 0000000000..0650185b47 --- /dev/null +++ b/app/views/shared/offence_details/_new_summary.html.haml @@ -0,0 +1,16 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('.header') + + - if claim.offence + .govuk-summary-card__content + - if claim.agfs_reform? + = render partial: 'shared/offence_details/new_fee_reform_summary', locals: { claim: claim } + + - else + = render partial: 'shared/offence_details/new_default_summary', locals: { claim: claim } + + - else + %p.govuk-body + = t('shared.summary.no_values.offence_details') diff --git a/app/views/shared/summary/_new_expenses.html.haml b/app/views/shared/summary/_new_expenses.html.haml new file mode 100644 index 0000000000..ee8c218319 --- /dev/null +++ b/app/views/shared/summary/_new_expenses.html.haml @@ -0,0 +1,20 @@ +- if current_user_is_caseworker? && claim.expenses.map(&:distance_gt_calculated?).any? + = render partial: 'shared/summary/expenses/distance_warnings', locals: { expenses: claim.expenses } + +%h3.govuk-heading-l + = t('shared.summary.expenses.travel_expenses') + +- if claim.expenses.with_vat.any? + = render template: 'shared/summary/expenses/new_index', locals: { claim: claim, vat: true } + +- if claim.expenses.without_vat.any? + = render template: 'shared/summary/expenses/new_index', locals: { claim: claim, vat: false } + +- if claim.travel_expense_additional_information.present? + .govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t('shared.summary.expenses.travel_expense_additional_information') + + .govuk-summary-card__content + = claim.travel_expense_additional_information diff --git a/app/views/shared/summary/expenses/_new_details.html.haml b/app/views/shared/summary/expenses/_new_details.html.haml new file mode 100644 index 0000000000..c340f6abb6 --- /dev/null +++ b/app/views/shared/summary/expenses/_new_details.html.haml @@ -0,0 +1,53 @@ +.details + %ul.govuk-list + - if claim.lgfs? + %li + %span + = succeed ':' do + = t('.origin') + = claim.supplier_name_with_postcode + + %li + %span + = succeed ':' do + = t('.destination') + = expense.location_with_postcode + + - if current_user_is_caseworker? && expense.distance? + %li{ class: ('error' if expense.distance_gt_calculated?) } + %span + = succeed ':' do + = t(expense.distance_label) + = t('.distance_count', count: expense.distance) + + - if expense.distance_gt_calculated? + %li{ class: ('error' if expense.distance_gt_calculated?) } + %span + = succeed ':' do + = t('.distance_calculated') + = expense.pretty_calculated_distance + + - if expense.show_map_link? + %li + = link_to_map expense, origin: claim.supplier_postcode, destination: expense.location_postcode + + - else + - if expense.distance? + %li + %span + = succeed ':' do + = t('.distance') + = t('.distance_count', count: expense.distance) + + %li{ class: ('error' if current_user_is_caseworker? && claim.lgfs? && expense.mileage_rate_id.eql?(2)) } + %span + = succeed ':' do + = t('.cost') + = expense.mileage_rate + + - if expense.hours? + %li + %span + = succeed ':' do + = t('.hours') + = expense.hours diff --git a/app/views/shared/summary/expenses/new_index.html.haml b/app/views/shared/summary/expenses/new_index.html.haml new file mode 100644 index 0000000000..14bf6ee137 --- /dev/null +++ b/app/views/shared/summary/expenses/new_index.html.haml @@ -0,0 +1,44 @@ +.govuk-summary-card + .govuk-summary-card__title-wrapper + %h2.govuk-summary-card__title + = t("shared.summary.expenses.index.header_#{vat ? 'with_vat' : 'without_vat'}") + .govuk-summary-card__content + = govuk_table(class: "govuk-!-margin-bottom-0 govuk-table govuk-table--custom expenses-data-table") do + = govuk_table_caption(class: 'govuk-visually-hidden') do + = t('.caption') + + = govuk_table_thead do + = govuk_table_row do + = govuk_table_th do + = t('.expense_type') + = govuk_table_th do + = t('.reason') + = govuk_table_th do + = t('.details') + = govuk_table_th do + = t('.date') + = govuk_table_th_numeric do + = t('.net_amount') + - if vat + = govuk_table_th_numeric do + = t('.vat') + = govuk_table_th_numeric do + = t('.total_amount') + + = govuk_table_tbody do + - expenses = vat ? claim.expenses.includes(:expense_type).with_vat : claim.expenses.includes(:expense_type).without_vat + - present_collection(expenses).each do |expense| + = render template: 'shared/summary/expenses/new_show', locals: { claim: claim, expense: expense } + + = govuk_table_tfoot do + = govuk_table_row(class: 'govuk-table__row--no-bottom-border') do + = govuk_table_th(scope: 'row', colspan: 4, 'data-label': t('.expense_type')) do + = succeed ':' do + = t("shared.summary.expenses.index.totals_#{vat ? 'with_vat' : 'without_vat'}") + = govuk_table_td_numeric('data-label': t('.net_amount')) do + = vat ? claim.expenses_with_vat_net : claim.expenses_without_vat_net + - if vat + = govuk_table_td_numeric('data-label': t('.vat')) do + = claim.expenses_vat + = govuk_table_td_numeric('data-label': t('.total_amount')) do + = vat ? claim.expenses_with_vat_gross : claim.expenses_without_vat_gross diff --git a/app/views/shared/summary/expenses/new_show.html.haml b/app/views/shared/summary/expenses/new_show.html.haml new file mode 100644 index 0000000000..ceb67eb59a --- /dev/null +++ b/app/views/shared/summary/expenses/new_show.html.haml @@ -0,0 +1,20 @@ += govuk_table_row do + = govuk_table_td('data-label': t('.expense_type')) do + %span + = expense.name + - if current_user_is_caseworker? && @claim.lgfs? + = govuk_tag expense.state, class: "app-tag--#{expense.state.downcase}" + = govuk_table_td('data-label': t('.reason')) do + %span + = expense.reason + = govuk_table_td('data-label': t('.details')) do + = render partial: 'shared/summary/expenses/new_details', locals: { claim: claim, expense: expense } + = govuk_table_td('data-label': t('.date')) do + = expense.pretty_date + = govuk_table_td_numeric('data-label': t('.net_amount')) do + = expense.amount + - if expense.vat_present? + = govuk_table_td_numeric('data-label': t('.vat')) do + = expense.vat_amount + = govuk_table_td_numeric('data-label': t('.gross_amount')) do + = expense.gross_amount diff --git a/app/webpack/stylesheets/_shame.scss b/app/webpack/stylesheets/_shame.scss index 5c0c913d1d..5905ac682f 100644 --- a/app/webpack/stylesheets/_shame.scss +++ b/app/webpack/stylesheets/_shame.scss @@ -206,7 +206,6 @@ form { // claims-table.SCSS .totals { padding-top: $gutter-two-thirds; - padding-bottom: $gutter-two-thirds; text-align: right; } @@ -501,3 +500,4 @@ form { .error { color: $govuk-error-colour; } + diff --git a/app/webpack/stylesheets/application.scss b/app/webpack/stylesheets/application.scss index b5ad7f5a71..3a0e3fa1f9 100644 --- a/app/webpack/stylesheets/application.scss +++ b/app/webpack/stylesheets/application.scss @@ -46,4 +46,4 @@ $govuk-fonts-path: "~govuk-frontend/dist/govuk/assets/fonts/"; @import "components/table"; @import "components/tag"; -@import "shame"; \ No newline at end of file +@import "shame"; diff --git a/config/locales/en.yml b/config/locales/en.yml index 64b3f41b4f..6eeaad4dac 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1580,6 +1580,8 @@ en: warrant_fee_paid: 'Have you previously been paid for an interim warrant fee?' date_issued: Warrant issued date date_executed: Warrant executed date + new_warrant_fees_lgfs_details: + fields: *interim_claim_info_fields summary: caption: 'Warrant fees: This section contains info related to interim claimed warrant fees.' summary: 'Note: To best navigate this table, select the right hand column and then step down through the rows.' @@ -2055,7 +2057,6 @@ en: reason_text: Reason text reason_hint: These reasons will be displayed to providers update_the_claim_status: Update the claim status - reason_text: Reason text laa_heading: Total authorised by LAA laa_heading_hint: include any amount already authorised determinations_table: @@ -2084,7 +2085,7 @@ en: invalid_claim: 'Claim is not in a state to be submitted' claim: advocate_category: Advocate category - assignee: "Assigned to:" + assignee: &assignee "Assigned to" case: Case case_cracked: Case cracked in case_num: Case number @@ -2095,7 +2096,7 @@ en: defendant: Defendant names defendants: Defendants j_a: Judicial apportionment - no_defendant: No defendant details have been supplied for this claim + no_defendant: &no_defendant 'No defendant details have been supplied for this claim' offence: Offence offence_class: Offence class q: @@ -2120,7 +2121,161 @@ en: clar_fees_warning: header: 'Warning: CLAR fees were not injected' message: 'The provider has claimed Criminal Legal Aid Review fees on this claim, but they have not been injected. Please enter them manually.' - + new_certification: + certification_box_title: Certification + certified_by: Certified by + certification_reason: Reason + certification_caption: Certification details + instructed_heading: Instructed advocate + alert: 'Cannot certify a claim in submitted state' + invalid_claim: 'Claim is not in a state to be submitted' + new_claim: + advocate_category: Advocate category + provider_reference: Provider reference number + case: Case + case_cracked: Case cracked in + case_worker: Case worker + claim_type: Claim and case type + defendant: Defendant names + defendants: Defendants + j_a: Judicial apportionment + offence: Offence + offence_class: Offence class + new_claim_accordion: + additional_information: Additional information + created_by: 'Created by:' + h2_basic_info: Basic claim information + h2_defendant_details: Defendant details + h2_evidence: Evidence + h2_messages: Messages and claim status + h2_status: Status + h2_summary: Fees + heading: Claim + new_defendant_details: + no_defendant: *no_defendant + new_claim_and_case_type_details: + provider_reference: Provider reference number + claim_submitted: Claim submitted on + assignee: *assignee + case_num: Case number + case_stage: *case_stage + case_type: *case_type + new_claim_defendant_details: + title_defendant: Defendant + first_name: First name + last_name: Last name + date_of_birth: Date of birth + order_of_judicial_apportionment: Order of judicial apportionment + reporders: Represention order + maat_reference: 'MAAT reference:' + no_reporder: No representation orders have been supplied for this defendant. + new_claim_retrial_details: + retrial_started_at: 'First day of retrial' + retrial_estimated_length: 'Estimated retrial length' + retrial_actual_length: 'Actual retrial length' + retrial_concluded_at: 'Retrial concluded on' + retrial_reduction: 'Apply reduced rate to retrial?' + new_evidence_checklist: + evidence_address: "Please send evidence to the following address:" + new_warrant_fees_details: + fields: *interim_claim_info_fields + fees: + caption: 'Fees: A detailed list by Category and Type including amounts' + new_evidence_list: + existing_evidence: Existing evidence + no_documents_uploaded: No documents have been uploaded. + name_of_file: File + file_size: File size + date_added: Date added + new_basic_and_additional_fees_details: + caption: Basic and additional fees + fee_category: Fee category + fee_type: Fee type + rate: Rate + days_claimed: Days + actual_trial_length: Actual trial length + quantity: *quantity + amount: Amount + dates_attended: Dates attended + date: Date + fee_subtype: &fee_subtype 'Fee subtype' + case_numbers: *case_numbers + fees_total: Fees total + new_agfs_fee_details: + fees: + caption: 'Fees: A detailed list by Category and Type including amounts' + fee_category: 'Fee category' + fee_type: 'Fee type' + quantity: 'Quantity' + rate: 'Rate' + net_amount: *net_amount + first_day_of_trial: 'First day of trial' + retrial_started_at: 'Retrial started at' + dates_attended: 'Dates attended' + fee_subtype: *fee_subtype + case_numbers: *case_numbers + fees_total: 'Fees total:' + date: 'Date' + new_lgfs_fee_details: + fees: + caption: 'Fees: A detailed list by Category and Type including amounts' + fee_category: 'Fee category' + fee_type: 'Fee type' + quantity: *quantity + rate: 'Rate' + net_amount: *net_amount + first_day_of_trial: 'First day of trial' + retrial_started_at: 'Retrial started at' + dates_attended: 'Dates attended' + fee_subtype: *fee_subtype + case_numbers: *case_numbers + fees_total: 'Fees total:' + date: 'Date' + actual_trial_length: *actual_trial_length + amount: 'Amount' + days_claimed: 'Days' + new_lgfs_disbursements: + disbursements_gross: 'Disbursements with VAT' + disbursements_caption: 'Disbursements: A detailed list Type including amounts' + disbursement_type: "Disbursement type" + net_amount: *net_amount + vat_amount: *vat_amount + vat: 'VAT' + gross_amount: Gross amount + total: "Total" + new_summary_lgfs: + mileage_rate: Mileage rate + expenses: + caption: 'Expenses: A detailed list by Type including amount, distance and location where applicable' + vat_amount: *vat_amount + date: Date + distance: Distance + fee_subtype: *fee_subtype + case_numbers: *case_numbers + expense_type: Expense type + location: Destination + quantity_hours: 'Hours' + expenses_total: 'Expenses total:' + claim_total: 'Claim total:' + reason: 'Reason' + additional_information: Additional information + new_summary_agfs: + mileage_rate: 'Mileage rate' + expenses: + caption: 'Expenses: A detailed list by Type including amount, distance and location where applicable' + amount: 'Amount' + vat_amount: 'VAT Amount' + distance: 'Distance' + dates_attended: 'Dates attended' + expense_type: 'Expense type' + location: 'Destination' + quantity_hours: 'Hours' + expenses_total: 'Expenses total:' + claim_total: 'Claim total:' + reason: 'Reason' + additional_information: 'Additional information' + net_amount: 'Net amount' + disbursements_caption: 'Disbursements: A detailed list Type including amounts' message_controls: attachment_label: Optionally attach a file update_claim_status: Update your claim status @@ -2132,6 +2287,9 @@ en: remove: Remove written_reasons_heading: Written reasons written_reasons: I have submitted written reasons + offence_details: + new_summary: + header: Offence details providers: new: @@ -2172,7 +2330,7 @@ en: summary: 'Note: View and Download links are in 4th column, Actions' existing_evidence: Existing evidence no_documents_uploaded: No documents have been uploaded. - name_of_file: Name of file + name_of_file: File file_size: File size date_added: Date added actions: Actions @@ -2190,32 +2348,62 @@ en: travel_expenses: Travel expenses travel_details: Travel details index: - calculated_distance: Calculated distance + calculated_distance: &calculated_distance 'Calculated distance' caption: *expenses_caption - date: Date of expense - details: Details - expense_type: Type of expense + date: &date 'Date of expense' + details: &details 'Details' + expense_type: &expense_type 'Type of expense' gross_amount: Gross amount - header_with_vat: Expenses with VAT - header_without_vat: Expenses without VAT + header_with_vat: &with_vat 'Expenses with VAT' + header_without_vat: &with_out_vat 'Expenses without VAT' + net_amount: *net_amount + reason: &reason Reason for travel + totals_with_vat: &totals_with_vat 'Expenses with VAT total' + totals_without_vat: &totals_without_vat 'Expenses without VAT total' + vat: *vat_amount + new_index: + destination: "Destination: " + distance: "Distance: " + cost: "Cost per mile: " + calculated_distance: *calculated_distance + caption: *expenses_caption + date: *date + details: *details + expense_type: *expense_type + total_amount: Total amount + header_with_vat: *with_vat + header_without_vat: *with_out_vat net_amount: *net_amount - reason: Reason for travel - totals_with_vat: Expenses with VAT total - totals_without_vat: Expenses without VAT total + reason: *reason + totals_with_vat: *totals_with_vat + totals_without_vat: *totals_without_vat vat: *vat_amount details: - distance_calculated: Distance calculated - distance_claimed: Distance claimed - distance: Distance - cost: Cost per mile - origin: Origin - destination: Destination - view_map_link: View on a map - hours: Hours + distance_calculated: &distance_calculated 'Distance calculated' + distance_claimed: &distance_claimed 'Distance claimed' + distance: &distance 'Distance' + cost: &cost 'Cost per mile' + origin: &origin 'Origin' + destination: &destination 'Destination' + view_map_link: &view_map_link 'View on a map' + hours: &hours 'Hours' + distance_count: + one: &distance_count_one '1 mile' + other: &distance_count_other '%{count} miles' + zero: &distance_count_zero 'not applicable' + new_details: + distance_calculated: *distance_calculated + distance_claimed: *distance_claimed + distance: *distance + cost: *cost + origin: *origin + destination: *destination + view_map_link: *view_map_link + hours: *hours distance_count: - one: '1 mile' - other: '%{count} miles' - zero: 'not applicable' + one: *distance_count_one + other: *distance_count_other + zero: *distance_count_zero distance_warnings: title: one: There is an error with the travel expenses @@ -2224,12 +2412,20 @@ en: one: The distance claimed by the provider is greater than the calculated distance for one expense. Please see the table below for details. other: The distance claimed by the provider is greater than the calculated distance for %{count} expenses. Please see the table below for details. show: - date: Date of expense - details: Details - expense_type: Type of expense + date: &date 'Date of expense' + details: &details 'Details' + expense_type: &expense_type 'Type of expense' gross_amount: Gross amount net_amount: *net_amount - reason: Reason for travel + reason: &reason 'Reason for travel' + vat: *vat_amount + new_show: + date: *date + details: *details + expense_type: *expense_type + gross_amount: Total amount + net_amount: *net_amount + reason: *reason vat: *vat_amount fee: Fee fee_index: Fee %{index} @@ -2254,7 +2450,7 @@ en: distance: Distance fee_category: Fee category fee_type: *fee_type - fee_subtype: Fee subtype + fee_subtype: *fee_subtype first_day_of_hearing: First day of hearing case_numbers: *case_numbers quantity: *quantity @@ -2312,40 +2508,39 @@ en: dates: Dates rate: Rate summary_agfs: - mileage_rate: Mileage rate + mileage_rate: 'Mileage rate' expenses: caption: 'Expenses: A detailed list by Type including amount, distance and location where applicable' fees: caption: 'Fees: A detailed list by Category and Type including amounts' - amount: Amount - vat_amount: *vat_amount - date: Date - distance: Distance - fee_category: Fee category - fee_type: Fee type - fee_subtype: Fee subtype - case_numbers: *case_numbers - quantity: *quantity - dates_attended: Dates attended + amount: 'Amount' + vat_amount: 'VAT Amount' + date: 'Date' + distance: 'Distance' + fee_category: 'Fee category' + fee_type: 'Fee type' + fee_subtype: *fee_subtype + case_numbers: 'Case Numbers' + quantity: 'Quantity' + dates_attended: 'Dates attended' fees_total: 'Fees total:' - expense_type: Expense type - location: Destination + expense_type: 'Expense type' + location: 'Destination' quantity_hours: 'Hours' - rate: Rate + rate: 'Rate' expenses_total: 'Expenses total:' claim_total: 'Claim total:' reason: 'Reason' - additional_information: Additional information - disbursements: - caption: 'Disbursements: A detailed list Type including amounts' - type: "Disbursement type" - net_amount: *net_amount - vat_amount: *vat_amount - total: "Total" - warrant_fee: - date_issued: "Warrant issued" - date_executed: "Warrant executed" - total: "Total" + additional_information: 'Additional information' + disbursements: + caption: 'Disbursements: A detailed list Type including amounts' + type: "Disbursement type" + net_amount: *net_amount + vat_amount: *vat_amount + total: "Total" + warrant_fee: + date_issued: "Warrant issued" + date_executed: "Warrant executed" total: "Total" ppe_total: "PPE total at the time" effective_pcmh_date: "Effective PCMH" @@ -2373,7 +2568,7 @@ en: fee_category: Fee category fee_type: Fee type actual_trial_length: *actual_trial_length - fee_subtype: Fee subtype + fee_subtype: *fee_subtype case_numbers: *case_numbers days_claimed: Days quantity: *quantity @@ -2397,19 +2592,18 @@ en: date_issued: "Warrant issued" date_executed: "Warrant executed" total: "Total" - total: "Total" - ppe_total: "PPE total at the time" - effective_pcmh_date: "Effective PCMH" - trial_start: "Trial start" - estimated_trial_length: "Trial estimated length" - retrial_start: "Re-trial start" - estimated_retrial_length: "Re-trial estimated length" - legal_aid_transfer_date: "Legal aid transfer" - trial_concluded_at: "First trial concluded" - no_values: - fees: "There are no fees for this claim" - expenses: "There are no expenses for this claim" - disbursements: "There are no disbursements for this claim" + ppe_total: "PPE total at the time" + effective_pcmh_date: "Effective PCMH" + trial_start: "Trial start" + estimated_trial_length: "Trial estimated length" + retrial_start: "Re-trial start" + estimated_retrial_length: "Re-trial estimated length" + legal_aid_transfer_date: "Legal aid transfer" + trial_concluded_at: "First trial concluded" + no_values: + fees: "There are no fees for this claim" + expenses: "There are no expenses for this claim" + disbursements: "There are no disbursements for this claim" supplier_numbers: add_supplier: Add another supplier diff --git a/spec/views/case_workers/claims/show_spec.rb b/spec/views/case_workers/claims/show_spec.rb index 0849732375..4a33b173d0 100644 --- a/spec/views/case_workers/claims/show_spec.rb +++ b/spec/views/case_workers/claims/show_spec.rb @@ -378,6 +378,59 @@ end end + describe 'offence details information' do + context 'when the claim is for a fixed fee case type' do + let(:claim) { create(:advocate_claim, :with_fixed_fee_case) } + + it 'does NOT displays offence details section' do + assign(:claim, claim) + render + expect(rendered).to have_no_content('Offence details') + end + end + + context 'when the claim is NOT for a fixed fee case type' do + let(:claim) { create(:advocate_claim, :with_graduated_fee_case) } + + it 'displays offence details section' do + assign(:claim, claim) + render + expect(rendered).to have_content('Offence details') + end + end + end + + describe 'all the main headings' do + let(:claim) { create(:claim) } + + before do + @expense = create(:expense, :with_date_attended, claim:) + create(:date_attended, attended_item: @expense) + assign(:claim, claim) + render + end + + it 'displays basic claim' do + expect(rendered).to have_content('Basic claim information') + end + + it 'displays defendant heading' do + expect(rendered).to have_content('Defendant details') + end + + it 'displays evidence heading' do + expect(rendered).to have_content('Evidence') + end + + it 'displays Fees heading' do + expect(rendered).to have_content('Fees') + end + + it 'displays travel expenses heading' do + expect(rendered).to have_content('Travel expenses') + end + end + def certified_claim eu = create(:external_user, :advocate, user: create(:user, first_name: 'Stepriponikas', last_name: 'Bonstart')) @claim = create(:allocated_claim, external_user: eu)