This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'controller_helper' | |
describe BankTransfersController do | |
let(:descriptor) { Descriptor.make!(:detran_2012) } | |
let(:tax_revenue) { TaxRevenue.make!(:arrecadacao, :accounting_account => AccountingAccount.make!(:bancos))) } | |
let(:account_movement) { AccountMovement.make!(:arrecadacao_sem_conta, :bank_account => bank_account, :history => tax_revenue ) } | |
let(:bank_account) { BankAccount.make!(:itau_tributos_construcao, :account_movements => [ account_movement ]) } | |
let(:deposit_bank_account) { BankAccount.make!(:santander_folha, :account_movements => [ account_movement ]) } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'spec_helper' | |
describe MovementsFilter do | |
let(:descriptor) { Descriptor.make!(:detran_2012) } | |
let(:management_unit) { ManagementUnit.make!(:unidade_central) } | |
let(:accounting_account) { AccountingAccount.make!(:with_bank_account, :title => "Credito") } | |
before do | |
Timecop.travel(Date.new(2012, 10, 10)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MovementsFilter | |
attr_writer :accountancy_movement, :pending_accountancy | |
def initialize(params = {}) | |
@descriptor = params.fetch(:descriptor) { raise ArgumentError, "You must supply a :descriptor param" } | |
@month = params[:month] || Date.current.month | |
@year = params[:year] || Date.current.year | |
end | |
def filter() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require 'request_helper' | |
feature "BankTransfers", :js => true do | |
let(:current_descriptor) { Descriptor.make!(:detran_2012) } | |
let(:current_user) { User.make!(:sobrinho) } | |
background do | |
create_roles ['bank_transfers', 'bank_transfer_closings', 'bank_accounts'] | |
sign_in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CrudController < ApplicationController | |
before_filter :choose_session_descriptor, :except => [:modal] | |
before_filter :authorize_resource! | |
inherit_resources | |
respond_to :js, :json | |
has_scope :filter, :type => :hash | |
has_scope :page, :default => 1, :only => [:index, :modal], :unless => :disable_pagination? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git add `git ls-files -m|grep extra` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity < Accounting::Model | |
include CustomData | |
reload_custom_data | |
attr_accessible :cnpj, :phone, :image, :email, :fax, | |
:budget_structure_id, :employee_ids, :tce_organ_type | |
attr_accessor :employee | |
mount_uploader :image, ImageUploader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity < Accounting::Model | |
include CustomData | |
reload_custom_data | |
attr_accessible :cnpj, :phone, :image, :email, :fax, | |
:budget_structure_id, :employee_ids, :tce_organ_type | |
attr_accessor :employee | |
mount_uploader :image, ImageUploader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
require "spec_helper" | |
describe "API::BudgetStructure", :api do | |
def get_budget_structures(params={}) | |
get api_budget_structures_url, params, { "x-unico-api-customer-secret-token" => "1234" } | |
end | |
def get_budget_structure(id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AccountingAccount < Accounting::Model | |
attr_accessible :account_plan_configuration_id, :function, | |
:title, :nature_balance, :nature_information, :contract_id, | |
:nature_balance_variation, :bookkeeping, :surplus_indicator, | |
:movimentation_kind, :debt_type, :detailing_required_thirteenth, | |
:bank_account_id, :retention_kind, :retention_subtype, | |
:regulatory_act_id, :parent_id, :child_code | |
attr_accessor :child_code |