-nature = @document_template.nature.to_sym
-if [:balance_sheet, :income_statement].include?(nature)
  =formalize do |f|
    -f.title Financialyear.human_name 
    -f.field Financialyear.human_name, select_tag("financialyear", options_for_select(@current_company.financialyears.collect{|x| [x.code, x.id.to_s]}, params[:financialyear]))
-elsif nature == :journal
  =formalize do |f|
    -f.title Journal.human_name
    -f.field Journal.human_name, select_tag("journal", options_for_select(@current_company.journals.collect{|x| [x.name, x.id.to_s]}, params[:journal]))
-if [:journal, :general_journal, :general_ledger].include?(nature)
  =formalize do |f|
    -f.title :period
    -f.field tg("from"), calendar_field_tag(:started_on, params[:started_on]||(Date.today-1.month))
    -f.field tg("to"),   calendar_field_tag(:stopped_on, params[:stopped_on]||Date.today)

-nature = (@document_template ? @document_template.nature.to_sym : :unknown)
-if [:balance_sheet, :income_statement].include?(nature)
  =formalize do |f|
    -f.title Financialyear.human_name 
    -f.field Financialyear.human_name, select_tag("financialyear", options_for_select(@current_company.financialyears.collect{|x| [x.code, x.id.to_s]}, params[:financialyear]))
-elsif nature == :journal
  =formalize do |f|
    -f.title Journal.human_name
    -f.field Journal.human_name, select_tag("journal", options_for_select(@current_company.journals.collect{|x| [x.name, x.id.to_s]}, params[:journal]))
-if [:journal, :general_journal, :general_ledger].include?(nature)
  =formalize do |f|
    -f.title :period
    -f.field tg("from"), calendar_field_tag(:started_on, params[:started_on]||(Date.today-1.month))
    -f.field tg("to"),   calendar_field_tag(:stopped_on, params[:stopped_on]||Date.today)

Fix a bug on document printing in accountancy
Fix a bug on document printing in accountancy


git-svn-id: f16a2f23d171dee4464daf87d70b3f1ae0981068@1487 67a09383-3dfa-4221-8551-890bac9c277c
