Module: Fortnox::API::Model::DocumentBase

Defined in:
lib/fortnox/api/models/document_base.rb

Class Method Summary collapse

Class Method Details

.ify(base) ⇒ Object

Method length is ignored due to readability. rubocop:disable Metrics/MethodLength



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
38
39
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
68
69
70
71
72
73
74
75
76
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/fortnox/api/models/document_base.rb', line 10

def self.ify( base )
  base.class_eval do

    # Url Direct url to the record.
    base.attribute :url, Types::Nullable::String.with( read_only: true )

    # AdministrationFee The document administration fee.
    base.attribute :administration_fee, Types::Nullable::Float

    # AdministrationFeeVAT VAT of the document administration fee.
    base.attribute :administration_fee_vat, Types::Nullable::Float.with( read_only: true )

    # Address1 Document address 1. 1024 characters
    base.attribute :address1, Types::Sized::String[ 1024 ]

    # Address2 Document address 2. 1024 characters
    base.attribute :address2, Types::Sized::String[ 1024 ]

    # BasisTaxReduction Basis of tax reduction.
    base.attribute :basis_tax_reduction, Types::Nullable::Float.with( read_only: true )

    # Cancelled If the document is cancelled.
    base.attribute :cancelled, Types::Nullable::Boolean.with( read_only: true )

    # City City for the document address.
    base.attribute :city, Types::Sized::String[ 1024 ]

    # Comments Comments of the document
    base.attribute :comments, Types::Sized::String[ 1024 ]

    # ContributionPercent Document contribution in percent.
    base.attribute :contribution_percent, Types::Nullable::Float.with( read_only: true )

    # ContributionValue Document contribution in amount.
    base.attribute :contribution_value, Types::Nullable::Float.with( read_only: true )

    # Country Country for the document address.
    base.attribute :country, Fortnox::API::Types::CountryCode

    # CostCenter Code of the cost center.
    base.attribute :cost_center, Types::Nullable::String

    # Currency Code of the currency.
    base.attribute :currency, Fortnox::API::Types::Currency

    # CurrencyRate Currency rate used for the document
    base.attribute :currency_rate, Types::Nullable::Float

    # CurrencyUnit Currency unit used for the document
    base.attribute :currency_unit, Types::Nullable::Float

    # CustomerName Name of the customer. 1024 characters
    base.attribute :customer_name, Types::Sized::String[ 1024 ]

    # CustomerNumber Customer number of the customer. Required
    base.attribute :customer_number, Types::Required::String

    # DeliveryAddress1 Document delivery address 1.
    base.attribute :delivery_address1, Types::Sized::String[ 1024 ]

    # DeliveryAddress2 Document delivery address 2.
    base.attribute :delivery_address2, Types::Sized::String[ 1024 ]

    # DeliveryCity City for the document delivery address.
    base.attribute :delivery_city, Types::Sized::String[ 1024 ]

    # DeliveryCountry Country for the document delivery address.
    base.attribute :delivery_country, Fortnox::API::Types::CountryCode

    # DeliveryDate Date of delivery.
    base.attribute :delivery_date, Types::Nullable::Date

    # DeliveryName  Name of the recipient of the delivery
    base.attribute :delivery_name, Types::Sized::String[ 1024 ]

    # DeliveryZipCode ZipCode for the document delivery address.
    base.attribute :delivery_zip_code, Types::Sized::String[ 1024 ]

    # DocumentNumber The document number.
    base.attribute :document_number, Types::Nullable::Integer

    # EmailInformation Separete EmailInformation object
    base.attribute :email_information, Types::EmailInformation

    # ExternalInvoiceReference1 External document reference 1. 80 characters
    base.attribute :external_invoice_reference1, Types::Sized::String[ 80 ]

    # ExternalInvoiceReference2 External document reference 2. 80 characters
    base.attribute :external_invoice_reference2, Types::Sized::String[ 80 ]

    # Freight Freight cost of the document. 12 digits (incl. decimals)
    base.attribute :freight, Types::Sized::Float[ 0.0, 99_999_999_999.0 ]

    # FreightVAT VAT of the freight cost.
    base.attribute :freight_vat, Types::Nullable::Float.with( read_only: true )

    # Gross Gross value of the document
    base.attribute :gross, Types::Nullable::Float.with( read_only: true )

    # HouseWork If there is any row of the document marked “house work”.
    base.attribute :house_work, Types::Nullable::Boolean.with( read_only: true )

    base.attribute :labels, Types::Strict::Array.member( Label )

    # Net Net amount
    base.attribute :net, Types::Nullable::Float.with( read_only: true )

    # NotCompleted If the document is set as not completed.
    base.attribute :not_completed, Types::Nullable::Boolean

    # OfferReference Reference to the offer, if one exists.
    base.attribute :offer_reference, Types::Nullable::Integer.with( read_only: true )

    # OrganisationNumber Organisation number of the customer for the
    # document.
    base.attribute :organisation_number, Types::Nullable::String.with( read_only: true )

    # OurReference Our reference. 50 characters
    base.attribute :our_reference, Types::Sized::String[ 50 ]

    # Phone1 Phone number 1 of the customer for the document. 1024 characters
    base.attribute :phone1, Types::Sized::String[ 1024 ]

    # Phone2 Phone number 2 of the customer for the document. 1024 characters
    base.attribute :phone2, Types::Sized::String[ 1024 ]

    # PriceList Code of the price list.
    base.attribute :price_list, Types::Nullable::String

    # PrintTemplate Print template of the document.
    base.attribute :print_template, Types::Nullable::String

    # Project Code of the project.
    base.attribute :project, Types::Nullable::String

    # Remarks Remarks of the document. 1024 characters
    base.attribute :remarks, Types::Sized::String[ 1024 ]

    # RoundOff Round off amount for the document.
    base.attribute :round_off, Types::Nullable::Float.with( read_only: true )

    # Sent If the document is printed or sent in any way.
    base.attribute :sent, Types::Nullable::Boolean.with( read_only: true )

    # TaxReduction The amount of tax reduction.
    base.attribute :tax_reduction, Types::Nullable::Integer.with( read_only: true )

    # TermsOfDelivery Code of the terms of delivery.
    base.attribute :terms_of_delivery, Types::Nullable::String

    # TermsOfPayment Code of the terms of payment.
    base.attribute :terms_of_payment, Types::Nullable::String

    # Total The total amount of the document.
    base.attribute :total, Types::Nullable::Float.with( read_only: true )

    # TotalVAT The total VAT amount of the document.
    base.attribute :total_vat, Types::Nullable::Float.with( read_only: true )

    # VATIncluded If the price of the document is including VAT.
    base.attribute :vat_included, Types::Nullable::Boolean

    # WayOfDelivery Code of the way of delivery.
    base.attribute :way_of_delivery, Types::Nullable::String

    # YourOrderNumber Your order number. 30 characters
    base.attribute :your_order_number, Types::Sized::String[ 30 ]

    # YourReference Your reference. 50 characters
    base.attribute :your_reference, Types::Sized::String[ 50 ]

    # ZipCode Zip code of the document. 1024 characters
    base.attribute :zip_code, Types::Sized::String[ 1024 ]
  end
end