business-central 1.0.5 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -32
- data/lib/business_central/client.rb +7 -52
- data/lib/business_central/exceptions.rb +11 -29
- data/lib/business_central/object/{attachment.rb → attachments.rb} +9 -11
- data/lib/business_central/object/base.rb +42 -114
- data/lib/business_central/object/companies.rb +19 -0
- data/lib/business_central/object/filter_query.rb +2 -0
- data/lib/business_central/object/object_helper.rb +10 -37
- data/lib/business_central/object/picture.rb +4 -40
- data/lib/business_central/object/request.rb +14 -15
- data/lib/business_central/object/response.rb +5 -1
- data/lib/business_central/object/url_builder.rb +16 -12
- data/lib/business_central/object/url_helper.rb +16 -2
- data/lib/business_central/version.rb +1 -1
- data/lib/business_central/web_service.rb +2 -0
- data/lib/business_central.rb +4 -55
- data/lib/refinements/strings.rb +42 -0
- data/test/business_central/client_test.rb +24 -0
- data/test/business_central/exceptions_test.rb +40 -0
- data/test/business_central/object/{attachment_test.rb → attachments_test.rb} +5 -6
- data/test/business_central/object/base_test.rb +59 -22
- data/test/business_central/object/{company_test.rb → companies_test.rb} +3 -21
- data/test/business_central/object/picture_test.rb +7 -16
- data/test/business_central/object/response_test.rb +5 -0
- data/test/business_central/web_service_test.rb +7 -2
- metadata +38 -167
- data/lib/business_central/object/account.rb +0 -13
- data/lib/business_central/object/aged_account_payable.rb +0 -13
- data/lib/business_central/object/aged_account_receivable.rb +0 -13
- data/lib/business_central/object/argument_helper.rb +0 -22
- data/lib/business_central/object/balance_sheet.rb +0 -13
- data/lib/business_central/object/cash_flow_statement.rb +0 -13
- data/lib/business_central/object/company.rb +0 -18
- data/lib/business_central/object/company_information.rb +0 -14
- data/lib/business_central/object/country_region.rb +0 -26
- data/lib/business_central/object/currency.rb +0 -29
- data/lib/business_central/object/customer.rb +0 -34
- data/lib/business_central/object/customer_financial_detail.rb +0 -13
- data/lib/business_central/object/customer_payment.rb +0 -43
- data/lib/business_central/object/customer_payment_journal.rb +0 -25
- data/lib/business_central/object/customer_sale.rb +0 -13
- data/lib/business_central/object/default_dimension.rb +0 -51
- data/lib/business_central/object/dimension.rb +0 -20
- data/lib/business_central/object/dimension_line.rb +0 -37
- data/lib/business_central/object/dimension_value.rb +0 -28
- data/lib/business_central/object/employee.rb +0 -21
- data/lib/business_central/object/general_ledger_entry.rb +0 -13
- data/lib/business_central/object/income_statement.rb +0 -13
- data/lib/business_central/object/irs1099_code.rb +0 -16
- data/lib/business_central/object/item.rb +0 -47
- data/lib/business_central/object/item_category.rb +0 -16
- data/lib/business_central/object/journal.rb +0 -29
- data/lib/business_central/object/journal_line.rb +0 -48
- data/lib/business_central/object/payment_method.rb +0 -16
- data/lib/business_central/object/payment_term.rb +0 -16
- data/lib/business_central/object/purchase_invoice.rb +0 -69
- data/lib/business_central/object/purchase_invoice_line.rb +0 -37
- data/lib/business_central/object/retained_earning_statement.rb +0 -13
- data/lib/business_central/object/sales_credit_memo.rb +0 -20
- data/lib/business_central/object/sales_credit_memo_line.rb +0 -30
- data/lib/business_central/object/sales_invoice.rb +0 -62
- data/lib/business_central/object/sales_invoice_line.rb +0 -30
- data/lib/business_central/object/sales_order.rb +0 -20
- data/lib/business_central/object/sales_order_line.rb +0 -30
- data/lib/business_central/object/sales_quote.rb +0 -20
- data/lib/business_central/object/sales_quote_line.rb +0 -30
- data/lib/business_central/object/shipment_method.rb +0 -16
- data/lib/business_central/object/subscription.rb +0 -16
- data/lib/business_central/object/tax_area.rb +0 -16
- data/lib/business_central/object/tax_group.rb +0 -16
- data/lib/business_central/object/time_registration_entry.rb +0 -16
- data/lib/business_central/object/trial_balance.rb +0 -13
- data/lib/business_central/object/units_of_measure.rb +0 -16
- data/lib/business_central/object/validation.rb +0 -57
- data/lib/business_central/object/vendor.rb +0 -42
- data/lib/business_central/object/vendor_purchase.rb +0 -13
- data/lib/core_ext/string.rb +0 -31
- data/test/business_central/object/account_test.rb +0 -67
- data/test/business_central/object/aged_account_payable_test.rb +0 -61
- data/test/business_central/object/aged_account_receivable_test.rb +0 -61
- data/test/business_central/object/balance_sheet_test.rb +0 -61
- data/test/business_central/object/cash_flow_statement_test.rb +0 -61
- data/test/business_central/object/company_information_test.rb +0 -81
- data/test/business_central/object/country_region_test.rb +0 -129
- data/test/business_central/object/currency_test.rb +0 -150
- data/test/business_central/object/customer_financial_detail_test.rb +0 -68
- data/test/business_central/object/customer_payment_journal_test.rb +0 -134
- data/test/business_central/object/customer_payment_test.rb +0 -141
- data/test/business_central/object/customer_sale_test.rb +0 -72
- data/test/business_central/object/customer_test.rb +0 -168
- data/test/business_central/object/default_dimension_test.rb +0 -170
- data/test/business_central/object/dimension_line_test.rb +0 -165
- data/test/business_central/object/dimension_test.rb +0 -65
- data/test/business_central/object/dimension_value_test.rb +0 -68
- data/test/business_central/object/employee_test.rb +0 -141
- data/test/business_central/object/general_ledger_entry_test.rb +0 -82
- data/test/business_central/object/income_statement_test.rb +0 -82
- data/test/business_central/object/irs1099_code_test.rb +0 -124
- data/test/business_central/object/item_category_test.rb +0 -122
- data/test/business_central/object/item_test.rb +0 -121
- data/test/business_central/object/journal_line_test.rb +0 -152
- data/test/business_central/object/journal_test.rb +0 -144
- data/test/business_central/object/payment_method_test.rb +0 -134
- data/test/business_central/object/payment_term_test.rb +0 -134
- data/test/business_central/object/purchase_invoice_line_test.rb +0 -123
- data/test/business_central/object/purchase_invoice_test.rb +0 -119
- data/test/business_central/object/retained_earning_statement_test.rb +0 -52
- data/test/business_central/object/sales_credit_memo_line_test.rb +0 -134
- data/test/business_central/object/sales_credit_memo_test.rb +0 -146
- data/test/business_central/object/sales_invoice_line_test.rb +0 -164
- data/test/business_central/object/sales_invoice_test.rb +0 -156
- data/test/business_central/object/sales_order_line_test.rb +0 -134
- data/test/business_central/object/sales_order_test.rb +0 -146
- data/test/business_central/object/sales_quote_line_test.rb +0 -134
- data/test/business_central/object/sales_quote_test.rb +0 -146
- data/test/business_central/object/shipment_method_test.rb +0 -133
- data/test/business_central/object/subscription_test.rb +0 -126
- data/test/business_central/object/tax_area_test.rb +0 -126
- data/test/business_central/object/tax_group_test.rb +0 -126
- data/test/business_central/object/time_registration_entry_test.rb +0 -126
- data/test/business_central/object/trial_balance_test.rb +0 -82
- data/test/business_central/object/units_of_measure_test.rb +0 -126
- data/test/business_central/object/validation_test.rb +0 -62
- data/test/business_central/object/vendor_purchase_test.rb +0 -82
- data/test/business_central/object/vendor_test.rb +0 -119
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class DefaultDimension < Base
|
6
|
-
OBJECT = 'defaultDimensions'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
parent_id: {
|
10
|
-
required: true
|
11
|
-
},
|
12
|
-
dimension_code: {
|
13
|
-
maximum_length: 20
|
14
|
-
},
|
15
|
-
dimension_value_code: {
|
16
|
-
maximum_length: 20
|
17
|
-
}
|
18
|
-
}.freeze
|
19
|
-
|
20
|
-
OBJECT_METHODS = %i[
|
21
|
-
get
|
22
|
-
post
|
23
|
-
patch
|
24
|
-
delete
|
25
|
-
].freeze
|
26
|
-
|
27
|
-
OBJECT_PARENTS = %w[
|
28
|
-
items
|
29
|
-
customers
|
30
|
-
vendors
|
31
|
-
employees
|
32
|
-
].freeze
|
33
|
-
|
34
|
-
def initialize(client, parent:, parent_id:, **args)
|
35
|
-
return if !valid_parent?(parent)
|
36
|
-
|
37
|
-
super(client, args)
|
38
|
-
@parent_path << {
|
39
|
-
path: parent,
|
40
|
-
id: parent_id
|
41
|
-
}
|
42
|
-
@parent_id = parent_id
|
43
|
-
end
|
44
|
-
|
45
|
-
def create(params = {})
|
46
|
-
params[:parent_id] = @parent_id
|
47
|
-
super(params)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class Dimension < Base
|
6
|
-
OBJECT = 'dimensions'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
code: {
|
10
|
-
required: true,
|
11
|
-
maximum_length: 20
|
12
|
-
}
|
13
|
-
}.freeze
|
14
|
-
|
15
|
-
OBJECT_METHODS = %i[
|
16
|
-
get
|
17
|
-
].freeze
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class DimensionLine < Base
|
6
|
-
OBJECT = 'dimensionLines'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
parent_id: {
|
10
|
-
required: true
|
11
|
-
},
|
12
|
-
code: {
|
13
|
-
maximum_length: 20
|
14
|
-
},
|
15
|
-
display_name: {
|
16
|
-
maximum_length: 30
|
17
|
-
},
|
18
|
-
value_id: {
|
19
|
-
required: true
|
20
|
-
},
|
21
|
-
value_code: {
|
22
|
-
maximum_length: 20
|
23
|
-
},
|
24
|
-
value_display_name: {
|
25
|
-
maximum_length: 50
|
26
|
-
}
|
27
|
-
}.freeze
|
28
|
-
|
29
|
-
OBJECT_METHODS = %i[
|
30
|
-
get
|
31
|
-
post
|
32
|
-
patch
|
33
|
-
delete
|
34
|
-
].freeze
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class DimensionValue < Base
|
6
|
-
OBJECT = 'dimensionValues'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
code: {
|
10
|
-
required: true,
|
11
|
-
maximum_length: 20
|
12
|
-
}
|
13
|
-
}.freeze
|
14
|
-
|
15
|
-
OBJECT_METHODS = %i[
|
16
|
-
get
|
17
|
-
].freeze
|
18
|
-
|
19
|
-
def initialize(client, dimension_id:, **args)
|
20
|
-
super(client, args)
|
21
|
-
@parent_path << {
|
22
|
-
path: 'dimensions',
|
23
|
-
id: dimension_id
|
24
|
-
}
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class Employee < Base
|
6
|
-
extend BusinessCentral::Object::ObjectHelper
|
7
|
-
|
8
|
-
OBJECT = 'employees'
|
9
|
-
|
10
|
-
OBJECT_METHODS = %i[
|
11
|
-
get
|
12
|
-
post
|
13
|
-
patch
|
14
|
-
delete
|
15
|
-
].freeze
|
16
|
-
|
17
|
-
navigation :default_dimension
|
18
|
-
navigation :picture
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class Item < Base
|
6
|
-
extend BusinessCentral::Object::ObjectHelper
|
7
|
-
|
8
|
-
OBJECT = 'items'
|
9
|
-
|
10
|
-
OBJECT_VALIDATION = {
|
11
|
-
number: {
|
12
|
-
maximum_length: 20
|
13
|
-
},
|
14
|
-
display_name: {
|
15
|
-
maximum_length: 100
|
16
|
-
},
|
17
|
-
type: {
|
18
|
-
required: true,
|
19
|
-
inclusive_of: %w[
|
20
|
-
Inventory
|
21
|
-
Service
|
22
|
-
Non-Inventory
|
23
|
-
]
|
24
|
-
},
|
25
|
-
item_category_code: {
|
26
|
-
maximum_length: 20
|
27
|
-
},
|
28
|
-
gtin: {
|
29
|
-
maximum_length: 14
|
30
|
-
},
|
31
|
-
tax_group_code: {
|
32
|
-
maximum_length: 20
|
33
|
-
}
|
34
|
-
}.freeze
|
35
|
-
|
36
|
-
OBJECT_METHODS = %i[
|
37
|
-
get
|
38
|
-
post
|
39
|
-
patch
|
40
|
-
delete
|
41
|
-
].freeze
|
42
|
-
|
43
|
-
navigation :default_dimension
|
44
|
-
navigation :picture
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class Journal < Base
|
6
|
-
extend BusinessCentral::Object::ObjectHelper
|
7
|
-
|
8
|
-
OBJECT = 'journals'
|
9
|
-
|
10
|
-
OBJECT_VALIDATION = {
|
11
|
-
code: {
|
12
|
-
maximum_length: 10
|
13
|
-
},
|
14
|
-
display_name: {
|
15
|
-
maximum_length: 50
|
16
|
-
}
|
17
|
-
}.freeze
|
18
|
-
|
19
|
-
OBJECT_METHODS = %i[
|
20
|
-
get
|
21
|
-
post
|
22
|
-
patch
|
23
|
-
delete
|
24
|
-
].freeze
|
25
|
-
|
26
|
-
navigation :journal_line
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class JournalLine < Base
|
6
|
-
OBJECT = 'journalLines'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
account_number: {
|
10
|
-
maximum_length: 20
|
11
|
-
},
|
12
|
-
document_number: {
|
13
|
-
maximum_length: 20
|
14
|
-
},
|
15
|
-
external_document_number: {
|
16
|
-
maximum_length: 20
|
17
|
-
},
|
18
|
-
description: {
|
19
|
-
maximum_length: 50
|
20
|
-
},
|
21
|
-
comment: {
|
22
|
-
maximum_length: 250
|
23
|
-
}
|
24
|
-
}.freeze
|
25
|
-
|
26
|
-
OBJECT_METHODS = %i[
|
27
|
-
get
|
28
|
-
post
|
29
|
-
patch
|
30
|
-
delete
|
31
|
-
].freeze
|
32
|
-
|
33
|
-
OBJECT_PARENTS = %w[
|
34
|
-
journals
|
35
|
-
].freeze
|
36
|
-
|
37
|
-
def initialize(client, parent: 'journals', parent_id:, **args)
|
38
|
-
return if !valid_parent?(parent)
|
39
|
-
|
40
|
-
super(client, args)
|
41
|
-
@parent_path << {
|
42
|
-
path: parent,
|
43
|
-
id: parent_id
|
44
|
-
}
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class PurchaseInvoice < Base
|
6
|
-
OBJECT = 'purchaseInvoices'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
number: {
|
10
|
-
maximum_length: 20
|
11
|
-
},
|
12
|
-
invoice_date: {
|
13
|
-
date: true
|
14
|
-
},
|
15
|
-
vendor_invoice_number: {
|
16
|
-
maximum_length: 35
|
17
|
-
},
|
18
|
-
vendor_number: {
|
19
|
-
maximum_length: 20
|
20
|
-
},
|
21
|
-
vendor_name: {
|
22
|
-
maximum_length: 50
|
23
|
-
},
|
24
|
-
currency_code: {
|
25
|
-
maximum_length: 10
|
26
|
-
},
|
27
|
-
status: {
|
28
|
-
maximum_length: 20,
|
29
|
-
inclusion_of: [
|
30
|
-
'Draft',
|
31
|
-
'In Review',
|
32
|
-
'Open',
|
33
|
-
'Paid',
|
34
|
-
'Canceled',
|
35
|
-
'Corrective. Read-Only'
|
36
|
-
]
|
37
|
-
},
|
38
|
-
payment_terms: {
|
39
|
-
maximum_length: 10
|
40
|
-
},
|
41
|
-
shipment_method: {
|
42
|
-
maximum_length: 10
|
43
|
-
},
|
44
|
-
pay_to_name: {
|
45
|
-
maximum_length: 100
|
46
|
-
},
|
47
|
-
pay_to_contact: {
|
48
|
-
maximum_length: 100
|
49
|
-
},
|
50
|
-
pay_to_vendor_number: {
|
51
|
-
maximum_length: 20
|
52
|
-
},
|
53
|
-
ship_to_name: {
|
54
|
-
maximum_length: 100
|
55
|
-
},
|
56
|
-
ship_to_contact: {
|
57
|
-
maximum_length: 100
|
58
|
-
}
|
59
|
-
}.freeze
|
60
|
-
|
61
|
-
OBJECT_METHODS = %i[
|
62
|
-
get
|
63
|
-
post
|
64
|
-
patch
|
65
|
-
delete
|
66
|
-
].freeze
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class PurchaseInvoiceLine < Base
|
6
|
-
OBJECT = 'purchaseInvoiceLines'
|
7
|
-
|
8
|
-
OBJECT_VALIDATION = {
|
9
|
-
line_type: {
|
10
|
-
inclusion_of: [
|
11
|
-
'Comment',
|
12
|
-
'Account',
|
13
|
-
'Item',
|
14
|
-
'Resource',
|
15
|
-
'Fixed Asset',
|
16
|
-
'Charge'
|
17
|
-
]
|
18
|
-
}
|
19
|
-
}.freeze
|
20
|
-
|
21
|
-
OBJECT_METHODS = %i[
|
22
|
-
get
|
23
|
-
post
|
24
|
-
patch
|
25
|
-
delete
|
26
|
-
].freeze
|
27
|
-
|
28
|
-
def initialize(client, purchase_invoice_id:, **args)
|
29
|
-
super(client, args)
|
30
|
-
@parent_path << {
|
31
|
-
path: 'purchaseInvoices',
|
32
|
-
id: purchase_invoice_id
|
33
|
-
}
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class SalesCreditMemo < Base
|
6
|
-
extend BusinessCentral::Object::ObjectHelper
|
7
|
-
|
8
|
-
OBJECT = 'salesCreditMemos'
|
9
|
-
|
10
|
-
OBJECT_METHODS = %i[
|
11
|
-
get
|
12
|
-
post
|
13
|
-
patch
|
14
|
-
delete
|
15
|
-
].freeze
|
16
|
-
|
17
|
-
navigation :sales_credit_memo_line
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class SalesCreditMemoLine < Base
|
6
|
-
OBJECT = 'salesCreditMemoLines'
|
7
|
-
|
8
|
-
OBJECT_METHODS = %i[
|
9
|
-
get
|
10
|
-
post
|
11
|
-
patch
|
12
|
-
delete
|
13
|
-
].freeze
|
14
|
-
|
15
|
-
OBJECT_PARENTS = %w[
|
16
|
-
salesCreditMemos
|
17
|
-
].freeze
|
18
|
-
|
19
|
-
def initialize(client, parent: 'salesCreditMemos', parent_id:, **args)
|
20
|
-
return if !valid_parent?(parent)
|
21
|
-
|
22
|
-
super(client, args)
|
23
|
-
@parent_path << {
|
24
|
-
path: parent,
|
25
|
-
id: parent_id
|
26
|
-
}
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class SalesInvoice < Base
|
6
|
-
extend BusinessCentral::Object::ObjectHelper
|
7
|
-
|
8
|
-
OBJECT = 'salesInvoices'
|
9
|
-
|
10
|
-
OBJECT_VALIDATION = {
|
11
|
-
customer_purchase_order_reference: {
|
12
|
-
maximum_length: 10
|
13
|
-
},
|
14
|
-
customer_number: {
|
15
|
-
maximum_length: 20
|
16
|
-
},
|
17
|
-
contact_id: {
|
18
|
-
maximum_length: 250
|
19
|
-
},
|
20
|
-
currency_code: {
|
21
|
-
maximum_length: 10
|
22
|
-
},
|
23
|
-
email: {
|
24
|
-
maximum_length: 80
|
25
|
-
},
|
26
|
-
phone: {
|
27
|
-
maximum_length: 30
|
28
|
-
},
|
29
|
-
payment_terms: {
|
30
|
-
maximum_length: 10
|
31
|
-
},
|
32
|
-
shipment_method: {
|
33
|
-
maximum_length: 10
|
34
|
-
},
|
35
|
-
salesperson: {
|
36
|
-
maximum_length: 20
|
37
|
-
},
|
38
|
-
bill_to_name: {
|
39
|
-
maximum_length: 100
|
40
|
-
},
|
41
|
-
bill_to_customer_number: {
|
42
|
-
maximum_length: 20
|
43
|
-
},
|
44
|
-
ship_to_name: {
|
45
|
-
maximum_length: 100
|
46
|
-
},
|
47
|
-
ship_to_contact: {
|
48
|
-
maximum_length: 100
|
49
|
-
}
|
50
|
-
}.freeze
|
51
|
-
|
52
|
-
OBJECT_METHODS = %i[
|
53
|
-
get
|
54
|
-
post
|
55
|
-
patch
|
56
|
-
delete
|
57
|
-
].freeze
|
58
|
-
|
59
|
-
navigation :sales_invoice_line
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class SalesInvoiceLine < Base
|
6
|
-
OBJECT = 'salesInvoiceLines'
|
7
|
-
|
8
|
-
OBJECT_METHODS = %i[
|
9
|
-
get
|
10
|
-
post
|
11
|
-
patch
|
12
|
-
delete
|
13
|
-
].freeze
|
14
|
-
|
15
|
-
OBJECT_PARENTS = %w[
|
16
|
-
salesInvoices
|
17
|
-
].freeze
|
18
|
-
|
19
|
-
def initialize(client, parent: 'salesInvoices', parent_id:, **args)
|
20
|
-
return if !valid_parent?(parent)
|
21
|
-
|
22
|
-
super(client, args)
|
23
|
-
@parent_path << {
|
24
|
-
path: parent,
|
25
|
-
id: parent_id
|
26
|
-
}
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module BusinessCentral
|
4
|
-
module Object
|
5
|
-
class SalesOrder < Base
|
6
|
-
extend BusinessCentral::Object::ObjectHelper
|
7
|
-
|
8
|
-
OBJECT = 'salesOrders'
|
9
|
-
|
10
|
-
OBJECT_METHODS = %i[
|
11
|
-
get
|
12
|
-
post
|
13
|
-
patch
|
14
|
-
delete
|
15
|
-
].freeze
|
16
|
-
|
17
|
-
navigation :sales_order_line
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|