cashctrl 0.1.0 → 0.2.0
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/README.md +418 -136
- data/cashctrl.gemspec +1 -1
- data/lib/cashctrl/client.rb +106 -103
- data/lib/cashctrl/collection.rb +6 -5
- data/lib/cashctrl/configuration.rb +1 -1
- data/lib/cashctrl/error.rb +3 -1
- data/lib/cashctrl/errors.rb +76 -0
- data/lib/cashctrl/localized_string.rb +2 -2
- data/lib/cashctrl/models/account.rb +5 -1
- data/lib/cashctrl/models/article.rb +9 -1
- data/lib/cashctrl/models/asset.rb +6 -1
- data/lib/cashctrl/models/attachment.rb +14 -0
- data/lib/cashctrl/models/bank.rb +3 -1
- data/lib/cashctrl/models/category.rb +1 -1
- data/lib/cashctrl/models/certificate_document.rb +1 -1
- data/lib/cashctrl/models/certificate_template.rb +1 -1
- data/lib/cashctrl/models/cost_center.rb +3 -1
- data/lib/cashctrl/models/currency.rb +1 -1
- data/lib/cashctrl/models/custom_field.rb +1 -1
- data/lib/cashctrl/models/custom_field_group.rb +1 -1
- data/lib/cashctrl/models/file.rb +2 -1
- data/lib/cashctrl/models/fiscal_period.rb +1 -1
- data/lib/cashctrl/models/fiscal_period_task.rb +1 -1
- data/lib/cashctrl/models/history.rb +1 -1
- data/lib/cashctrl/models/insurance_type.rb +1 -1
- data/lib/cashctrl/models/journal.rb +10 -1
- data/lib/cashctrl/models/journal_import.rb +1 -1
- data/lib/cashctrl/models/journal_import_entry.rb +1 -1
- data/lib/cashctrl/models/journal_item.rb +20 -0
- data/lib/cashctrl/models/loader.rb +3 -0
- data/lib/cashctrl/models/location.rb +1 -1
- data/lib/cashctrl/models/order.rb +8 -1
- data/lib/cashctrl/models/order_book_entry.rb +1 -1
- data/lib/cashctrl/models/order_document.rb +1 -1
- data/lib/cashctrl/models/order_item.rb +23 -0
- data/lib/cashctrl/models/order_layout.rb +1 -1
- data/lib/cashctrl/models/order_payment.rb +1 -1
- data/lib/cashctrl/models/person.rb +7 -1
- data/lib/cashctrl/models/report.rb +1 -1
- data/lib/cashctrl/models/report_collection.rb +1 -1
- data/lib/cashctrl/models/report_element.rb +1 -1
- data/lib/cashctrl/models/rounding.rb +2 -1
- data/lib/cashctrl/models/salary_book_entry.rb +1 -1
- data/lib/cashctrl/models/salary_certificate.rb +2 -1
- data/lib/cashctrl/models/salary_document.rb +1 -1
- data/lib/cashctrl/models/salary_field.rb +1 -1
- data/lib/cashctrl/models/salary_layout.rb +1 -1
- data/lib/cashctrl/models/salary_payment.rb +1 -1
- data/lib/cashctrl/models/salary_setting.rb +1 -1
- data/lib/cashctrl/models/salary_statement.rb +3 -1
- data/lib/cashctrl/models/salary_status.rb +1 -1
- data/lib/cashctrl/models/salary_sum.rb +1 -1
- data/lib/cashctrl/models/salary_template.rb +1 -1
- data/lib/cashctrl/models/salary_type.rb +1 -1
- data/lib/cashctrl/models/sequence_number.rb +1 -1
- data/lib/cashctrl/models/setting.rb +1 -1
- data/lib/cashctrl/models/tax.rb +2 -1
- data/lib/cashctrl/models/text.rb +1 -1
- data/lib/cashctrl/models/title.rb +1 -1
- data/lib/cashctrl/models/unit.rb +1 -1
- data/lib/cashctrl/relation.rb +271 -0
- data/lib/cashctrl/resource.rb +300 -57
- data/lib/cashctrl/resources/account/bank.rb +3 -13
- data/lib/cashctrl/resources/account/category.rb +3 -9
- data/lib/cashctrl/resources/account/cost_center/category.rb +3 -9
- data/lib/cashctrl/resources/account/cost_center.rb +3 -25
- data/lib/cashctrl/resources/account.rb +4 -30
- data/lib/cashctrl/resources/attachments.rb +32 -0
- data/lib/cashctrl/resources/base.rb +160 -84
- data/lib/cashctrl/resources/currency.rb +1 -10
- data/lib/cashctrl/resources/custom_field/group.rb +3 -11
- data/lib/cashctrl/resources/custom_field.rb +3 -15
- data/lib/cashctrl/resources/file/category.rb +4 -10
- data/lib/cashctrl/resources/file.rb +44 -28
- data/lib/cashctrl/resources/fiscal_period/task.rb +2 -12
- data/lib/cashctrl/resources/fiscal_period.rb +17 -59
- data/lib/cashctrl/resources/history.rb +3 -21
- data/lib/cashctrl/resources/import_session.rb +43 -0
- data/lib/cashctrl/resources/inventory/article/category.rb +3 -9
- data/lib/cashctrl/resources/inventory/article/import.rb +13 -0
- data/lib/cashctrl/resources/inventory/article.rb +3 -18
- data/lib/cashctrl/resources/inventory/asset/category.rb +3 -9
- data/lib/cashctrl/resources/inventory/asset.rb +3 -18
- data/lib/cashctrl/resources/inventory/unit.rb +1 -1
- data/lib/cashctrl/resources/journal/import/entry.rb +1 -22
- data/lib/cashctrl/resources/journal/import.rb +1 -7
- data/lib/cashctrl/resources/journal.rb +19 -57
- data/lib/cashctrl/resources/location.rb +1 -1
- data/lib/cashctrl/resources/order/book_entry.rb +1 -1
- data/lib/cashctrl/resources/order/category.rb +4 -15
- data/lib/cashctrl/resources/order/document.rb +13 -21
- data/lib/cashctrl/resources/order/layout.rb +1 -1
- data/lib/cashctrl/resources/order/payment.rb +9 -29
- data/lib/cashctrl/resources/order.rb +21 -68
- data/lib/cashctrl/resources/organization.rb +13 -0
- data/lib/cashctrl/resources/person/category.rb +3 -9
- data/lib/cashctrl/resources/person/import.rb +11 -0
- data/lib/cashctrl/resources/person/title.rb +1 -1
- data/lib/cashctrl/resources/person.rb +4 -23
- data/lib/cashctrl/resources/report/collection.rb +10 -42
- data/lib/cashctrl/resources/report/element.rb +14 -46
- data/lib/cashctrl/resources/report.rb +4 -30
- data/lib/cashctrl/resources/rounding.rb +1 -1
- data/lib/cashctrl/resources/salary/book_entry.rb +1 -1
- data/lib/cashctrl/resources/salary/category.rb +3 -9
- data/lib/cashctrl/resources/salary/certificate/document.rb +14 -39
- data/lib/cashctrl/resources/salary/certificate/template.rb +2 -8
- data/lib/cashctrl/resources/salary/certificate.rb +2 -12
- data/lib/cashctrl/resources/salary/document.rb +14 -34
- data/lib/cashctrl/resources/salary/field.rb +3 -17
- data/lib/cashctrl/resources/salary/insurance/type.rb +1 -1
- data/lib/cashctrl/resources/salary/layout.rb +1 -1
- data/lib/cashctrl/resources/salary/payment.rb +9 -29
- data/lib/cashctrl/resources/salary/setting.rb +1 -1
- data/lib/cashctrl/resources/salary/statement.rb +19 -54
- data/lib/cashctrl/resources/salary/status.rb +3 -11
- data/lib/cashctrl/resources/salary/sum.rb +1 -1
- data/lib/cashctrl/resources/salary/template.rb +2 -8
- data/lib/cashctrl/resources/salary/type.rb +1 -8
- data/lib/cashctrl/resources/sequence_number.rb +1 -7
- data/lib/cashctrl/resources/setting.rb +6 -24
- data/lib/cashctrl/resources/tax.rb +1 -1
- data/lib/cashctrl/resources/text.rb +1 -1
- data/lib/cashctrl/schema.yml +111 -0
- data/lib/cashctrl/version.rb +2 -2
- data/lib/cashctrl.rb +35 -25
- data/lib/generators/model_generator.rb +19 -7
- data/sig/cashctrl.rbs +1 -1
- metadata +12 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class Journal < Resource
|
|
8
8
|
attribute :debit_id, type: :integer
|
|
@@ -26,6 +26,7 @@ module Cashctrl
|
|
|
26
26
|
attribute :notes, type: :string
|
|
27
27
|
attribute :reference, type: :string
|
|
28
28
|
attribute :amount, type: :decimal
|
|
29
|
+
attribute :items, type: :json
|
|
29
30
|
attribute :currency_id, type: :integer
|
|
30
31
|
attribute :currency_rate, type: :decimal
|
|
31
32
|
attribute :currency_code, type: :string, readonly: true
|
|
@@ -51,6 +52,14 @@ module Cashctrl
|
|
|
51
52
|
attribute :imported, type: :datetime, readonly: true
|
|
52
53
|
attribute :imported_by, type: :string, readonly: true
|
|
53
54
|
attribute :is_recurring, type: :boolean, readonly: true
|
|
55
|
+
belongs_to :debit, resource: "Account"
|
|
56
|
+
belongs_to :credit, resource: "Account"
|
|
57
|
+
belongs_to :associate, resource: "Person"
|
|
58
|
+
belongs_to :tax, resource: "Tax"
|
|
59
|
+
belongs_to :currency, resource: "Currency"
|
|
60
|
+
belongs_to :order, resource: "Order"
|
|
61
|
+
nested :items, model: "JournalItem"
|
|
62
|
+
nested :attachments, model: "Attachment"
|
|
54
63
|
end
|
|
55
64
|
end
|
|
56
65
|
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
module CashCtrl
|
|
6
|
+
module Models
|
|
7
|
+
class JournalItem < Resource
|
|
8
|
+
attribute :account_id, type: :integer
|
|
9
|
+
attribute :debit, type: :decimal
|
|
10
|
+
attribute :credit, type: :decimal
|
|
11
|
+
attribute :description, type: :string
|
|
12
|
+
attribute :tax_id, type: :integer
|
|
13
|
+
attribute :associate_id, type: :integer
|
|
14
|
+
attribute :amount, type: :decimal, readonly: true
|
|
15
|
+
belongs_to :account, resource: "Account"
|
|
16
|
+
belongs_to :tax, resource: "Tax"
|
|
17
|
+
belongs_to :associate, resource: "Person"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class Order < Resource
|
|
8
8
|
attribute :category_id, type: :integer
|
|
@@ -41,6 +41,13 @@ module Cashctrl
|
|
|
41
41
|
attribute :notify_user_id, type: :integer
|
|
42
42
|
attribute :notify_email, type: :string
|
|
43
43
|
attribute :is_recurring, type: :boolean, readonly: true
|
|
44
|
+
belongs_to :category, resource: "Order::Category"
|
|
45
|
+
belongs_to :associate, resource: "Person"
|
|
46
|
+
belongs_to :responsible_person, resource: "Person"
|
|
47
|
+
belongs_to :currency, resource: "Currency"
|
|
48
|
+
belongs_to :rounding, resource: "Rounding"
|
|
49
|
+
nested :items, model: "OrderItem"
|
|
50
|
+
nested :attachments, model: "Attachment"
|
|
44
51
|
end
|
|
45
52
|
end
|
|
46
53
|
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
module CashCtrl
|
|
6
|
+
module Models
|
|
7
|
+
class OrderItem < Resource
|
|
8
|
+
attribute :account_id, type: :integer
|
|
9
|
+
attribute :tax_id, type: :integer
|
|
10
|
+
attribute :unit_id, type: :integer
|
|
11
|
+
attribute :name, type: :string
|
|
12
|
+
attribute :description, type: :string
|
|
13
|
+
attribute :article_nr, type: :string
|
|
14
|
+
attribute :quantity, type: :decimal
|
|
15
|
+
attribute :unit_price, type: :decimal
|
|
16
|
+
attribute :discount_percentage, type: :decimal
|
|
17
|
+
attribute :type, type: :string
|
|
18
|
+
belongs_to :account, resource: "Account"
|
|
19
|
+
belongs_to :tax, resource: "Tax"
|
|
20
|
+
belongs_to :unit, resource: "Inventory::Unit"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class Person < Resource
|
|
8
8
|
attribute :category_id, type: :integer
|
|
@@ -67,6 +67,12 @@ module Cashctrl
|
|
|
67
67
|
attribute :is_family, type: :boolean
|
|
68
68
|
attribute :is_auto_fill_responsible_person, type: :boolean
|
|
69
69
|
attribute :is_inactive, type: :boolean
|
|
70
|
+
belongs_to :category, resource: "Person::Category"
|
|
71
|
+
belongs_to :superior, resource: "Person"
|
|
72
|
+
belongs_to :location, resource: "Location"
|
|
73
|
+
has_many :orders, resource: "Order", foreign_key: :associate_id
|
|
74
|
+
has_many :journals, resource: "Journal", foreign_key: :associate_id
|
|
75
|
+
nested :attachments, model: "Attachment"
|
|
70
76
|
end
|
|
71
77
|
end
|
|
72
78
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class Rounding < Resource
|
|
8
8
|
attribute :name, type: :string
|
|
@@ -10,6 +10,7 @@ module Cashctrl
|
|
|
10
10
|
attribute :account_name, type: :string, readonly: true
|
|
11
11
|
attribute :mode, type: :string
|
|
12
12
|
attribute :value, type: :decimal
|
|
13
|
+
belongs_to :account, resource: "Account"
|
|
13
14
|
end
|
|
14
15
|
end
|
|
15
16
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class SalaryCertificate < Resource
|
|
8
8
|
attribute :person_id, type: :integer
|
|
@@ -10,6 +10,7 @@ module Cashctrl
|
|
|
10
10
|
attribute :template_id, type: :integer
|
|
11
11
|
attribute :year, type: :integer
|
|
12
12
|
attribute :values, type: :json
|
|
13
|
+
belongs_to :person, resource: "Person"
|
|
13
14
|
end
|
|
14
15
|
end
|
|
15
16
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class SalaryStatement < Resource
|
|
8
8
|
attribute :person_id, type: :integer
|
|
@@ -12,6 +12,8 @@ module Cashctrl
|
|
|
12
12
|
attribute :status, type: :string
|
|
13
13
|
attribute :total_gross, type: :decimal, readonly: true
|
|
14
14
|
attribute :total_net, type: :decimal, readonly: true
|
|
15
|
+
belongs_to :person, resource: "Person"
|
|
16
|
+
nested :attachments, model: "Attachment"
|
|
15
17
|
end
|
|
16
18
|
end
|
|
17
19
|
end
|
data/lib/cashctrl/models/tax.rb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# This file is auto-generated from schema.yml. Do not edit manually.
|
|
4
4
|
|
|
5
|
-
module
|
|
5
|
+
module CashCtrl
|
|
6
6
|
module Models
|
|
7
7
|
class Tax < Resource
|
|
8
8
|
attribute :name, type: :string
|
|
@@ -12,6 +12,7 @@ module Cashctrl
|
|
|
12
12
|
attribute :account_id, type: :integer
|
|
13
13
|
attribute :account_name, type: :string, readonly: true
|
|
14
14
|
attribute :is_inactive, type: :boolean
|
|
15
|
+
belongs_to :account, resource: "Account"
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
18
|
end
|
data/lib/cashctrl/models/text.rb
CHANGED