pina 0.14.3 → 0.14.4

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
  SHA256:
3
- metadata.gz: ff6e594b9c73a20ce3693151ba982ed27e66b9571241bc75b57bcbfa29854afa
4
- data.tar.gz: 249191684f10fd080ac0cd53f68729203c4bccd8fe19f71795a2b87da3b023cc
3
+ metadata.gz: b5e0ebb95c6fdb101e7471bd548d73f65213ebf63be475d733c9b0308e2cf8cc
4
+ data.tar.gz: 7a68501cc01a30114798226138ed770af8c0f6ae9cd748148030689ed0cf019a
5
5
  SHA512:
6
- metadata.gz: 92aa7c800628520222e12c9c344ee9d2d71c165364b5476c4b77c464cc23935eec55f40bda293365dd5072ecc186a24464a26788fcc92aa5ea1b0bffc0cdd813
7
- data.tar.gz: d4fa14b6224fe4c5325fb8b65c3a5737a3ef8440be45cf159c06c601a941063ccb30279328e08af2577fdb7f35aa9afec3794bcd3b2db789e3d3a5c5e560e33f
6
+ metadata.gz: 0c32261bfcb3c5f1e6b059c27264335412e0b14957b023d106feacc9cc037df3f9c76ff6d0924c95180bdaa2b6288d703b2bb8507f76a960b1e63e9dbece9486
7
+ data.tar.gz: 860221f8ba713fcc4f7d37f89ccba3701f1de10a2bf05dad1c102de62694c1bee4e525c07acf0fd71925dce822f0ad9c077cf568c3943cff0e8a6b0ca2f57fc5
@@ -8,4 +8,7 @@ Metrics/ClassLength:
8
8
  Max: 130
9
9
 
10
10
  Metrics/LineLength:
11
- Max: 120
11
+ Max: 120
12
+
13
+ Metrics/BlockLength:
14
+ ExcludedMethods: ['describe', 'context', 'shared_examples']
data/README.md CHANGED
@@ -40,8 +40,10 @@ docker-compose run web bash
40
40
  | Resource | All | Find | Find_by | Where | Create | Update | Delete |
41
41
  | ----------------------- | :---: | :---: | :-----: | :---: | :-----:| :----: | :----: |
42
42
  | Contacts | o | o | o | o | o | o | - |
43
+ | DocumentPairing | o | - | - | - | - | - | - |
43
44
  | MyBankAccount | o | o | - | o | o | o | - |
44
- | PettyCashDisburstment | o | - | - | - | - | - | - |
45
+ | PettyCashDisburstment | o | o | - | - | - | - | - |
46
+ | PettyCashIncome | o | o | - | - | - | - | - |
45
47
  | ProcessedDocument | o | o | - | o | - | - | o |
46
48
  | PurchaseInvoice | o | o | - | o | o | o | - |
47
49
  | Receivable | o | o | - | o | - | - | - |
@@ -119,6 +121,29 @@ contact.email = 'brand_new@email.com'
119
121
  Pina::Contact.update('existing', contact)
120
122
  ```
121
123
 
124
+ ### Document pairings
125
+
126
+ #### All document pairings
127
+
128
+ ```ruby
129
+ Pina::DocumentPairing.all
130
+ ```
131
+
132
+ Gets all document pairings from your database. Results are paginated and you can access
133
+ first, next or previous page like this:
134
+
135
+ ```ruby
136
+ pairings = Pina::DocumentPairing.all
137
+ pairings.next_page
138
+ ```
139
+
140
+ ```ruby
141
+ pairings = Pina::DocumentPairing.all
142
+ pairings.previous_page
143
+
144
+ pairings.first_page
145
+ ```
146
+
122
147
  ### Sales Invoices
123
148
 
124
149
  #### All sales invoices
@@ -199,6 +224,25 @@ Pina::SalesOrder.find(order_id)
199
224
  Pina::PettyCashDisburstment.all
200
225
  ```
201
226
 
227
+ #### Fetching specific petty cash disburstment
228
+
229
+ ```ruby
230
+ Pina::PettyCashDisburstment.find(gid)
231
+ ```
232
+
233
+ ### Petty Cash Incomes
234
+
235
+ #### All petty cash incomes
236
+ ```ruby
237
+ Pina::PettyCashIncome.all
238
+ ```
239
+
240
+ #### Fetching specific petty cash income
241
+
242
+ ```ruby
243
+ Pina::PettyCashIncome.find(gid)
244
+ ```
245
+
202
246
  ### Processed Documents
203
247
 
204
248
  #### All processed documents
@@ -19,6 +19,7 @@ require 'pina/sales_order'
19
19
  require 'pina/receivable'
20
20
  require 'pina/processed_document'
21
21
  require 'pina/petty_cash_disburstment'
22
+ require 'pina/petty_cash_income'
22
23
  require 'pina/stat_processed_document'
23
24
  require 'pina/my_bank_account'
24
25
  require 'pina/uploaded_document'
@@ -0,0 +1,9 @@
1
+ module Pina
2
+ module Collections
3
+ class PettyCashIncome
4
+ include Virtus.model
5
+
6
+ attribute :items, Array[Pina::Models::PettyCashIncome]
7
+ end
8
+ end
9
+ end
@@ -1,30 +1,8 @@
1
- require 'pina/models/petty_cash_disburstment_item'
2
- require 'pina/models/coercions/nested_value'
1
+ require 'pina/models/petty_cash_document'
3
2
 
4
3
  module Pina
5
4
  module Models
6
- class PettyCashDisburstment
7
- include Virtus.model
8
-
9
- attribute :created_at
10
- attribute :updated_at
11
- attribute :creator, NestedValue
12
- attribute :modifier, NestedValue
13
- attribute :items, Array[Pina::Models::PettyCashDisburstmentItem]
14
- attribute :number
15
- attribute :issue_date
16
- attribute :receipt_date
17
- attribute :note
18
- attribute :coefficient
19
- attribute :petty_cash, NestedValue
20
- attribute :department, NestedValue
21
- attribute :total
22
- attribute :contact, NestedValue
23
- attribute :contract, NestedValue
24
- attribute :vat_document
25
- attribute :confirmed
26
- attribute :status
27
- attribute :gid
5
+ class PettyCashDisburstment < PettyCashDocument
28
6
  end
29
7
  end
30
8
  end
@@ -0,0 +1,30 @@
1
+ require 'pina/models/petty_cash_item'
2
+ require 'pina/models/coercions/nested_value'
3
+
4
+ module Pina
5
+ module Models
6
+ class PettyCashDocument
7
+ include Virtus.model
8
+
9
+ attribute :created_at
10
+ attribute :updated_at
11
+ attribute :creator, NestedValue
12
+ attribute :modifier, NestedValue
13
+ attribute :items, Array[Pina::Models::PettyCashItem]
14
+ attribute :number
15
+ attribute :issue_date
16
+ attribute :receipt_date
17
+ attribute :note
18
+ attribute :coefficient
19
+ attribute :petty_cash, NestedValue
20
+ attribute :department, NestedValue
21
+ attribute :total
22
+ attribute :contact, NestedValue
23
+ attribute :contract, NestedValue
24
+ attribute :vat_document
25
+ attribute :confirmed
26
+ attribute :status
27
+ attribute :gid
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,8 @@
1
+ require 'pina/models/petty_cash_document'
2
+
3
+ module Pina
4
+ module Models
5
+ class PettyCashIncome < PettyCashDocument
6
+ end
7
+ end
8
+ end
@@ -2,7 +2,7 @@ require 'pina/models/coercions/nested_value'
2
2
 
3
3
  module Pina
4
4
  module Models
5
- class PettyCashDisburstmentItem
5
+ class PettyCashItem
6
6
  include Virtus.model
7
7
 
8
8
  attribute :created_at
@@ -10,7 +10,7 @@ module Pina
10
10
  attribute :creator, NestedValue
11
11
  attribute :modifier, NestedValue
12
12
  attribute :external_id
13
- attribute :rule_id, NestedValue
13
+ attribute :rule, NestedValue
14
14
  attribute :variable_symbol
15
15
  attribute :price
16
16
  attribute :description
@@ -0,0 +1,32 @@
1
+ require 'pina/models/petty_cash_income'
2
+ require 'pina/collections/petty_cash_income'
3
+
4
+ module Pina
5
+ class PettyCashIncome
6
+ class << self
7
+ def find(gid)
8
+ response = Pina::RestAdapter.get(:petty_cash_incomes, gid)
9
+
10
+ return Pina::Models::PettyCashIncome.new(attributes(response)) if
11
+ response.ok?
12
+
13
+ response
14
+ end
15
+
16
+ def all
17
+ response = Pina::RestAdapter.get(:petty_cash_incomes)
18
+
19
+ return Pina::Collections::PettyCashIncome.new(attributes(response)) if
20
+ response.ok?
21
+
22
+ response
23
+ end
24
+
25
+ private
26
+
27
+ def attributes(response)
28
+ response.to_hash.merge(response: response)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Pina
2
- VERSION = '0.14.3'.freeze
2
+ VERSION = '0.14.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Hronek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-16 00:00:00.000000000 Z
11
+ date: 2019-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -234,6 +234,7 @@ files:
234
234
  - lib/pina/collections/document_pairing.rb
235
235
  - lib/pina/collections/my_bank_account.rb
236
236
  - lib/pina/collections/petty_cash_disburstment.rb
237
+ - lib/pina/collections/petty_cash_income.rb
237
238
  - lib/pina/collections/processed_document.rb
238
239
  - lib/pina/collections/purchase_invoice.rb
239
240
  - lib/pina/collections/receivable.rb
@@ -253,7 +254,9 @@ files:
253
254
  - lib/pina/models/my_bank_account.rb
254
255
  - lib/pina/models/nested_value.rb
255
256
  - lib/pina/models/petty_cash_disburstment.rb
256
- - lib/pina/models/petty_cash_disburstment_item.rb
257
+ - lib/pina/models/petty_cash_document.rb
258
+ - lib/pina/models/petty_cash_income.rb
259
+ - lib/pina/models/petty_cash_item.rb
257
260
  - lib/pina/models/processed_document.rb
258
261
  - lib/pina/models/purchase_invoice.rb
259
262
  - lib/pina/models/purchase_item.rb
@@ -266,6 +269,7 @@ files:
266
269
  - lib/pina/models/uploaded_document_pairing.rb
267
270
  - lib/pina/my_bank_account.rb
268
271
  - lib/pina/petty_cash_disburstment.rb
272
+ - lib/pina/petty_cash_income.rb
269
273
  - lib/pina/processed_document.rb
270
274
  - lib/pina/purchase_invoice.rb
271
275
  - lib/pina/receivable.rb