From 106032ba79f427777da7d1f25cad595e1740d56f Mon Sep 17 00:00:00 2001 From: tnicolas1 <166516439+tnicolas1@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:41:00 +0100 Subject: [PATCH] =?UTF-8?q?Utilisation=20du=20'numAdmPrestaDoss'=20pour=20?= =?UTF-8?q?l'affichage=20du=20num=C3=A9ro=20de=20prestation=20dossier=20(#?= =?UTF-8?q?1335)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/pfmp.rb | 8 ++++++++ app/views/pfmps/_payment_requests_history.html.haml | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/models/pfmp.rb b/app/models/pfmp.rb index a3f3258d0..d73450b31 100644 --- a/app/models/pfmp.rb +++ b/app/models/pfmp.rb @@ -99,6 +99,14 @@ def administrative_number schooling.attributive_decision_number + index end + def num_presta_doss + transition = latest_payment_request.last_transition_to(:integrated) + + return nil if transition.nil? + + transition.metadata["numAdmPrestaDoss"] + end + def within_schooling_dates? return true if (schooling.open? && start_date >= schooling.start_date) || schooling.no_dates? diff --git a/app/views/pfmps/_payment_requests_history.html.haml b/app/views/pfmps/_payment_requests_history.html.haml index 933207d15..339d484be 100644 --- a/app/views/pfmps/_payment_requests_history.html.haml +++ b/app/views/pfmps/_payment_requests_history.html.haml @@ -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 + - num_presta_doss = @pfmp.num_presta_doss + - if !num_presta_doss.nil? + Numéro de prestation dossier : + %strong= num_presta_doss .fr-mt-2w.gray-text Dernière mise à jour le = l(payment_request.last_transition&.updated_at || payment_request.updated_at, format: :long)