Class: LockstepSdk::CreditMemoAppliedModel
- Inherits:
-
Object
- Object
- LockstepSdk::CreditMemoAppliedModel
- 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
-
#app_enrollment_id ⇒ Uuid
The AppEnrollmentId of the application that imported this record.
-
#apply_to_invoice_date ⇒ Date-time
The date on which this credit memo was applied to the Invoice represented by ‘InvoiceId`.
-
#attachments ⇒ AttachmentModel
A collection of attachments linked to this record.
-
#created ⇒ Date-time
Date credit memo applied record was created.
-
#created_user_id ⇒ Uuid
The id of the user who created this applied credit memo.
-
#credit_memo_applied_amount ⇒ Double
The amount of the credit memo that was applied to the Invoice represented by ‘InvoiceId`.
-
#credit_memo_applied_id ⇒ Uuid
The unique ID of this record, automatically assigned by Lockstep when this record is added to the Lockstep platform.
-
#credit_memo_invoice ⇒ InvoiceModel
The credit memo invoice associated with this applied credit memo.
-
#credit_memo_invoice_id ⇒ Uuid
The Lockstep ID of the Invoice of type “Credit Memo” that was consumed in this payment application event.
-
#custom_field_definitions ⇒ CustomFieldDefinitionModel
A collection of custom fields linked to this record.
-
#custom_field_values ⇒ CustomFieldValueModel
A collection of custom fields linked to this record.
-
#entry_number ⇒ Int32
Reference number for the applied credit memo.
-
#erp_key ⇒ String
The unique ID of this record as it was known in its originating financial system.
-
#group_key ⇒ Uuid
The GroupKey uniquely identifies a single Lockstep Platform account.
-
#invoice ⇒ InvoiceModel
The invoice associated with this applied credit memo.
-
#invoice_id ⇒ Uuid
The Lockstep ID of the Invoice to which this credit memo was applied.
-
#modified ⇒ Date-time
Date credit memo applied record was modified.
-
#modified_user_id ⇒ Uuid
The id of the user who modified this applied credit memo.
-
#notes ⇒ NoteModel
A collection of notes linked to this record.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ object
This object as a JSON key-value structure.
-
#initialize(params = {}) ⇒ CreditMemoAppliedModel
constructor
Initialize the CreditMemoAppliedModel using the provided prototype.
-
#to_json(*options) ⇒ String
This object converted to a JSON string.
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 |
# 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) @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) @credit_memo_invoice = params.dig(:credit_memo_invoice) @invoice = params.dig(:invoice) end |
Instance Attribute Details
#app_enrollment_id ⇒ Uuid
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.
101 102 103 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 101 def app_enrollment_id @app_enrollment_id end |
#apply_to_invoice_date ⇒ Date-time
Returns The date on which this credit memo was applied to the Invoice represented by ‘InvoiceId`.
77 78 79 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 77 def apply_to_invoice_date @apply_to_invoice_date end |
#attachments ⇒ AttachmentModel
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).
105 106 107 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 105 def @attachments end |
#created ⇒ Date-time
Returns Date credit memo applied record was created.
85 86 87 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 85 def created @created end |
#created_user_id ⇒ Uuid
Returns The id of the user who created this applied credit memo.
89 90 91 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 89 def created_user_id @created_user_id end |
#credit_memo_applied_amount ⇒ Double
Returns The amount of the credit memo that was applied to the Invoice represented by ‘InvoiceId`.
81 82 83 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 81 def credit_memo_applied_amount @credit_memo_applied_amount end |
#credit_memo_applied_id ⇒ Uuid
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`.
53 54 55 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 53 def credit_memo_applied_id @credit_memo_applied_id end |
#credit_memo_invoice ⇒ InvoiceModel
Returns The credit memo invoice associated with this applied credit memo.
121 122 123 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 121 def credit_memo_invoice @credit_memo_invoice end |
#credit_memo_invoice_id ⇒ Uuid
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`.
65 66 67 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 65 def credit_memo_invoice_id @credit_memo_invoice_id end |
#custom_field_definitions ⇒ CustomFieldDefinitionModel
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).
113 114 115 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 113 def custom_field_definitions @custom_field_definitions end |
#custom_field_values ⇒ CustomFieldValueModel
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).
117 118 119 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 117 def custom_field_values @custom_field_values end |
#entry_number ⇒ Int32
Returns Reference number for the applied credit memo.
73 74 75 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 73 def entry_number @entry_number end |
#erp_key ⇒ String
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).
69 70 71 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 69 def erp_key @erp_key end |
#group_key ⇒ Uuid
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).
57 58 59 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 57 def group_key @group_key end |
#invoice ⇒ InvoiceModel
Returns The invoice associated with this applied credit memo.
125 126 127 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 125 def invoice @invoice end |
#invoice_id ⇒ Uuid
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`.
61 62 63 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 61 def invoice_id @invoice_id end |
#modified ⇒ Date-time
Returns Date credit memo applied record was modified.
93 94 95 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 93 def modified @modified end |
#modified_user_id ⇒ Uuid
Returns The id of the user who modified this applied credit memo.
97 98 99 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 97 def modified_user_id @modified_user_id end |
#notes ⇒ NoteModel
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).
109 110 111 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 109 def notes @notes end |
Instance Method Details
#as_json(options = {}) ⇒ object
Returns This object as a JSON key-value structure.
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 129 def as_json(={}) { '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, 'creditMemoInvoice' => @credit_memo_invoice, 'invoice' => @invoice, } end |
#to_json(*options) ⇒ String
Returns This object converted to a JSON string.
155 156 157 |
# File 'lib/lockstep_sdk/models/credit_memo_applied_model.rb', line 155 def to_json(*) "[#{as_json(*).to_json(*)}]" end |