Skip to content

Commit

Permalink
plan_comptable_comite extrait les secteurs par référence à period
Browse files Browse the repository at this point in the history
  • Loading branch information
comptasso committed Nov 14, 2015
1 parent d21c611 commit 4732f54
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/models/utilities/plan_comptable_comite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class Utilities::PlanComptableComite < Utilities::PlanComptable
def initialize(period)
@status = 'comite'
@period = period
@asc_id = Sector.where('name LIKE ?', 'ASC').first.id
@fonc_id = Sector.where('name LIKE ?', 'Fonctionnement').first.id
@asc_id = period.organism.sectors.where('name LIKE ?', 'ASC').first.id
@fonc_id = period.organism.sectors.where('name LIKE ?', 'Fonctionnement').first.id
end

# crée des comptes à partir d'un fichier source
Expand Down
4 changes: 2 additions & 2 deletions config/initializers/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@
# FLCVERSION = '1.14.3RC' # Amélioration module Adhérent (rapidité, icone nb_supprimer)
# FLCVERSION = '1.14.4RC' # Les banques et caisses sont ordonnées par leur id
# FLCVERSION = '1.14.5RC' # Refactorisation des bank_extract_lines et démarrage des écritures à 1
FLCVERSION = '1.14.6RC' # Correction lines_to_point affichage piece_number et non id
# FLCVERSION = '1.14.6RC' # Correction lines_to_point affichage piece_number et non id
FLCVERSION = '1.14.7RC' # correction bug dans la création du plan comptable comité
8 changes: 6 additions & 2 deletions spec/models/utilities/plan_comptable_comite_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

before(:each) do
Tenant.set_current_tenant(1)
Sector.create(organism_id:1, name:'ASC')
Sector.create(organism_id:1, name:'Fonctionnement')
@s1 = Sector.create(organism_id:1, name:'ASC')
@s2 = Sector.create(organism_id:1, name:'Fonctionnement')
Period.any_instance.stub(:organism).and_return o
Account.any_instance.stub(:organism).and_return o

Expand All @@ -22,6 +22,10 @@
@p.stub(:should_not_have_more_than_two_open_periods).and_return(true)
@p.stub(:check_nomenclature).and_return true
@p.save

o.stub(:sectors).and_return(@ar = double(Arel))
@ar.stub(:where).with('name LIKE ?', 'ASC').and_return [@s1]
@ar.stub(:where).with('name LIKE ?', 'Fonctionnement').and_return [@s2]

end

Expand Down

0 comments on commit 4732f54

Please sign in to comment.