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



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

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)
    @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)
    @attachments = params.dig(:attachments)
    @notes = params.dig(:notes)
    @custom_field_definitions = params.dig(:custom_field_definitions)
    @custom_field_values = params.dig(:custom_field_values)
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.



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

def app_enrollment_id
  @app_enrollment_id
end

#apply_to_invoice_dateDate-time

Returns Date payment applied to credit memo.

Returns:

  • (Date-time)

    Date payment applied to credit memo.



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

def apply_to_invoice_date
  @apply_to_invoice_date
end

#attachmentsAttachmentModel

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

Returns:

  • (AttachmentModel)

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



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

def attachments
  @attachments
end

#createdDate-time

Returns Date credit memo applied record was created.

Returns:

  • (Date-time)

    Date credit memo applied record was created.



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

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.



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

def created_user_id
  @created_user_id
end

#credit_memo_applied_amountDouble

Returns Amount applied to credit memo.

Returns:

  • (Double)

    Amount applied to credit memo.



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

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



54
55
56
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 54

def credit_memo_applied_id
  @credit_memo_applied_id
end

#credit_memo_invoice_idUuid

Returns The id of the credit memo invoice.

Returns:

  • (Uuid)

    The id of the credit memo invoice



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

def credit_memo_invoice_id
  @credit_memo_invoice_id
end

#custom_field_definitionsCustomFieldDefinitionModel

Returns All definitions attached to this applied Credit Memo. To retrieve this collection, specify `CustomFieldValues` in the “Include” parameter for your query.

Returns:

  • (CustomFieldDefinitionModel)

    All definitions attached to this applied Credit Memo. To retrieve this collection, specify `CustomFieldValues` in the “Include” parameter for your query.



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

def custom_field_definitions
  @custom_field_definitions
end

#custom_field_valuesCustomFieldValueModel

Returns All values attached to this Credit Memo. To retrieve this collection, specify `CustomFieldValues` in the “Include” parameter for your query.

Returns:

  • (CustomFieldValueModel)

    All values attached to this Credit Memo. To retrieve this collection, specify `CustomFieldValues` in the “Include” parameter for your query.



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

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.



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

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



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

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



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

def group_key
  @group_key
end

#invoice_idUuid

Returns The id of the invoice.

Returns:

  • (Uuid)

    The id of the invoice



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

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.



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

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.



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

def modified_user_id
  @modified_user_id
end

#notesNoteModel

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

Returns:

  • (NoteModel)

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



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

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



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 122

def as_json(options={})
    {
        'creditMemoAppliedId' => @credit_memo_applied_id,
        'groupKey' => @group_key,
        'invoiceId' => @invoice_id,
        'creditMemoInvoiceId' => @credit_memo_invoice_id,
        'erpKey' => @erp_key,
        '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,
        'attachments' => @attachments,
        'notes' => @notes,
        'customFieldDefinitions' => @custom_field_definitions,
        'customFieldValues' => @custom_field_values,
    }
end

#to_json(*options) ⇒ String

Returns This object converted to a JSON string.

Returns:

  • (String)

    This object converted to a JSON string



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

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