rconomic 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/.travis.yml +0 -1
- data/Gemfile +0 -1
- data/lib/economic/account.rb +3 -5
- data/lib/economic/cash_book.rb +1 -1
- data/lib/economic/cash_book_entry.rb +92 -94
- data/lib/economic/creditor.rb +1 -1
- data/lib/economic/creditor_contact.rb +15 -17
- data/lib/economic/creditor_entry.rb +0 -1
- data/lib/economic/current_invoice.rb +32 -35
- data/lib/economic/current_invoice_line.rb +14 -2
- data/lib/economic/debtor.rb +60 -37
- data/lib/economic/debtor_contact.rb +26 -20
- data/lib/economic/endpoint.rb +72 -0
- data/lib/economic/entity/handle.rb +35 -21
- data/lib/economic/entity/mapper.rb +41 -0
- data/lib/economic/entity.rb +58 -34
- data/lib/economic/invoice.rb +15 -2
- data/lib/economic/proxies/account_proxy.rb +2 -3
- data/lib/economic/proxies/actions/find_by_ci_number.rb +4 -2
- data/lib/economic/proxies/actions/find_by_date_interval.rb +0 -1
- data/lib/economic/proxies/actions/find_by_name.rb +5 -1
- data/lib/economic/proxies/cash_book_entry_proxy.rb +1 -1
- data/lib/economic/proxies/entity_proxy.rb +15 -8
- data/lib/economic/session.rb +27 -31
- data/lib/rconomic/version.rb +1 -1
- data/rconomic.gemspec +1 -5
- data/spec/economic/cash_book_entry_spec.rb +27 -5
- data/spec/economic/cash_book_spec.rb +6 -6
- data/spec/economic/creditor_contact_spec.rb +24 -15
- data/spec/economic/creditor_spec.rb +9 -9
- data/spec/economic/current_invoice_line_spec.rb +7 -7
- data/spec/economic/current_invoice_spec.rb +82 -33
- data/spec/economic/debtor_contact_spec.rb +25 -15
- data/spec/economic/debtor_entry_spec.rb +3 -3
- data/spec/economic/debtor_spec.rb +49 -15
- data/spec/economic/endpoint_spec.rb +71 -0
- data/spec/economic/entity/handle_spec.rb +42 -49
- data/spec/economic/entity/mapper_spec.rb +54 -0
- data/spec/economic/entity_spec.rb +78 -72
- data/spec/economic/entry_spec.rb +3 -3
- data/spec/economic/invoice_spec.rb +37 -18
- data/spec/economic/proxies/actions/find_by_name_spec.rb +15 -12
- data/spec/economic/proxies/cash_book_entry_proxy_spec.rb +26 -24
- data/spec/economic/proxies/cash_book_proxy_spec.rb +23 -21
- data/spec/economic/proxies/creditor_contact_proxy_spec.rb +12 -16
- data/spec/economic/proxies/creditor_entry_proxy_spec.rb +18 -14
- data/spec/economic/proxies/creditor_proxy_spec.rb +23 -26
- data/spec/economic/proxies/current_invoice_line_proxy_spec.rb +17 -20
- data/spec/economic/proxies/current_invoice_proxy_spec.rb +38 -41
- data/spec/economic/proxies/debtor_contact_proxy_spec.rb +12 -15
- data/spec/economic/proxies/debtor_entry_proxy_spec.rb +18 -14
- data/spec/economic/proxies/debtor_proxy_spec.rb +31 -34
- data/spec/economic/proxies/entry_proxy_spec.rb +26 -22
- data/spec/economic/proxies/invoice_proxy_spec.rb +18 -21
- data/spec/economic/session_spec.rb +57 -44
- data/spec/fixtures/{spec_entity_create_from_data → account_create_from_data}/success.xml +5 -5
- data/spec/fixtures/{spec_entity_delete → account_delete}/success.xml +1 -1
- data/spec/fixtures/{spec_entity_get_data → account_get_data}/success.xml +5 -5
- data/spec/fixtures/{spec_entity_update_from_data → account_update_from_data}/success.xml +5 -5
- data/spec/fixtures/cash_book_entry_create_creditor_invoice/success.xml +2 -2
- data/spec/fixtures/cash_book_entry_create_creditor_payment/success.xml +2 -2
- data/spec/fixtures/creditor_contact_create_from_data/success.xml +10 -0
- data/spec/fixtures/debtor_contact_create_from_data/success.xml +10 -0
- data/spec/fixtures/debtor_create_from_data/success.xml +57 -0
- data/spec/spec_helper.rb +10 -104
- data/spec/support/api_requests.rb +20 -0
- data/spec/support/factories.rb +65 -0
- data/spec/support/fixtures.rb +9 -0
- metadata +27 -31
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
NDMzYWQwOWMzYTE4NzUwNjA2YTBlMzJhZTA2ZjdjOTZhYmUzOTE2NmU5YzAx
|
10
|
-
NWU5OWYyYmI0YzA2MWFmMTliZGFjNzY0MDc4YjgxYThjMTIzMTQyOTE5Yjg5
|
11
|
-
YzU1ZTE4ZmM4OWM0ODcyNmNmM2JjZmMxMDdlZmU1MzdkMzgxYTQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
N2Q2MzYxYTIxZmVmZWRlNDhiMDg3ZjE5N2U2MWI0NzJiM2RlODdmNjBlNGVk
|
14
|
-
NTgwZGRmMDI2YzczZGI5OGM2NmUzNjRhOTFjZjkwY2ZhYjBlOWU0MGE2YmM5
|
15
|
-
Y2NkYTQ5N2RlOGE5Zjg0NjliZDEyNzE5MzQwN2RmZTllODc4NWM=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 14a1723793e7bc6dbb57eefc74016d232bef34f5
|
4
|
+
data.tar.gz: 36cec979913999f6ab22056e2b73893d06895444
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f99ac8b85d8783ae420c2258e827e1319031eb180d0464af38281f71bae8b8e10bc966950e10f15d96f57e81fa98aa28150dc9ba988459b7e714fe29d77b513b
|
7
|
+
data.tar.gz: 8ae97965563faa5fa04746ad62262848f954ff3a7494561d8fcf9aca709e972a076dd6dd6b7010590a80cd9f5fcc2a25cc7748e20d8bd1436417726235632293
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/lib/economic/account.rb
CHANGED
@@ -3,15 +3,13 @@ require 'economic/entity'
|
|
3
3
|
module Economic
|
4
4
|
class Account < Entity
|
5
5
|
has_properties :name, :number, :balance, :block_direct_entries, :contra_account, :debit_credit, :department, :distribution_key, :is_accessible, :opening_account, :total_from, :type, :vat_account
|
6
|
-
|
7
|
-
|
6
|
+
|
8
7
|
def handle
|
9
8
|
Handle.build({:name => @name})
|
10
9
|
end
|
11
|
-
|
12
|
-
|
10
|
+
|
13
11
|
protected
|
14
|
-
|
12
|
+
|
15
13
|
def build_soap_data
|
16
14
|
{
|
17
15
|
'Handle' => handle.to_hash,
|
data/lib/economic/cash_book.rb
CHANGED
@@ -6,109 +6,107 @@ module Economic
|
|
6
6
|
# API documentation: http://www.e-conomic.com/apidocs/Documentation/T_Economic_Api_ICashBook.html
|
7
7
|
class CashBookEntry < Entity
|
8
8
|
has_properties :id1,
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
9
|
+
:id2,
|
10
|
+
:account_handle,
|
11
|
+
:amount,
|
12
|
+
:amount_default_currency,
|
13
|
+
:bank_payment_creditor_id,
|
14
|
+
:bank_payment_creditor_invoice_id,
|
15
|
+
:bank_payment_type_handle,
|
16
|
+
:capitalise_handle,
|
17
|
+
:cash_book_handle,
|
18
|
+
:contra_account_handle,
|
19
|
+
:contra_vat_account_handle,
|
20
|
+
:cost_type_handle,
|
21
|
+
:creditor_handle,
|
22
|
+
:creditor_invoice_number,
|
23
|
+
:currency_handle,
|
24
|
+
:date,
|
25
|
+
:debtor_handle,
|
26
|
+
:debtor_invoice_number,
|
27
|
+
:department_handle,
|
28
|
+
:distribution_key_handle,
|
29
|
+
:due_date,
|
30
|
+
:employee_handle,
|
31
|
+
:end_date,
|
32
|
+
:project_handle,
|
33
|
+
:start_date,
|
34
|
+
:text,
|
35
|
+
:type,
|
36
|
+
:vat_account_handle,
|
37
|
+
:voucher_number
|
38
38
|
|
39
39
|
defaults(
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
40
|
+
:account_handle => nil,
|
41
|
+
:amount => 0,
|
42
|
+
:amount_default_currency => 0,
|
43
|
+
:bank_payment_creditor_id => nil,
|
44
|
+
:bank_payment_creditor_invoice_id => nil,
|
45
|
+
:bank_payment_type_handle => nil,
|
46
|
+
:capitalise_handle => nil,
|
47
|
+
:cash_book_handle => nil,
|
48
|
+
:contra_account_handle => nil,
|
49
|
+
:contra_vat_account_handle => nil,
|
50
|
+
:cost_type_handle => nil,
|
51
|
+
:creditor_handle => nil,
|
52
|
+
:creditor_invoice_number => nil,
|
53
|
+
:currency_handle => nil,
|
54
|
+
:date => Time.now,
|
55
|
+
:debtor_handle => nil,
|
56
|
+
:debtor_invoice_number => nil,
|
57
|
+
:department_handle => nil,
|
58
|
+
:distribution_key_handle => nil,
|
59
|
+
:due_date => nil,
|
60
|
+
:employee_handle => nil,
|
61
|
+
:end_date => nil,
|
62
|
+
:project_handle => nil,
|
63
|
+
:start_date => Time.now,
|
64
|
+
:text => "",
|
65
|
+
:type => "",
|
66
|
+
:vat_account_handle => nil,
|
67
|
+
:voucher_number => 0
|
68
68
|
)
|
69
69
|
|
70
70
|
def handle
|
71
|
-
@handle
|
71
|
+
@handle || Handle.new(:id1 => @id1, :id2 => @id2)
|
72
72
|
end
|
73
73
|
|
74
74
|
protected
|
75
75
|
|
76
|
-
def
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
return data
|
76
|
+
def fields
|
77
|
+
to_hash = Proc.new { |handle| handle.to_hash }
|
78
|
+
[
|
79
|
+
["Handle", :handle, Proc.new { |v| v.to_hash }],
|
80
|
+
["Id1", :id1],
|
81
|
+
["Id2", :id2],
|
82
|
+
["Type", :type],
|
83
|
+
["CashBookHandle", :cash_book_handle, to_hash],
|
84
|
+
["DebtorHandle", :debtor_handle, to_hash],
|
85
|
+
["AccountHandle", :account_handle, to_hash],
|
86
|
+
["ContraAccountHandle", :contra_account_handle, to_hash],
|
87
|
+
["Date", :date, nil, :required],
|
88
|
+
["VoucherNumber", :voucher_number, nil, :required],
|
89
|
+
["Text", :text, nil, :required],
|
90
|
+
["AmountDefaultCurrency", :amount_default_currency, nil, :required],
|
91
|
+
["CurrencyHandle", :currency_handle, to_hash],
|
92
|
+
["Amount", :amount, nil, :required],
|
93
|
+
["VatAccountHandle", :vat_account_handle, to_hash],
|
94
|
+
["ContraVatAccountHandle", :contra_vat_account_handle, to_hash],
|
95
|
+
["DebtorInvoiceNumber", :debtor_invoice_number],
|
96
|
+
["CreditorInvoiceNumber", :creditor_invoice_number],
|
97
|
+
["DueDate", :due_date, nil, :required],
|
98
|
+
["DepartmentHandle", :department_handle, to_hash],
|
99
|
+
["DistributionKeyHandle", :distribution_key_handle, to_hash],
|
100
|
+
["ProjectHandle", :project_handle, to_hash],
|
101
|
+
["CostTypeHandle", :cost_type_handle, to_hash],
|
102
|
+
["BankPaymentTypeHandle", :bank_payment_type_handle, to_hash],
|
103
|
+
["BankPaymentCreditorId", :bank_payment_creditor_id],
|
104
|
+
["BankPaymentCreditorInvoiceId", :bank_payment_creditor_invoice_id],
|
105
|
+
["CapitaliseHandle", :capitalise_handle, to_hash],
|
106
|
+
["StartDate", :start_date, nil, :required],
|
107
|
+
["EndDate", :end_date, nil, :required],
|
108
|
+
["EmployeeHandle", :employee_handle, to_hash]
|
109
|
+
]
|
112
110
|
end
|
113
111
|
end
|
114
112
|
end
|
data/lib/economic/creditor.rb
CHANGED
@@ -25,7 +25,7 @@ module Economic
|
|
25
25
|
has_properties :number, :creditor_group_handle, :name, :vat_zone, :currency_handle, :term_of_payment_handle, :is_accessible, :ci_number, :email, :address, :postal_code, :city, :country, :bank_account, :attention_handle, :your_reference_handle, :our_reference_handle, :default_payment_type_handle, :default_payment_creditor_id, :county, :auto_contra_account_handle
|
26
26
|
|
27
27
|
def handle
|
28
|
-
@handle
|
28
|
+
@handle || Handle.build({:number => @number})
|
29
29
|
end
|
30
30
|
|
31
31
|
# Returns the Creditors contacts
|
@@ -36,27 +36,25 @@ module Economic
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def handle
|
39
|
-
@handle
|
39
|
+
@handle || Handle.build({:id => @id})
|
40
40
|
end
|
41
41
|
|
42
42
|
protected
|
43
43
|
|
44
|
-
def
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
44
|
+
def fields
|
45
|
+
to_hash = Proc.new { |handle| handle.to_hash }
|
46
|
+
# SOAP field, entity method, formatter proc, required?
|
47
|
+
[
|
48
|
+
["Handle", :handle, Proc.new { |v| v.to_hash }, :required],
|
49
|
+
["Id", :id, nil],
|
50
|
+
["CreditorHandle", :creditor_handle, to_hash],
|
51
|
+
["Name", :name],
|
52
|
+
["Number", :handle, Proc.new { |v| v.number }, :required],
|
53
|
+
["TelephoneNumber", :telephone_number],
|
54
|
+
["Email", :email],
|
55
|
+
["Comments", :comments],
|
56
|
+
["ExternalId", :external_id]
|
57
|
+
]
|
58
58
|
end
|
59
|
-
|
60
59
|
end
|
61
|
-
|
62
60
|
end
|
@@ -2,7 +2,8 @@ require 'economic/entity'
|
|
2
2
|
|
3
3
|
module Economic
|
4
4
|
|
5
|
-
# CurrentInvoices are invoices that are not yet booked. They are therefore not
|
5
|
+
# CurrentInvoices are invoices that are not yet booked. They are therefore not
|
6
|
+
# read-only.
|
6
7
|
#
|
7
8
|
# API documentation: http://www.e-conomic.com/apidocs/Documentation/T_Economic_Api_ICurrentInvoice.html
|
8
9
|
#
|
@@ -65,8 +66,8 @@ module Economic
|
|
65
66
|
@attention_handle = handle
|
66
67
|
end
|
67
68
|
|
68
|
-
# Books a current invoice. An invoice number greater than all other invoice
|
69
|
-
# assigned to the resulting Economic::Invoice.
|
69
|
+
# Books a current invoice. An invoice number greater than all other invoice
|
70
|
+
# numbers will be assigned to the resulting Economic::Invoice.
|
70
71
|
#
|
71
72
|
# Returns the resulting Economic::Invoice object
|
72
73
|
def book
|
@@ -108,7 +109,7 @@ module Economic
|
|
108
109
|
end
|
109
110
|
|
110
111
|
def handle
|
111
|
-
@handle
|
112
|
+
@handle || Handle.new(:id => @id)
|
112
113
|
end
|
113
114
|
|
114
115
|
def lines
|
@@ -120,7 +121,6 @@ module Economic
|
|
120
121
|
|
121
122
|
result = super
|
122
123
|
self.id = result[:id].to_i
|
123
|
-
@handle = nil # Reset a memoized handle, leaving it up to #handle to recreate it with correct id
|
124
124
|
|
125
125
|
lines.each do |invoice_line|
|
126
126
|
invoice_line.session = session
|
@@ -131,36 +131,33 @@ module Economic
|
|
131
131
|
|
132
132
|
protected
|
133
133
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
return data
|
134
|
+
def fields
|
135
|
+
date_formatter = Proc.new { |date| date.respond_to?(:iso8601) ? date.iso8601 : nil }
|
136
|
+
to_hash = Proc.new { |handle| handle.to_hash }
|
137
|
+
[
|
138
|
+
["Id", :id, nil, :required],
|
139
|
+
["DebtorHandle", :debtor, Proc.new { |d| d.handle.to_hash }],
|
140
|
+
["DebtorName", :debtor_name, nil, :required],
|
141
|
+
["DebtorAddress", :debtor_address],
|
142
|
+
["DebtorPostalCode", :debtor_postal_code],
|
143
|
+
["DebtorCity", :debtor_city],
|
144
|
+
["DebtorCountry", :debtor_country],
|
145
|
+
["AttentionHandle", :attention_handle, to_hash],
|
146
|
+
["Date", :date, date_formatter],
|
147
|
+
["TermOfPaymentHandle", :term_of_payment_handle, to_hash],
|
148
|
+
["DueDate", :due_date, date_formatter, :required],
|
149
|
+
["CurrencyHandle", :currency_handle, to_hash],
|
150
|
+
["ExchangeRate", :exchange_rate],
|
151
|
+
["IsVatIncluded", :is_vat_included, nil, :required],
|
152
|
+
["LayoutHandle", :layout_handle, to_hash],
|
153
|
+
["DeliveryDate", :delivery_date, date_formatter, :required],
|
154
|
+
["Heading", :heading],
|
155
|
+
["NetAmount", :net_amount, nil, :required],
|
156
|
+
["VatAmount", :vat_amount, nil, :required],
|
157
|
+
["GrossAmount", :gross_amount, nil, :required],
|
158
|
+
["Margin", :margin, nil, :required],
|
159
|
+
["MarginAsPercent", :margin_as_percent, nil, :required]
|
160
|
+
]
|
163
161
|
end
|
164
162
|
end
|
165
|
-
|
166
163
|
end
|
@@ -9,7 +9,19 @@ module Economic
|
|
9
9
|
#
|
10
10
|
# See Economic::CurrentInvoice for usage example
|
11
11
|
class CurrentInvoiceLine < Entity
|
12
|
-
has_properties :number,
|
12
|
+
has_properties :number,
|
13
|
+
:invoice_handle,
|
14
|
+
:description,
|
15
|
+
:delivery_date,
|
16
|
+
:unit_handle,
|
17
|
+
:product_handle,
|
18
|
+
:quantity,
|
19
|
+
:unit_net_price,
|
20
|
+
:discount_as_percent,
|
21
|
+
:unit_cost_price,
|
22
|
+
:total_net_amount,
|
23
|
+
:total_margin,
|
24
|
+
:margin_as_percent
|
13
25
|
|
14
26
|
defaults(
|
15
27
|
:invoice_handle => nil,
|
@@ -27,7 +39,7 @@ module Economic
|
|
27
39
|
)
|
28
40
|
|
29
41
|
def handle
|
30
|
-
@handle
|
42
|
+
@handle || Handle.build(:number => number)
|
31
43
|
end
|
32
44
|
|
33
45
|
def invoice
|
data/lib/economic/debtor.rb
CHANGED
@@ -25,10 +25,35 @@ module Economic
|
|
25
25
|
# debtor.layout_handle = { :id => 16 }
|
26
26
|
# debtor.save
|
27
27
|
class Debtor < Entity
|
28
|
-
has_properties :number,
|
28
|
+
has_properties :number,
|
29
|
+
:debtor_group_handle,
|
30
|
+
:name,
|
31
|
+
:vat_zone,
|
32
|
+
:currency_handle,
|
33
|
+
:price_group_handle,
|
34
|
+
:is_accessible,
|
35
|
+
:ean,
|
36
|
+
:public_entry_number,
|
37
|
+
:email,
|
38
|
+
:telephone_and_fax_number,
|
39
|
+
:website,
|
40
|
+
:address,
|
41
|
+
:postal_code,
|
42
|
+
:city,
|
43
|
+
:country,
|
44
|
+
:credit_maximum,
|
45
|
+
:vat_number,
|
46
|
+
:county,
|
47
|
+
:ci_number,
|
48
|
+
:term_of_payment_handle,
|
49
|
+
:layout_handle,
|
50
|
+
:attention_handle,
|
51
|
+
:your_reference_handle,
|
52
|
+
:our_reference_handle,
|
53
|
+
:balance
|
29
54
|
|
30
55
|
def handle
|
31
|
-
@handle
|
56
|
+
@handle || Handle.new({:number => @number})
|
32
57
|
end
|
33
58
|
|
34
59
|
# Returns the Debtors contacts
|
@@ -36,47 +61,45 @@ module Economic
|
|
36
61
|
@contacts ||= DebtorContactProxy.new(self)
|
37
62
|
end
|
38
63
|
|
39
|
-
# Provides access to the current invoices for Debtor - ie invoices that
|
64
|
+
# Provides access to the current invoices for Debtor - ie invoices that
|
65
|
+
# haven't yet been booked
|
40
66
|
def current_invoices
|
41
67
|
@current_invoices ||= CurrentInvoiceProxy.new(self)
|
42
68
|
end
|
43
69
|
|
44
70
|
protected
|
45
71
|
|
46
|
-
def
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
return data
|
72
|
+
def fields
|
73
|
+
to_hash = Proc.new { |handle| handle.to_hash }
|
74
|
+
[
|
75
|
+
["Handle", :handle, to_hash, :required],
|
76
|
+
["Number", :handle, Proc.new { |h| h.number }, :required],
|
77
|
+
["DebtorGroupHandle", :debtor_group_handle, to_hash],
|
78
|
+
["Name", :name, nil, :required],
|
79
|
+
["VatZone", :vat_zone, nil, :required],
|
80
|
+
["CurrencyHandle", :currency_handle, to_hash],
|
81
|
+
["PriceGroupHandle", :price_group_handle, to_hash],
|
82
|
+
["IsAccessible", :is_accessible, nil, :required],
|
83
|
+
["Ean", :ean],
|
84
|
+
["PublicEntryNumber", :public_entry_number],
|
85
|
+
["Email", :email],
|
86
|
+
["TelephoneAndFaxNumber", :telephone_and_fax_number],
|
87
|
+
["Website", :website],
|
88
|
+
["Address", :address],
|
89
|
+
["PostalCode", :postal_code],
|
90
|
+
["City", :city],
|
91
|
+
["Country", :country],
|
92
|
+
["CreditMaximum", :credit_maximum],
|
93
|
+
["VatNumber", :vat_number],
|
94
|
+
["County", :county],
|
95
|
+
["CINumber", :ci_number],
|
96
|
+
["TermOfPaymentHandle", :term_of_payment_handle, to_hash],
|
97
|
+
["LayoutHandle", :layout_handle, to_hash],
|
98
|
+
["AttentionHandle", :attention_handle],
|
99
|
+
["YourReferenceHandle", :your_reference_handle],
|
100
|
+
["OurReferenceHandle", :our_reference_handle],
|
101
|
+
["Balance", :balance]
|
102
|
+
]
|
78
103
|
end
|
79
|
-
|
80
104
|
end
|
81
|
-
|
82
105
|
end
|