commit
388e490373
7 changed files with 76 additions and 58 deletions
|
@ -703,7 +703,7 @@ GEM
|
|||
semantic_range (>= 2.3.0)
|
||||
websocket-driver (0.7.1)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.4)
|
||||
websocket-extensions (0.1.5)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
xray-rails (0.3.1)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
}
|
||||
|
||||
.libelle {
|
||||
width: 300px;
|
||||
width: 325px;
|
||||
}
|
||||
|
||||
td.updated-at {
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
module EtablissementHelper
|
||||
def pretty_currency(capital_social)
|
||||
number_to_currency(capital_social, locale: :fr)
|
||||
def pretty_currency(capital_social, unit: '€')
|
||||
number_to_currency(capital_social, locale: :fr, unit: unit)
|
||||
end
|
||||
|
||||
def pretty_currency_unit(unit)
|
||||
dict = { 'kEuros' => 'k€' }
|
||||
dict[unit]
|
||||
end
|
||||
|
||||
def raison_sociale_or_name(etablissement)
|
||||
|
@ -35,6 +40,6 @@ module EtablissementHelper
|
|||
end
|
||||
|
||||
def pretty_date_exercice(date)
|
||||
date.sub(/(?<year>\d{4})(?<month>\d{2})/, '\k<month>/\k<year>') if date.present?
|
||||
date.sub(/(?<year>\d{4})(?<month>\d{2})/, '\k<year>') if date.present?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
%th.libelle
|
||||
Effectif mensuel
|
||||
= try_format_mois_effectif(etablissement)
|
||||
(URSSAF)
|
||||
(URSSAF) :
|
||||
%td= etablissement.entreprise_effectif_mensuel
|
||||
%tr
|
||||
%th.libelle
|
||||
Effectif moyen annuel
|
||||
= etablissement.entreprise_effectif_annuel_annee
|
||||
(URSSAF)
|
||||
(URSSAF) :
|
||||
%td= etablissement.entreprise_effectif_annuel
|
||||
%tr
|
||||
%th.libelle Effectif de l'organisation (INSEE) :
|
||||
|
@ -57,41 +57,39 @@
|
|||
%th.libelle Capital social :
|
||||
%td= pretty_currency(etablissement.entreprise.capital_social)
|
||||
%tr
|
||||
%th.libelle Exercices :
|
||||
%th.libelle Chiffre d'affaires :
|
||||
%td
|
||||
- if profile == 'instructeur'
|
||||
- etablissement.exercices.each_with_index do |exercice, index|
|
||||
= "#{exercice.date_fin_exercice.year} : "
|
||||
= pretty_currency(exercice.ca)
|
||||
%br
|
||||
%details
|
||||
- etablissement.exercices.each_with_index do |exercice, index|
|
||||
= "#{exercice.date_fin_exercice.year} : "
|
||||
= pretty_currency(exercice.ca)
|
||||
%br
|
||||
- elsif etablissement.exercices.present?
|
||||
= t('activemodel.models.exercices_summary', count: etablissement.exercices.count)
|
||||
|
||||
- if etablissement.entreprise_attestation_sociale.attached?
|
||||
%tr
|
||||
%th.libelle Attestation sociale
|
||||
- if profile == 'instructeur'
|
||||
%td= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale)
|
||||
- else
|
||||
%td Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
|
||||
|
||||
- if etablissement.entreprise_attestation_fiscale.attached?
|
||||
%tr
|
||||
%th.libelle Attestation fiscale
|
||||
- if profile == 'instructeur'
|
||||
%td= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale)
|
||||
- else
|
||||
%td Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
|
||||
|
||||
- if etablissement.entreprise_bilans_bdf.present?
|
||||
%tr
|
||||
%th.libelle
|
||||
Bilans Banque de France
|
||||
= "en #{etablissement.entreprise_bilans_bdf_monnaie}"
|
||||
- if profile == 'instructeur'
|
||||
- if profile == 'instructeur'
|
||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||
locals: { libelle: 'Résultat exercice', key: 'resultat_exercice', etablissement: etablissement }
|
||||
|
||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||
locals: { libelle: "Excédent brut d'exploitation", key: 'excedent_brut_exploitation', etablissement: etablissement }
|
||||
|
||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||
locals: { libelle: 'Fonds de roulement net global', key: 'fonds_roulement_net_global', etablissement: etablissement }
|
||||
|
||||
= render partial: 'shared/dossiers/identite_entreprise_bilan_detail',
|
||||
locals: { libelle: 'Besoin en fonds de roulement', key: 'besoin_en_fonds_de_roulement', etablissement: etablissement }
|
||||
%tr
|
||||
%th.libelle
|
||||
Chiffres financiers clés (Banque de France)
|
||||
= "en #{pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie)} :"
|
||||
|
||||
- if controller.is_a?(Instructeurs::AvisController)
|
||||
%td
|
||||
Consulter les bilans
|
||||
Les consulter
|
||||
= link_to "au format csv", bilans_bdf_instructeur_avis_path(@avis, format: 'csv')
|
||||
,
|
||||
= link_to "au format xlsx", bilans_bdf_instructeur_avis_path(@avis, format: 'xlsx')
|
||||
|
@ -99,32 +97,32 @@
|
|||
= link_to "au format ods", bilans_bdf_instructeur_avis_path(@avis, format: 'ods')
|
||||
- else
|
||||
%td
|
||||
Consulter les bilans
|
||||
Les consulter
|
||||
= link_to "au format csv", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'csv')
|
||||
,
|
||||
= link_to "au format xlsx", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'xlsx')
|
||||
ou
|
||||
= link_to "au format ods", bilans_bdf_instructeur_dossier_path(procedure_id: @dossier.procedure.id, dossier_id: @dossier.id, format: 'ods')
|
||||
%tr
|
||||
%th.libelle
|
||||
Résultat exercice
|
||||
= "(#{pretty_date_exercice(etablissement.entreprise_date_arret_exercice)})"
|
||||
%td= etablissement.entreprise_resultat_exercice
|
||||
%tr
|
||||
%th
|
||||
Excédent brut d'exploitation
|
||||
%td= etablissement.entreprise_excedent_brut_exploitation
|
||||
%tr
|
||||
%th
|
||||
Fonds de roulement net global
|
||||
%td= etablissement.entreprise_fdr_net_global
|
||||
%tr
|
||||
%th
|
||||
Besoin en fonds de roulement
|
||||
%td= etablissement.entreprise_besoin_fdr
|
||||
|
||||
- else
|
||||
- else
|
||||
%tr
|
||||
%th.libelle
|
||||
Bilans Banque de France :
|
||||
%td Les 3 derniers bilans connus de votre entreprise par la Banque de France ont été joints à votre dossier.
|
||||
- if etablissement.entreprise_attestation_sociale.attached?
|
||||
%tr
|
||||
%th.libelle Attestation sociale :
|
||||
- if profile == 'instructeur'
|
||||
%td= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_sociale)
|
||||
- else
|
||||
%td Une attestation de vigilance délivrée par l'ACOSS a été jointe à votre dossier.
|
||||
|
||||
- if etablissement.entreprise_attestation_fiscale.attached?
|
||||
%tr
|
||||
%th.libelle Attestation fiscale :
|
||||
- if profile == 'instructeur'
|
||||
%td= link_to "Consulter l'attestation", url_for(etablissement.entreprise_attestation_fiscale)
|
||||
- else
|
||||
%td Une attestation fiscale délivrée par l'URSSAF a été jointe à votre dossier.
|
||||
|
||||
- if etablissement.association?
|
||||
%tr
|
||||
|
@ -147,6 +145,6 @@
|
|||
%td= try_format_date(etablissement.association_date_declaration)
|
||||
|
||||
%p
|
||||
= link_to '➡ Autres informations sur l’organisme sur « entreprise.data.gouv.fr »',
|
||||
= link_to "➡ Autres informations sur l’organisme sur « entreprise.data.gouv.fr » (ex: fiche d'immatriculation RNCS)",
|
||||
"https://entreprise.data.gouv.fr/etablissement/#{etablissement.siret}",
|
||||
target: "_blank"
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
%tr
|
||||
%th.libelle
|
||||
= "#{libelle} :"
|
||||
%td
|
||||
%details
|
||||
- etablissement.entreprise_bilans_bdf.each do |bilan|
|
||||
= "#{pretty_date_exercice(bilan["date_arret_exercice"])} : "
|
||||
= pretty_currency(bilan[key], unit: pretty_currency_unit(etablissement.entreprise_bilans_bdf_monnaie))
|
||||
%br
|
||||
|
|
@ -52,8 +52,13 @@ RSpec.describe EtablissementHelper, type: :helper do
|
|||
it { is_expected.to eq('123 000,00 €') }
|
||||
end
|
||||
|
||||
describe '#pretty_currency with special unit' do
|
||||
subject { pretty_currency(12345, unit: 'k€') }
|
||||
|
||||
it { is_expected.to eq('12 345,00 k€') }
|
||||
end
|
||||
describe '#pretty_date_exercice' do
|
||||
subject { pretty_date_exercice("201908") }
|
||||
it { is_expected.to eq("08/2019") }
|
||||
it { is_expected.to eq("2019") }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9683,9 +9683,9 @@ websocket-driver@>=0.5.1:
|
|||
websocket-extensions ">=0.1.1"
|
||||
|
||||
websocket-extensions@>=0.1.1:
|
||||
version "0.1.3"
|
||||
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
|
||||
integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==
|
||||
version "0.1.4"
|
||||
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
|
||||
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
|
||||
|
||||
wgs84@0.0.0:
|
||||
version "0.0.0"
|
||||
|
|
Loading…
Add table
Reference in a new issue