Class: LockstepSdk::InvoiceLineModel

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

Overview

Represents a line in an invoice

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ InvoiceLineModel

Initialize the InvoiceLineModel using the provided prototype



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

def initialize(params = {})
    @invoice_line_id = params.dig(:invoice_line_id)
    @group_key = params.dig(:group_key)
    @invoice_id = params.dig(:invoice_id)
    @erp_key = params.dig(:erp_key)
    @line_number = params.dig(:line_number)
    @product_code = params.dig(:product_code)
    @description = params.dig(:description)
    @unit_measure_code = params.dig(:unit_measure_code)
    @unit_price = params.dig(:unit_price)
    @quantity = params.dig(:quantity)
    @quantity_shipped = params.dig(:quantity_shipped)
    @quantity_received = params.dig(:quantity_received)
    @total_amount = params.dig(:total_amount)
    @exemption_code = params.dig(:exemption_code)
    @reporting_date = params.dig(:reporting_date)
    @override_origin_address_id = params.dig(:override_origin_address_id)
    @override_bill_to_address_id = params.dig(:override_bill_to_address_id)
    @override_ship_to_address_id = params.dig(:override_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)
    @notes = params.dig(:notes)
    @attachments = params.dig(:attachments)
end

Instance Attribute Details

#app_enrollment_idUuid

Returns AppEnrollmentId for this record; used for mapping purposes.

Returns:

  • (Uuid)

    AppEnrollmentId for this record; used for mapping purposes.



146
147
148
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 146

def app_enrollment_id
  @app_enrollment_id
end

#attachmentsAttachmentModel

Returns All attachments attached to this company. To retrieve this collection, specify `Attachments` in the “Include” parameter for your query.

Returns:

  • (AttachmentModel)

    All attachments attached to this company. To retrieve this collection, specify `Attachments` in the “Include” parameter for your query.



154
155
156
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 154

def attachments
  @attachments
end

#createdDate-time

Returns The date on which this line was created.

Returns:

  • (Date-time)

    The date on which this line was created.



130
131
132
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 130

def created
  @created
end

#created_user_idUuid

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

Returns:

  • (Uuid)

    The ID number of the user who created this line.



134
135
136
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 134

def created_user_id
  @created_user_id
end

#descriptionString

Returns Description of this invoice line.

Returns:

  • (String)

    Description of this invoice line.



82
83
84
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 82

def description
  @description
end

#erp_keyString

Returns The unique ID of this record as it was known in its originating financial system, if it was different from the original `LineNumber`. 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 it was different from the original `LineNumber`. 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).



70
71
72
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 70

def erp_key
  @erp_key
end

#exemption_codeString

Returns If this line is tax exempt, this code indicates the reason for the exemption.

Returns:

  • (String)

    If this line is tax exempt, this code indicates the reason for the exemption.



110
111
112
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 110

def exemption_code
  @exemption_code
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).



62
63
64
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 62

def group_key
  @group_key
end

#invoice_idUuid

Returns The ID number of the invoice this line belongs to.

Returns:

  • (Uuid)

    The ID number of the invoice this line belongs to.



66
67
68
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 66

def invoice_id
  @invoice_id
end

#invoice_line_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`.



58
59
60
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 58

def invoice_line_id
  @invoice_line_id
end

#line_numberString

Returns The line number of this line, as defined in the originating ERP or accounting system. You can sort on this number to get the original view of lines within the invoice.

Returns:

  • (String)

    The line number of this line, as defined in the originating ERP or accounting system. You can sort on this number to get the original view of lines within the invoice.



74
75
76
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 74

def line_number
  @line_number
end

#modifiedDate-time

Returns The date on which this line was last modified.

Returns:

  • (Date-time)

    The date on which this line was last modified.



138
139
140
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 138

def modified
  @modified
end

#modified_user_idUuid

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

Returns:

  • (Uuid)

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



142
143
144
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 142

def modified_user_id
  @modified_user_id
end

#notesNoteModel

Returns All notes attached to this company. To retrieve this collection, specify `Notes` in the “Include” parameter for your query.

Returns:

  • (NoteModel)

    All notes attached to this company. To retrieve this collection, specify `Notes` in the “Include” parameter for your query.



150
151
152
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 150

def notes
  @notes
end

#override_bill_to_address_idUuid

Returns An optional ID number for the line's bill to address.

Returns:

  • (Uuid)

    An optional ID number for the line's bill to address.



122
123
124
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 122

def override_bill_to_address_id
  @override_bill_to_address_id
end

#override_origin_address_idUuid

Returns An optional ID number for the line's origin address.

Returns:

  • (Uuid)

    An optional ID number for the line's origin address.



118
119
120
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 118

def override_origin_address_id
  @override_origin_address_id
end

#override_ship_to_address_idUuid

Returns An optional ID number for the line's ship to address.

Returns:

  • (Uuid)

    An optional ID number for the line's ship to address.



126
127
128
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 126

def override_ship_to_address_id
  @override_ship_to_address_id
end

#product_codeString

Returns A code number identifying the product or service that is specified on this line.

Returns:

  • (String)

    A code number identifying the product or service that is specified on this line.



78
79
80
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 78

def product_code
  @product_code
end

#quantityDouble

Returns The quantity of items for ths line.

Returns:

  • (Double)

    The quantity of items for ths line.



94
95
96
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 94

def quantity
  @quantity
end

#quantity_receivedDouble

Returns The number of items that has been received.

Returns:

  • (Double)

    The number of items that has been received.



102
103
104
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 102

def quantity_received
  @quantity_received
end

#quantity_shippedDouble

Returns The number of items that have been shipped.

Returns:

  • (Double)

    The number of items that have been shipped.



98
99
100
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 98

def quantity_shipped
  @quantity_shipped
end

#reporting_dateDate

Returns If null, the products specified on this line were delivered on the same date as all other lines. If not null, this line was delivered or finalized on a different date than the overall invoice.

Returns:

  • (Date)

    If null, the products specified on this line were delivered on the same date as all other lines. If not null, this line was delivered or finalized on a different date than the overall invoice.



114
115
116
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 114

def reporting_date
  @reporting_date
end

#total_amountDouble

Returns The total amount for this line.

Returns:

  • (Double)

    The total amount for this line.



106
107
108
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 106

def total_amount
  @total_amount
end

#unit_measure_codeString

Returns For lines measured in a unit other than “quantity”, this code indicates the measurement system for the quantity field. If the line is measured in quantity, this field is null.

Returns:

  • (String)

    For lines measured in a unit other than “quantity”, this code indicates the measurement system for the quantity field. If the line is measured in quantity, this field is null.



86
87
88
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 86

def unit_measure_code
  @unit_measure_code
end

#unit_priceDouble

Returns The price of a single unit for this line.

Returns:

  • (Double)

    The price of a single unit for this line.



90
91
92
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 90

def unit_price
  @unit_price
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



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
185
186
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 158

def as_json(options={})
    {
        'invoiceLineId' => @invoice_line_id,
        'groupKey' => @group_key,
        'invoiceId' => @invoice_id,
        'erpKey' => @erp_key,
        'lineNumber' => @line_number,
        'productCode' => @product_code,
        'description' => @description,
        'unitMeasureCode' => @unit_measure_code,
        'unitPrice' => @unit_price,
        'quantity' => @quantity,
        'quantityShipped' => @quantity_shipped,
        'quantityReceived' => @quantity_received,
        'totalAmount' => @total_amount,
        'exemptionCode' => @exemption_code,
        'reportingDate' => @reporting_date,
        'overrideOriginAddressId' => @override_origin_address_id,
        'overrideBillToAddressId' => @override_bill_to_address_id,
        'overrideShipToAddressId' => @override_ship_to_address_id,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
        'notes' => @notes,
        'attachments' => @attachments,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



190
191
192
# File 'lib/lockstep_sdk/models/invoice_line_model.rb', line 190

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