ActiveAdmin.register JamRuby::AffiliateQuarterlyPayment, :as => 'Affiliate Quarterly Payments' do

  menu :label => 'Quarterly Reports', :parent => 'Affiliates'

  config.sort_order = 'due_amount_in_cents DESC'
  config.batch_actions = false
  config.clear_action_items!
  config.filters = true
  config.per_page = 50
  config.paginate = true

  filter :affiliate_partner
  filter :year
  filter :quarter
  filter :closed
  filter :paid

  form :partial => 'form'

  index do

    # default_actions # use this for all view/edit/delete links

    column 'Year' do |oo| oo.year end
    column 'Quarter' do |oo| oo.quarter end
    column 'Partner' do |oo| link_to(oo.affiliate_partner.display_name, oo.affiliate_partner.admin_url, {:title => oo.affiliate_partner.display_name}) end
    column "Due (\u00A2)" do |oo| oo.due_amount_in_cents end
    column 'JamTracks Sold' do |oo| oo.jamtracks_sold end
    column 'Paid' do |oo| oo.paid end
    column 'Closed' do |oo| oo.paid end

  end

  controller do

  end
end
