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
|
@@ -1,36 +1,28 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Order
|
|
6
6
|
class Document < Base
|
|
7
7
|
api_path "order/document"
|
|
8
8
|
model_class Models::OrderDocument
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
client.get_raw("#{api_path}/read.pdf", id: id)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def read_zip(id:)
|
|
16
|
-
client.get_raw("#{api_path}/read.zip", id: id)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def mail(id:, recipient_email:, **params)
|
|
20
|
-
client.post("#{api_path}/mail.json", { id: id, recipientEmail: recipient_email, **params })
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def read_pdf(id:)
|
|
25
|
-
client.get_raw("#{api_path}/read.pdf", id: id)
|
|
10
|
+
def read_pdf(ids:)
|
|
11
|
+
client.get_raw("#{api_path}/read.pdf", ids: csv(ids))
|
|
26
12
|
end
|
|
27
13
|
|
|
28
|
-
def read_zip(
|
|
29
|
-
client.get_raw("#{api_path}/read.zip",
|
|
14
|
+
def read_zip(ids:)
|
|
15
|
+
client.get_raw("#{api_path}/read.zip", ids: csv(ids))
|
|
30
16
|
end
|
|
31
17
|
|
|
32
|
-
def mail(
|
|
33
|
-
|
|
18
|
+
def mail(order_ids:, mail_from:, mail_subject:, mail_text:, mail_to: nil, mail_cc: nil, mail_bcc: nil,
|
|
19
|
+
is_copy_to_me: nil, sent_status_id: nil)
|
|
20
|
+
params = api_params(
|
|
21
|
+
order_ids: csv(order_ids), mail_from: mail_from, mail_subject: mail_subject, mail_text: mail_text,
|
|
22
|
+
mail_to: mail_to, mail_cc: mail_cc, mail_bcc: mail_bcc, is_copy_to_me: is_copy_to_me,
|
|
23
|
+
sent_status_id: sent_status_id
|
|
24
|
+
)
|
|
25
|
+
client.post("#{api_path}/mail.json", params)
|
|
34
26
|
end
|
|
35
27
|
end
|
|
36
28
|
end
|
|
@@ -1,35 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Order
|
|
6
6
|
class Payment < Base
|
|
7
7
|
api_path "order/payment"
|
|
8
8
|
model_class Models::OrderPayment
|
|
9
9
|
|
|
10
|
-
class << self
|
|
11
|
-
def list
|
|
12
|
-
raise NotImplementedError, "Order::Payment does not support list"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def read(id:)
|
|
16
|
-
raise NotImplementedError, "Order::Payment does not support read"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def update(id:, **params)
|
|
20
|
-
raise NotImplementedError, "Order::Payment does not support update"
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def delete(ids:)
|
|
24
|
-
raise NotImplementedError, "Order::Payment does not support delete"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def download(ids:)
|
|
28
|
-
ids_param = Array(ids).join(",")
|
|
29
|
-
client.get_raw("#{api_path}/download", ids: ids_param)
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
10
|
def list
|
|
34
11
|
raise NotImplementedError, "Order::Payment does not support list"
|
|
35
12
|
end
|
|
@@ -38,17 +15,20 @@ module Cashctrl
|
|
|
38
15
|
raise NotImplementedError, "Order::Payment does not support read"
|
|
39
16
|
end
|
|
40
17
|
|
|
41
|
-
def update(
|
|
18
|
+
def update(*, **)
|
|
42
19
|
raise NotImplementedError, "Order::Payment does not support update"
|
|
43
20
|
end
|
|
44
21
|
|
|
45
|
-
def delete(
|
|
22
|
+
def delete(*)
|
|
46
23
|
raise NotImplementedError, "Order::Payment does not support delete"
|
|
47
24
|
end
|
|
48
25
|
|
|
49
|
-
def download(
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
def download(order_ids:, date:, amount: nil, is_combine: nil, status_id: nil, type: nil)
|
|
27
|
+
params = api_params(
|
|
28
|
+
order_ids: csv(order_ids), date: date, amount: amount, is_combine: is_combine, status_id: status_id,
|
|
29
|
+
type: type
|
|
30
|
+
)
|
|
31
|
+
client.get_raw("#{api_path}/download", params)
|
|
52
32
|
end
|
|
53
33
|
end
|
|
54
34
|
end
|
|
@@ -1,93 +1,46 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Order < Base
|
|
6
|
+
include Attachments
|
|
7
|
+
|
|
6
8
|
api_path "order"
|
|
7
9
|
model_class Models::Order
|
|
10
|
+
list_params :type
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
client.post("#{api_path}/update_status.json", id: id, status: status)
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def update_recurrence(id:, recurrence: nil, start_date: nil, end_date: nil, days_before: nil,
|
|
15
|
-
notify_type: nil, notify_person_id: nil, notify_user_id: nil, notify_email: nil)
|
|
16
|
-
params = { id: id }
|
|
17
|
-
params[:recurrence] = recurrence if recurrence
|
|
18
|
-
params[:startDate] = start_date if start_date
|
|
19
|
-
params[:endDate] = end_date if end_date
|
|
20
|
-
params[:daysBefore] = days_before if days_before
|
|
21
|
-
params[:notifyType] = notify_type if notify_type
|
|
22
|
-
params[:notifyPersonId] = notify_person_id if notify_person_id
|
|
23
|
-
params[:notifyUserId] = notify_user_id if notify_user_id
|
|
24
|
-
params[:notifyEmail] = notify_email if notify_email
|
|
25
|
-
client.post("#{api_path}/update_recurrence.json", params)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def continue(id:)
|
|
29
|
-
client.post("#{api_path}/continue.json", id: id)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def dossier(id:)
|
|
33
|
-
client.get("#{api_path}/dossier.json", id: id)
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
def dossier_add(id:, dossier_ids:)
|
|
37
|
-
dossier_ids_param = Array(dossier_ids).join(",")
|
|
38
|
-
client.post("#{api_path}/dossier_add.json", id: id, dossierIds: dossier_ids_param)
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def dossier_remove(id:, dossier_ids:)
|
|
42
|
-
dossier_ids_param = Array(dossier_ids).join(",")
|
|
43
|
-
client.post("#{api_path}/dossier_remove.json", id: id, dossierIds: dossier_ids_param)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def update_attachments(id:, file_ids:)
|
|
47
|
-
file_ids_param = Array(file_ids).join(",")
|
|
48
|
-
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def update_status(id:, status:)
|
|
53
|
-
client.post("#{api_path}/update_status.json", id: id, status: status)
|
|
12
|
+
def update_status(ids:, status_id:)
|
|
13
|
+
client.post("#{api_path}/update_status.json", ids: csv(ids), statusId: status_id)
|
|
54
14
|
end
|
|
55
15
|
|
|
56
16
|
def update_recurrence(id:, recurrence: nil, start_date: nil, end_date: nil, days_before: nil,
|
|
57
17
|
notify_type: nil, notify_person_id: nil, notify_user_id: nil, notify_email: nil)
|
|
58
|
-
params =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
params[:notifyType] = notify_type if notify_type
|
|
64
|
-
params[:notifyPersonId] = notify_person_id if notify_person_id
|
|
65
|
-
params[:notifyUserId] = notify_user_id if notify_user_id
|
|
66
|
-
params[:notifyEmail] = notify_email if notify_email
|
|
18
|
+
params = api_params(
|
|
19
|
+
id: id, recurrence: recurrence, start_date: start_date, end_date: end_date, days_before: days_before,
|
|
20
|
+
notify_type: notify_type, notify_person_id: notify_person_id, notify_user_id: notify_user_id,
|
|
21
|
+
notify_email: notify_email
|
|
22
|
+
)
|
|
67
23
|
client.post("#{api_path}/update_recurrence.json", params)
|
|
68
24
|
end
|
|
69
25
|
|
|
70
|
-
def continue(
|
|
71
|
-
|
|
26
|
+
def continue(ids:, category_id:, associate_id: nil, date: nil, notes: nil, status_id: nil)
|
|
27
|
+
params = api_params(
|
|
28
|
+
ids: csv(ids), category_id: category_id, associate_id: associate_id, date: date, notes: notes,
|
|
29
|
+
status_id: status_id
|
|
30
|
+
)
|
|
31
|
+
client.post("#{api_path}/continue.json", params)
|
|
72
32
|
end
|
|
73
33
|
|
|
74
34
|
def dossier(id:)
|
|
75
35
|
client.get("#{api_path}/dossier.json", id: id)
|
|
76
36
|
end
|
|
77
37
|
|
|
78
|
-
def dossier_add(
|
|
79
|
-
|
|
80
|
-
client.post("#{api_path}/dossier_add.json", id: id, dossierIds: dossier_ids_param)
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def dossier_remove(id:, dossier_ids:)
|
|
84
|
-
dossier_ids_param = Array(dossier_ids).join(",")
|
|
85
|
-
client.post("#{api_path}/dossier_remove.json", id: id, dossierIds: dossier_ids_param)
|
|
38
|
+
def dossier_add(group_id:, ids:)
|
|
39
|
+
client.post("#{api_path}/dossier_add.json", groupId: group_id, ids: csv(ids))
|
|
86
40
|
end
|
|
87
41
|
|
|
88
|
-
def
|
|
89
|
-
|
|
90
|
-
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
42
|
+
def dossier_remove(group_id:, ids:)
|
|
43
|
+
client.post("#{api_path}/dossier_remove.json", groupId: group_id, ids: csv(ids))
|
|
91
44
|
end
|
|
92
45
|
end
|
|
93
46
|
end
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Person
|
|
6
6
|
class Category < Base
|
|
7
7
|
api_path "person/category"
|
|
8
8
|
model_class Models::Category
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
client.get("#{api_path}/tree.json")
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def tree
|
|
17
|
-
client.get("#{api_path}/tree.json")
|
|
10
|
+
def tree(id = nil)
|
|
11
|
+
tree_collection(client.get("#{api_path}/tree.json", api_params(id: id)))
|
|
18
12
|
end
|
|
19
13
|
end
|
|
20
14
|
end
|
|
@@ -1,39 +1,20 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Person < Base
|
|
6
|
+
include Attachments
|
|
7
|
+
|
|
6
8
|
api_path "person"
|
|
7
9
|
model_class Models::Person
|
|
8
10
|
|
|
9
|
-
class << self
|
|
10
|
-
def categorize(ids:, target:)
|
|
11
|
-
ids_param = Array(ids).join(",")
|
|
12
|
-
client.post("#{api_path}/categorize.json", ids: ids_param, target: target)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def update_attachments(id:, file_ids:)
|
|
16
|
-
file_ids_param = Array(file_ids).join(",")
|
|
17
|
-
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def list_vcf(**params)
|
|
21
|
-
client.get_raw("#{api_path}/list.vcf", params)
|
|
22
|
-
end
|
|
23
|
-
end
|
|
24
|
-
|
|
25
11
|
def categorize(ids:, target:)
|
|
26
12
|
ids_param = Array(ids).join(",")
|
|
27
13
|
client.post("#{api_path}/categorize.json", ids: ids_param, target: target)
|
|
28
14
|
end
|
|
29
15
|
|
|
30
|
-
def update_attachments(id:, file_ids:)
|
|
31
|
-
file_ids_param = Array(file_ids).join(",")
|
|
32
|
-
client.post("#{api_path}/update_attachments.json", id: id, fileIds: file_ids_param)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
16
|
def list_vcf(**params)
|
|
36
|
-
client.get_raw("#{api_path}/list.vcf", params)
|
|
17
|
+
client.get_raw("#{api_path}/list.vcf", api_params(**params))
|
|
37
18
|
end
|
|
38
19
|
end
|
|
39
20
|
end
|
|
@@ -1,70 +1,38 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Report
|
|
6
6
|
class Collection < Base
|
|
7
7
|
api_path "report/collection"
|
|
8
8
|
model_class Models::ReportCollection
|
|
9
9
|
|
|
10
|
-
class << self
|
|
11
|
-
def list
|
|
12
|
-
raise NotImplementedError, "Report::Collection does not support list"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def meta(id:)
|
|
16
|
-
client.get("#{api_path}/meta.json", id: id)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def download_pdf(id:, **params)
|
|
20
|
-
client.get_raw("#{api_path}/download.pdf", { id: id, **params })
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def download_csv(id:, **params)
|
|
24
|
-
client.get_raw("#{api_path}/download.csv", { id: id, **params })
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def download_xlsx(id:, **params)
|
|
28
|
-
client.get_raw("#{api_path}/download.xlsx", { id: id, **params })
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def download_annual_report(id:, **params)
|
|
32
|
-
client.get_raw("#{api_path}/download_annualreport.pdf", { id: id, **params })
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def reorder(ids:)
|
|
36
|
-
ids_param = Array(ids).join(",")
|
|
37
|
-
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
|
|
41
10
|
def list
|
|
42
11
|
raise NotImplementedError, "Report::Collection does not support list"
|
|
43
12
|
end
|
|
44
13
|
|
|
45
|
-
def meta(id
|
|
46
|
-
client.get("#{api_path}/meta.json",
|
|
14
|
+
def meta(id:, **params)
|
|
15
|
+
client.get("#{api_path}/meta.json", api_params(collection_id: id, **params))
|
|
47
16
|
end
|
|
48
17
|
|
|
49
18
|
def download_pdf(id:, **params)
|
|
50
|
-
client.get_raw("#{api_path}/download.pdf",
|
|
19
|
+
client.get_raw("#{api_path}/download.pdf", api_params(collection_id: id, **params))
|
|
51
20
|
end
|
|
52
21
|
|
|
53
22
|
def download_csv(id:, **params)
|
|
54
|
-
client.get_raw("#{api_path}/download.csv",
|
|
23
|
+
client.get_raw("#{api_path}/download.csv", api_params(collection_id: id, **params))
|
|
55
24
|
end
|
|
56
25
|
|
|
57
26
|
def download_xlsx(id:, **params)
|
|
58
|
-
client.get_raw("#{api_path}/download.xlsx",
|
|
27
|
+
client.get_raw("#{api_path}/download.xlsx", api_params(collection_id: id, **params))
|
|
59
28
|
end
|
|
60
29
|
|
|
61
|
-
def download_annual_report(
|
|
62
|
-
client.get_raw("#{api_path}/download_annualreport.pdf",
|
|
30
|
+
def download_annual_report(fiscal_period_id: nil)
|
|
31
|
+
client.get_raw("#{api_path}/download_annualreport.pdf", api_params(fiscal_period_id: fiscal_period_id))
|
|
63
32
|
end
|
|
64
33
|
|
|
65
|
-
def reorder(ids:)
|
|
66
|
-
|
|
67
|
-
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
34
|
+
def reorder(ids:, target:, before: nil)
|
|
35
|
+
client.post("#{api_path}/reorder.json", api_params(ids: csv(ids), target: target, before: before))
|
|
68
36
|
end
|
|
69
37
|
end
|
|
70
38
|
end
|
|
@@ -1,78 +1,46 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Report
|
|
6
6
|
class Element < Base
|
|
7
7
|
api_path "report/element"
|
|
8
8
|
model_class Models::ReportElement
|
|
9
9
|
|
|
10
|
-
class << self
|
|
11
|
-
def list
|
|
12
|
-
raise NotImplementedError, "Report::Element does not support list"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def data(id:, **params)
|
|
16
|
-
client.get("#{api_path}/data.json", { id: id, **params })
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def data_html(id:, **params)
|
|
20
|
-
client.get_raw("#{api_path}/data.html", { id: id, **params })
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def meta(id:)
|
|
24
|
-
client.get("#{api_path}/meta.json", id: id)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def download_pdf(id:, **params)
|
|
28
|
-
client.get_raw("#{api_path}/download.pdf", { id: id, **params })
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def download_csv(id:, **params)
|
|
32
|
-
client.get_raw("#{api_path}/download.csv", { id: id, **params })
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def download_xlsx(id:, **params)
|
|
36
|
-
client.get_raw("#{api_path}/download.xlsx", { id: id, **params })
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def reorder(ids:)
|
|
40
|
-
ids_param = Array(ids).join(",")
|
|
41
|
-
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
10
|
def list
|
|
46
11
|
raise NotImplementedError, "Report::Element does not support list"
|
|
47
12
|
end
|
|
48
13
|
|
|
49
14
|
def data(id:, **params)
|
|
50
|
-
client.get("#{api_path}/data.json",
|
|
15
|
+
client.get("#{api_path}/data.json", api_params(element_id: id, **params))
|
|
51
16
|
end
|
|
52
17
|
|
|
53
18
|
def data_html(id:, **params)
|
|
54
|
-
client.get_raw("#{api_path}/data.html",
|
|
19
|
+
client.get_raw("#{api_path}/data.html", api_params(element_id: id, **params))
|
|
55
20
|
end
|
|
56
21
|
|
|
57
|
-
def meta(id
|
|
58
|
-
client.get("#{api_path}/meta.json",
|
|
22
|
+
def meta(id:, **params)
|
|
23
|
+
client.get("#{api_path}/meta.json", api_params(element_id: id, **params))
|
|
59
24
|
end
|
|
60
25
|
|
|
61
26
|
def download_pdf(id:, **params)
|
|
62
|
-
client.get_raw("#{api_path}/download.pdf",
|
|
27
|
+
client.get_raw("#{api_path}/download.pdf", api_params(element_id: id, **params))
|
|
63
28
|
end
|
|
64
29
|
|
|
65
30
|
def download_csv(id:, **params)
|
|
66
|
-
client.get_raw("#{api_path}/download.csv",
|
|
31
|
+
client.get_raw("#{api_path}/download.csv", api_params(element_id: id, **params))
|
|
67
32
|
end
|
|
68
33
|
|
|
69
34
|
def download_xlsx(id:, **params)
|
|
70
|
-
client.get_raw("#{api_path}/download.xlsx",
|
|
35
|
+
client.get_raw("#{api_path}/download.xlsx", api_params(element_id: id, **params))
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def download_xml(id:, **params)
|
|
39
|
+
client.get_raw("#{api_path}/download.xml", api_params(element_id: id, **params))
|
|
71
40
|
end
|
|
72
41
|
|
|
73
|
-
def reorder(ids:)
|
|
74
|
-
|
|
75
|
-
client.post("#{api_path}/reorder.json", ids: ids_param)
|
|
42
|
+
def reorder(ids:, target:, before: nil)
|
|
43
|
+
client.post("#{api_path}/reorder.json", api_params(ids: csv(ids), target: target, before: before))
|
|
76
44
|
end
|
|
77
45
|
end
|
|
78
46
|
end
|
|
@@ -1,37 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
class Report < Base
|
|
6
6
|
api_path "report"
|
|
7
7
|
model_class Models::Report
|
|
8
8
|
|
|
9
|
-
class << self
|
|
10
|
-
def list
|
|
11
|
-
raise NotImplementedError, "Report does not support list, use tree instead"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def read(id:)
|
|
15
|
-
raise NotImplementedError, "Report does not support read"
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def create(**params)
|
|
19
|
-
raise NotImplementedError, "Report does not support create"
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def update(id:, **params)
|
|
23
|
-
raise NotImplementedError, "Report does not support update"
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def delete(ids:)
|
|
27
|
-
raise NotImplementedError, "Report does not support delete"
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def tree
|
|
31
|
-
client.get("#{api_path}/tree.json")
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
9
|
def list
|
|
36
10
|
raise NotImplementedError, "Report does not support list, use tree instead"
|
|
37
11
|
end
|
|
@@ -44,16 +18,16 @@ module Cashctrl
|
|
|
44
18
|
raise NotImplementedError, "Report does not support create"
|
|
45
19
|
end
|
|
46
20
|
|
|
47
|
-
def update(
|
|
21
|
+
def update(*, **)
|
|
48
22
|
raise NotImplementedError, "Report does not support update"
|
|
49
23
|
end
|
|
50
24
|
|
|
51
|
-
def delete(
|
|
25
|
+
def delete(*)
|
|
52
26
|
raise NotImplementedError, "Report does not support delete"
|
|
53
27
|
end
|
|
54
28
|
|
|
55
29
|
def tree
|
|
56
|
-
client.get("#{api_path}/tree.json")
|
|
30
|
+
tree_collection(client.get("#{api_path}/tree.json"))
|
|
57
31
|
end
|
|
58
32
|
end
|
|
59
33
|
end
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
module
|
|
3
|
+
module CashCtrl
|
|
4
4
|
module Resources
|
|
5
5
|
module Salary
|
|
6
6
|
class Category < Base
|
|
7
7
|
api_path "salary/category"
|
|
8
8
|
model_class Models::Category
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
client.get("#{api_path}/tree.json")
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def tree
|
|
17
|
-
client.get("#{api_path}/tree.json")
|
|
10
|
+
def tree(id = nil)
|
|
11
|
+
tree_collection(client.get("#{api_path}/tree.json", api_params(id: id)))
|
|
18
12
|
end
|
|
19
13
|
end
|
|
20
14
|
end
|