Class: LockstepSdk::CreditMemoAppliedModel

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

Overview

Credit Memos reflect credits granted to a customer for various reasons, such as discounts or refunds. Credit Memos may be applied to Invoices as Payments. When a Credit Memo is applied as payment to an Invoice, Lockstep creates a Credit Memo Application record to track the amount from the Credit Memo that was applied as payment to the Invoice. You can examine Credit Memo Application records to track which Invoices were paid using this Credit.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ CreditMemoAppliedModel

Initialize the CreditMemoAppliedModel using the provided prototype



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 29

def initialize(params = {})
    @credit_memo_applied_id = params.dig(:credit_memo_applied_id)
    @group_key = params.dig(:group_key)
    @invoice_id = params.dig(:invoice_id)
    @credit_memo_invoice_id = params.dig(:credit_memo_invoice_id)
    @erp_key = params.dig(:erp_key)
    @erp_write_status = params.dig(:erp_write_status)
    @erp_write_status_name = params.dig(:erp_write_status_name)
    @entry_number = params.dig(:entry_number)
    @apply_to_invoice_date = params.dig(:apply_to_invoice_date)
    @credit_memo_applied_amount = params.dig(:credit_memo_applied_amount)
    @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)
    @source_modified_date = params.dig(:source_modified_date)
    @attachments = params.dig(:attachments)
    @notes = params.dig(:notes)
    @custom_field_definitions = params.dig(:custom_field_definitions)
    @custom_field_values = params.dig(:custom_field_values)
    @credit_memo_invoice = params.dig(:credit_memo_invoice)
    @invoice = params.dig(:invoice)
end

Instance Attribute Details

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



112
113
114
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 112

def app_enrollment_id
  @app_enrollment_id
end

#apply_to_invoice_dateDate-time

Returns The date on which this credit memo was applied to the Invoice represented by ‘InvoiceId`.

Returns:

  • (Date-time)

    The date on which this credit memo was applied to the Invoice represented by ‘InvoiceId`.



88
89
90
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 88

def apply_to_invoice_date
  @apply_to_invoice_date
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 `CreditMemoApplied` and the `ObjectKey` set to the `CreditMemoAppliedId` 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:



120
121
122
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 120

def attachments
  @attachments
end

#createdDate-time

Returns Date credit memo applied record was created.

Returns:

  • (Date-time)

    Date credit memo applied record was created.



96
97
98
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 96

def created
  @created
end

#created_user_idUuid

Returns The id of the user who created this applied credit memo.

Returns:

  • (Uuid)

    The id of the user who created this applied credit memo.



100
101
102
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 100

def created_user_id
  @created_user_id
end

#credit_memo_applied_amountDouble

Returns The amount of the credit memo that was applied to the Invoice represented by ‘InvoiceId`.

Returns:

  • (Double)

    The amount of the credit memo that was applied to the Invoice represented by ‘InvoiceId`.



92
93
94
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 92

def credit_memo_applied_amount
  @credit_memo_applied_amount
end

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



56
57
58
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 56

def credit_memo_applied_id
  @credit_memo_applied_id
end

#credit_memo_invoiceInvoiceModel

Returns The credit memo invoice associated with this applied credit memo.

Returns:

  • (InvoiceModel)

    The credit memo invoice associated with this applied credit memo



136
137
138
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 136

def credit_memo_invoice
  @credit_memo_invoice
end

#credit_memo_invoice_idUuid

Returns The Lockstep ID of the Invoice of type “Credit Memo” that was consumed in this payment application event. Example: Company ABC received a credit memo, CM000123 for $500. Company ABC then chooses to apply this credit memo to reduce the balance of the invoice PO1000578. The ‘CreditMemoInvoiceId` is the Lockstep Platform ID number of Invoice `CM000123`.

Returns:

  • (Uuid)

    The Lockstep ID of the Invoice of type “Credit Memo” that was consumed in this payment application event. Example: Company ABC received a credit memo, CM000123 for $500. Company ABC then chooses to apply this credit memo to reduce the balance of the invoice PO1000578. The ‘CreditMemoInvoiceId` is the Lockstep Platform ID number of Invoice `CM000123`.



68
69
70
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 68

def credit_memo_invoice_id
  @credit_memo_invoice_id
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 `CreditMemoApplied` and the `ObjectKey` set to the `CreditMemoAppliedId` 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:



128
129
130
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 128

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 `CreditMemoApplied` and the `ObjectKey` set to the `CreditMemoAppliedId` 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:



132
133
134
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 132

def custom_field_values
  @custom_field_values
end

#entry_numberInt32

Returns Reference number for the applied credit memo.

Returns:

  • (Int32)

    Reference number for the applied credit memo.



84
85
86
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 84

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



72
73
74
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 72

def erp_key
  @erp_key
end

#erp_write_statusErpWriteStatuses

Returns Possible statuses for a record that supports ERP write.

Returns:

  • (ErpWriteStatuses)

    Possible statuses for a record that supports ERP write.



76
77
78
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 76

def erp_write_status
  @erp_write_status
end

#erp_write_status_nameString

Returns The name of the ErpWriteStatus for this credit memo application.

Returns:

  • (String)

    The name of the ErpWriteStatus for this credit memo application



80
81
82
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 80

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



60
61
62
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 60

def group_key
  @group_key
end

#invoiceInvoiceModel

Returns The invoice associated with this applied credit memo.

Returns:

  • (InvoiceModel)

    The invoice associated with this applied credit memo



140
141
142
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 140

def invoice
  @invoice
end

#invoice_idUuid

Returns The Lockstep ID of the Invoice to which this credit memo was applied. This Invoice’s outstanding balance was reduced by the value of the field ‘CreditMemoAppliedAmount` on the date `ApplyToInvoiceDate`. Example: Company ABC received a credit memo, CM000123 for $500. Company ABC then chooses to apply this credit memo to reduce the balance of the invoice PO1000578. The `InvoiceErpKey` is the Lockstep Platform ID number of Invoice `PO1000578`.

Returns:

  • (Uuid)

    The Lockstep ID of the Invoice to which this credit memo was applied. This Invoice’s outstanding balance was reduced by the value of the field ‘CreditMemoAppliedAmount` on the date `ApplyToInvoiceDate`. Example: Company ABC received a credit memo, CM000123 for $500. Company ABC then chooses to apply this credit memo to reduce the balance of the invoice PO1000578. The `InvoiceErpKey` is the Lockstep Platform ID number of Invoice `PO1000578`.



64
65
66
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 64

def invoice_id
  @invoice_id
end

#modifiedDate-time

Returns Date credit memo applied record was modified.

Returns:

  • (Date-time)

    Date credit memo applied record was modified.



104
105
106
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 104

def modified
  @modified
end

#modified_user_idUuid

Returns The id of the user who modified this applied credit memo.

Returns:

  • (Uuid)

    The id of the user who modified this applied credit memo.



108
109
110
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 108

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 `CreditMemoApplied` and the `ObjectKey` set to the `CreditMemoAppliedId` 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:



124
125
126
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 124

def notes
  @notes
end

#source_modified_dateDate-time

Returns The date on which this record was last modified in source ERP.

Returns:

  • (Date-time)

    The date on which this record was last modified in source ERP.



116
117
118
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 116

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



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

def as_json(options={})
    {
        'creditMemoAppliedId' => @credit_memo_applied_id,
        'groupKey' => @group_key,
        'invoiceId' => @invoice_id,
        'creditMemoInvoiceId' => @credit_memo_invoice_id,
        'erpKey' => @erp_key,
        'erpWriteStatus' => @erp_write_status,
        'erpWriteStatusName' => @erp_write_status_name,
        'entryNumber' => @entry_number,
        'applyToInvoiceDate' => @apply_to_invoice_date,
        'creditMemoAppliedAmount' => @credit_memo_applied_amount,
        'created' => @created,
        'createdUserId' => @created_user_id,
        'modified' => @modified,
        'modifiedUserId' => @modified_user_id,
        'appEnrollmentId' => @app_enrollment_id,
        'sourceModifiedDate' => @source_modified_date,
        'attachments' => @attachments,
        'notes' => @notes,
        'customFieldDefinitions' => @custom_field_definitions,
        'customFieldValues' => @custom_field_values,
        'creditMemoInvoice' => @credit_memo_invoice,
        'invoice' => @invoice,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



173
174
175
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 173

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