Skip to content

Commit

Permalink
Utilisation du 'numAdmPrestaDoss'
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicolas1 committed Jan 16, 2025
1 parent 8819773 commit 8b14e46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions app/models/pfmp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ def administrative_number
schooling.attributive_decision_number + index
end

def administrative_number_with_num_adm_presta_doss
transition = latest_payment_request.last_transition_to(:integrated)

return nil if transition.nil?

index = relative_human_index.to_s.rjust(2, "0")

transition.metadata["numAdmPrestaDoss"] + index
end

def within_schooling_dates?
return true if (schooling.open? && start_date >= schooling.start_date) || schooling.no_dates?

Expand Down
6 changes: 4 additions & 2 deletions app/views/pfmps/_payment_requests_history.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
Coordonnées bancaires utilisées :
%strong= payment_request.rib&.iban || payment_request.reconstructed_iban || payment_request.student.rib(current_establishment)&.iban || "manquantes"
.fr-mt-2w.gray-text
Numéro de prestation dossier :
%strong= @pfmp.administrative_number
- administrative_number = @pfmp.administrative_number_with_num_adm_presta_doss
- if !administrative_number.nil?
Numéro de prestation dossier :
%strong= administrative_number
.fr-mt-2w.gray-text
Dernière mise à jour le
= l(payment_request.last_transition&.updated_at || payment_request.updated_at, format: :long)

0 comments on commit 8b14e46

Please sign in to comment.