octobat 2.0.21 → 2.0.22
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 +4 -4
- data/Gemfile.lock +1 -1
- data/History.txt +4 -0
- data/VERSION +1 -1
- data/lib/octobat.rb +1 -0
- data/lib/octobat/customer.rb +5 -0
- data/lib/octobat/customer_balance_transaction.rb +50 -0
- data/lib/octobat/util.rb +1 -0
- data/lib/octobat/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f103ca1de7b1fa391b9e7d17530d78ada6d6353bd63c5c8e7db09047ef9e3063
|
4
|
+
data.tar.gz: 9aa6e8e6c71f51f678e7087f4184154c419d70399254044059d30efdceee2d8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eb46faf6dfcfcc621f2aa8207a42e9c214b8af361bbc657058213e447e9a4b0bab9bcc274ebb68b7a5dc29a1b478568db23eded829becdb7f01f762153b511d
|
7
|
+
data.tar.gz: 3fcd9c96dfd1d01d9ba83e6cdaa166ac9604eb67d48d364b3b9c3fe379528c4f02962f531f2d58d204ce8d97973171ddd554f2b61207d86c0031e51d539aa06e
|
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.22
|
data/lib/octobat.rb
CHANGED
@@ -27,6 +27,7 @@ require 'octobat/list_object'
|
|
27
27
|
require 'octobat/customer'
|
28
28
|
require 'octobat/supplier'
|
29
29
|
require 'octobat/transaction'
|
30
|
+
require 'octobat/customer_balance_transaction'
|
30
31
|
require 'octobat/item'
|
31
32
|
require 'octobat/purchase_item'
|
32
33
|
require 'octobat/document'
|
data/lib/octobat/customer.rb
CHANGED
@@ -16,5 +16,10 @@ module Octobat
|
|
16
16
|
def payment_sources(params = {}, opts = {})
|
17
17
|
PaymentSource.list(params.merge({ :customer => id }), {api_key: @api_key}.merge(opts))
|
18
18
|
end
|
19
|
+
|
20
|
+
def customer_balance_transactions(params = {}, opts = {})
|
21
|
+
CustomerBalanceTransaction.list(params.merge({ :customer => id }), {api_key: @api_key}.merge(opts))
|
22
|
+
end
|
23
|
+
|
19
24
|
end
|
20
25
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Octobat
|
2
|
+
class CustomerBalanceTransaction < APIResource
|
3
|
+
extend Octobat::APIOperations::List
|
4
|
+
include Octobat::APIOperations::Create
|
5
|
+
|
6
|
+
|
7
|
+
def url
|
8
|
+
!parent_obj.nil? ? parentize_url : super
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def save_url
|
13
|
+
if self[:id] == nil && self.class.respond_to?(:create)
|
14
|
+
self.relative_save_url
|
15
|
+
else
|
16
|
+
url
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
def parentize_url
|
22
|
+
if parent_obj.include?(:customer)
|
23
|
+
"#{Customer.url}/#{CGI.escape(parent_obj[:customer])}/customer_balance_transactions/#{CGI.escape(id)}"
|
24
|
+
else
|
25
|
+
url
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
def relative_save_url
|
32
|
+
if self[:customer]
|
33
|
+
"#{Customer.url}/#{CGI.escape(self[:customer])}/customer_balance_transactions"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
def self.url
|
39
|
+
if @parent_resource.include?(:customer)
|
40
|
+
"#{Customer.url}/#{CGI.escape(@parent_resource[:customer])}/customer_balance_transactions"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.set_parent_resource(filters)
|
45
|
+
@parent_resource = filters.select{|k, v| [:customer].include?(k)}
|
46
|
+
end
|
47
|
+
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
data/lib/octobat/util.rb
CHANGED
data/lib/octobat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octobat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaultier Laperche
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/octobat/credit_note.rb
|
69
69
|
- lib/octobat/credit_note_numbering_sequence.rb
|
70
70
|
- lib/octobat/customer.rb
|
71
|
+
- lib/octobat/customer_balance_transaction.rb
|
71
72
|
- lib/octobat/document.rb
|
72
73
|
- lib/octobat/document_email_template.rb
|
73
74
|
- lib/octobat/document_language.rb
|