This commit is contained in:
Nicolas Bally 2016-01-08 13:58:10 +01:00
parent 8b19471d02
commit 449ec28909
4 changed files with 7 additions and 7 deletions

View File

@ -19,10 +19,10 @@ class Admin::SheetsController < ApplicationController
def recus
date = Date.today
date = DateTime.new(2014, 1, 1).beginning_of_year
date = DateTime.new(2015, 1, 1).beginning_of_year
@sheet_years = SheetYear.find(:all, :conditions => ["paid_at >= ? and paid_at <= ?",date ,date.end_of_year])
@donates = Donate.find(:all, :conditions => ["paid_at >= ? and paid_at <= ?",date ,date.end_of_year])
@sheet_years = SheetYear.joins(:person).order("people.surname").find(:all, :conditions => ["paid_at >= ? and paid_at <= ?",date ,date.end_of_year])
@donates = Donate.joins(:person).order("people.surname").find(:all, :conditions => ["paid_at >= ? and paid_at <= ?",date ,date.end_of_year])
render :layout => false
end

View File

@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-
class Donate < ActiveRecord::Base
belongs_to :sheet
has_one :person, :through => :sheet
#attr_accessible :paid_at, :amount, :payment_type, :bank, :check_number
end

View File

@ -1,7 +1,7 @@
# -*- encoding : utf-8 -*-
class SheetYear < ActiveRecord::Base
belongs_to :sheet
has_one :person, :through => :sheet
validates_presence_of :year
#attr_accessible :year, :join_type, :benefactor, :gift_year, :paid_at, :amount, :payment_type, :bank, :check_number, :sheet_id, :plume

View File

@ -15,7 +15,7 @@
%td{:style => "text-align:right;"}
Numéro d'ordre du reçu
%br
="2014/"+("%04d" % i).to_s
="2015/"+("%04d" % i).to_s
%h2{:style => "text-align:center;"}
Reçu dons aux œuvres
@ -172,7 +172,7 @@
%td{:style => "text-align:right;"}
Numéro d'ordre du reçu
%br
="2014/"+("%04d" % i).to_s
="2015/"+("%04d" % i).to_s
%h2{:style => "text-align:center;"}
Reçu dons aux œuvres