Class: LockstepSdk::InvoiceModel

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/models/invoice_model.rb

Overview

An Invoice represents a bill sent from one company to another. The creator of the invoice is identified by the ‘CompanyId` field, and the recipient of the invoice is identified by the `CustomerId` field. Most invoices are uniquely identified both by a Lockstep Platform ID number and a customer ERP “key” that was generated by the system that originated the invoice. Invoices have a total amount and a due date, and when some payments have been made on the Invoice the `TotalAmount` and the `OutstandingBalanceAmount` may be different.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ InvoiceModel

Initialize the InvoiceModel using the provided prototype



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
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 30

def initialize(params = {})
    @group_key = params.dig(:group_key)
    @invoice_id = params.dig(:invoice_id)
    @company_id = params.dig(:company_id)
    @customer_id = params.dig(:customer_id)
    @erp_key = params.dig(:erp_key)
    @purchase_order_code = params.dig(:purchase_order_code)
    @reference_code = params.dig(:reference_code)
    @salesperson_code = params.dig(:salesperson_code)
    @salesperson_name = params.dig(:salesperson_name)
    @invoice_type_code = params.dig(:invoice_type_code)
    @invoice_status_code = params.dig(:invoice_status_code)
    @terms_code = params.dig(:terms_code)
    @special_terms = params.dig(:special_terms)
    @currency_code = params.dig(:currency_code)
    @total_amount = params.dig(:total_amount)
    @sales_tax_amount = params.dig(:sales_tax_amount)
    @discount_amount = params.dig(:discount_amount)
    @outstanding_balance_amount = params.dig(:outstanding_balance_amount)
    @invoice_date = params.dig(:invoice_date)
    @discount_date = params.dig(:discount_date)
    @posted_date = params.dig(:posted_date)
    @invoice_closed_date = params.dig(:invoice_closed_date)
    @payment_due_date = params.dig(:payment_due_date)
    @imported_date = params.dig(:imported_date)
    @primary_origin_address_id = params.dig(:primary_origin_address_id)
    @primary_bill_to_address_id = params.dig(:primary_bill_to_address_id)
    @primary_ship_to_address_id = params.dig(:primary_ship_to_address_id)
    @created = params.dig(:created)
    @created_user_id = params.dig(:created_user_id)
    @modified = params.dig(:modified)
    @modified_user_id = params.dig(:modified_user_id)
    @app_enrollment_id = params.dig(:app_enrollment_id)
    @is_voided = params.dig(:is_voided)
    @in_dispute = params.dig(:in_dispute)
    @exclude_from_aging = params.dig(:exclude_from_aging)
    @preferred_delivery_method = params.dig(:preferred_delivery_method)
    @currency_rate = params.dig(:currency_rate)
    @base_currency_total_amount = params.dig(:base_currency_total_amount)
    @base_currency_sales_tax_amount = params.dig(:base_currency_sales_tax_amount)
    @base_currency_discount_amount = params.dig(:base_currency_discount_amount)
    @base_currency_outstanding_balance_amount = params.dig(:base_currency_outstanding_balance_amount)
    @addresses = params.dig(:addresses)
    @lines = params.dig(:lines)
    @payments = params.dig(:payments)
    @notes = params.dig(:notes)
    @attachments = params.dig(:attachments)
    @company = params.dig(:company)
    @customer = params.dig(:customer)
    @customer_primary_contact = params.dig(:customer_primary_contact)
    @credit_memos = params.dig(:credit_memos)
    @custom_field_values = params.dig(:custom_field_values)
    @custom_field_definitions = params.dig(:custom_field_definitions)
end

Instance Attribute Details

#addressesInvoiceAddressModel

Returns All addresses connected to this invoice. To retrieve this collection, specify ‘Addresses` in the “Include” parameter for your query.

Returns:

  • (InvoiceAddressModel)

    All addresses connected to this invoice. To retrieve this collection, specify ‘Addresses` in the “Include” parameter for your query.



251
252
253
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 251

def addresses
  @addresses
end

#app_enrollment_idUuid

Returns The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.

Returns:

  • (Uuid)

    The AppEnrollmentId of the application that imported this record. For accounts with more than one financial system connected, this field identifies the originating financial system that produced this record. This value is null if this record was not loaded from an external ERP or financial system.



211
212
213
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 211

def app_enrollment_id
  @app_enrollment_id
end

#attachmentsAttachmentModel

Returns A collection of attachments linked to this record. To retrieve this collection, specify ‘Attachments` in the `include` parameter when retrieving data. To create an attachment, use the [Upload Attachment](developer.lockstep.io/reference/post_api-v1-attachments) endpoint with the `TableKey` to `Invoice` and the `ObjectKey` set to the `InvoiceId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



267
268
269
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 267

def attachments
  @attachments
end

#base_currency_discount_amountDouble

Returns The total discounts given by the seller to the buyer on this invoice in the group’s base currency.

Returns:

  • (Double)

    The total discounts given by the seller to the buyer on this invoice in the group’s base currency.



243
244
245
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 243

def base_currency_discount_amount
  @base_currency_discount_amount
end

#base_currency_outstanding_balance_amountDouble

Returns The remaining balance value of this invoice in the group’s base currency.

Returns:

  • (Double)

    The remaining balance value of this invoice in the group’s base currency.



247
248
249
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 247

def base_currency_outstanding_balance_amount
  @base_currency_outstanding_balance_amount
end

#base_currency_sales_tax_amountDouble

Returns The total sales (or transactional) tax calculated for this invoice in the group’s base currency.

Returns:

  • (Double)

    The total sales (or transactional) tax calculated for this invoice in the group’s base currency.



239
240
241
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 239

def base_currency_sales_tax_amount
  @base_currency_sales_tax_amount
end

#base_currency_total_amountDouble

Returns The total value of this invoice, inclusive of all taxes and line items in the group’s base currency.

Returns:

  • (Double)

    The total value of this invoice, inclusive of all taxes and line items in the group’s base currency.



235
236
237
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 235

def base_currency_total_amount
  @base_currency_total_amount
end

#companyCompanyModel

Returns The Company associated to this invoice. To retrieve this item, specify ‘Company` in the “Include” parameter for your query.

Returns:

  • (CompanyModel)

    The Company associated to this invoice. To retrieve this item, specify ‘Company` in the “Include” parameter for your query.



271
272
273
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 271

def company
  @company
end

#company_idUuid

Returns The ID number of the company that created this invoice.

Returns:

  • (Uuid)

    The ID number of the company that created this invoice.



95
96
97
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 95

def company_id
  @company_id
end

#createdDate-time

Returns The date on which this invoice record was created.

Returns:

  • (Date-time)

    The date on which this invoice record was created.



195
196
197
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 195

def created
  @created
end

#created_user_idUuid

Returns The ID number of the user who created this invoice.

Returns:

  • (Uuid)

    The ID number of the user who created this invoice.



199
200
201
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 199

def created_user_id
  @created_user_id
end

#credit_memosCreditMemoInvoiceModel

Returns The credit memos associated to this invoice. To retrieve this item, specify ‘CreditMemos` in the “Include” parameter for your query.

Returns:

  • (CreditMemoInvoiceModel)

    The credit memos associated to this invoice. To retrieve this item, specify ‘CreditMemos` in the “Include” parameter for your query.



283
284
285
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 283

def credit_memos
  @credit_memos
end

#currency_codeString

Returns The three-character ISO 4217 currency code used for this invoice.

Returns:

  • (String)

    The three-character ISO 4217 currency code used for this invoice.



139
140
141
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 139

def currency_code
  @currency_code
end

#currency_rateDouble

Returns The Currency Rate used to get from the account’s base currency to the invoice amount.

Returns:

  • (Double)

    The Currency Rate used to get from the account’s base currency to the invoice amount.



231
232
233
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 231

def currency_rate
  @currency_rate
end

#custom_field_definitionsCustomFieldDefinitionModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify ‘CustomFieldDefinitions` in the `include` parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the `TableKey` to `Invoice` and the `ObjectKey` set to the `InvoiceId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



291
292
293
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 291

def custom_field_definitions
  @custom_field_definitions
end

#custom_field_valuesCustomFieldValueModel

Returns A collection of custom fields linked to this record. To retrieve this collection, specify ‘CustomFieldValues` in the `include` parameter when retrieving data. To create a custom field, use the [Create Custom Field](developer.lockstep.io/reference/post_api-v1-customfieldvalues) endpoint with the `TableKey` to `Invoice` and the `ObjectKey` set to the `InvoiceId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



287
288
289
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 287

def custom_field_values
  @custom_field_values
end

#customerCompanyModel

Returns The Customer associated to the invoice customer To retrieve this item, specify ‘Customer` in the “Include” parameter for your query.

Returns:

  • (CompanyModel)

    The Customer associated to the invoice customer To retrieve this item, specify ‘Customer` in the “Include” parameter for your query.



275
276
277
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 275

def customer
  @customer
end

#customer_idUuid

Returns The ID number of the counterparty for the invoice, for example, a customer or vendor.

Returns:

  • (Uuid)

    The ID number of the counterparty for the invoice, for example, a customer or vendor.



99
100
101
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 99

def customer_id
  @customer_id
end

#customer_primary_contactContactModel

Returns The Contact associated to the invoice customer To retrieve this item, specify ‘Customer` in the “Include” parameter for your query.

Returns:

  • (ContactModel)

    The Contact associated to the invoice customer To retrieve this item, specify ‘Customer` in the “Include” parameter for your query.



279
280
281
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 279

def customer_primary_contact
  @customer_primary_contact
end

#discount_amountDouble

Returns The total discounts given by the seller to the buyer on this invoice in it’s tendered currency.

Returns:

  • (Double)

    The total discounts given by the seller to the buyer on this invoice in it’s tendered currency.



151
152
153
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 151

def discount_amount
  @discount_amount
end

#discount_dateDate

Returns The date when discounts were adjusted for this invoice.

Returns:

  • (Date)

    The date when discounts were adjusted for this invoice.



163
164
165
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 163

def discount_date
  @discount_date
end

#erp_keyString

Returns The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    The unique ID of this record as it was known in its originating financial system. If this company record was imported from a financial system, it will have the value ‘ErpKey` set to the original primary key number of the record as it was known in the originating financial system. If this record was not imported, this value will be `null`. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



103
104
105
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 103

def erp_key
  @erp_key
end

#exclude_from_agingBoolean

Returns Should the invoice be excluded from aging calculations?.

Returns:

  • (Boolean)

    Should the invoice be excluded from aging calculations?



223
224
225
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 223

def exclude_from_aging
  @exclude_from_aging
end

#group_keyUuid

Returns The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).

Returns:

  • (Uuid)

    The GroupKey uniquely identifies a single Lockstep Platform account. All records for this account will share the same GroupKey value. GroupKey values cannot be changed once created. For more information, see [Accounts and GroupKeys](developer.lockstep.io/docs/accounts-and-groupkeys).



87
88
89
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 87

def group_key
  @group_key
end

#imported_dateDate-time

Returns The date and time when this record was imported from the user’s ERP or accounting system.

Returns:

  • (Date-time)

    The date and time when this record was imported from the user’s ERP or accounting system.



179
180
181
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 179

def imported_date
  @imported_date
end

#in_disputeBoolean

Returns Is the invoice in dispute?.

Returns:

  • (Boolean)

    Is the invoice in dispute?



219
220
221
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 219

def in_dispute
  @in_dispute
end

#invoice_closed_dateDate

Returns The date when the invoice was closed and finalized after completion of all payments and delivery of all products and services.

Returns:

  • (Date)

    The date when the invoice was closed and finalized after completion of all payments and delivery of all products and services.



171
172
173
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 171

def invoice_closed_date
  @invoice_closed_date
end

#invoice_dateDate

Returns The reporting date for this invoice.

Returns:

  • (Date)

    The reporting date for this invoice.



159
160
161
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 159

def invoice_date
  @invoice_date
end

#invoice_idUuid

Returns The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ‘ErpKey`.

Returns:

  • (Uuid)

    The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform. For the ID of this record in its originating financial system, see ‘ErpKey`.



91
92
93
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 91

def invoice_id
  @invoice_id
end

#invoice_status_codeString

Returns A code identifying the status of this invoice. Recognized Invoice status codes are: * ‘Open` - Represents an invoice that is considered open and needs more work to complete * `Closed` - Represents an invoice that is considered closed and resolved.

Returns:

  • (String)

    A code identifying the status of this invoice. Recognized Invoice status codes are: * ‘Open` - Represents an invoice that is considered open and needs more work to complete * `Closed` - Represents an invoice that is considered closed and resolved



127
128
129
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 127

def invoice_status_code
  @invoice_status_code
end

#invoice_type_codeString

Returns A code identifying the type of this invoice. Recognized Invoice types are: * ‘AR Invoice` - Represents an invoice sent by Company to the Customer * `AP Invoice` - Represents an invoice sent by Vendor to the Company * `AR Credit Memo` - Represents a credit memo generated by Company given to Customer * `AP Credit Memo` - Represents a credit memo generated by Vendor given to Company.

Returns:

  • (String)

    A code identifying the type of this invoice. Recognized Invoice types are: * ‘AR Invoice` - Represents an invoice sent by Company to the Customer * `AP Invoice` - Represents an invoice sent by Vendor to the Company * `AR Credit Memo` - Represents a credit memo generated by Company given to Customer * `AP Credit Memo` - Represents a credit memo generated by Vendor given to Company



123
124
125
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 123

def invoice_type_code
  @invoice_type_code
end

#is_voidedBoolean

Returns Is the invoice voided?.

Returns:

  • (Boolean)

    Is the invoice voided?



215
216
217
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 215

def is_voided
  @is_voided
end

#linesInvoiceLineModel

Returns All lines attached to this invoice. To retrieve this collection, specify ‘Lines` in the “Include” parameter for your query.

Returns:

  • (InvoiceLineModel)

    All lines attached to this invoice. To retrieve this collection, specify ‘Lines` in the “Include” parameter for your query.



255
256
257
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 255

def lines
  @lines
end

#modifiedDate-time

Returns The date on which this invoice record was last modified.

Returns:

  • (Date-time)

    The date on which this invoice record was last modified.



203
204
205
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 203

def modified
  @modified
end

#modified_user_idUuid

Returns The ID number of the user who most recently modified this invoice.

Returns:

  • (Uuid)

    The ID number of the user who most recently modified this invoice.



207
208
209
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 207

def modified_user_id
  @modified_user_id
end

#notesNoteModel

Returns A collection of notes linked to this record. To retrieve this collection, specify ‘Notes` in the `include` parameter when retrieving data. To create a note, use the [Create Note](developer.lockstep.io/reference/post_api-v1-notes) endpoint with the `TableKey` to `Invoice` and the `ObjectKey` set to the `InvoiceId` for this record. For more information on extensibility, see [linking extensible metadata to objects](developer.lockstep.io/docs/custom-fields#linking-metadata-to-an-object).

Returns:



263
264
265
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 263

def notes
  @notes
end

#outstanding_balance_amountDouble

Returns The remaining balance value of this invoice in it’s tendered currency.

Returns:

  • (Double)

    The remaining balance value of this invoice in it’s tendered currency.



155
156
157
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 155

def outstanding_balance_amount
  @outstanding_balance_amount
end

#payment_due_dateDate

Returns The date when the remaining outstanding balance is due.

Returns:

  • (Date)

    The date when the remaining outstanding balance is due.



175
176
177
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 175

def payment_due_date
  @payment_due_date
end

#paymentsInvoicePaymentDetailModel

Returns All payments attached to this invoice, the amount of the payment applied to this Invoice, and the date the Payment was applied. To retrieve this collection, specify ‘Payments` in the “Include” parameter for your query.

Returns:

  • (InvoicePaymentDetailModel)

    All payments attached to this invoice, the amount of the payment applied to this Invoice, and the date the Payment was applied. To retrieve this collection, specify ‘Payments` in the “Include” parameter for your query.



259
260
261
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 259

def payments
  @payments
end

#posted_dateDate

Returns The date when this invoice posted to the company’s general ledger.

Returns:

  • (Date)

    The date when this invoice posted to the company’s general ledger.



167
168
169
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 167

def posted_date
  @posted_date
end

#preferred_delivery_methodString

Returns Indicates the preferred delivery method for this invoice. Examples include Print, Email, Fax.

Returns:

  • (String)

    Indicates the preferred delivery method for this invoice. Examples include Print, Email, Fax



227
228
229
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 227

def preferred_delivery_method
  @preferred_delivery_method
end

#primary_bill_to_address_idUuid

Returns The ID number of the invoice’s bill-to address.

Returns:

  • (Uuid)

    The ID number of the invoice’s bill-to address



187
188
189
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 187

def primary_bill_to_address_id
  @primary_bill_to_address_id
end

#primary_origin_address_idUuid

Returns The ID number of the invoice’s origination address.

Returns:

  • (Uuid)

    The ID number of the invoice’s origination address



183
184
185
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 183

def primary_origin_address_id
  @primary_origin_address_id
end

#primary_ship_to_address_idUuid

Returns The ID number of the invoice’s ship-to address.

Returns:

  • (Uuid)

    The ID number of the invoice’s ship-to address



191
192
193
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 191

def primary_ship_to_address_id
  @primary_ship_to_address_id
end

#purchase_order_codeString

Returns The “Purchase Order Code” is a code that is sometimes used by companies to refer to the original PO that was sent that caused this invoice to be written. If a customer sends a purchase order to a vendor, the vendor can then create an invoice and refer back to the originating purchase order using this field.

Returns:

  • (String)

    The “Purchase Order Code” is a code that is sometimes used by companies to refer to the original PO that was sent that caused this invoice to be written. If a customer sends a purchase order to a vendor, the vendor can then create an invoice and refer back to the originating purchase order using this field.



107
108
109
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 107

def purchase_order_code
  @purchase_order_code
end

#reference_codeString

Returns An additional reference code that is sometimes used to identify this invoice. The meaning of this field is specific to the ERP or accounting system used by the user.

Returns:

  • (String)

    An additional reference code that is sometimes used to identify this invoice. The meaning of this field is specific to the ERP or accounting system used by the user.



111
112
113
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 111

def reference_code
  @reference_code
end

#sales_tax_amountDouble

Returns The total sales (or transactional) tax calculated for this invoice in it’s tendered currency.

Returns:

  • (Double)

    The total sales (or transactional) tax calculated for this invoice in it’s tendered currency.



147
148
149
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 147

def sales_tax_amount
  @sales_tax_amount
end

#salesperson_codeString

Returns A code identifying the salesperson responsible for writing this quote, invoice, or order.

Returns:

  • (String)

    A code identifying the salesperson responsible for writing this quote, invoice, or order.



115
116
117
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 115

def salesperson_code
  @salesperson_code
end

#salesperson_nameString

Returns A name identifying the salesperson responsible for writing this quote, invoice, or order.

Returns:

  • (String)

    A name identifying the salesperson responsible for writing this quote, invoice, or order.



119
120
121
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 119

def salesperson_name
  @salesperson_name
end

#special_termsString

Returns If the customer negotiated any special terms different from the standard terms above, describe them here.

Returns:

  • (String)

    If the customer negotiated any special terms different from the standard terms above, describe them here.



135
136
137
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 135

def special_terms
  @special_terms
end

#terms_codeString

Returns A code identifying the terms given to the purchaser. This field is imported directly from the originating financial system and does not follow a specified format.

Returns:

  • (String)

    A code identifying the terms given to the purchaser. This field is imported directly from the originating financial system and does not follow a specified format.



131
132
133
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 131

def terms_code
  @terms_code
end

#total_amountDouble

Returns The total value of this invoice, inclusive of all taxes and line items in it’s tendered currency.

Returns:

  • (Double)

    The total value of this invoice, inclusive of all taxes and line items in it’s tendered currency.



143
144
145
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 143

def total_amount
  @total_amount
end

Instance Method Details

#as_json(options = {}) ⇒ object

Returns This object as a JSON key-value structure.

Returns:

  • (object)

    This object as a JSON key-value structure



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 295

def as_json(options={})
    {
        'groupKey' => @group_key,
        'invoiceId' => @invoice_id,
        'companyId' => @company_id,
        'customerId' => @customer_id,
        'erpKey' => @erp_key,
        'purchaseOrderCode' => @purchase_order_code,
        'referenceCode' => @reference_code,
        'salespersonCode' => @salesperson_code,
        'salespersonName' => @salesperson_name,
        'invoiceTypeCode' => @invoice_type_code,
        'invoiceStatusCode' => @invoice_status_code,
        'termsCode' => @terms_code,
        'specialTerms' => @special_terms,
        'currencyCode' => @currency_code,
        'totalAmount' => @total_amount,
        'salesTaxAmount' => @sales_tax_amount,
        'discountAmount' => @discount_amount,
        'outstandingBalanceAmount' => @outstanding_balance_amount,
        'invoiceDate' => @invoice_date,
        'discountDate' => @discount_date,
        'postedDate' => @posted_date,
        'invoiceClosedDate' => @invoice_closed_date,
        'paymentDueDate' => @payment_due_date,
        'importedDate' => @imported_date,
        'primaryOriginAddressId' => @primary_origin_address_id,
        'primaryBillToAddressId' => @primary_bill_to_address_id,
        'primaryShipToAddressId' => @primary_ship_to_address_id,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
        'isVoided' => @is_voided,
        'inDispute' => @in_dispute,
        'excludeFromAging' => @exclude_from_aging,
        'preferredDeliveryMethod' => @preferred_delivery_method,
        'currencyRate' => @currency_rate,
        'baseCurrencyTotalAmount' => @base_currency_total_amount,
        'baseCurrencySalesTaxAmount' => @base_currency_sales_tax_amount,
        'baseCurrencyDiscountAmount' => @base_currency_discount_amount,
        'baseCurrencyOutstandingBalanceAmount' => @base_currency_outstanding_balance_amount,
        'addresses' => @addresses,
        'lines' => @lines,
        'payments' => @payments,
        'notes' => @notes,
        'attachments' => @attachments,
        'company' => @company,
        'customer' => @customer,
        'customerPrimaryContact' => @customer_primary_contact,
        'creditMemos' => @credit_memos,
        'customFieldValues' => @custom_field_values,
        'customFieldDefinitions' => @custom_field_definitions,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



354
355
356
# File 'lib/lockstep_sdk/models/invoice_model.rb', line 354

def to_json(*options)
    "[#{as_json(*options).to_json(*options)}]"
end