Class: LockstepSdk::InvoiceLineSyncModel

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

Overview

The InvoiceLineSyncModel represents information coming into Lockstep from an external financial system or other enterprise resource planning system. To import data from an external system, convert your original data into the InvoiceLineSyncModel format and call the [Upload Sync File API](developer.lockstep.io/reference/post_api-v1-sync-zip). This API retrieves all of the data you uploaded in a compressed ZIP file and imports it into the Lockstep platform.

Once imported, this record will be available in the Lockstep API as an [InvoiceLineModel](developer.lockstep.io/docs/invoicelinemodel).

For more information on writing your own connector, see [Connector Data](developer.lockstep.io/docs/connector-data).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ InvoiceLineSyncModel

Initialize the InvoiceLineSyncModel using the provided prototype



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

def initialize(params = {})
    @erp_key = params.dig(:erp_key)
    @invoice_erp_key = params.dig(:invoice_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)
    @origin_address_line1 = params.dig(:origin_address_line1)
    @origin_address_line2 = params.dig(:origin_address_line2)
    @origin_address_line3 = params.dig(:origin_address_line3)
    @origin_address_city = params.dig(:origin_address_city)
    @origin_address_region = params.dig(:origin_address_region)
    @origin_address_postal_code = params.dig(:origin_address_postal_code)
    @origin_address_country = params.dig(:origin_address_country)
    @origin_address_latitude = params.dig(:origin_address_latitude)
    @origin_address_longitude = params.dig(:origin_address_longitude)
    @bill_to_address_line1 = params.dig(:bill_to_address_line1)
    @bill_to_address_line2 = params.dig(:bill_to_address_line2)
    @bill_to_address_line3 = params.dig(:bill_to_address_line3)
    @bill_to_address_city = params.dig(:bill_to_address_city)
    @bill_to_address_region = params.dig(:bill_to_address_region)
    @bill_to_address_postal_code = params.dig(:bill_to_address_postal_code)
    @bill_to_address_country = params.dig(:bill_to_address_country)
    @bill_to_address_latitude = params.dig(:bill_to_address_latitude)
    @bill_to_address_longitude = params.dig(:bill_to_address_longitude)
    @ship_to_address_line1 = params.dig(:ship_to_address_line1)
    @ship_to_address_line2 = params.dig(:ship_to_address_line2)
    @ship_to_address_line3 = params.dig(:ship_to_address_line3)
    @ship_to_address_city = params.dig(:ship_to_address_city)
    @ship_to_address_region = params.dig(:ship_to_address_region)
    @ship_to_address_postal_code = params.dig(:ship_to_address_postal_code)
    @ship_to_address_country = params.dig(:ship_to_address_country)
    @ship_to_address_latitude = params.dig(:ship_to_address_latitude)
    @ship_to_address_longitude = params.dig(:ship_to_address_longitude)
    @created = params.dig(:created)
    @modified = params.dig(:modified)
end

Instance Attribute Details

#bill_to_address_cityString

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address



182
183
184
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 182

def bill_to_address_city
  @bill_to_address_city
end

#bill_to_address_countryString

Returns Billing address for this invoice line, if this line item is to be billed to a different address This will be validated by the /api/v1/countries data set.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address This will be validated by the /api/v1/countries data set



194
195
196
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 194

def bill_to_address_country
  @bill_to_address_country
end

#bill_to_address_latitudeFloat

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (Float)

    Billing address for this invoice line, if this line item is to be billed to a different address



198
199
200
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 198

def bill_to_address_latitude
  @bill_to_address_latitude
end

#bill_to_address_line1String

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address



170
171
172
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 170

def bill_to_address_line1
  @bill_to_address_line1
end

#bill_to_address_line2String

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address



174
175
176
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 174

def bill_to_address_line2
  @bill_to_address_line2
end

#bill_to_address_line3String

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address



178
179
180
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 178

def bill_to_address_line3
  @bill_to_address_line3
end

#bill_to_address_longitudeFloat

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (Float)

    Billing address for this invoice line, if this line item is to be billed to a different address



202
203
204
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 202

def bill_to_address_longitude
  @bill_to_address_longitude
end

#bill_to_address_postal_codeString

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address



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

def bill_to_address_postal_code
  @bill_to_address_postal_code
end

#bill_to_address_regionString

Returns Billing address for this invoice line, if this line item is to be billed to a different address.

Returns:

  • (String)

    Billing address for this invoice line, if this line item is to be billed to a different address



186
187
188
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 186

def bill_to_address_region
  @bill_to_address_region
end

#createdDate-time

Returns If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.

Returns:

  • (Date-time)

    If known, the date when this record was created according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a created-date, leave this field null.



242
243
244
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 242

def created
  @created
end

#descriptionString

Returns Description of this invoice line.

Returns:

  • (String)

    Description of this invoice line.



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

def description
  @description
end

#erp_keyString

Returns This is the primary key of the Invoice Line record. For this field, you should use whatever the contact’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your invoice line records in a database, whatever the primary key for the invoice line table is in the database should be the “ErpKey”. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).

Returns:

  • (String)

    This is the primary key of the Invoice Line record. For this field, you should use whatever the contact’s unique identifying number is in the originating system. Search for a unique, non-changing number within the originating financial system for this record. Example: If you store your invoice line records in a database, whatever the primary key for the invoice line table is in the database should be the “ErpKey”. For more information, see [Identity Columns](developer.lockstep.io/docs/identity-columns).



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

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.



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

def exemption_code
  @exemption_code
end

#invoice_erp_keyString

Returns The original primary key or unique ID of the invoice to which this line belongs. This value should match the [Invoice ErpKey](developer.lockstep.io/docs/importing-invoices#erpkey) field on the [InvoiceSyncModel](developer.lockstep.io/docs/importing-invoices).

Returns:



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

def invoice_erp_key
  @invoice_erp_key
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.



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

def line_number
  @line_number
end

#modifiedDate-time

Returns If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.

Returns:

  • (Date-time)

    If known, the date when this record was most recently modified according to the originating financial system in which this record is maintained. If the originating financial system does not maintain a most-recently-modified-date, leave this field null.



246
247
248
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 246

def modified
  @modified
end

#origin_address_cityString

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address



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

def origin_address_city
  @origin_address_city
end

#origin_address_countryString

Returns Origination address for this invoice line, if this line item was originated from a different address This will be validated by the /api/v1/countries data set.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address This will be validated by the /api/v1/countries data set



158
159
160
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 158

def origin_address_country
  @origin_address_country
end

#origin_address_latitudeFloat

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (Float)

    Origination address for this invoice line, if this line item was originated from a different address



162
163
164
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 162

def origin_address_latitude
  @origin_address_latitude
end

#origin_address_line1String

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address



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

def origin_address_line1
  @origin_address_line1
end

#origin_address_line2String

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address



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

def origin_address_line2
  @origin_address_line2
end

#origin_address_line3String

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address



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

def origin_address_line3
  @origin_address_line3
end

#origin_address_longitudeFloat

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (Float)

    Origination address for this invoice line, if this line item was originated from a different address



166
167
168
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 166

def origin_address_longitude
  @origin_address_longitude
end

#origin_address_postal_codeString

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address



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

def origin_address_postal_code
  @origin_address_postal_code
end

#origin_address_regionString

Returns Origination address for this invoice line, if this line item was originated from a different address.

Returns:

  • (String)

    Origination address for this invoice line, if this line item was originated from a different address



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

def origin_address_region
  @origin_address_region
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.



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

def product_code
  @product_code
end

#quantityDouble

Returns The quantity of items for ths line.

Returns:

  • (Double)

    The quantity of items for ths line.



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

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.



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

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.



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

def quantity_shipped
  @quantity_shipped
end

#reporting_dateDate-time

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-time)

    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.



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

def reporting_date
  @reporting_date
end

#ship_to_address_cityString

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



218
219
220
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 218

def ship_to_address_city
  @ship_to_address_city
end

#ship_to_address_countryString

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address This will be validated by the /api/v1/countries data set.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address This will be validated by the /api/v1/countries data set



230
231
232
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 230

def ship_to_address_country
  @ship_to_address_country
end

#ship_to_address_latitudeFloat

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (Float)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



234
235
236
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 234

def ship_to_address_latitude
  @ship_to_address_latitude
end

#ship_to_address_line1String

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



206
207
208
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 206

def ship_to_address_line1
  @ship_to_address_line1
end

#ship_to_address_line2String

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



210
211
212
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 210

def ship_to_address_line2
  @ship_to_address_line2
end

#ship_to_address_line3String

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



214
215
216
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 214

def ship_to_address_line3
  @ship_to_address_line3
end

#ship_to_address_longitudeFloat

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (Float)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



238
239
240
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 238

def ship_to_address_longitude
  @ship_to_address_longitude
end

#ship_to_address_postal_codeString

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



226
227
228
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 226

def ship_to_address_postal_code
  @ship_to_address_postal_code
end

#ship_to_address_regionString

Returns Shipping address for this invoice line, if this line item is to be shipped to a different address.

Returns:

  • (String)

    Shipping address for this invoice line, if this line item is to be shipped to a different address



222
223
224
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 222

def ship_to_address_region
  @ship_to_address_region
end

#total_amountDouble

Returns The total amount for this line.

Returns:

  • (Double)

    The total amount for this line.



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

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.



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

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.



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

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



250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 250

def as_json(options={})
    {
        'erpKey' => @erp_key,
        'invoiceErpKey' => @invoice_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,
        'originAddressLine1' => @origin_address_line1,
        'originAddressLine2' => @origin_address_line2,
        'originAddressLine3' => @origin_address_line3,
        'originAddressCity' => @origin_address_city,
        'originAddressRegion' => @origin_address_region,
        'originAddressPostalCode' => @origin_address_postal_code,
        'originAddressCountry' => @origin_address_country,
        'originAddressLatitude' => @origin_address_latitude,
        'originAddressLongitude' => @origin_address_longitude,
        'billToAddressLine1' => @bill_to_address_line1,
        'billToAddressLine2' => @bill_to_address_line2,
        'billToAddressLine3' => @bill_to_address_line3,
        'billToAddressCity' => @bill_to_address_city,
        'billToAddressRegion' => @bill_to_address_region,
        'billToAddressPostalCode' => @bill_to_address_postal_code,
        'billToAddressCountry' => @bill_to_address_country,
        'billToAddressLatitude' => @bill_to_address_latitude,
        'billToAddressLongitude' => @bill_to_address_longitude,
        'shipToAddressLine1' => @ship_to_address_line1,
        'shipToAddressLine2' => @ship_to_address_line2,
        'shipToAddressLine3' => @ship_to_address_line3,
        'shipToAddressCity' => @ship_to_address_city,
        'shipToAddressRegion' => @ship_to_address_region,
        'shipToAddressPostalCode' => @ship_to_address_postal_code,
        'shipToAddressCountry' => @ship_to_address_country,
        'shipToAddressLatitude' => @ship_to_address_latitude,
        'shipToAddressLongitude' => @ship_to_address_longitude,
        'created' => @created,
        'modified' => @modified,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



299
300
301
# File 'lib/lockstep_sdk/models/invoice_line_sync_model.rb', line 299

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