use nb_dossiers to estimate total weight
Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
This commit is contained in:
parent
1a6337cf37
commit
09b3cf98f6
2 changed files with 3 additions and 3 deletions
|
@ -5,11 +5,11 @@ module Instructeurs
|
||||||
def index
|
def index
|
||||||
@procedure = procedure
|
@procedure = procedure
|
||||||
@average_dossier_weight = procedure.average_dossier_weight
|
@average_dossier_weight = procedure.average_dossier_weight
|
||||||
|
|
||||||
@archivable_months = archivable_months
|
@archivable_months = archivable_months
|
||||||
@count_dossiers_termines_by_month = Traitement.count_dossiers_termines_by_month(@procedure)
|
@count_dossiers_termines_by_month = Traitement.count_dossiers_termines_by_month(@procedure)
|
||||||
|
@nb_dossiers = @count_dossiers_termines_by_month.sum { |count_by_month| count_by_month["count"] }
|
||||||
@dossiers_termines = @procedure.dossiers.state_termine
|
@dossiers_termines = @procedure.dossiers.state_termine
|
||||||
@poids_total = ProcedureArchiveService.procedure_files_size(@procedure)
|
@poids_total = @nb_dossiers * @average_dossier_weight
|
||||||
groupe_instructeur = current_instructeur.groupe_instructeurs.where(procedure: @procedure.id).first
|
groupe_instructeur = current_instructeur.groupe_instructeurs.where(procedure: @procedure.id).first
|
||||||
@archives = Archive.for_groupe_instructeur(groupe_instructeur).to_a
|
@archives = Archive.for_groupe_instructeur(groupe_instructeur).to_a
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
%td
|
%td
|
||||||
Tous les dossiers
|
Tous les dossiers
|
||||||
%td
|
%td
|
||||||
= @count_dossiers_termines_by_month.sum { |count_by_month| count_by_month["count"] }
|
= @nb_dossiers
|
||||||
%td
|
%td
|
||||||
- if matching_archive.present? && matching_archive.available?
|
- if matching_archive.present? && matching_archive.available?
|
||||||
- weight = matching_archive.file.byte_size
|
- weight = matching_archive.file.byte_size
|
||||||
|
|
Loading…
Add table
Reference in a new issue