myfinance-rails 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a75f70349a4185df31b90d8df5633134843f56c8
4
- data.tar.gz: df40966ec62b41207aa42c42c4b7142fa1bc7f77
3
+ metadata.gz: 4eb3008e8ac8821247621f307d62693fc4f0e0e6
4
+ data.tar.gz: 7abfe8346b03fceb1f227c59ae2d6068d16eff24
5
5
  SHA512:
6
- metadata.gz: 5e29bb5a4ae7e115fb140bc3bcca83b0902007fbedeeec4ccfc124bb7b1f81594b73df10f6302729dd79f7eb1b3b0bd1edffabcf27cd910a0c3f5576d779bd43
7
- data.tar.gz: 7708ceeaebd305cc85ff964864c2a2881e4cb45ca095b098ad5207437c16c022c5e331f8bfeb3ab76ed0cd632357edbcbe099dbaf6abce8ca417f4e89aa2014b
6
+ metadata.gz: bd997e73fb908c670f4a28b16de5b602a99e9537210f774dcf89ac4eadbbaabf5770563b49be545bf417e2f75f5a120bc8d17e294421fcdd083f36b6194b0d6a
7
+ data.tar.gz: 0be7c55379a0c1d96e2be00d563f024c03afe575524a33ea8acabcacfdf0d058708da4db91cca92bdb0dfc93dde4ffa6e234ed0343e286bc9f92e6ddde4a67f3
@@ -1,7 +1,11 @@
1
1
  module Myfinance
2
2
 
3
- def self.cria_conta_a_receber(nome_da_entidade,faturamento)
3
+ def self.cria_conta_a_receber_entidade(nome_da_entidade,faturamento)
4
4
  entity_id = entidade_id(nome_da_entidade)
5
+ cria_conta_a_receber(entity_id,faturamento)
6
+ end
7
+
8
+ def self.cria_conta_a_receber(entity_id,faturamento)
5
9
  receivable_account = {
6
10
  'receivable_account' => faturamento
7
11
  }
@@ -10,6 +14,5 @@ module Myfinance
10
14
  end
11
15
 
12
16
 
13
-
14
17
  end
15
18
 
@@ -5,7 +5,7 @@ module Myfinance
5
5
  response = lget '/entities.json'
6
6
  response.each do | ent |
7
7
  cliente = ent['entity']
8
- if cliente['name'] == nome
8
+ if cliente['name'] == nome or cliente['federation_subscription_number'] == nome
9
9
  mid = cliente['id']
10
10
  break
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Myfinance
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -13,11 +13,14 @@ describe 'Manipulando Contas a Receber', type: :feature do
13
13
  it 'deve poder criar uma conta a receber para uma entidade e um cliente' do
14
14
  Myfinance.setup('2acecbb483842ebbfb2c638070bf019b70e757190166d277')
15
15
 
16
+ # entidade_id = Myfinance.entidade_id('06604529878')
17
+ entidade_id = Myfinance.entidade_id('11.023.029/0001-05')
16
18
  cliente_id = Myfinance.pessoa_id('27.206.831/0001-70')
17
19
  categoria_id = Myfinance.categoria_id('Alimentação / Restaurantes')
18
20
  centro_de_receita_id = Myfinance.centro_de_receita_id('Projetos')
19
21
 
20
22
  faturamento = {
23
+ 'entity_id' => entidade_id,
21
24
  'due_date' => (Date.today + 30),
22
25
  'occurred_at' => nil,
23
26
  'amount' => '100.0',
@@ -53,7 +56,10 @@ describe 'Manipulando Contas a Receber', type: :feature do
53
56
 
54
57
  ]
55
58
  }
56
- conta_a_receber = Myfinance.cria_conta_a_receber('Minhas Finanças',faturamento)
59
+ conta_a_receber = Myfinance.cria_conta_a_receber_entidade('Minhas Finanças',faturamento)
60
+ expect(conta_a_receber['receivable_account']).to_not be_nil
61
+
62
+ conta_a_receber = Myfinance.cria_conta_a_receber(entidade_id,faturamento)
57
63
  expect(conta_a_receber['receivable_account']).to_not be_nil
58
64
  end
59
65
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myfinance-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Lopes Neto