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 |
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
<%= f.input :code %> | |
<%= f.input :title %> | |
<%= label_tag "Conta Bancária?" %> | |
<%= select_tag "conta_bancaria", options_for_select([["Sim", true], ["Não", false]]), :include_blank => true %> |
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
alias srspec="SCREENSHOT=true spring rspec" | |
alias test="bundle exec rspec spec/business && | |
bundle exec rspec spec/controllers && | |
bundle exec rspec spec/decorators && | |
bundle exec rspec spec/enumerations && | |
bundle exec rspec spec/helpers && | |
bundle exec rspec spec/importers && | |
bundle exec rspec spec/integrations && | |
bundle exec rspec spec/lib && | |
bundle exec rspec spec/models && |
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
<%= f.input :code %> | |
<%= f.input :title %> | |
<%= f.input :with_bank_account, :as => :select %> |
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, :with_bank_account |
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
<%= f.input :code %> | |
<%= f.input :title %> | |
<%= f.input :with_bank_account, :selected => f.object.with_bank_account, :as => :select %> |
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
<%= f.input :code %> | |
<%= f.input :title %> | |
<% locked_field = params[:locked_fields].try(:include?, "with_bank_account") %> | |
<%= f.input :with_bank_account, :as => :select, :required => false, :hint => false, :disabled => locked_field %> | |
<% if locked_field %> | |
<%= f.input :with_bank_account, :as => :hidden %> | |
<% end %> |
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
function changeBudgetChangeDecreeTypeVisibility(event) { | |
var $BudgetChangeDecreeTypeWrapper = $budgetChangeDecreeTypeInput.closest('div'); | |
if ($regulatoryActTypeInput.val() == '<%= RegulatoryActType::BUDGET_CHANGE %>' && | |
$classificationInput.val() == '<%= RegulatoryActClassification::DECREE %>') { | |
$BudgetChangeDecreeTypeWrapper.show(); | |
} else { | |
$BudgetChangeDecreeTypeWrapper.hide(); | |
} |
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 BudgetRevenueDeductionsController do | |
let(:detran_2012) { Descriptor.make!(:detran_2012) } | |
let(:secretaria_educacao_2012) { Descriptor.make!(:secretaria_de_educacao_2012) } | |
let(:bank_account) { BankAccount.make!(:itau_tributos) } | |
let(:main_nature) { RevenueNature.make!(:receitas_correntes) } | |
let(:revenue_nature) { RevenueNature.make!(:receitas_correntes, :main_nature => main_nature, :prefix => "93", :kind => RevenueNatureKind::ANALYTICAL) } | |
let(:budget_revenue) { BudgetRevenue.make!(:reforma, :code => 2, :revenue_nature => revenue_nature) } |
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 BudgetRevenueDeductionsController < CrudController | |
protected | |
def create_resource(object) | |
object.descriptor = current_descriptor | |
object.transaction do | |
if super | |
MovementsGenerator.new(object).generate! | |
Withdraw.new.withdraw_funds!(object.bank_account, |