effective_qb_online 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/effective/qb_api.rb +19 -1
- data/app/views/admin/qb_online/_company.html.haml +46 -32
- data/app/views/admin/qb_receipts/_form.html.haml +1 -1
- data/lib/effective_qb_online/version.rb +1 -1
- data/lib/generators/effective_qb_online/install_generator.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f20c50a036b10136d52f4c052b16abf5e555cfbe8502babb3b6ceb0922194a42
|
4
|
+
data.tar.gz: 7d45f23076d1678691b6d1f1cfd86331048ae9d40c2020c871ad0567257b3770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2d817cd48f01bae89b467c06b4bd48cb14912698db983947051d083dfae9c07f29502247b6a78deaf602c00288f17525b3737988cfdd94cf64f8bcedbcc9e9e
|
7
|
+
data.tar.gz: 1ffdebaa33b29ba09c0ee322449894b37e7e5c565e4ea5a528a255b53f190728cb9f3b6d62ba3ea4716d70ff1eebc7ed0e7faf754d63178a155d188bc638aa81
|
@@ -41,6 +41,14 @@ module Effective
|
|
41
41
|
)
|
42
42
|
end
|
43
43
|
|
44
|
+
def api_error
|
45
|
+
begin
|
46
|
+
company_info.present?; nil
|
47
|
+
rescue => e
|
48
|
+
return e.message
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
44
52
|
# Singular
|
45
53
|
def company_info
|
46
54
|
with_service('CompanyInfo') { |service| service.fetch_by_id(realm.realm_id) }
|
@@ -67,10 +75,20 @@ module Effective
|
|
67
75
|
items
|
68
76
|
.reject { |item| item.type == 'Category' }
|
69
77
|
.sort_by { |item| [item.type, item.name] }
|
70
|
-
.map { |item| [item.name, item.id, item.type] }
|
78
|
+
.map { |item| [item.name, item.id, {'data-html': item_html(item)}, item.type] }
|
71
79
|
.group_by(&:last)
|
72
80
|
end
|
73
81
|
|
82
|
+
def item_html(item)
|
83
|
+
details = [
|
84
|
+
("##{item.id}"),
|
85
|
+
(item.sku if item.sku.present?),
|
86
|
+
(item.description if item.description.present?)
|
87
|
+
].compact.join(', ')
|
88
|
+
|
89
|
+
"<span>#{item.name}</span> <small>(#{details})</small>"
|
90
|
+
end
|
91
|
+
|
74
92
|
def payment_methods
|
75
93
|
with_service('PaymentMethod') { |service| service.all }
|
76
94
|
end
|
@@ -1,32 +1,46 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
%
|
5
|
-
%
|
6
|
-
%
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
%
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
%
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
%
|
20
|
-
|
21
|
-
|
22
|
-
.
|
23
|
-
.
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
%
|
28
|
-
|
29
|
-
|
30
|
-
.
|
31
|
-
.
|
32
|
-
|
1
|
+
- company_info = (api.company_info rescue nil)
|
2
|
+
|
3
|
+
- if company_info.present?
|
4
|
+
%table.table.table-sm
|
5
|
+
%tbody
|
6
|
+
%tr
|
7
|
+
%td Name
|
8
|
+
%td= company_info.company_name
|
9
|
+
|
10
|
+
%tr
|
11
|
+
%td Country
|
12
|
+
%td= company_info.country
|
13
|
+
|
14
|
+
%tr
|
15
|
+
%td QuickBooks Online
|
16
|
+
%td
|
17
|
+
= link_to('Revoke Access and Disconnect', effective_qb_online.revoke_quickbooks_oauth_path, class: 'btn btn-sm btn-danger', 'data-method': 'delete', 'data-confirm': 'Really disconnect from QuickBooks Online?')
|
18
|
+
|
19
|
+
%tr
|
20
|
+
%td Deposit to Account
|
21
|
+
%td
|
22
|
+
= effective_form_with(model: [:admin, api.realm], engine: true) do |f|
|
23
|
+
.row
|
24
|
+
.col= f.select :deposit_to_account_id, api.accounts_collection, grouped: true, label: false
|
25
|
+
.col= f.save
|
26
|
+
|
27
|
+
%tr
|
28
|
+
%td Payment Method
|
29
|
+
%td
|
30
|
+
= effective_form_with(model: [:admin, api.realm], engine: true) do |f|
|
31
|
+
.row
|
32
|
+
.col= f.select :payment_method_id, api.payment_methods_collection, label: false
|
33
|
+
.col= f.save
|
34
|
+
|
35
|
+
|
36
|
+
- if company_info.blank?
|
37
|
+
%table.table.table-sm
|
38
|
+
%tbody
|
39
|
+
%tr
|
40
|
+
%td QuickBooks API Error
|
41
|
+
%td= api.api_error
|
42
|
+
|
43
|
+
%tr
|
44
|
+
%td QuickBooks Online
|
45
|
+
%td
|
46
|
+
= link_to('Revoke Access and Disconnect', effective_qb_online.revoke_quickbooks_oauth_path, class: 'btn btn-sm btn-danger', 'data-method': 'delete', 'data-confirm': 'Really disconnect from QuickBooks Online?')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_qb_online
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|